summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrew.shadura@collabora.co.uk>2015-07-23 19:48:55 +0200
committerAndrew Shadura <andrew.shadura@collabora.co.uk>2015-07-23 19:48:55 +0200
commit1fc77e4078b7ceeacc0bb5f9696169e1a292a0f3 (patch)
treea9c82b850228b2bb3656fb6cd60a7a6fe261178e
parentbd9fd4c78d21417383ad3f9c995f8a1f57fa91b4 (diff)
Imported Upstream version 0.4.0
-rw-r--r--.gitignore3
-rw-r--r--CHANGELOG.md8
-rw-r--r--CMakeLists.txt75
-rw-r--r--README.md37
-rw-r--r--VERSION2
-rw-r--r--analyzers/CMakeLists.txt16
-rwxr-xr-xanalyzers/nst.sh3
-rw-r--r--analyzers/src/breakdown/CMakeLists.txt7
-rw-r--r--analyzers/src/breakdown/analyzer.cpp69
-rw-r--r--analyzers/src/breakdown/breakdown_analyzer.cpp615
-rw-r--r--analyzers/src/breakdown/breakdowncounter.cpp54
-rw-r--r--analyzers/src/breakdown/breakdowncounter.h64
-rw-r--r--analyzers/src/breakdown/cifsv1breakdownanalyzer.cpp414
-rw-r--r--analyzers/src/breakdown/cifsv1breakdownanalyzer.h128
-rw-r--r--analyzers/src/breakdown/cifsv1commands.cpp47
-rw-r--r--analyzers/src/breakdown/cifsv1commands.h47
-rw-r--r--analyzers/src/breakdown/cifsv2breakdownanalyzer.cpp134
-rw-r--r--analyzers/src/breakdown/cifsv2breakdownanalyzer.h71
-rw-r--r--analyzers/src/breakdown/cifsv2commands.cpp94
-rw-r--r--analyzers/src/breakdown/cifsv2commands.h78
-rw-r--r--analyzers/src/breakdown/commandrepresenter.h71
-rw-r--r--analyzers/src/breakdown/latencies.cpp94
-rw-r--r--analyzers/src/breakdown/latencies.h101
-rw-r--r--analyzers/src/breakdown/nfsv3breakdownanalyzer.cpp148
-rw-r--r--analyzers/src/breakdown/nfsv3breakdownanalyzer.h119
-rw-r--r--analyzers/src/breakdown/nfsv3commands.cpp46
-rw-r--r--analyzers/src/breakdown/nfsv3commands.h49
-rw-r--r--analyzers/src/breakdown/nfsv41breakdownanalyzer.cpp503
-rw-r--r--analyzers/src/breakdown/nfsv41breakdownanalyzer.h222
-rw-r--r--analyzers/src/breakdown/nfsv41commands.cpp46
-rw-r--r--analyzers/src/breakdown/nfsv41commands.h49
-rw-r--r--analyzers/src/breakdown/nfsv4breakdownanalyzer.cpp366
-rw-r--r--analyzers/src/breakdown/nfsv4breakdownanalyzer.h176
-rw-r--r--analyzers/src/breakdown/nfsv4commands.cpp46
-rw-r--r--analyzers/src/breakdown/nfsv4commands.h49
-rw-r--r--analyzers/src/breakdown/nfsv4representer.cpp43
-rw-r--r--analyzers/src/breakdown/nfsv4representer.h48
-rw-r--r--analyzers/src/breakdown/representer.cpp145
-rw-r--r--analyzers/src/breakdown/representer.h79
-rw-r--r--analyzers/src/breakdown/statistics.cpp98
-rw-r--r--analyzers/src/breakdown/statistics.h112
-rw-r--r--analyzers/src/breakdown/statisticscompositor.cpp83
-rw-r--r--analyzers/src/breakdown/statisticscompositor.h50
-rw-r--r--analyzers/src/json/CMakeLists.txt17
-rw-r--r--analyzers/src/json/abstract_tcp_service.cpp205
-rw-r--r--analyzers/src/json/abstract_tcp_service.h127
-rw-r--r--analyzers/src/json/ip_endpoint.cpp64
-rw-r--r--analyzers/src/json/ip_endpoint.h59
-rw-r--r--analyzers/src/json/json_analyzer.cpp886
-rw-r--r--analyzers/src/json/json_analyzer.h586
-rw-r--r--analyzers/src/json/json_plugin.cpp123
-rw-r--r--analyzers/src/json/json_tcp_service.cpp239
-rw-r--r--analyzers/src/json/json_tcp_service.h52
-rw-r--r--analyzers/src/ofdws/file_rw_op.cpp81
-rw-r--r--analyzers/src/ofdws/file_rw_op.h93
-rw-r--r--analyzers/src/ofdws/ofdws_analyzer.cpp233
-rw-r--r--analyzers/src/ofdws/ofdws_analyzer.h154
-rw-r--r--analyzers/src/ofws/ofws_analyzer.cpp350
-rw-r--r--analyzers/src/ofws/ofws_analyzer.h226
-rw-r--r--analyzers/src/test/test_analyzer.cpp733
-rw-r--r--analyzers/src/watch/CMakeLists.txt4
-rw-r--r--analyzers/src/watch/Doxyfile2303
-rw-r--r--analyzers/src/watch/nc_windows/header_window.cpp102
-rw-r--r--analyzers/src/watch/nc_windows/header_window.h50
-rw-r--r--analyzers/src/watch/nc_windows/main_window.cpp111
-rw-r--r--analyzers/src/watch/nc_windows/main_window.h56
-rw-r--r--analyzers/src/watch/nc_windows/nc_window_const.h48
-rw-r--r--analyzers/src/watch/nc_windows/statistics_window.cpp198
-rw-r--r--analyzers/src/watch/nc_windows/statistics_window.h72
-rw-r--r--analyzers/src/watch/plotter.cpp381
-rw-r--r--analyzers/src/watch/plotter.h84
-rw-r--r--analyzers/src/watch/protocols/abstract_protocol.cpp68
-rw-r--r--analyzers/src/watch/protocols/abstract_protocol.h66
-rw-r--r--analyzers/src/watch/protocols/cifsv1_protocol.cpp42
-rw-r--r--analyzers/src/watch/protocols/cifsv1_protocol.h36
-rw-r--r--analyzers/src/watch/protocols/cifsv2_protocol.cpp41
-rw-r--r--analyzers/src/watch/protocols/cifsv2_protocol.h36
-rw-r--r--analyzers/src/watch/protocols/nfsv3_protocol.cpp39
-rw-r--r--analyzers/src/watch/protocols/nfsv3_protocol.h36
-rw-r--r--analyzers/src/watch/protocols/nfsv41_protocol.cpp61
-rw-r--r--analyzers/src/watch/protocols/nfsv41_protocol.h38
-rw-r--r--analyzers/src/watch/protocols/nfsv4_protocol.cpp61
-rw-r--r--analyzers/src/watch/protocols/nfsv4_protocol.h38
-rw-r--r--analyzers/src/watch/user_gui.cpp211
-rw-r--r--analyzers/src/watch/user_gui.h70
-rw-r--r--analyzers/src/watch/watch_analyzer.cpp1085
-rw-r--r--analyzers/src/watch/watch_analyzer.h570
-rw-r--r--astyle.cfg23
-rwxr-xr-xci/ci_build.sh336
-rw-r--r--cmake/FindJSON.cmake39
-rw-r--r--cmake/options.cmake7
-rw-r--r--cmake/packaging.cmake37
-rw-r--r--cmake/valgrind.cmake82
-rw-r--r--docs/CMakeLists.txt13
-rw-r--r--docs/TODO2
-rw-r--r--docs/design/CMakeLists.txt34
-rw-r--r--docs/design/download_plantuml.cmake10
-rw-r--r--docs/design/libwatch/CMakeLists.txt15
-rw-r--r--docs/design/libwatch/class_diagram.plantuml111
-rw-r--r--docs/graphics.pdfbin352514 -> 368598 bytes
-rw-r--r--docs/graphics.vsdxbin104571 -> 110408 bytes
-rw-r--r--docs/logo.pngbin0 -> 25537 bytes
-rw-r--r--docs/logo64.pngbin0 -> 2114 bytes
-rw-r--r--docs/nfstrace.8.in180
-rwxr-xr-xdocs/nfstrace_manual.docxbin0 -> 271106 bytes
-rw-r--r--docs/nfstrace_manual.odtbin4320497 -> 0 bytes
-rw-r--r--docs/nfstrace_manual.pdfbin338295 -> 707110 bytes
-rw-r--r--docs/template.cpp20
-rw-r--r--docs/template.h19
-rw-r--r--src/analysis/analysis_manager.cpp4
-rw-r--r--src/analysis/analysis_manager.h14
-rw-r--r--src/analysis/analyzers.cpp18
-rw-r--r--src/analysis/analyzers.h42
-rw-r--r--src/analysis/cifs_parser.cpp350
-rw-r--r--src/analysis/cifs_parser.h98
-rw-r--r--src/analysis/nfs_parser.cpp1015
-rw-r--r--src/analysis/nfs_parser.h (renamed from src/analysis/nfs_parser_thread.h)50
-rw-r--r--src/analysis/nfs_parser_thread.cpp217
-rw-r--r--src/analysis/parser_thread.h123
-rw-r--r--src/analysis/parsers.h74
-rw-r--r--src/analysis/plugin.cpp18
-rw-r--r--src/analysis/plugin.h4
-rw-r--r--src/analysis/print_analyzer.cpp3712
-rw-r--r--src/analysis/print_analyzer.h550
-rw-r--r--src/analysis/rpc_sessions.h34
-rw-r--r--src/api/cifs2_commands.h1259
-rw-r--r--src/api/cifs_commands.h352
-rw-r--r--src/api/cifs_pc_to_net.h115
-rw-r--r--src/api/cifs_types.h181
-rw-r--r--src/api/ianalyzer.h1811
-rw-r--r--src/api/ianalyzer_type.h130
-rw-r--r--src/api/nfs3_types_rpcgen.h149
-rw-r--r--src/api/nfs41_types_rpcgen.h3129
-rw-r--r--src/api/nfs4_types_rpcgen.h692
-rw-r--r--src/api/nfs_types.h84
-rw-r--r--src/api/plugin_api.h.in78
-rw-r--r--src/api/procedure.h (renamed from src/api/rpc_procedure.h)19
-rw-r--r--src/api/rpc_types.h3
-rw-r--r--src/controller/cmdline_args.cpp8
-rw-r--r--src/controller/cmdline_args.h45
-rw-r--r--src/controller/controller.cpp18
-rw-r--r--src/controller/parameters.cpp99
-rw-r--r--src/controller/parameters.h13
-rw-r--r--src/controller/running_status.h2
-rw-r--r--src/controller/signal_handler.cpp12
-rw-r--r--src/controller/signal_handler.h1
-rw-r--r--src/filtration/cifs_filtrator.h169
-rw-r--r--src/filtration/filtration_manager.cpp21
-rw-r--r--src/filtration/filtration_processor.h307
-rw-r--r--src/filtration/filtratorimpl.h320
-rw-r--r--src/filtration/filtrators.h120
-rw-r--r--src/filtration/pcap/capture_reader.cpp12
-rw-r--r--src/filtration/pcap/network_interfaces.h19
-rw-r--r--src/filtration/processing_thread.h2
-rw-r--r--src/filtration/rpc_filtrator.h215
-rw-r--r--src/main.cpp9
-rw-r--r--src/protocols/cifs/cifs.cpp91
-rw-r--r--src/protocols/cifs/cifs.h233
-rw-r--r--src/protocols/cifs2/cifs2.cpp162
-rw-r--r--src/protocols/cifs2/cifs2.h203
-rw-r--r--src/protocols/cifs2/cifs2_utils.cpp719
-rw-r--r--src/protocols/cifs2/cifs2_utils.h95
-rw-r--r--src/protocols/ip/ipv4_header.h4
-rw-r--r--src/protocols/netbios/netbios.cpp37
-rw-r--r--src/protocols/netbios/netbios.h71
-rw-r--r--src/protocols/nfs/nfs_procedure.h96
-rw-r--r--src/protocols/nfs/nfs_utils.cpp55
-rw-r--r--src/protocols/nfs/nfs_utils.h41
-rw-r--r--src/protocols/nfs/nfsv41.x190
-rw-r--r--src/protocols/nfs3/nfs3_rpcgen.cpp1808
-rw-r--r--src/protocols/nfs3/nfs3_utils.cpp2630
-rw-r--r--src/protocols/nfs3/nfs3_utils.h384
-rw-r--r--src/protocols/nfs4/nfs41_utils.cpp8691
-rw-r--r--src/protocols/nfs4/nfs41_utils.h629
-rw-r--r--src/protocols/nfs4/nfs4_rpcgen.cpp2800
-rw-r--r--src/protocols/nfs4/nfs4_utils.cpp4040
-rw-r--r--src/protocols/nfs4/nfs4_utils.h362
-rw-r--r--src/protocols/xdr/xdr_decoder.h1
-rw-r--r--src/utils/dynamic_load.cpp56
-rw-r--r--src/utils/dynamic_load.h37
-rw-r--r--src/utils/log.cpp21
-rw-r--r--src/utils/log.h6
-rw-r--r--src/utils/out.cpp5
-rw-r--r--src/utils/out.h3
-rw-r--r--src/utils/profiler.h96
-rw-r--r--tests/functional/CMakeLists.txt34
-rw-r--r--tests/functional/check-compressed-drane.sh.in2
-rw-r--r--tests/functional/check-compressed-trace.sh.in2
-rw-r--r--tests/functional/check-output.sh.in2
-rw-r--r--tests/unit/CMakeLists.txt19
-rw-r--r--tests/unit/analyzers/CMakeLists.txt17
-rw-r--r--tests/unit/analyzers/breakdown/CMakeLists.txt14
-rw-r--r--tests/unit/analyzers/breakdown/breakdown.cpp73
-rw-r--r--tests/unit/analyzers/breakdown/latency.cpp100
-rw-r--r--tests/unit/analyzers/breakdown/statistic.cpp141
-rw-r--r--tests/unit/analyzers/cifs.cpp195
-rw-r--r--tests/unit/analyzers/json/CMakeLists.txt19
-rw-r--r--tests/unit/analyzers/json/ip_endpoint.cpp41
-rw-r--r--tests/unit/analyzers/json/tcp_service.cpp165
-rw-r--r--tests/unit/analyzers/json/test_json_analyzer.cpp1799
-rw-r--r--tests/unit/filtration/CMakeLists.txt13
-rw-r--r--tests/unit/filtration/cifsv2.cpp232
-rw-r--r--tests/unit/filtration/stream.cpp365
-rw-r--r--tests/unit/protocols/CMakeLists.txt13
-rw-r--r--tests/unit/protocols/cifsv2.cpp92
-rw-r--r--tests/unit/utils/CMakeLists.txt10
-rw-r--r--tests/unit/utils/test_utils.cpp9
-rw-r--r--traces/eth-ipv4-tcp-cifs2.pcap.bz2bin0 -> 31530 bytes
-rw-r--r--traces/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2bin0 -> 1476395 bytes
-rw-r--r--traces/eth-ipv4-tcp-nfsv41.pcap.bz2bin0 -> 42626 bytes
-rw-r--r--traces/eth-ipv4-tcp-smb2-putty.pcap.bz2bin0 -> 267558 bytes
-rw-r--r--traces/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2bin0 -> 674315 bytes
-rw-r--r--[-rwxr-xr-x]traces/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2bin3533 -> 3533 bytes
-rw-r--r--traces/references/1-packet.pcap.bz2.ref68
-rw-r--r--traces/references/breakdown/1-packet.pcap.bz2.ref233
-rw-r--r--traces/references/breakdown/2sessions-tcp-wsize32k-tcp-wsize512k.pcap.bz2.ref (renamed from traces/references/2sessions-tcp-wsize32k-tcp-wsize512k.pcap.bz2.ref)181
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-cifs2.pcap.bz2.ref255
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2.ref534
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-nfsv3-4-readdir-75k-entries.pcap.bz2.ref (renamed from traces/references/eth-ipv4-tcp-nfsv3-4-readdir-75k-entries.pcap.bz2.ref)177
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-nfsv3.pcap.bz2.ref258
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-nfsv4-incorrect_mount.pcap.bz2.ref (renamed from traces/references/eth-ipv4-tcp-nfsv4-incorrect_mount.pcap.bz2.ref)173
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-nfsv4-posix.pcap.bz2.ref (renamed from traces/references/eth-ipv4-tcp-nfsv4-posix.pcap.bz2.ref)173
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-nfsv4.pcap.bz2.ref (renamed from traces/references/eth-ipv4-tcp-nfsv4.pcap.bz2.ref)173
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-nfsv41.pcap.bz2.ref341
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-smb2-putty.pcap.bz2.ref255
-rw-r--r--traces/references/breakdown/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2.ref255
-rw-r--r--traces/references/breakdown/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref258
-rw-r--r--traces/references/breakdown/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2.ref (renamed from traces/references/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2.ref)223
-rw-r--r--traces/references/breakdown/eth-ipv4-udp-nfsv3.pcap.bz2.ref (renamed from traces/references/eth-ipv4-udp-nfsv3.pcap.bz2.ref)223
-rw-r--r--traces/references/breakdown/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref258
-rw-r--r--traces/references/breakdown/eth-ipv6-tcp-nfsv3.pcap.bz2.ref258
-rw-r--r--traces/references/breakdown/lo-ipv4-tcp-nfsv3-nfsacl.pcap.bz2.ref (renamed from traces/references/lo-ipv4-tcp-nfsv3-nfsacl.pcap.bz2.ref)197
-rw-r--r--traces/references/breakdown/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref258
-rw-r--r--traces/references/eth-ipv4-tcp-nfsv3.pcap.bz2.ref93
-rw-r--r--traces/references/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref93
-rw-r--r--traces/references/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref93
-rw-r--r--traces/references/eth-ipv6-tcp-nfsv3.pcap.bz2.ref93
-rw-r--r--traces/references/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref93
238 files changed, 52773 insertions, 10855 deletions
diff --git a/.gitignore b/.gitignore
index 22ebe7f..728a8e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,3 +29,6 @@ src/controller/build_info.h
*.exe
*.out
*.app
+
+# Astyle backups
+*.orig
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fec25eb..ade333d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+0.3.2
+=====
+- new libjson plugin that outputs gathered statistics as json (via TCP);
+- fix endianess bug on mips/powerpc/s390x/sparc;
+- fix build issue on debian/kFreeBSD;
+- add missing dependencies to cpack configuration;
+- new `nfstrace` cli option: list available plugins and/or available interfaces.
+
0.3.1
=====
- new experimental `libwatch.so` plugin with functionality similar to the
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad7609d..794fc34 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,8 @@ else ()
message (WARNING "Compilation by ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} isn't tested")
endif ()
+include(cmake/options.cmake)
+
find_package(Threads REQUIRED) # POSIX Threads
find_path(PCAP_ROOT_DIR
@@ -31,38 +33,40 @@ endif ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pedantic -Wall -Werror -Wextra -fPIC -fvisibility=hidden")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-dynamic")
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${INCLUDE_COVERAGE_INFO}")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage -O0")
endif ()
# Read version string from file
-file(STRINGS VERSION NST_VERSION)
+file (STRINGS VERSION NST_VERSION)
string (REPLACE "." ";" VERSION_LIST ${NST_VERSION})
-list(GET VERSION_LIST 0 NST_V_MAJOR)
-list(GET VERSION_LIST 1 NST_V_MINOR)
-list(GET VERSION_LIST 2 NST_V_PATCH)
+list (GET VERSION_LIST 0 NST_V_MAJOR)
+list (GET VERSION_LIST 1 NST_V_MINOR)
+list (GET VERSION_LIST 2 NST_V_PATCH)
set (NST_VERSION_FULL "${PROJECT_NAME} ${NST_VERSION} (${CMAKE_BUILD_TYPE})")
-string(TIMESTAMP COMPILATION_DATE "%Y-%m-%d")
+string (TIMESTAMP COMPILATION_DATE "%Y-%m-%d")
include_directories (src)
+
+# nfstrace executable ==========================================================
file (GLOB_RECURSE SRCS "src/*.cpp")
-set (LIBS ${CMAKE_DL_LIBS} # libdl with dlopen()
- ${CMAKE_THREAD_LIBS_INIT} # libpthread
- ${PCAP_LIBRARY} # libpcap
- )
+set (LIBS ${CMAKE_DL_LIBS} # libdl with dlopen()
+ ${CMAKE_THREAD_LIBS_INIT} # libpthread
+ ${PCAP_LIBRARY} # libpcap
+ )
-configure_file(docs/nfstrace.8.in ${PROJECT_SOURCE_DIR}/docs/nfstrace.8)
-configure_file(src/api/plugin_api.h.in ${PROJECT_SOURCE_DIR}/src/api/plugin_api.h)
-configure_file(src/controller/build_info.h.in ${PROJECT_SOURCE_DIR}/src/controller/build_info.h)
+configure_file (docs/nfstrace.8.in ${PROJECT_SOURCE_DIR}/docs/nfstrace.8)
+configure_file (src/api/plugin_api.h.in ${PROJECT_SOURCE_DIR}/src/api/plugin_api.h)
+configure_file (src/controller/build_info.h.in ${PROJECT_SOURCE_DIR}/src/controller/build_info.h)
-add_executable (${PROJECT_NAME} ${SRCS})
+add_executable (${PROJECT_NAME} ${SRCS})
target_link_libraries (${PROJECT_NAME} ${LIBS})
-# build watch analyzer==========================================================
-add_subdirectory(analyzers)
+# analyzer plugins =============================================================
+add_subdirectory (analyzers)
# testing ======================================================================
enable_testing ()
@@ -79,39 +83,36 @@ install (FILES ${headers} DESTINATION include/nfstrace/api)
install (FILES ${PROJECT_SOURCE_DIR}/docs/nfstrace.8 DESTINATION share/man/man8)
# build packages ===============================================================
-set (CPACK_PACKAGE_VERSION ${NST_VERSION})
-set (CPACK_PACKAGING_INSTALL_PREFIX "/usr")
-set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "NFS tracing/monitoring/capturing/statistic tool")
-set (CPACK_PACKAGE_CONTACT "Nfstrace developers <nfstrace@epam.com>")
-
-set (CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
-set (CPACK_RPM_PACKAGE_LICENSE "GPLv2")
-set (CPACK_RPM_PACKAGE_VENDOR "EPAM Systems")
-set (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/share/man /usr/share/man/man8)
-set (CPACK_RPM_PACKAGE_REQUIRES "libpcap >= 1.3.0-1")
-
-set (CPACK_DEBIAN_PACKAGE_SECTION "admin")
-set (CPACK_DEBIAN_PACKAGE_DEPENDS "libpcap0.8 (>=1.3.0-1)")
-
-include (CPack)
+include ("cmake/packaging.cmake")
# coverage =====================================================================
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${INCLUDE_COVERAGE_INFO}")
find_program (GCOVR_PATH gcovr)
if (GCOVR_PATH)
add_custom_target (coverage
COMMAND ${GCOVR_PATH} --xml -r \"${CMAKE_SOURCE_DIR}\" --object-directory \"${CMAKE_BINARY_DIR}\" -o coverage.xml 2>&1 >/dev/null
- WORKING_DIRECTORY ${CMAKE_PROJECT_DIR})
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ add_custom_target (coverage-html
+ COMMAND ${GCOVR_PATH} --html --html-details -r \"${CMAKE_SOURCE_DIR}\" --object-directory \"${CMAKE_BINARY_DIR}\" -o coverage.html 2>&1 >/dev/null
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ else ()
+ message (WARNING "'gcovr' executable not found - coverage report is not available.")
endif ()
endif ()
# documentation ================================================================
+add_subdirectory (docs)
-find_program (DOXYGEN_PATH doxygen)
+# code style ===================================================================
+find_program (ASTYLE_PATH astyle)
-if (DOXYGEN_PATH)
- add_custom_target (documentation
- COMMAND ${DOXYGEN_PATH} Doxyfile
+if (ASTYLE_PATH)
+ add_custom_target (codestyle
+ COMMAND find analyzers src tests -name '*.h' -o -name '*.cpp' |
+ xargs ${ASTYLE_PATH} --options=${CMAKE_SOURCE_DIR}/astyle.cfg
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif ()
+
+# Runtime analysis reports
+include ("cmake/valgrind.cmake")
diff --git a/README.md b/README.md
index 3d120f1..49fa005 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-NFSTRACE
+NFSTRACE ![NFSTRACE Logo](docs/logo64.png "Logo")
========
-`nfstrace` is an NFS tracing/monitoring/capturing/analyzing tool.
+`nfstrace` is an NFS and CIFS tracing/monitoring/capturing/analyzing tool.
It performs live Ethernet 1 Gbps - 10 Gbps packets capturing and helps to
-determine NFS procedures in raw network traffic. Furthermore, it performs
+determine NFS/CIFS procedures in raw network traffic. Furthermore, it performs
filtration, dumping, compression, statistical analysis, visualization and
provides the API for custom pluggable analysis modules.
@@ -14,23 +14,30 @@ following protocols:
- Ethernet
- IPv4 | IPv6
- UPD | TCP
-- NFSv3 | NFSv4
+- NFSv3 | NFSv4 | NFSv4.1 | CIFSv1 | CIFSv2
`nfstrace` has been tested on the following GNU/Linux and FreeBSD systems:
- Fedora 20
- OpenSUSE 13.2
-- Ubuntu 14.10
+- Ubuntu 14.04/14.10
- CentOS 7
- Arch Linux
- FreeBSD 10.1
-- Alt Linux 7.0.4
+- Alt Linux 7.0.5
You can find more detailed description at `docs/nfstrace_manual.pdf`
Problems, bugs, questions, desirable enhancements, etc. should be sent to
<nfstrace@epam.com>
+External Dependencies
+--------
+
+- PCAP library (core component)
+- json library (used for libjson.so plugin)
+- Curses (used for libwatch.so plugin)
+- GMock (used for testing)
Building
--------
@@ -99,21 +106,27 @@ reference results.
Authors
-------
-Vitali Adamenka ([vitali_adamenka@epam.com](mailto:vitali_adamenka@epam.com))
+Vitali Adamenka ([vitali_adamenka@epam.com](mailto:vitali_adamenka@epam.com))
+
+Yauheni Azaranka ([yauheni_azaranka@epam.com](mailto:yaheni_azaranka@epam.com))
+
+Alexey Costroma ([alexey_costroma@epam.com](mailto:alexey_costroma@epam.com))
+
+Dzianis Huznou ([dzianis_huznou@epam.com](mailto:dzianis_huznou@epam.com))
-Yauheni Azaranka ([yauheni_azaranka@epam.com](mailto:yaheni_azaranka@epam.com))
+Pavel Karneliuk ([pavel_karneliuk@epam.com](mailto:pavel_karneliuk@epam.com))
-Alexey Costroma ([alexey_costroma@epam.com](mailto:alexey_costroma@epam.com))
+Andrey Kuznetsov ([andrey_kuznetsov@epam.com](mailto:andrey_kuznetsov@epam.com))
-Dzianis Huznou ([dzianis_huznou@epam.com](mailto:dzianis_huznou@epam.com))
+Mikhail Litvinets ([mikhail_litvinets@epam.com](mailto:mikhail_litvinets@epam.com))
-Pavel Karneliuk ([pavel_karneliuk@epam.com](mailto:pavel_karneliuk@epam.com))
+Ilya Storozhilov ([ilya_storozhilov@epam.com](mailto:ilya_storozhilov@epam.com))
License
-------
-Copyright (c) 2013, 2014 EPAM Systems
+Copyright (c) 2015 EPAM Systems
Nfstrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/VERSION b/VERSION
index 9e11b32..1d0ba9e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.3.1
+0.4.0
diff --git a/analyzers/CMakeLists.txt b/analyzers/CMakeLists.txt
index b743a52..efff460 100644
--- a/analyzers/CMakeLists.txt
+++ b/analyzers/CMakeLists.txt
@@ -1,15 +1,15 @@
cmake_minimum_required (VERSION 2.8.12)
# build analyzers ==============================================================
-add_library (breakdown MODULE src/breakdown/breakdown_analyzer.cpp)
-add_library (ofws MODULE src/ofws/ofws_analyzer.cpp)
-add_library (ofdws MODULE src/ofdws/ofdws_analyzer.cpp
- src/ofdws/file_rw_op.cpp)
add_library (testanalyzer MODULE src/test/test_analyzer.cpp)
-set_target_properties (breakdown ofws ofdws testanalyzer
+
+set_target_properties (testanalyzer
PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/analyzers"
NO_SONAME ON)
-add_subdirectory (src/watch)
-
# installation of plugins ======================================================
-install (TARGETS breakdown ofws ofdws LIBRARY DESTINATION lib/nfstrace)
+install (TARGETS testanalyzer LIBRARY DESTINATION lib/nfstrace)
+
+# build analyzers (new way) ====================================================
+add_subdirectory (src/watch)
+add_subdirectory (src/breakdown)
+add_subdirectory (src/json)
diff --git a/analyzers/nst.sh b/analyzers/nst.sh
index ccdef35..e99f680 100755
--- a/analyzers/nst.sh
+++ b/analyzers/nst.sh
@@ -38,6 +38,7 @@ Known issues:
EOF
}
+i_ext=.dat
o_ext=.png
analyzer=
@@ -93,7 +94,7 @@ fi
OIFS="${IFS}"
IFS=$'\n'
-for i_file in "${i_files[@]}" ; do
+for i_file in ${i_files[@]} ; do
o_file="${i_file/%$i_ext/$o_ext}"
gnuplot -e "i_file='$i_file';o_file='$o_file'" "$analyzer$e_ext" &>/dev/null
result=$?
diff --git a/analyzers/src/breakdown/CMakeLists.txt b/analyzers/src/breakdown/CMakeLists.txt
new file mode 100644
index 0000000..9f2777b
--- /dev/null
+++ b/analyzers/src/breakdown/CMakeLists.txt
@@ -0,0 +1,7 @@
+project (breakdown)
+aux_source_directory (${CMAKE_SOURCE_DIR}/analyzers/src/breakdown SRC_TEST_LIST)
+add_library (${PROJECT_NAME} SHARED ${SRC_TEST_LIST})
+set_target_properties (breakdown
+ PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/analyzers"
+ NO_SONAME ON)
+install (TARGETS breakdown LIBRARY DESTINATION lib/nfstrace)
diff --git a/analyzers/src/breakdown/analyzer.cpp b/analyzers/src/breakdown/analyzer.cpp
new file mode 100644
index 0000000..de60cf0
--- /dev/null
+++ b/analyzers/src/breakdown/analyzer.cpp
@@ -0,0 +1,69 @@
+///------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Operation CIFS analyzer. Identify clients that are busier than others.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "cifsv1breakdownanalyzer.h"
+#include "cifsv2breakdownanalyzer.h"
+#include "nfsv3breakdownanalyzer.h"
+#include "nfsv41breakdownanalyzer.h"
+#include "nfsv4breakdownanalyzer.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+/*! Compositor of analyzers of differents protocols
+ * Class inherits implementation, each child has only "final overrriden" protocol events callbacks
+ */
+class Analyzer : public CIFSBreakdownAnalyzer, public CIFSv2BreakdownAnalyzer, public NFSv3BreakdownAnalyzer, public NFSv4BreakdownAnalyzer, public NFSv41BreakdownAnalyzer
+{
+public:
+ void flush_statistics() override final
+ {
+ CIFSBreakdownAnalyzer::flush_statistics();
+ CIFSv2BreakdownAnalyzer::flush_statistics();
+ NFSv3BreakdownAnalyzer::flush_statistics();
+ NFSv4BreakdownAnalyzer::flush_statistics();
+ NFSv41BreakdownAnalyzer::flush_statistics();
+ }
+};
+
+extern "C"
+{
+
+ const char* usage()
+ {
+ return "No options";
+ }
+
+ IAnalyzer* create(const char*)
+ {
+ return new Analyzer();
+ }
+
+ void destroy(IAnalyzer* instance)
+ {
+ delete instance;
+ }
+
+ NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy, nullptr)
+
+}//extern "C"
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/breakdown_analyzer.cpp b/analyzers/src/breakdown/breakdown_analyzer.cpp
deleted file mode 100644
index 46d5752..0000000
--- a/analyzers/src/breakdown/breakdown_analyzer.cpp
+++ /dev/null
@@ -1,615 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Operation breakdown analyzer. Identify clients that are busier than others.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include <cmath>
-#include <cstdint>
-#include <cstdlib>
-#include <iomanip>
-#include <list>
-#include <fstream>
-#include <sstream>
-#include <unordered_map>
-#include <map>
-#include <vector>
-
-#include <sys/time.h>
-
-#include <api/plugin_api.h>
-//------------------------------------------------------------------------------
-template <typename T>
-T to_sec(const timeval& val)
-{
- return (((T)val.tv_sec) + ((T)val.tv_usec) / 1000000.0);
-}
-
-template <typename T>
-class TwoPassVariance
-{
- using ConstIterator = std::list<timeval>::const_iterator;
-
-public:
- TwoPassVariance() : count{0} {}
- ~TwoPassVariance() {}
-
- void add(const timeval& t)
- {
- ++count;
- latencies.push_back(t);
- }
-
- uint32_t get_count() const { return count; }
-
- T get_avg() const
- {
- if(count == 0) return T();
-
- ConstIterator i = latencies.begin();
- ConstIterator end = latencies.end();
-
- timeval res;
- timerclear(&res);
- for(; i != end; ++i)
- {
- timeradd(&res, &(*i), &res);
- }
- return to_sec<T>(res) / count;
- }
-
- T get_st_dev() const
- {
- if(count < 2) return T();
-
- const T avg = get_avg();
- T st_dev = T();
-
- ConstIterator i = latencies.begin();
- ConstIterator end = latencies.end();
- for(T delta; i != end; ++i)
- {
- delta = to_sec<T>(*i) - avg;
- st_dev += pow(delta, 2.0);
- }
- st_dev /= (count - 1);
- return sqrt(st_dev);
- }
-
-private:
- void operator=(const TwoPassVariance&) = delete;
-
- uint32_t count;
- std::list<timeval> latencies;
-};
-
-template <typename T>
-class OnlineVariance
-{
-public:
- OnlineVariance() : count{0},
- st_dev{},
- avg{},
- m2{} {}
- ~OnlineVariance() {}
-
- void add(const timeval& t)
- {
- T x = to_sec<T>(t);
- T delta = x - avg;
- avg += delta / (++count);
- m2 += delta * (x - avg);
- }
-
- uint32_t get_count() const { return count; }
-
- T get_avg() const { return avg; }
-
- T get_st_dev() const
- {
- if(count < 2) return T();
- return sqrt(m2 / (count - 1));
- }
-
-private:
- void operator=(const OnlineVariance&) = delete;
-
- uint32_t count;
- T st_dev;
- T avg;
- T m2;
-};
-
-template
-<
-typename T, // Data type defines evaluation precision
-template <typename> class Algorithm // Evaluation algorithm
->
-class Latencies
-{
-public:
- Latencies()
- {
- timerclear(&min);
- timerclear(&max);
- }
-
- void add(const timeval& t) { algorithm.add(t); set_range(t); }
- uint64_t get_count() const { return algorithm.get_count(); }
- long double get_avg() const { return algorithm.get_avg(); }
- long double get_st_dev() const { return algorithm.get_st_dev(); }
- const timeval& get_min() const { return min; }
- const timeval& get_max() const { return max; }
-
-private:
- void operator=(const Latencies&) = delete;
-
- void set_range(const timeval& t)
- {
- if(timercmp(&t, &min, <))
- min = t;
- if(min.tv_sec == 0 && min.tv_usec == 0)
- min = t;
- if(timercmp(&t, &max, >))
- max = t;
- }
-
- Algorithm<T> algorithm;
- timeval min;
- timeval max;
-};
-
-template
-<
- typename T,
- template <class> class Algorithm
->
-class BreakdownCounter
-{
-public:
- BreakdownCounter() {}
- ~BreakdownCounter() {}
- const Latencies<T, Algorithm>& operator[](uint32_t index) const
- {
- return latencies[index];
- }
- Latencies<T, Algorithm>& operator[](uint32_t index)
- {
- return latencies[index];
- }
-
-private:
- void operator= (const BreakdownCounter&) = delete;
-
- Latencies<T, Algorithm> latencies[ProcEnumNFS4::count];
-};
-
-template
-<
- typename T,
- template <class> class Algorithm
->
-class BreakdownAnalyzer : public IAnalyzer
-{
- struct Less
- {
- bool operator() (const Session& a, const Session& b) const
- {
- return ((a.port[0] < b.port[0]) && (a.port[1] <= b.port[1])) ||
- ((a.ip.v4.addr[0] < b.ip.v4.addr[0]) && (a.ip.v4.addr[1] <= b.ip.v4.addr[1]));
- }
- };
-
- using Breakdown = BreakdownCounter<T, Algorithm>;
- using PerOpStat = std::map<Session, Breakdown, Less>;
- using Pair = typename PerOpStat::value_type;
-public:
- BreakdownAnalyzer(std::ostream& o = std::cout) : nfs3_proc_total{0},
- nfs3_proc_count(ProcEnumNFS3::count, 0),
- nfs4_proc_total{0},
- nfs4_ops_total{0},
- nfs4_proc_count(ProcEnumNFS4::count, 0),
- out(o) { }
- virtual ~BreakdownAnalyzer() { }
-
- void null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL3args*,
- const struct rpcgen::NULL3res*) override final { account(proc); }
- void getattr3(const struct RPCProcedure* proc,
- const struct rpcgen::GETATTR3args*,
- const struct rpcgen::GETATTR3res*) override final { account(proc); }
- void setattr3(const struct RPCProcedure* proc,
- const struct rpcgen::SETATTR3args*,
- const struct rpcgen::SETATTR3res*) override final { account(proc); }
- void lookup3(const struct RPCProcedure* proc,
- const struct rpcgen::LOOKUP3args*,
- const struct rpcgen::LOOKUP3res*) override final { account(proc); }
- void access3(const struct RPCProcedure* proc,
- const struct rpcgen::ACCESS3args*,
- const struct rpcgen::ACCESS3res*) override final { account(proc); }
- void readlink3(const struct RPCProcedure* proc,
- const struct rpcgen::READLINK3args*,
- const struct rpcgen::READLINK3res*) override final { account(proc); }
- void read3(const struct RPCProcedure* proc,
- const struct rpcgen::READ3args*,
- const struct rpcgen::READ3res*) override final { account(proc); }
- void write3(const struct RPCProcedure* proc,
- const struct rpcgen::WRITE3args*,
- const struct rpcgen::WRITE3res*) override final { account(proc); }
- void create3(const struct RPCProcedure* proc,
- const struct rpcgen::CREATE3args*,
- const struct rpcgen::CREATE3res*) override final { account(proc); }
- void mkdir3(const struct RPCProcedure* proc,
- const struct rpcgen::MKDIR3args*,
- const struct rpcgen::MKDIR3res*) override final { account(proc); }
- void symlink3(const struct RPCProcedure* proc,
- const struct rpcgen::SYMLINK3args*,
- const struct rpcgen::SYMLINK3res*) override final { account(proc); }
- void mknod3(const struct RPCProcedure* proc,
- const struct rpcgen::MKNOD3args*,
- const struct rpcgen::MKNOD3res*) override final { account(proc); }
- void remove3(const struct RPCProcedure* proc,
- const struct rpcgen::REMOVE3args*,
- const struct rpcgen::REMOVE3res*) override final { account(proc); }
- void rmdir3(const struct RPCProcedure* proc,
- const struct rpcgen::RMDIR3args*,
- const struct rpcgen::RMDIR3res*) override final { account(proc); }
- void rename3(const struct RPCProcedure* proc,
- const struct rpcgen::RENAME3args*,
- const struct rpcgen::RENAME3res*) override final { account(proc); }
- void link3(const struct RPCProcedure* proc,
- const struct rpcgen::LINK3args*,
- const struct rpcgen::LINK3res*) override final { account(proc); }
- void readdir3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIR3args*,
- const struct rpcgen::READDIR3res*) override final { account(proc); }
- void readdirplus3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIRPLUS3args*,
- const struct rpcgen::READDIRPLUS3res*) override final { account(proc); }
- void fsstat3(const struct RPCProcedure* proc,
- const struct rpcgen::FSSTAT3args*,
- const struct rpcgen::FSSTAT3res*) override final { account(proc); }
- void fsinfo3(const struct RPCProcedure* proc,
- const struct rpcgen::FSINFO3args*,
- const struct rpcgen::FSINFO3res*) override final { account(proc); }
- void pathconf3(const struct RPCProcedure* proc,
- const struct rpcgen::PATHCONF3args*,
- const struct rpcgen::PATHCONF3res*) override final { account(proc); }
- void commit3(const struct RPCProcedure* proc,
- const struct rpcgen::COMMIT3args*,
- const struct rpcgen::COMMIT3res*) override final { account(proc); }
-
- void null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL4args*,
- const struct rpcgen::NULL4res*) override final { account(proc); }
- void compound4(const struct RPCProcedure* proc,
- const struct rpcgen::COMPOUND4args*,
- const struct rpcgen::COMPOUND4res* res) override final { account(proc, res); }
-
- virtual void flush_statistics()
- {
- out << "### Breakdown analyzer ###"
- << std::endl
- << "NFSv3 total procedures: "
- << nfs3_proc_total
- << ". Per procedure:"
- << std::endl;
- for(int i = 0; i < ProcEnumNFS3::count ; ++i)
- {
- out.width(12);
- out << std::left
- << print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(i));
- out.width(5);
- out << std::right
- << nfs3_proc_count[i];
- out.width(7);
- out.setf(std::ios::fixed, std::ios::floatfield);
- out.precision(2);
- out << (nfs3_proc_total ? ((static_cast<double>(nfs3_proc_count[i]) / static_cast<double>(nfs3_proc_total)) * 100.0) : 0);
- out.setf(std::ios::fixed | std::ios::scientific , std::ios::floatfield);
- out << '%' << std::endl;
- }
-
- if(nfs3_per_proc_stat.size()) // is not empty?
- {
- out << "Per connection info: " << std::endl;
-
- std::stringstream session;
-
- for(auto& it : nfs3_per_proc_stat)
- {
- const Breakdown& current = it.second;
- uint64_t s_total_proc {0};
- for(int i = 0; i < ProcEnumNFS3::count; ++i)
- {
- s_total_proc += current[i].get_count();
- }
- session.str("");
- print_session(session, it.first);
- print_per_session(current, session.str(), s_total_proc, 0, NFS_V3);
- std::ofstream file(("breakdown_" + session.str() + ".dat").c_str(), std::ios::out | std::ios::trunc);
- store_per_session(file, current, session.str(), s_total_proc, 0, NFS_V3);
- }
- }
-
- out << "\nNFSv4 total procedures: "
- << nfs4_proc_total
- << ". Per procedure:"
- << std::endl;
- for(int i = 0; i < ProcEnumNFS4::count; ++i)
- {
- if(i == ProcEnumNFS4::count_proc)
- out << "NFSv4 total operations: "
- << nfs4_ops_total
- << ". Per operation:"
- << std::endl;
- out.width(22);
- out << std::left << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(i));
- out.width(5);
- out << std::right << nfs4_proc_count[i];
- out.width(7);
- out.setf(std::ios::fixed, std::ios::floatfield);
- out.precision(2);
- if(i>=ProcEnumNFS4::count_proc)
- out << (nfs4_ops_total ? ((static_cast<double>(nfs4_proc_count[i]) / static_cast<double>(nfs4_ops_total)) * 100.0) : 0);
- else
- out << (nfs4_proc_total ? ((static_cast<double>(nfs4_proc_count[i]) / static_cast<double>(nfs4_proc_total)) * 100.0) : 0);
- out.setf(std::ios::fixed | std::ios::scientific , std::ios::floatfield);
- out << '%' << std::endl;
- }
-
- if(nfs4_per_proc_stat.size()) // is not empty?
- {
- out << "Per connection info: " << std::endl;
-
- std::stringstream session;
-
- for(auto& it : nfs4_per_proc_stat)
- {
- const Breakdown& current = it.second;
- uint64_t s_total_proc {0};
- uint64_t s_total_ops {0};
- for(int i = 0; i < ProcEnumNFS4::count_proc; ++i)
- s_total_proc += current[i].get_count();
- for(int i = ProcEnumNFS4::count_proc; i < ProcEnumNFS4::count; ++i)
- s_total_ops += current[i].get_count();
- session.str("");
- print_session(session, it.first);
- print_per_session(current, session.str(), s_total_proc, s_total_ops, NFS_V4);
- std::ofstream file(("breakdown_" + session.str() + ".dat").c_str(), std::ios::out | std::ios::trunc);
- store_per_session(file, current, session.str(), s_total_proc, s_total_ops, NFS_V4);
- }
- }
- }
-
- void store_per_session(std::ostream& file,
- const Breakdown& breakdown,
- const std::string& session,
- uint64_t s_total_proc,
- uint64_t s_total_ops,
- unsigned int nfs_vers) const
- {
- file << "Session: " << session << std::endl;
-
- unsigned int op_count {0};
-
- if(nfs_vers == NFS_V3) op_count = ProcEnumNFS3::count;
- if(nfs_vers == NFS_V4) op_count = ProcEnumNFS4::count;
-
- for(unsigned i = 0; i < op_count; ++i)
- {
- if(nfs_vers == NFS_V3)
- file << print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(i));
- if(nfs_vers == NFS_V4)
- file << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(i));
- file << ' ' << breakdown[i].get_count() << ' ';
- if(nfs_vers == NFS_V4 && i>=ProcEnumNFS4::count_proc)
- file << (s_total_ops ? (((T)(breakdown[i].get_count()) / s_total_ops) * 100) : 0);
- else
- file << (s_total_proc ? (((T)(breakdown[i].get_count()) / s_total_proc) * 100) : 0);
- file << ' ' << to_sec<T>(breakdown[i].get_min())
- << ' ' << to_sec<T>(breakdown[i].get_max())
- << ' ' << breakdown[i].get_avg()
- << ' ' << breakdown[i].get_st_dev()
- << std::endl;
- }
- }
-
- void print_per_session(const Breakdown& breakdown,
- const std::string& session,
- uint64_t s_total_proc,
- uint64_t s_total_ops,
- unsigned int nfs_vers) const
- {
- out << "Session: " << session << std::endl;
-
- unsigned int op_count {0};
-
- if(nfs_vers == NFS_V3) op_count = ProcEnumNFS3::count;
- if(nfs_vers == NFS_V4) op_count = ProcEnumNFS4::count;
-
- out << "Total procedures: " << s_total_proc
- << ". Per procedure:" << std::endl;
- for(unsigned i = 0; i < op_count; ++i)
- {
- if(nfs_vers == NFS_V4 && i == ProcEnumNFS4::count_proc)
- out << "Total operations: "
- << s_total_ops
- << ". Per operation:"
- << std::endl;
- out.width(22);
- if(nfs_vers == NFS_V3)
- out << std::left
- << print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(i));
- if(nfs_vers == NFS_V4)
- out << std::left
- << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(i));
- out.width(6);
- out << " Count:";
- out.width(5);
- out << std::right
- << breakdown[i].get_count()
- << ' ';
- out.precision(2);
- out << '(';
- out.width(6);
- if(nfs_vers == NFS_V4 && i>=ProcEnumNFS4::count_proc)
- out << std::fixed
- << (s_total_ops ? (((T)(breakdown[i].get_count()) / s_total_ops) * 100) : 0);
- else
- out << std::fixed
- << (s_total_proc ? (((T)(breakdown[i].get_count()) / s_total_proc) * 100) : 0);
- out << "%) Min: ";
- out.precision(3);
- out << std::fixed
- << to_sec<T>(breakdown[i].get_min())
- << " Max: "
- << std::fixed
- << to_sec<T>(breakdown[i].get_max())
- << " Avg: "
- << std::fixed
- << breakdown[i].get_avg();
- out.precision(8);
- out << " StDev: "
- << std::fixed
- << breakdown[i].get_st_dev()
- << std::endl;
- }
- }
-
-private:
- void account(const struct RPCProcedure* proc,
- const struct rpcgen::COMPOUND4res* res = nullptr)
- {
- typename PerOpStat::iterator i;
- const u_int nfs_proc = proc->rpc_call.ru.RM_cmb.cb_proc;
- const u_int nfs_vers = proc->rpc_call.ru.RM_cmb.cb_vers;
- timeval latency{0,0};
-
- // diff between 'reply' and 'call' timestamps
- timersub(proc->rtimestamp, proc->ctimestamp, &latency);
-
- if(nfs_vers == NFS_V4)
- {
- ++nfs4_proc_total;
- ++nfs4_proc_count[nfs_proc];
-
- i = nfs4_per_proc_stat.find(*(proc->session));
- if(i == nfs4_per_proc_stat.end())
- {
- auto session_res = nfs4_per_proc_stat.emplace(*(proc->session), Breakdown{});
- if(session_res.second == false) return;
- i = session_res.first;
- }
-
- if(res)
- {
- nfs4_ops_total += res->resarray.resarray_len;
-
- rpcgen::nfs_resop4* current_el = res->resarray.resarray_val;
- for(unsigned j=0; j<(res->resarray.resarray_len); j++, current_el++)
- {
- // In all cases we suppose, that NFSv4 operation ILLEGAL(10044)
- // has the second position in ProcEnumNFS4
- u_int nfs_oper = current_el->resop;
- if(nfs_oper == ProcEnumNFS4::NFSProcedure::ILLEGAL) nfs_oper = 2;
- ++nfs4_proc_count[nfs_oper];
-
- (i->second)[nfs_oper].add(latency);
- }
- }
- }
-
- if(nfs_vers == NFS_V3)
- {
- ++nfs3_proc_total;
- ++nfs3_proc_count[nfs_proc];
-
- i = nfs3_per_proc_stat.find(*(proc->session));
- if(i == nfs3_per_proc_stat.end())
- {
- auto session_res = nfs3_per_proc_stat.emplace(*(proc->session), Breakdown{});
- if(session_res.second == false) return;
- i = session_res.first;
- }
- }
-
- (i->second)[nfs_proc].add(latency);
-
- }
- uint64_t nfs3_proc_total;
- std::vector<int> nfs3_proc_count;
- PerOpStat nfs3_per_proc_stat;
-
- uint64_t nfs4_proc_total;
- uint64_t nfs4_ops_total;
- std::vector<int> nfs4_proc_count;
- PerOpStat nfs4_per_proc_stat;
-
- std::ostream& out;
-};
-
-extern "C"
-{
-
-const char* usage()
-{
- return "ACC - for accurate evaluation(default), MEM - for memory efficient evaluation. Options cannot be combined";
-}
-
-IAnalyzer* create(const char* optarg)
-{
- enum
- {
- ACC = 0,
- MEM
- };
- const char* token[] = {
- "ACC",
- "MEM",
- NULL
- };
-
- char* value = NULL;
- if(*optarg == '\0')
- return new BreakdownAnalyzer<long double, OnlineVariance>();
- else
- do
- {
- switch(getsubopt((char**)&optarg, (char**)token, &value))
- {
- case ACC:
- return new BreakdownAnalyzer<long double, TwoPassVariance>();
- case MEM:
- return new BreakdownAnalyzer<long double, OnlineVariance>();
- default:
- return NULL;
- }
- } while (*optarg != '\0');
- return NULL;
-}
-
-void destroy(IAnalyzer* instance)
-{
- delete instance;
-}
-
-NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy)
-
-}//extern "C"
-//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/breakdowncounter.cpp b/analyzers/src/breakdown/breakdowncounter.cpp
new file mode 100644
index 0000000..5d3df3c
--- /dev/null
+++ b/analyzers/src/breakdown/breakdowncounter.cpp
@@ -0,0 +1,54 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Statistics counter
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <algorithm>
+#include <numeric>
+
+#include "breakdowncounter.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+BreakdownCounter::BreakdownCounter(size_t count) : latencies(count, NST::breakdown::Latencies())
+{
+}
+
+BreakdownCounter::~BreakdownCounter()
+{
+}
+
+Latencies& BreakdownCounter::operator[](int index)
+{
+ return latencies[index];
+}
+
+uint64_t BreakdownCounter::get_total_count() const
+{
+ return std::accumulate(std::begin(latencies), std::end(latencies), 0, [](int sum, const NST::breakdown::Latencies & latency)
+ {
+ return sum + latency.get_count();
+ });
+}
+
+const Latencies BreakdownCounter::operator[](int index) const
+{
+ return latencies[index];
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/breakdowncounter.h b/analyzers/src/breakdown/breakdowncounter.h
new file mode 100644
index 0000000..2d9a86c
--- /dev/null
+++ b/analyzers/src/breakdown/breakdowncounter.h
@@ -0,0 +1,64 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Statistics counter
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef BREAKDOWNCOUNTER_H
+#define BREAKDOWNCOUNTER_H
+//------------------------------------------------------------------------------
+#include <cinttypes>
+#include <vector>
+
+#include "latencies.h"
+//------------------------------------------------------------------------------
+/*! Counts and keeps breakdown statistics for session
+ */
+class BreakdownCounter
+{
+public:
+ BreakdownCounter(std::size_t count);
+ ~BreakdownCounter();
+
+ /*!
+ * \brief operator [] returns statistics by index (command number)
+ * \param index - command number
+ * \return statistics
+ */
+ const NST::breakdown::Latencies operator[](int index) const;
+
+ /*!
+ * \brief operator [] returns statistics by index (command number)
+ * \param index - command number
+ * \return statistics
+ */
+ NST::breakdown::Latencies& operator[](int index);
+
+ /*!
+ * \brief get_total_count returns total amount of commands
+ * \return commands count
+ */
+ uint64_t get_total_count () const;
+
+private:
+ void operator= (const BreakdownCounter&) = delete;
+ std::vector<NST::breakdown::Latencies> latencies;
+};
+//------------------------------------------------------------------------------
+#endif//BREAKDOWNCOUNTER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv1breakdownanalyzer.cpp b/analyzers/src/breakdown/cifsv1breakdownanalyzer.cpp
new file mode 100644
index 0000000..e8977e8
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv1breakdownanalyzer.cpp
@@ -0,0 +1,414 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: CIFS breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "cifsv1commands.h"
+#include "cifsv1breakdownanalyzer.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+static const size_t space_for_cmd_name = 22;
+//------------------------------------------------------------------------------
+CIFSBreakdownAnalyzer::CIFSBreakdownAnalyzer(std::ostream& o)
+ : statistics(SMBv1Commands().commands_count())
+ , representer(o, new SMBv1Commands(), space_for_cmd_name)
+{
+}
+
+void CIFSBreakdownAnalyzer::createDirectorySMBv1(const SMBv1::CreateDirectoryCommand* cmd, const SMBv1::CreateDirectoryArgumentType*, const SMBv1::CreateDirectoryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CREATE_DIRECTORY);
+}
+
+void CIFSBreakdownAnalyzer::deleteDirectorySMBv1(const SMBv1::DeleteDirectoryCommand* cmd, const SMBv1::DeleteDirectoryArgumentType*, const SMBv1::DeleteDirectoryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_DELETE_DIRECTORY);
+}
+
+void CIFSBreakdownAnalyzer::openSMBv1(const SMBv1::OpenCommand* cmd, const SMBv1::OpenArgumentType*, const SMBv1::OpenResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_OPEN);
+}
+
+void CIFSBreakdownAnalyzer::createSMBv1(const SMBv1::CreateCommand* cmd, const SMBv1::CreateArgumentType*, const SMBv1::CreateResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CREATE);
+}
+
+void CIFSBreakdownAnalyzer::closeSMBv1(const SMBv1::CloseCommand* cmd, const SMBv1::CloseArgumentType*, const SMBv1::CloseResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CLOSE);
+}
+
+void CIFSBreakdownAnalyzer::flushSMBv1(const SMBv1::FlushCommand* cmd, const SMBv1::FlushArgumentType*, const SMBv1::FlushResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_FLUSH);
+}
+
+void CIFSBreakdownAnalyzer::deleteSMBv1(const SMBv1::DeleteCommand* cmd, const SMBv1::DeleteArgumentType*, const SMBv1::DeleteResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_DELETE);
+}
+
+void CIFSBreakdownAnalyzer::renameSMBv1(const SMBv1::RenameCommand* cmd, const SMBv1::RenameArgumentType*, const SMBv1::RenameResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_RENAME);
+}
+
+void CIFSBreakdownAnalyzer::queryInfoSMBv1(const SMBv1::QueryInformationCommand* cmd, const SMBv1::QueryInformationArgumentType*, const SMBv1::QueryInformationResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_QUERY_INFORMATION);
+}
+
+void CIFSBreakdownAnalyzer::setInfoSMBv1(const SMBv1::SetInformationCommand* cmd, const SMBv1::SetInformationArgumentType*, const SMBv1::SetInformationResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_SET_INFORMATION);
+}
+
+void CIFSBreakdownAnalyzer::readSMBv1(const SMBv1::ReadCommand* cmd, const SMBv1::ReadArgumentType*, const SMBv1::ReadResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_READ);
+}
+
+void CIFSBreakdownAnalyzer::writeSMBv1(const SMBv1::WriteCommand* cmd, const SMBv1::WriteArgumentType*, const SMBv1::WriteResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE);
+}
+
+void CIFSBreakdownAnalyzer::lockByteRangeSMBv1(const SMBv1::LockByteRangeCommand* cmd, const SMBv1::LockByteRangeArgumentType*, const SMBv1::LockByteRangeResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_LOCK_BYTE_RANGE);
+}
+
+void CIFSBreakdownAnalyzer::unlockByteRangeSMBv1(const SMBv1::UnlockByteRangeCommand* cmd, const SMBv1::UnlockByteRangeArgumentType*, const SMBv1::UnlockByteRangeResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_UNLOCK_BYTE_RANGE);
+}
+
+void CIFSBreakdownAnalyzer::createTmpSMBv1(const SMBv1::CreateTemporaryCommand* cmd, const SMBv1::CreateTemporaryArgumentType*, const SMBv1::CreateTemporaryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CREATE_TEMPORARY);
+}
+
+void CIFSBreakdownAnalyzer::createNewSMBv1(const SMBv1::CreateNewCommand* cmd, const SMBv1::CreateNewArgumentType*, const SMBv1::CreateNewResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CREATE_NEW);
+}
+
+void CIFSBreakdownAnalyzer::checkDirectorySMBv1(const SMBv1::CheckDirectoryCommand* cmd, const SMBv1::CheckDirectoryArgumentType*, const SMBv1::CheckDirectoryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CHECK_DIRECTORY);
+}
+
+void CIFSBreakdownAnalyzer::processExitSMBv1(const SMBv1::ProcessExitCommand* cmd, const SMBv1::ProcessExitArgumentType*, const SMBv1::ProcessExitResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_PROCESS_EXIT);
+}
+
+void CIFSBreakdownAnalyzer::seekSMBv1(const SMBv1::SeekCommand* cmd, const SMBv1::SeekArgumentType*, const SMBv1::SeekResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_SEEK);
+}
+
+void CIFSBreakdownAnalyzer::lockAndReadSMBv1(const SMBv1::LockAndReadCommand* cmd, const SMBv1::LockAndReadArgumentType*, const SMBv1::LockAndReadResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_LOCK_AND_READ);
+}
+
+void CIFSBreakdownAnalyzer::writeAndUnlockSMBv1(const SMBv1::WriteAndUnlockCommand* cmd, const SMBv1::WriteAndUnlockArgumentType*, const SMBv1::WriteAndUnlockResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_AND_UNLOCK);
+}
+
+void CIFSBreakdownAnalyzer::readRawSMBv1(const SMBv1::ReadRawCommand* cmd, const SMBv1::ReadRawArgumentType*, const SMBv1::ReadRawResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_READ_RAW);
+}
+
+void CIFSBreakdownAnalyzer::readMpxSMBv1(const SMBv1::ReadMpxCommand* cmd, const SMBv1::ReadMpxArgumentType*, const SMBv1::ReadMpxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_READ_MPX);
+}
+
+void CIFSBreakdownAnalyzer::readMpxSecondarySMBv1(const SMBv1::ReadMpxSecondaryCommand* cmd, const SMBv1::ReadMpxSecondaryArgumentType*, const SMBv1::ReadMpxSecondaryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_READ_MPX_SECONDARY);
+}
+
+void CIFSBreakdownAnalyzer::writeRawSMBv1(const SMBv1::WriteRawCommand* cmd, const SMBv1::WriteRawArgumentType*, const SMBv1::WriteRawResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_RAW);
+}
+
+void CIFSBreakdownAnalyzer::writeMpxSMBv1(const SMBv1::WriteMpxCommand* cmd, const SMBv1::WriteMpxArgumentType*, const SMBv1::WriteMpxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_MPX);
+}
+
+void CIFSBreakdownAnalyzer::writeMpxSecondarySMBv1(const SMBv1::WriteMpxSecondaryCommand* cmd, const SMBv1::WriteMpxSecondaryArgumentType*, const SMBv1::WriteMpxSecondaryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_MPX_SECONDARY);
+}
+
+void CIFSBreakdownAnalyzer::writeCompleteSMBv1(const SMBv1::WriteCompleteCommand* cmd, const SMBv1::WriteCompleteArgumentType*, const SMBv1::WriteCompleteResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_COMPLETE);
+}
+
+void CIFSBreakdownAnalyzer::queryServerSMBv1(const SMBv1::QueryServerCommand* cmd, const SMBv1::QueryServerArgumentType*, const SMBv1::QueryServerResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_QUERY_SERVER);
+}
+
+void CIFSBreakdownAnalyzer::setInfo2SMBv1(const SMBv1::SetInformation2Command* cmd, const SMBv1::SetInformation2ArgumentType*, const SMBv1::SetInformation2ResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_SET_INFORMATION2);
+}
+
+void CIFSBreakdownAnalyzer::queryInfo2SMBv1(const SMBv1::QueryInformation2Command* cmd, const SMBv1::QueryInformation2ArgumentType*, const SMBv1::QueryInformation2ResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_QUERY_INFORMATION2);
+}
+
+void CIFSBreakdownAnalyzer::lockingAndxSMBv1(const SMBv1::LockingAndxCommand* cmd, const SMBv1::LockingAndxArgumentType*, const SMBv1::LockingAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_LOCKING_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::transactionSMBv1(const SMBv1::TransactionCommand* cmd, const SMBv1::TransactionArgumentType*, const SMBv1::TransactionResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_TRANSACTION);
+}
+
+void CIFSBreakdownAnalyzer::transactionSecondarySMBv1(const SMBv1::TransactionSecondaryCommand* cmd, const SMBv1::TransactionSecondaryArgumentType*, const SMBv1::TransactionSecondaryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_TRANSACTION_SECONDARY);
+}
+
+void CIFSBreakdownAnalyzer::ioctlSMBv1(const SMBv1::IoctlCommand* cmd, const SMBv1::IoctlArgumentType*, const SMBv1::IoctlResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_IOCTL);
+}
+
+void CIFSBreakdownAnalyzer::ioctlSecondarySMBv1(const SMBv1::IoctlSecondaryCommand* cmd, const SMBv1::IoctlSecondaryArgumentType*, const SMBv1::IoctlSecondaryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_IOCTL_SECONDARY);
+}
+
+void CIFSBreakdownAnalyzer::copySMBv1(const SMBv1::CopyCommand* cmd, const SMBv1::CopyArgumentType*, const SMBv1::CopyResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_COPY);
+}
+
+void CIFSBreakdownAnalyzer::moveSMBv1(const SMBv1::MoveCommand* cmd, const SMBv1::MoveArgumentType*, const SMBv1::MoveResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_MOVE);
+}
+
+void CIFSBreakdownAnalyzer::echoSMBv1(const SMBv1::EchoCommand* cmd, const SMBv1::EchoArgumentType*, const SMBv1::EchoResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_ECHO);
+}
+
+void CIFSBreakdownAnalyzer::writeAndCloseSMBv1(const SMBv1::WriteAndCloseCommand* cmd, const SMBv1::WriteAndCloseArgumentType*, const SMBv1::WriteAndCloseResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_AND_CLOSE);
+}
+
+void CIFSBreakdownAnalyzer::openAndxSMBv1(const SMBv1::OpenAndxCommand* cmd, const SMBv1::OpenAndxArgumentType*, const SMBv1::OpenAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_OPEN_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::readAndxSMBv1(const SMBv1::ReadAndxCommand* cmd, const SMBv1::ReadAndxArgumentType*, const SMBv1::ReadAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_READ_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::writeAndxSMBv1(const SMBv1::WriteAndxCommand* cmd, const SMBv1::WriteAndxArgumentType*, const SMBv1::WriteAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::newFileSizeSMBv1(const SMBv1::NewFileSizeCommand* cmd, const SMBv1::NewFileSizeArgumentType*, const SMBv1::NewFileSizeResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NEW_FILE_SIZE);
+}
+
+void CIFSBreakdownAnalyzer::closeAndTreeDiscSMBv1(const SMBv1::CloseAndTreeDiscCommand* cmd, const SMBv1::CloseAndTreeDiscArgumentType*, const SMBv1::CloseAndTreeDiscResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CLOSE_AND_TREE_DISC);
+}
+
+void CIFSBreakdownAnalyzer::transaction2SMBv1(const SMBv1::Transaction2Command* cmd, const SMBv1::Transaction2ArgumentType*, const SMBv1::Transaction2ResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_TRANSACTION2);
+}
+
+void CIFSBreakdownAnalyzer::transaction2SecondarySMBv1(const SMBv1::Transaction2SecondaryCommand* cmd, const SMBv1::Transaction2SecondaryArgumentType*, const SMBv1::Transaction2SecondaryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_TRANSACTION2_SECONDARY);
+}
+
+void CIFSBreakdownAnalyzer::findClose2SMBv1(const SMBv1::FindClose2Command* cmd, const SMBv1::FindClose2ArgumentType*, const SMBv1::FindClose2ResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_FIND_CLOSE2);
+}
+
+void CIFSBreakdownAnalyzer::findNotifyCloseSMBv1(const SMBv1::FindNotifyCloseCommand* cmd, const SMBv1::FindNotifyCloseArgumentType*, const SMBv1::FindNotifyCloseResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_FIND_NOTIFY_CLOSE);
+}
+
+void CIFSBreakdownAnalyzer::treeConnectSMBv1(const SMBv1::TreeConnectCommand* cmd, const SMBv1::TreeConnectArgumentType*, const SMBv1::TreeConnectResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_TREE_CONNECT);
+}
+
+void CIFSBreakdownAnalyzer::treeDisconnectSMBv1(const SMBv1::TreeDisconnectCommand* cmd, const SMBv1::TreeDisconnectArgumentType*, const SMBv1::TreeDisconnectResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_TREE_DISCONNECT);
+}
+
+void CIFSBreakdownAnalyzer::negotiateSMBv1(const SMBv1::NegotiateCommand* cmd, const SMBv1::NegotiateArgumentType*, const SMBv1::NegotiateResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NEGOTIATE);
+}
+
+void CIFSBreakdownAnalyzer::sessionSetupAndxSMBv1(const SMBv1::SessionSetupAndxCommand* cmd, const SMBv1::SessionSetupAndxArgumentType*, const SMBv1::SessionSetupAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_SESSION_SETUP_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::logoffAndxSMBv1(const SMBv1::LogoffAndxCommand* cmd, const SMBv1::LogoffAndxArgumentType*, const SMBv1::LogoffAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_LOGOFF_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::treeConnectAndxSMBv1(const SMBv1::TreeConnectAndxCommand* cmd, const SMBv1::TreeConnectAndxArgumentType*, const SMBv1::TreeConnectAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_TREE_CONNECT_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::securityPackageAndxSMBv1(const SMBv1::SecurityPackageAndxCommand* cmd, const SMBv1::SecurityPackageAndxArgumentType*, const SMBv1::SecurityPackageAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_SECURITY_PACKAGE_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::queryInformationDiskSMBv1(const SMBv1::QueryInformationDiskCommand* cmd, const SMBv1::QueryInformationDiskArgumentType*, const SMBv1::QueryInformationDiskResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_QUERY_INFORMATION_DISK);
+}
+
+void CIFSBreakdownAnalyzer::searchSMBv1(const SMBv1::SearchCommand* cmd, const SMBv1::SearchArgumentType*, const SMBv1::SearchResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_SEARCH);
+}
+
+void CIFSBreakdownAnalyzer::findSMBv1(const SMBv1::FindCommand* cmd, const SMBv1::FindArgumentType*, const SMBv1::FindResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_FIND);
+}
+
+void CIFSBreakdownAnalyzer::findUniqueSMBv1(const SMBv1::FindUniqueCommand* cmd, const SMBv1::FindUniqueArgumentType*, const SMBv1::FindUniqueResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_FIND_UNIQUE);
+}
+
+void CIFSBreakdownAnalyzer::findCloseSMBv1(const SMBv1::FindCloseCommand* cmd, const SMBv1::FindCloseArgumentType*, const SMBv1::FindCloseResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_FIND_CLOSE);
+}
+
+void CIFSBreakdownAnalyzer::ntTransactSMBv1(const SMBv1::NtTransactCommand* cmd, const SMBv1::NtTransactArgumentType*, const SMBv1::NtTransactResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NT_TRANSACT);
+}
+
+void CIFSBreakdownAnalyzer::ntTransactSecondarySMBv1(const SMBv1::NtTransactSecondaryCommand* cmd, const SMBv1::NtTransactSecondaryArgumentType*, const SMBv1::NtTransactSecondaryResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NT_TRANSACT_SECONDARY);
+}
+
+void CIFSBreakdownAnalyzer::ntCreateAndxSMBv1(const SMBv1::NtCreateAndxCommand* cmd, const SMBv1::NtCreateAndxArgumentType*, const SMBv1::NtCreateAndxResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NT_CREATE_ANDX);
+}
+
+void CIFSBreakdownAnalyzer::ntCancelSMBv1(const SMBv1::NtCancelCommand* cmd, const SMBv1::NtCancelArgumentType*, const SMBv1::NtCancelResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NT_CANCEL);
+}
+
+void CIFSBreakdownAnalyzer::ntRenameSMBv1(const SMBv1::NtRenameCommand* cmd, const SMBv1::NtRenameArgumentType*, const SMBv1::NtRenameResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NT_RENAME);
+}
+
+void CIFSBreakdownAnalyzer::openPrintFileSMBv1(const SMBv1::OpenPrintFileCommand* cmd, const SMBv1::OpenPrintFileArgumentType*, const SMBv1::OpenPrintFileResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_OPEN_PRINT_FILE);
+}
+
+void CIFSBreakdownAnalyzer::writePrintFileSMBv1(const SMBv1::WritePrintFileCommand* cmd, const SMBv1::WritePrintFileArgumentType*, const SMBv1::WritePrintFileResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_PRINT_FILE);
+}
+
+void CIFSBreakdownAnalyzer::closePrintFileSMBv1(const SMBv1::ClosePrintFileCommand* cmd, const SMBv1::ClosePrintFileArgumentType*, const SMBv1::ClosePrintFileResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_CLOSE_PRINT_FILE);
+}
+
+void CIFSBreakdownAnalyzer::getPrintQueueSMBv1(const SMBv1::GetPrintQueueCommand* cmd, const SMBv1::GetPrintQueueArgumentType*, const SMBv1::GetPrintQueueResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_GET_PRINT_QUEUE);
+}
+
+void CIFSBreakdownAnalyzer::readBulkSMBv1(const SMBv1::ReadBulkCommand* cmd, const SMBv1::ReadBulkArgumentType*, const SMBv1::ReadBulkResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_READ_BULK);
+}
+
+void CIFSBreakdownAnalyzer::writeBulkSMBv1(const SMBv1::WriteBulkCommand* cmd, const SMBv1::WriteBulkArgumentType*, const SMBv1::WriteBulkResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_BULK);
+}
+
+void CIFSBreakdownAnalyzer::writeBulkDataSMBv1(const SMBv1::WriteBulkDataCommand* cmd, const SMBv1::WriteBulkDataArgumentType*, const SMBv1::WriteBulkDataResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_WRITE_BULK_DATA);
+}
+
+void CIFSBreakdownAnalyzer::invalidSMBv1(const SMBv1::InvalidCommand* cmd, const SMBv1::InvalidArgumentType*, const SMBv1::InvalidResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_INVALID);
+}
+
+void CIFSBreakdownAnalyzer::noAndxCommandSMBv1(const SMBv1::NoAndxCommand* cmd, const SMBv1::NoAndxCmdArgumentType*, const SMBv1::NoAndxCmdResultType*)
+{
+ statistics.account(cmd, NST::API::SMBv1::SMBv1Commands::SMB_COM_NO_ANDX_COMMAND);
+}
+
+void CIFSBreakdownAnalyzer::flush_statistics()
+{
+ representer.flush_statistics(statistics);
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv1breakdownanalyzer.h b/analyzers/src/breakdown/cifsv1breakdownanalyzer.h
new file mode 100644
index 0000000..335b0fd
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv1breakdownanalyzer.h
@@ -0,0 +1,128 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: CIFS breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFSBREAKDOWNANALYZER_H
+#define CIFSBREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "representer.h"
+#include "statistics.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*! \class Analyzer for CIFS v1
+ * Handles CIFS v1 commands
+ */
+class CIFSBreakdownAnalyzer : virtual public IAnalyzer
+{
+ Statistics statistics; //!< Statistics
+ Representer representer; //!< Class for statistics representation
+public:
+ CIFSBreakdownAnalyzer(std::ostream& o = std::cout);
+
+ void createDirectorySMBv1(const SMBv1::CreateDirectoryCommand* cmd, const SMBv1::CreateDirectoryArgumentType*, const SMBv1::CreateDirectoryResultType*) override final;
+ void deleteDirectorySMBv1(const SMBv1::DeleteDirectoryCommand* cmd, const SMBv1::DeleteDirectoryArgumentType*, const SMBv1::DeleteDirectoryResultType*) override final;
+ void openSMBv1(const SMBv1::OpenCommand* cmd, const SMBv1::OpenArgumentType*, const SMBv1::OpenResultType*) override final;
+ void createSMBv1(const SMBv1::CreateCommand* cmd, const SMBv1::CreateArgumentType*, const SMBv1::CreateResultType*) override final;
+ void closeSMBv1(const SMBv1::CloseCommand* cmd, const SMBv1::CloseArgumentType*, const SMBv1::CloseResultType*) override final;
+ void flushSMBv1(const SMBv1::FlushCommand* cmd, const SMBv1::FlushArgumentType*, const SMBv1::FlushResultType*) override final;
+ void deleteSMBv1(const SMBv1::DeleteCommand* cmd, const SMBv1::DeleteArgumentType*, const SMBv1::DeleteResultType*) override final;
+ void renameSMBv1(const SMBv1::RenameCommand* cmd, const SMBv1::RenameArgumentType*, const SMBv1::RenameResultType*) override final;
+ void queryInfoSMBv1(const SMBv1::QueryInformationCommand* cmd, const SMBv1::QueryInformationArgumentType*, const SMBv1::QueryInformationResultType*) override final;
+ void setInfoSMBv1(const SMBv1::SetInformationCommand* cmd, const SMBv1::SetInformationArgumentType*, const SMBv1::SetInformationResultType*) override final;
+ void readSMBv1(const SMBv1::ReadCommand* cmd, const SMBv1::ReadArgumentType*, const SMBv1::ReadResultType*) override final;
+ void writeSMBv1(const SMBv1::WriteCommand* cmd, const SMBv1::WriteArgumentType*, const SMBv1::WriteResultType*) override final;
+ void lockByteRangeSMBv1(const SMBv1::LockByteRangeCommand* cmd, const SMBv1::LockByteRangeArgumentType*, const SMBv1::LockByteRangeResultType*) override final;
+ void unlockByteRangeSMBv1(const SMBv1::UnlockByteRangeCommand* cmd, const SMBv1::UnlockByteRangeArgumentType*, const SMBv1::UnlockByteRangeResultType*) override final;
+ void createTmpSMBv1(const SMBv1::CreateTemporaryCommand* cmd, const SMBv1::CreateTemporaryArgumentType*, const SMBv1::CreateTemporaryResultType*) override final;
+ void createNewSMBv1(const SMBv1::CreateNewCommand* cmd, const SMBv1::CreateNewArgumentType*, const SMBv1::CreateNewResultType*) override final;
+ void checkDirectorySMBv1(const SMBv1::CheckDirectoryCommand* cmd, const SMBv1::CheckDirectoryArgumentType*, const SMBv1::CheckDirectoryResultType*) override final;
+ void processExitSMBv1(const SMBv1::ProcessExitCommand* cmd, const SMBv1::ProcessExitArgumentType*, const SMBv1::ProcessExitResultType*) override final;
+ void seekSMBv1(const SMBv1::SeekCommand* cmd, const SMBv1::SeekArgumentType*, const SMBv1::SeekResultType*) override final;
+ void lockAndReadSMBv1(const SMBv1::LockAndReadCommand* cmd, const SMBv1::LockAndReadArgumentType*, const SMBv1::LockAndReadResultType*) override final;
+ void writeAndUnlockSMBv1(const SMBv1::WriteAndUnlockCommand* cmd, const SMBv1::WriteAndUnlockArgumentType*, const SMBv1::WriteAndUnlockResultType*) override final;
+ void readRawSMBv1(const SMBv1::ReadRawCommand* cmd, const SMBv1::ReadRawArgumentType*, const SMBv1::ReadRawResultType*) override final;
+ void readMpxSMBv1(const SMBv1::ReadMpxCommand* cmd, const SMBv1::ReadMpxArgumentType*, const SMBv1::ReadMpxResultType*) override final;
+ void readMpxSecondarySMBv1(const SMBv1::ReadMpxSecondaryCommand* cmd, const SMBv1::ReadMpxSecondaryArgumentType*, const SMBv1::ReadMpxSecondaryResultType*) override final;
+ void writeRawSMBv1(const SMBv1::WriteRawCommand* cmd, const SMBv1::WriteRawArgumentType*, const SMBv1::WriteRawResultType*) override final;
+ void writeMpxSMBv1(const SMBv1::WriteMpxCommand* cmd, const SMBv1::WriteMpxArgumentType*, const SMBv1::WriteMpxResultType*) override final;
+ void writeMpxSecondarySMBv1(const SMBv1::WriteMpxSecondaryCommand* cmd, const SMBv1::WriteMpxSecondaryArgumentType*, const SMBv1::WriteMpxSecondaryResultType*) override final;
+ void writeCompleteSMBv1(const SMBv1::WriteCompleteCommand* cmd, const SMBv1::WriteCompleteArgumentType*, const SMBv1::WriteCompleteResultType*) override final;
+ void queryServerSMBv1(const SMBv1::QueryServerCommand* cmd, const SMBv1::QueryServerArgumentType*, const SMBv1::QueryServerResultType*) override final;
+ void setInfo2SMBv1(const SMBv1::SetInformation2Command* cmd, const SMBv1::SetInformation2ArgumentType*, const SMBv1::SetInformation2ResultType*) override final;
+ void queryInfo2SMBv1(const SMBv1::QueryInformation2Command* cmd, const SMBv1::QueryInformation2ArgumentType*, const SMBv1::QueryInformation2ResultType*) override final;
+ void lockingAndxSMBv1(const SMBv1::LockingAndxCommand* cmd, const SMBv1::LockingAndxArgumentType*, const SMBv1::LockingAndxResultType*) override final;
+ void transactionSMBv1(const SMBv1::TransactionCommand* cmd, const SMBv1::TransactionArgumentType*, const SMBv1::TransactionResultType*) override final;
+ void transactionSecondarySMBv1(const SMBv1::TransactionSecondaryCommand* cmd, const SMBv1::TransactionSecondaryArgumentType*, const SMBv1::TransactionSecondaryResultType*) override final;
+ void ioctlSMBv1(const SMBv1::IoctlCommand* cmd, const SMBv1::IoctlArgumentType*, const SMBv1::IoctlResultType*) override final;
+ void ioctlSecondarySMBv1(const SMBv1::IoctlSecondaryCommand* cmd, const SMBv1::IoctlSecondaryArgumentType*, const SMBv1::IoctlSecondaryResultType*) override final;
+ void copySMBv1(const SMBv1::CopyCommand* cmd, const SMBv1::CopyArgumentType*, const SMBv1::CopyResultType*) override final;
+ void moveSMBv1(const SMBv1::MoveCommand* cmd, const SMBv1::MoveArgumentType*, const SMBv1::MoveResultType*) override final;
+ void echoSMBv1(const SMBv1::EchoCommand* cmd, const SMBv1::EchoArgumentType*, const SMBv1::EchoResultType*) override final;
+ void writeAndCloseSMBv1(const SMBv1::WriteAndCloseCommand* cmd, const SMBv1::WriteAndCloseArgumentType*, const SMBv1::WriteAndCloseResultType*) override final;
+ void openAndxSMBv1(const SMBv1::OpenAndxCommand* cmd, const SMBv1::OpenAndxArgumentType*, const SMBv1::OpenAndxResultType*) override final;
+ void readAndxSMBv1(const SMBv1::ReadAndxCommand* cmd, const SMBv1::ReadAndxArgumentType*, const SMBv1::ReadAndxResultType*) override final;
+ void writeAndxSMBv1(const SMBv1::WriteAndxCommand* cmd, const SMBv1::WriteAndxArgumentType*, const SMBv1::WriteAndxResultType*) override final;
+ void newFileSizeSMBv1(const SMBv1::NewFileSizeCommand* cmd, const SMBv1::NewFileSizeArgumentType*, const SMBv1::NewFileSizeResultType*) override final;
+ void closeAndTreeDiscSMBv1(const SMBv1::CloseAndTreeDiscCommand* cmd, const SMBv1::CloseAndTreeDiscArgumentType*, const SMBv1::CloseAndTreeDiscResultType*) override final;
+ void transaction2SMBv1(const SMBv1::Transaction2Command* cmd, const SMBv1::Transaction2ArgumentType*, const SMBv1::Transaction2ResultType*) override final;
+ void transaction2SecondarySMBv1(const SMBv1::Transaction2SecondaryCommand* cmd, const SMBv1::Transaction2SecondaryArgumentType*, const SMBv1::Transaction2SecondaryResultType*) override final;
+ void findClose2SMBv1(const SMBv1::FindClose2Command* cmd, const SMBv1::FindClose2ArgumentType*, const SMBv1::FindClose2ResultType*) override final;
+ void findNotifyCloseSMBv1(const SMBv1::FindNotifyCloseCommand* cmd, const SMBv1::FindNotifyCloseArgumentType*, const SMBv1::FindNotifyCloseResultType*) override final;
+ void treeConnectSMBv1(const SMBv1::TreeConnectCommand* cmd, const SMBv1::TreeConnectArgumentType*, const SMBv1::TreeConnectResultType*) override final;
+ void treeDisconnectSMBv1(const SMBv1::TreeDisconnectCommand* cmd, const SMBv1::TreeDisconnectArgumentType*, const SMBv1::TreeDisconnectResultType*) override final;
+ void negotiateSMBv1(const SMBv1::NegotiateCommand* cmd, const SMBv1::NegotiateArgumentType*, const SMBv1::NegotiateResultType*) override final;
+ void sessionSetupAndxSMBv1(const SMBv1::SessionSetupAndxCommand* cmd, const SMBv1::SessionSetupAndxArgumentType*, const SMBv1::SessionSetupAndxResultType*) override final;
+ void logoffAndxSMBv1(const SMBv1::LogoffAndxCommand* cmd, const SMBv1::LogoffAndxArgumentType*, const SMBv1::LogoffAndxResultType*) override final;
+ void treeConnectAndxSMBv1(const SMBv1::TreeConnectAndxCommand* cmd, const SMBv1::TreeConnectAndxArgumentType*, const SMBv1::TreeConnectAndxResultType*) override final;
+ void securityPackageAndxSMBv1(const SMBv1::SecurityPackageAndxCommand* cmd, const SMBv1::SecurityPackageAndxArgumentType*, const SMBv1::SecurityPackageAndxResultType*) override final;
+ void queryInformationDiskSMBv1(const SMBv1::QueryInformationDiskCommand* cmd, const SMBv1::QueryInformationDiskArgumentType*, const SMBv1::QueryInformationDiskResultType*) override final;
+ void searchSMBv1(const SMBv1::SearchCommand* cmd, const SMBv1::SearchArgumentType*, const SMBv1::SearchResultType*) override final;
+ void findSMBv1(const SMBv1::FindCommand* cmd, const SMBv1::FindArgumentType*, const SMBv1::FindResultType*) override final;
+ void findUniqueSMBv1(const SMBv1::FindUniqueCommand* cmd, const SMBv1::FindUniqueArgumentType*, const SMBv1::FindUniqueResultType*) override final;
+ void findCloseSMBv1(const SMBv1::FindCloseCommand* cmd, const SMBv1::FindCloseArgumentType*, const SMBv1::FindCloseResultType*) override final;
+ void ntTransactSMBv1(const SMBv1::NtTransactCommand* cmd, const SMBv1::NtTransactArgumentType*, const SMBv1::NtTransactResultType*) override final;
+ void ntTransactSecondarySMBv1(const SMBv1::NtTransactSecondaryCommand* cmd, const SMBv1::NtTransactSecondaryArgumentType*, const SMBv1::NtTransactSecondaryResultType*) override final;
+ void ntCreateAndxSMBv1(const SMBv1::NtCreateAndxCommand* cmd, const SMBv1::NtCreateAndxArgumentType*, const SMBv1::NtCreateAndxResultType*) override final;
+ void ntCancelSMBv1(const SMBv1::NtCancelCommand* cmd, const SMBv1::NtCancelArgumentType*, const SMBv1::NtCancelResultType*) override final;
+ void ntRenameSMBv1(const SMBv1::NtRenameCommand* cmd, const SMBv1::NtRenameArgumentType*, const SMBv1::NtRenameResultType*) override final;
+ void openPrintFileSMBv1(const SMBv1::OpenPrintFileCommand* cmd, const SMBv1::OpenPrintFileArgumentType*, const SMBv1::OpenPrintFileResultType*) override final;
+ void writePrintFileSMBv1(const SMBv1::WritePrintFileCommand* cmd, const SMBv1::WritePrintFileArgumentType*, const SMBv1::WritePrintFileResultType*) override final;
+ void closePrintFileSMBv1(const SMBv1::ClosePrintFileCommand* cmd, const SMBv1::ClosePrintFileArgumentType*, const SMBv1::ClosePrintFileResultType*) override final;
+ void getPrintQueueSMBv1(const SMBv1::GetPrintQueueCommand* cmd, const SMBv1::GetPrintQueueArgumentType*, const SMBv1::GetPrintQueueResultType*) override final;
+ void readBulkSMBv1(const SMBv1::ReadBulkCommand* cmd, const SMBv1::ReadBulkArgumentType*, const SMBv1::ReadBulkResultType*) override final;
+ void writeBulkSMBv1(const SMBv1::WriteBulkCommand* cmd, const SMBv1::WriteBulkArgumentType*, const SMBv1::WriteBulkResultType*) override final;
+ void writeBulkDataSMBv1(const SMBv1::WriteBulkDataCommand* cmd, const SMBv1::WriteBulkDataArgumentType*, const SMBv1::WriteBulkDataResultType*) override final;
+ void invalidSMBv1(const SMBv1::InvalidCommand* cmd, const SMBv1::InvalidArgumentType*, const SMBv1::InvalidResultType*) override final;
+ void noAndxCommandSMBv1(const SMBv1::NoAndxCommand* cmd, const SMBv1::NoAndxCmdArgumentType*, const SMBv1::NoAndxCmdResultType*) override final;
+protected:
+ void flush_statistics() override;
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFSBREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv1commands.cpp b/analyzers/src/breakdown/cifsv1commands.cpp
new file mode 100644
index 0000000..9c2df5d
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv1commands.cpp
@@ -0,0 +1,47 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents CIFS v1 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "cifsv1commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+const char* NST::breakdown::SMBv1Commands::command_name(int cmd_code)
+{
+ return print_cifs1_procedures(static_cast<NST::API::SMBv1::SMBv1Commands>(cmd_code));
+}
+
+size_t SMBv1Commands::commands_count()
+{
+ return static_cast<size_t>(NST::API::SMBv1::SMBv1Commands::CMD_COUNT);
+}
+
+const char* NST::breakdown::SMBv1Commands::command_description(int cmd_code)
+{
+ return print_cifs1_procedures(static_cast<NST::API::SMBv1::SMBv1Commands>(cmd_code));
+}
+
+const char* NST::breakdown::SMBv1Commands::protocol_name()
+{
+ return "CIFS v1";
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv1commands.h b/analyzers/src/breakdown/cifsv1commands.h
new file mode 100644
index 0000000..3e0aeb7
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv1commands.h
@@ -0,0 +1,47 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents CIFS v1 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFS_COMMANDS_H
+#define CIFS_COMMANDS_H
+//------------------------------------------------------------------------------
+#include "commandrepresenter.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*!
+ * Represents CIFS v1 commands
+ * Converts commands to string
+ */
+struct SMBv1Commands : public CommandRepresenter
+{
+ const char* command_description(int cmd_code) override final;
+ const char* command_name(int cmd_code) override final;
+ size_t commands_count();
+ const char* protocol_name();
+};
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFS_COMMANDS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv2breakdownanalyzer.cpp b/analyzers/src/breakdown/cifsv2breakdownanalyzer.cpp
new file mode 100644
index 0000000..67100e7
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv2breakdownanalyzer.cpp
@@ -0,0 +1,134 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: CIFS v2 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "cifsv2breakdownanalyzer.h"
+#include "cifsv2commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+static const size_t space_for_cmd_name = 22;
+//------------------------------------------------------------------------------
+CIFSv2BreakdownAnalyzer::CIFSv2BreakdownAnalyzer(std::ostream& o)
+ : stats(SMBv2Commands().commands_count())
+ , cifs2Representer(o, new SMBv2Commands(), space_for_cmd_name)
+{
+}
+
+void CIFSv2BreakdownAnalyzer::closeFileSMBv2(const SMBv2::CloseFileCommand* cmd, const SMBv2::CloseRequest*, const SMBv2::CloseResponse*)
+{
+ stats.account(cmd, SMBv2Commands::CLOSE);
+}
+
+void CIFSv2BreakdownAnalyzer::negotiateSMBv2(const SMBv2::NegotiateCommand* cmd, const SMBv2::NegotiateRequest*, const SMBv2::NegotiateResponse*)
+{
+ stats.account(cmd, SMBv2Commands::NEGOTIATE);
+}
+
+void CIFSv2BreakdownAnalyzer::sessionSetupSMBv2(const SMBv2::SessionSetupCommand* cmd, const SMBv2::SessionSetupRequest*, const SMBv2::SessionSetupResponse*)
+{
+ stats.account(cmd, SMBv2Commands::SESSION_SETUP);
+}
+
+void CIFSv2BreakdownAnalyzer::logOffSMBv2(const SMBv2::LogOffCommand* cmd, const SMBv2::LogOffRequest*, const SMBv2::LogOffResponse*)
+{
+ stats.account(cmd, SMBv2Commands::LOGOFF);
+}
+
+void CIFSv2BreakdownAnalyzer::treeConnectSMBv2(const SMBv2::TreeConnectCommand* cmd, const SMBv2::TreeConnectRequest*, const SMBv2::TreeConnectResponse*)
+{
+ stats.account(cmd, SMBv2Commands::TREE_CONNECT);
+}
+
+void CIFSv2BreakdownAnalyzer::treeDisconnectSMBv2(const SMBv2::TreeDisconnectCommand* cmd, const SMBv2::TreeDisconnectRequest*, const SMBv2::TreeDisconnectResponse*)
+{
+ stats.account(cmd, SMBv2Commands::TREE_DISCONNECT);
+}
+
+void CIFSv2BreakdownAnalyzer::createSMBv2(const SMBv2::CreateCommand* cmd, const SMBv2::CreateRequest*, const SMBv2::CreateResponse*)
+{
+ stats.account(cmd, SMBv2Commands::CREATE);
+}
+
+void CIFSv2BreakdownAnalyzer::flushSMBv2(const SMBv2::FlushCommand* cmd, const SMBv2::FlushRequest*, const SMBv2::FlushResponse*)
+{
+ stats.account(cmd, SMBv2Commands::FLUSH);
+}
+
+void CIFSv2BreakdownAnalyzer::readSMBv2(const SMBv2::ReadCommand* cmd, const SMBv2::ReadRequest*, const SMBv2::ReadResponse*)
+{
+ stats.account(cmd, SMBv2Commands::READ);
+}
+
+void CIFSv2BreakdownAnalyzer::writeSMBv2(const SMBv2::WriteCommand* cmd, const SMBv2::WriteRequest*, const SMBv2::WriteResponse*)
+{
+ stats.account(cmd, SMBv2Commands::WRITE);
+}
+
+void CIFSv2BreakdownAnalyzer::lockSMBv2(const SMBv2::LockCommand* cmd, const SMBv2::LockRequest*, const SMBv2::LockResponse*)
+{
+ stats.account(cmd, SMBv2Commands::LOCK);
+}
+
+void CIFSv2BreakdownAnalyzer::ioctlSMBv2(const SMBv2::IoctlCommand* cmd, const SMBv2::IoCtlRequest*, const SMBv2::IoCtlResponse*)
+{
+ stats.account(cmd, SMBv2Commands::IOCTL);
+}
+
+void CIFSv2BreakdownAnalyzer::cancelSMBv2(const SMBv2::CancelCommand* cmd, const SMBv2::CancelRequest*, const SMBv2::CancelResponce*)
+{
+ stats.account(cmd, SMBv2Commands::CANCEL);
+}
+
+void CIFSv2BreakdownAnalyzer::echoSMBv2(const SMBv2::EchoCommand* cmd, const SMBv2::EchoRequest*, const SMBv2::EchoResponse*)
+{
+ stats.account(cmd, SMBv2Commands::ECHO);
+}
+
+void CIFSv2BreakdownAnalyzer::queryDirSMBv2(const SMBv2::QueryDirCommand* cmd, const SMBv2::QueryDirRequest*, const SMBv2::QueryDirResponse*)
+{
+ stats.account(cmd, SMBv2Commands::QUERY_DIRECTORY);
+}
+
+void CIFSv2BreakdownAnalyzer::changeNotifySMBv2(const SMBv2::ChangeNotifyCommand* cmd, const SMBv2::ChangeNotifyRequest*, const SMBv2::ChangeNotifyResponse*)
+{
+ stats.account(cmd, SMBv2Commands::CHANGE_NOTIFY);
+}
+
+void CIFSv2BreakdownAnalyzer::queryInfoSMBv2(const SMBv2::QueryInfoCommand* cmd, const SMBv2::QueryInfoRequest*, const SMBv2::QueryInfoResponse*)
+{
+ stats.account(cmd, SMBv2Commands::QUERY_INFO);
+}
+
+void CIFSv2BreakdownAnalyzer::setInfoSMBv2(const SMBv2::SetInfoCommand* cmd, const SMBv2::SetInfoRequest*, const SMBv2::SetInfoResponse*)
+{
+ stats.account(cmd, SMBv2Commands::SET_INFO);
+}
+
+void CIFSv2BreakdownAnalyzer::breakOplockSMBv2(const SMBv2::BreakOpLockCommand* cmd, const SMBv2::OplockAcknowledgment*, const SMBv2::OplockResponse*)
+{
+ stats.account(cmd, SMBv2Commands::OPLOCK_BREAK);
+}
+
+void CIFSv2BreakdownAnalyzer::flush_statistics()
+{
+ cifs2Representer.flush_statistics(stats);
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv2breakdownanalyzer.h b/analyzers/src/breakdown/cifsv2breakdownanalyzer.h
new file mode 100644
index 0000000..73f1fad
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv2breakdownanalyzer.h
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: CIFS v2 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFSV2BREAKDOWNANALYZER_H
+#define CIFSV2BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "representer.h"
+#include "statistics.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*! \class Analyzer for CIFS v2
+ * Handles CIFS v2 commands
+ */
+class CIFSv2BreakdownAnalyzer : virtual public IAnalyzer
+{
+ Statistics stats; //!< Statistics
+ Representer cifs2Representer; //!< Class for statistics representation
+public:
+ CIFSv2BreakdownAnalyzer(std::ostream& o = std::cout);
+ void closeFileSMBv2(const SMBv2::CloseFileCommand* cmd, const SMBv2::CloseRequest*, const SMBv2::CloseResponse*) override final;
+ void negotiateSMBv2(const SMBv2::NegotiateCommand* cmd, const SMBv2::NegotiateRequest*, const SMBv2::NegotiateResponse*) override final;
+ void sessionSetupSMBv2(const SMBv2::SessionSetupCommand* cmd, const SMBv2::SessionSetupRequest*, const SMBv2::SessionSetupResponse*) override final;
+ void logOffSMBv2(const SMBv2::LogOffCommand* cmd, const SMBv2::LogOffRequest*, const SMBv2::LogOffResponse*) override final;
+ void treeConnectSMBv2(const SMBv2::TreeConnectCommand* cmd, const SMBv2::TreeConnectRequest*, const SMBv2::TreeConnectResponse*) override final;
+ void treeDisconnectSMBv2(const SMBv2::TreeDisconnectCommand* cmd, const SMBv2::TreeDisconnectRequest*, const SMBv2::TreeDisconnectResponse*) override final;
+ void createSMBv2(const SMBv2::CreateCommand* cmd, const SMBv2::CreateRequest*, const SMBv2::CreateResponse*) override final;
+ void flushSMBv2(const SMBv2::FlushCommand* cmd, const SMBv2::FlushRequest*, const SMBv2::FlushResponse*) override final;
+ void readSMBv2(const SMBv2::ReadCommand* cmd, const SMBv2::ReadRequest*, const SMBv2::ReadResponse*) override final;
+ void writeSMBv2(const SMBv2::WriteCommand* cmd, const SMBv2::WriteRequest*, const SMBv2::WriteResponse*) override final;
+ void lockSMBv2(const SMBv2::LockCommand* cmd, const SMBv2::LockRequest*, const SMBv2::LockResponse*) override final;
+ void ioctlSMBv2(const SMBv2::IoctlCommand* cmd, const SMBv2::IoCtlRequest*, const SMBv2::IoCtlResponse*) override final;
+ void cancelSMBv2(const SMBv2::CancelCommand* cmd, const SMBv2::CancelRequest*, const SMBv2::CancelResponce*) override final;
+ void echoSMBv2(const SMBv2::EchoCommand* cmd, const SMBv2::EchoRequest*, const SMBv2::EchoResponse*) override final;
+ void queryDirSMBv2(const SMBv2::QueryDirCommand* cmd, const SMBv2::QueryDirRequest*, const SMBv2::QueryDirResponse*) override final;
+ void changeNotifySMBv2(const SMBv2::ChangeNotifyCommand* cmd, const SMBv2::ChangeNotifyRequest*, const SMBv2::ChangeNotifyResponse*) override final;
+ void queryInfoSMBv2(const SMBv2::QueryInfoCommand* cmd, const SMBv2::QueryInfoRequest*, const SMBv2::QueryInfoResponse*) override final;
+ void setInfoSMBv2(const SMBv2::SetInfoCommand* cmd, const SMBv2::SetInfoRequest*, const SMBv2::SetInfoResponse*) override final;
+ void breakOplockSMBv2(const SMBv2::BreakOpLockCommand* cmd, const SMBv2::OplockAcknowledgment*, const SMBv2::OplockResponse*) override final;
+protected:
+ void flush_statistics() override;
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFSV2BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv2commands.cpp b/analyzers/src/breakdown/cifsv2commands.cpp
new file mode 100644
index 0000000..e00e244
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv2commands.cpp
@@ -0,0 +1,94 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents CIFS v2 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <map>
+
+#include "cifsv2commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+
+const char* NST::breakdown::SMBv2Commands::command_name(int cmd_code)
+{
+ static std::map<Commands, const char*> cmdNames;
+ if (cmdNames.empty())
+ {
+ cmdNames[Commands::NEGOTIATE] = "NEGOTIATE";
+ cmdNames[Commands::SESSION_SETUP] = "SESSION SETUP";
+ cmdNames[Commands::LOGOFF] = "LOGOFF";
+ cmdNames[Commands::TREE_CONNECT] = "TREE CONNECT";
+ cmdNames[Commands::TREE_DISCONNECT] = "TREE DISCONNECT";
+ cmdNames[Commands::CREATE] = "CREATE";
+ cmdNames[Commands::CLOSE] = "CLOSE";
+ cmdNames[Commands::FLUSH] = "FLUSH";
+ cmdNames[Commands::READ] = "READ";
+ cmdNames[Commands::WRITE] = "WRITE";
+ cmdNames[Commands::LOCK] = "LOCK";
+ cmdNames[Commands::IOCTL] = "IOCTL";
+ cmdNames[Commands::CANCEL] = "CANCEL";
+ cmdNames[Commands::ECHO] = "ECHO";
+ cmdNames[Commands::QUERY_DIRECTORY] = "QUERY DIRECTORY";
+ cmdNames[Commands::CHANGE_NOTIFY] = "CHANGE NOTIFY";
+ cmdNames[Commands::QUERY_INFO] = "QUERY INFO";
+ cmdNames[Commands::SET_INFO] = "SET INFO";
+ cmdNames[Commands::OPLOCK_BREAK] = "OPLOCK BREAK";
+ }
+ return cmdNames[static_cast<Commands>(cmd_code)];
+}
+
+size_t SMBv2Commands::commands_count()
+{
+ return Commands::CMD_COUNT;
+}
+
+const char* NST::breakdown::SMBv2Commands::command_description(int cmd_code)
+{
+ static std::map<Commands, const char*> cmdNames;
+ if (cmdNames.empty())
+ {
+ cmdNames[Commands::NEGOTIATE] = "NEGOTIATE";
+ cmdNames[Commands::SESSION_SETUP] = "SESSION_SETUP";
+ cmdNames[Commands::LOGOFF] = "LOGOFF";
+ cmdNames[Commands::TREE_CONNECT] = "TREE_CONNECT";
+ cmdNames[Commands::TREE_DISCONNECT] = "TREE_DISCONNECT";
+ cmdNames[Commands::CREATE] = "CREATE";
+ cmdNames[Commands::CLOSE] = "CLOSE";
+ cmdNames[Commands::FLUSH] = "FLUSH";
+ cmdNames[Commands::READ] = "READ";
+ cmdNames[Commands::WRITE] = "WRITE";
+ cmdNames[Commands::LOCK] = "LOCK";
+ cmdNames[Commands::IOCTL] = "IOCTL";
+ cmdNames[Commands::CANCEL] = "CANCEL";
+ cmdNames[Commands::ECHO] = "ECHO";
+ cmdNames[Commands::QUERY_DIRECTORY] = "QUERY_DIRECTORY";
+ cmdNames[Commands::CHANGE_NOTIFY] = "CHANGE_NOTIFY";
+ cmdNames[Commands::QUERY_INFO] = "QUERY_INFO";
+ cmdNames[Commands::SET_INFO] = "SET_INFO";
+ cmdNames[Commands::OPLOCK_BREAK] = "OPLOCK_BREAK";
+ }
+ return cmdNames[static_cast<Commands>(cmd_code)];
+}
+
+const char* NST::breakdown::SMBv2Commands::protocol_name()
+{
+ return "CIFS v2";
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/cifsv2commands.h b/analyzers/src/breakdown/cifsv2commands.h
new file mode 100644
index 0000000..306f18a
--- /dev/null
+++ b/analyzers/src/breakdown/cifsv2commands.h
@@ -0,0 +1,78 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents CIFS v2 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFS2_COMMANDS_H
+#define CIFS2_COMMANDS_H
+//------------------------------------------------------------------------------
+#include "commandrepresenter.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*!
+ * Represents CIFS v2 commands
+ * Converts commands to string
+ */
+struct SMBv2Commands : CommandRepresenter
+{
+ /*!
+ * \brief The Commands enum commands codes
+ */
+ enum Commands
+ {
+ NEGOTIATE,
+ SESSION_SETUP,
+ LOGOFF,
+ TREE_CONNECT,
+ TREE_DISCONNECT,
+ CREATE,
+ CLOSE,
+ FLUSH,
+ READ,
+ WRITE,
+ LOCK,
+ IOCTL,
+ CANCEL,
+ ECHO,
+ QUERY_DIRECTORY,
+ CHANGE_NOTIFY,
+ QUERY_INFO,
+ SET_INFO,
+ OPLOCK_BREAK,
+ CMD_COUNT
+ };
+
+ const char* command_description(int cmd_code) override final;
+
+ const char* command_name(int cmd_code) override final;
+
+ size_t commands_count();
+
+ const char* protocol_name();
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFS2_COMMANDS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/commandrepresenter.h b/analyzers/src/breakdown/commandrepresenter.h
new file mode 100644
index 0000000..2e1a61a
--- /dev/null
+++ b/analyzers/src/breakdown/commandrepresenter.h
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Interface for command representers
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef COMMANDREPRESENTER_H
+#define COMMANDREPRESENTER_H
+//------------------------------------------------------------------------------
+#include <string>
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*!
+ * \brief The CommandRepresenter struct represents interface for command representers
+ * Commands representer should be able to convert commands to string
+ */
+struct CommandRepresenter
+{
+ /*!
+ * \brief returns description of the command
+ * \param cmd_code command code
+ * \return description
+ */
+ virtual const char* command_description(int cmd_code) = 0;
+
+ /*!
+ * \brief returns name of the command
+ * \param cmd_code command code
+ * \return name
+ */
+ virtual const char* command_name(int cmd_code) = 0;
+
+ /*!
+ * \brief returns name of the protocol
+ * \return protocol
+ */
+ virtual const char* protocol_name() = 0;
+
+ /*!
+ * \brief commandsCount returns total count of commands
+ * \return count
+ */
+ virtual size_t commands_count() = 0;
+
+ virtual ~CommandRepresenter() {}
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//COMMANDREPRESENTER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/latencies.cpp b/analyzers/src/breakdown/latencies.cpp
new file mode 100644
index 0000000..e162250
--- /dev/null
+++ b/analyzers/src/breakdown/latencies.cpp
@@ -0,0 +1,94 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Helpers for parsing CIFS v2 structures.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cmath>
+
+#include "latencies.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+
+Latencies::Latencies() : count {0}, avg {0}, m2 {0}
+{
+ timerclear(&min);
+ timerclear(&max);
+}
+
+void Latencies::add(const timeval& t)
+{
+ long double x = to_sec(t);
+ long double delta = x - avg;
+ avg += delta / (++count);
+ m2 += delta * (x - avg);
+
+ set_range(t);
+}
+
+uint64_t Latencies::get_count() const
+{
+ return count;
+}
+
+long double Latencies::get_avg() const
+{
+ return avg;
+}
+
+long double Latencies::get_st_dev() const
+{
+ if (count < 2)
+ {
+ return 0;
+ }
+ return sqrt(m2 / (count - 1));
+}
+
+const timeval& Latencies::get_min() const
+{
+ return min;
+}
+
+const timeval& Latencies::get_max() const
+{
+ return max;
+}
+
+void Latencies::set_range(const timeval& t)
+{
+ if (timercmp(&t, &min, < ))
+ {
+ min = t;
+ }
+ if (min.tv_sec == 0 && min.tv_usec == 0)
+ {
+ min = t;
+ }
+ if (timercmp(&t, &max, > ))
+ {
+ max = t;
+ }
+}
+
+long double NST::breakdown::to_sec(const timeval& val)
+{
+ return static_cast<long double>(val.tv_sec) + val.tv_usec / 1000000.0L;
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/latencies.h b/analyzers/src/breakdown/latencies.h
new file mode 100644
index 0000000..7b36ec0
--- /dev/null
+++ b/analyzers/src/breakdown/latencies.h
@@ -0,0 +1,101 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Latencies calculator
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef LATENCIES_H
+#define LATENCIES_H
+//------------------------------------------------------------------------------
+#include <cstdint>
+
+#include <sys/time.h>
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*!
+ * \brief Latencies calculates latencies
+ */
+class Latencies
+{
+public:
+ Latencies();
+
+ /*! Adds value of latency
+ * \param t - timeout
+ */
+ void add(const timeval& t);
+
+ /*!
+ * \brief gets count of timeouts
+ * \return count of timeouts
+ */
+ uint64_t get_count() const;
+
+ /*!
+ * \brief get_avg Gets average latency
+ * \return average timeout
+ */
+ long double get_avg() const;
+
+ /*!
+ * \brief get_st_dev Gets latency dispertion
+ * \return timeout dispertion
+ */
+ long double get_st_dev() const;
+
+ /*!
+ * \brief get_min Gets minimal value of latencies
+ * \return minimal latency
+ */
+ const timeval& get_min() const;
+
+ /*!
+ * \brief get_min Gets maximal value of latencies
+ * \return maximal latency
+ */
+ const timeval& get_max() const;
+
+private:
+ void operator=(const Latencies&) = delete;
+
+ void set_range(const timeval& t);
+
+ timeval min;
+ timeval max;
+
+ uint64_t count;
+ long double avg;
+ long double m2;
+};
+
+/*!
+ * \brief to_sec Converts timeval to double
+ * \param val - time struct
+ * \return converted value
+ */
+long double to_sec(const timeval& val);
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//LATENCIES_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/nfsv3breakdownanalyzer.cpp b/analyzers/src/breakdown/nfsv3breakdownanalyzer.cpp
new file mode 100644
index 0000000..e12409a
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv3breakdownanalyzer.cpp
@@ -0,0 +1,148 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: NFS v3 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "breakdowncounter.h"
+#include "nfsv3breakdownanalyzer.h"
+#include "nfsv3commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+NFSv3BreakdownAnalyzer::NFSv3BreakdownAnalyzer(std::ostream& o)
+ : stats(NFSv3Commands().commands_count())
+ , representer(o, new NFSv3Commands())
+{
+}
+
+void NFSv3BreakdownAnalyzer::null(const RPCProcedure* proc, const NFS3::NULL3args*, const NFS3::NULL3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::getattr3(const RPCProcedure* proc, const NFS3::GETATTR3args*, const NFS3::GETATTR3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::setattr3(const RPCProcedure* proc, const NFS3::SETATTR3args*, const NFS3::SETATTR3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::lookup3(const RPCProcedure* proc, const NFS3::LOOKUP3args*, const NFS3::LOOKUP3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::access3(const RPCProcedure* proc, const NFS3::ACCESS3args*, const NFS3::ACCESS3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::readlink3(const RPCProcedure* proc, const NFS3::READLINK3args*, const NFS3::READLINK3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::read3(const RPCProcedure* proc, const NFS3::READ3args*, const NFS3::READ3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::write3(const RPCProcedure* proc, const NFS3::WRITE3args*, const NFS3::WRITE3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::create3(const RPCProcedure* proc, const NFS3::CREATE3args*, const NFS3::CREATE3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::mkdir3(const RPCProcedure* proc, const NFS3::MKDIR3args*, const NFS3::MKDIR3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::symlink3(const RPCProcedure* proc, const NFS3::SYMLINK3args*, const NFS3::SYMLINK3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::mknod3(const RPCProcedure* proc, const NFS3::MKNOD3args*, const NFS3::MKNOD3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::remove3(const RPCProcedure* proc, const NFS3::REMOVE3args*, const NFS3::REMOVE3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::rmdir3(const RPCProcedure* proc, const NFS3::RMDIR3args*, const NFS3::RMDIR3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+
+void NFSv3BreakdownAnalyzer::rename3(const RPCProcedure* proc, const NFS3::RENAME3args*, const NFS3::RENAME3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::link3(const RPCProcedure* proc, const NFS3::LINK3args*, const NFS3::LINK3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::readdir3(const RPCProcedure* proc, const NFS3::READDIR3args*, const NFS3::READDIR3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::readdirplus3(const RPCProcedure* proc, const NFS3::READDIRPLUS3args*, const NFS3::READDIRPLUS3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::fsstat3(const RPCProcedure* proc, const NFS3::FSSTAT3args*, const NFS3::FSSTAT3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::fsinfo3(const RPCProcedure* proc, const NFS3::FSINFO3args*, const NFS3::FSINFO3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::pathconf3(const RPCProcedure* proc, const NFS3::PATHCONF3args*, const NFS3::PATHCONF3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::commit3(const RPCProcedure* proc, const NFS3::COMMIT3args*, const NFS3::COMMIT3res*)
+{
+ stats.account(proc, proc->call.ru.RM_cmb.cb_proc);
+}
+
+void NFSv3BreakdownAnalyzer::flush_statistics()
+{
+ representer.flush_statistics(stats);
+}
diff --git a/analyzers/src/breakdown/nfsv3breakdownanalyzer.h b/analyzers/src/breakdown/nfsv3breakdownanalyzer.h
new file mode 100644
index 0000000..943a453
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv3breakdownanalyzer.h
@@ -0,0 +1,119 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: NFS v3 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV3BREAKDOWNANALYZER_H
+#define NFSV3BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "representer.h"
+#include "statistics.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*! \brief NFSv3BreakdownAnalyzer Analyzer for NFS v3
+ * Handles NFS v3 commands
+ */
+class NFSv3BreakdownAnalyzer : virtual public IAnalyzer
+{
+ Statistics stats; //!< Statistics
+ Representer representer; //!< Class for statistics representation
+public:
+ NFSv3BreakdownAnalyzer(std::ostream& o = std::cout);
+
+ void null(const RPCProcedure* proc,
+ const struct NFS3::NULL3args*,
+ const struct NFS3::NULL3res*) override final;
+ void getattr3(const RPCProcedure* proc,
+ const struct NFS3::GETATTR3args*,
+ const struct NFS3::GETATTR3res*) override final;
+ void setattr3(const RPCProcedure* proc,
+ const struct NFS3::SETATTR3args*,
+ const struct NFS3::SETATTR3res*) override final;
+ void lookup3(const RPCProcedure* proc,
+ const struct NFS3::LOOKUP3args*,
+ const struct NFS3::LOOKUP3res*) override final;
+ void access3(const RPCProcedure* proc,
+ const struct NFS3::ACCESS3args*,
+ const struct NFS3::ACCESS3res*) override final;
+ void readlink3(const RPCProcedure* proc,
+ const struct NFS3::READLINK3args*,
+ const struct NFS3::READLINK3res*) override final;
+ void read3(const RPCProcedure* proc,
+ const struct NFS3::READ3args*,
+ const struct NFS3::READ3res*) override final;
+ void write3(const RPCProcedure* proc,
+ const struct NFS3::WRITE3args*,
+ const struct NFS3::WRITE3res*) override final;
+ void create3(const RPCProcedure* proc,
+ const struct NFS3::CREATE3args*,
+ const struct NFS3::CREATE3res*) override final;
+ void mkdir3(const RPCProcedure* proc,
+ const struct NFS3::MKDIR3args*,
+ const struct NFS3::MKDIR3res*) override final;
+ void symlink3(const RPCProcedure* proc,
+ const struct NFS3::SYMLINK3args*,
+ const struct NFS3::SYMLINK3res*) override final;
+ void mknod3(const RPCProcedure* proc,
+ const struct NFS3::MKNOD3args*,
+ const struct NFS3::MKNOD3res*) override final;
+ void remove3(const RPCProcedure* proc,
+ const struct NFS3::REMOVE3args*,
+ const struct NFS3::REMOVE3res*) override final;
+ void rmdir3(const RPCProcedure* proc,
+ const struct NFS3::RMDIR3args*,
+ const struct NFS3::RMDIR3res*) override final;
+ void rename3(const RPCProcedure* proc,
+ const struct NFS3::RENAME3args*,
+ const struct NFS3::RENAME3res*) override final;
+ void link3(const RPCProcedure* proc,
+ const struct NFS3::LINK3args*,
+ const struct NFS3::LINK3res*) override final;
+ void readdir3(const RPCProcedure* proc,
+ const struct NFS3::READDIR3args*,
+ const struct NFS3::READDIR3res*) override final;
+ void readdirplus3(const RPCProcedure* proc,
+ const struct NFS3::READDIRPLUS3args*,
+ const struct NFS3::READDIRPLUS3res*) override final;
+ void fsstat3(const RPCProcedure* proc,
+ const struct NFS3::FSSTAT3args*,
+ const struct NFS3::FSSTAT3res*) override final;
+ void fsinfo3(const RPCProcedure* proc,
+ const struct NFS3::FSINFO3args*,
+ const struct NFS3::FSINFO3res*) override final;
+ void pathconf3(const RPCProcedure* proc,
+ const struct NFS3::PATHCONF3args*,
+ const struct NFS3::PATHCONF3res*) override final;
+ void commit3(const RPCProcedure* proc,
+ const struct NFS3::COMMIT3args*,
+ const struct NFS3::COMMIT3res*) override final;
+
+ void flush_statistics() override;
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFSV3BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/nfsv3commands.cpp b/analyzers/src/breakdown/nfsv3commands.cpp
new file mode 100644
index 0000000..8e2c163
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv3commands.cpp
@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents NFS v3 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "nfsv3commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+const char* NFSv3Commands::command_description(int cmd_code)
+{
+ return print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(cmd_code));
+}
+
+const char* NFSv3Commands::command_name(int cmd_code)
+{
+ return print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(cmd_code));
+}
+
+size_t NFSv3Commands::commands_count()
+{
+ return ProcEnumNFS3::count;
+}
+
+const char* NST::breakdown::NFSv3Commands::protocol_name()
+{
+ return "NFS v3";
+}
diff --git a/analyzers/src/breakdown/nfsv3commands.h b/analyzers/src/breakdown/nfsv3commands.h
new file mode 100644
index 0000000..19f035d
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv3commands.h
@@ -0,0 +1,49 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents NFS v3 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV3COMMANDS_H
+#define NFSV3COMMANDS_H
+//------------------------------------------------------------------------------
+#include "commandrepresenter.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*!
+ * Represents NFS v3 commands
+ * Converts commands to string
+ */
+class NFSv3Commands : public CommandRepresenter
+{
+public:
+ const char* command_description(int cmd_code) override final;
+ const char* command_name(int cmd_code) override final;
+ size_t commands_count() override final;
+ const char* protocol_name();
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFSV3COMMANDS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/nfsv41breakdownanalyzer.cpp b/analyzers/src/breakdown/nfsv41breakdownanalyzer.cpp
new file mode 100644
index 0000000..ba95f08
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv41breakdownanalyzer.cpp
@@ -0,0 +1,503 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: NFS v4.1 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "nfsv41breakdownanalyzer.h"
+#include "nfsv41commands.h"
+#include "statisticscompositor.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+static const size_t space_for_cmd_name = 22;
+static const size_t count_of_compounds = 2;
+//------------------------------------------------------------------------------
+NFSv41BreakdownAnalyzer::NFSv41BreakdownAnalyzer(std::ostream& o)
+ : compound_stats(count_of_compounds)
+ , stats(NFSv41Commands().commands_count())
+ , representer(o, new NFSv41Commands(), space_for_cmd_name, count_of_compounds)
+{
+}
+
+void NFSv41BreakdownAnalyzer::compound41(const RPCProcedure* proc, const NFS41::COMPOUND4args*, const NFS41::COMPOUND4res*)
+{
+ compound_stats.account(proc, NFS_V41);
+}
+
+void NFSv41BreakdownAnalyzer::access41(const RPCProcedure* proc, const NFS41::ACCESS4args*, const NFS41::ACCESS4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::ACCESS);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::close41(const RPCProcedure* proc, const NFS41::CLOSE4args*, const NFS41::CLOSE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::CLOSE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::commit41(const RPCProcedure* proc, const NFS41::COMMIT4args*, const NFS41::COMMIT4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::COMMIT);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::create41(const RPCProcedure* proc, const NFS41::CREATE4args*, const NFS41::CREATE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::CREATE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::delegpurge41(const RPCProcedure* proc, const NFS41::DELEGPURGE4args*, const NFS41::DELEGPURGE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::DELEGPURGE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::delegreturn41(const RPCProcedure* proc, const NFS41::DELEGRETURN4args*, const NFS41::DELEGRETURN4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::DELEGRETURN);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::getattr41(const RPCProcedure* proc, const NFS41::GETATTR4args*, const NFS41::GETATTR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::GETATTR);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::getfh41(const RPCProcedure* proc, const NFS41::GETFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::GETFH);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::link41(const RPCProcedure* proc, const NFS41::LINK4args*, const NFS41::LINK4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LINK);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::lock41(const RPCProcedure* proc, const NFS41::LOCK4args*, const NFS41::LOCK4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LOCK);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::lockt41(const RPCProcedure* proc, const NFS41::LOCKT4args*, const NFS41::LOCKT4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LOCKT);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::locku41(const RPCProcedure* proc, const NFS41::LOCKU4args*, const NFS41::LOCKU4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LOCKU);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::lookup41(const RPCProcedure* proc, const NFS41::LOOKUP4args*, const NFS41::LOOKUP4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LOOKUP);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::lookupp41(const RPCProcedure* proc, const NFS41::LOOKUPP4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LOOKUPP);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::nverify41(const RPCProcedure* proc, const NFS41::NVERIFY4args*, const NFS41::NVERIFY4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::NVERIFY);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::open41(const RPCProcedure* proc, const NFS41::OPEN4args*, const NFS41::OPEN4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::OPEN);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::openattr41(const RPCProcedure* proc, const NFS41::OPENATTR4args*, const NFS41::OPENATTR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::OPENATTR);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::open_confirm41(const RPCProcedure* proc, const NFS41::OPEN_CONFIRM4args*, const NFS41::OPEN_CONFIRM4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::OPEN_CONFIRM);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::open_downgrade41(const RPCProcedure* proc, const NFS41::OPEN_DOWNGRADE4args*, const NFS41::OPEN_DOWNGRADE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::OPEN_DOWNGRADE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::putfh41(const RPCProcedure* proc, const NFS41::PUTFH4args*, const NFS41::PUTFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::PUTFH);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::putpubfh41(const RPCProcedure* proc, const NFS41::PUTPUBFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::PUTPUBFH);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::putrootfh41(const RPCProcedure* proc, const NFS41::PUTROOTFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::PUTROOTFH);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::read41(const RPCProcedure* proc, const NFS41::READ4args*, const NFS41::READ4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::READ);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::readdir41(const RPCProcedure* proc, const NFS41::READDIR4args*, const NFS41::READDIR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::READDIR);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::readlink41(const RPCProcedure* proc, const NFS41::READLINK4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::READLINK);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::remove41(const RPCProcedure* proc, const NFS41::REMOVE4args*, const NFS41::REMOVE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::REMOVE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::rename41(const RPCProcedure* proc, const NFS41::RENAME4args*, const NFS41::RENAME4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::RENAME);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::renew41(const RPCProcedure* proc, const NFS41::RENEW4args*, const NFS41::RENEW4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::RENEW);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::restorefh41(const RPCProcedure* proc, const NFS41::RESTOREFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::RESTOREFH);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::savefh41(const RPCProcedure* proc, const NFS41::SAVEFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SAVEFH);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::secinfo41(const RPCProcedure* proc, const NFS41::SECINFO4args*, const NFS41::SECINFO4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SECINFO);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::setattr41(const RPCProcedure* proc, const NFS41::SETATTR4args*, const NFS41::SETATTR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SETATTR);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::setclientid41(const RPCProcedure* proc, const NFS41::SETCLIENTID4args*, const NFS41::SETCLIENTID4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SETCLIENTID);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::setclientid_confirm41(const RPCProcedure* proc, const NFS41::SETCLIENTID_CONFIRM4args*, const NFS41::SETCLIENTID_CONFIRM4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SETCLIENTID_CONFIRM);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::verify41(const RPCProcedure* proc, const NFS41::VERIFY4args*, const NFS41::VERIFY4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::VERIFY);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::write41(const RPCProcedure* proc, const NFS41::WRITE4args*, const NFS41::WRITE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::WRITE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::release_lockowner41(const RPCProcedure* proc, const NFS41::RELEASE_LOCKOWNER4args*, const NFS41::RELEASE_LOCKOWNER4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::RELEASE_LOCKOWNER);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::backchannel_ctl41(const RPCProcedure* proc, const NFS41::BACKCHANNEL_CTL4args*, const NFS41::BACKCHANNEL_CTL4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::BACKCHANNEL_CTL);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::bind_conn_to_session41(const RPCProcedure* proc, const NFS41::BIND_CONN_TO_SESSION4args*, const NFS41::BIND_CONN_TO_SESSION4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::BIND_CONN_TO_SESSION);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::exchange_id41(const RPCProcedure* proc, const NFS41::EXCHANGE_ID4args*, const NFS41::EXCHANGE_ID4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::EXCHANGE_ID);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::create_session41(const RPCProcedure* proc, const NFS41::CREATE_SESSION4args*, const NFS41::CREATE_SESSION4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::CREATE_SESSION);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::destroy_session41(const RPCProcedure* proc, const NFS41::DESTROY_SESSION4args*, const NFS41::DESTROY_SESSION4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::DESTROY_SESSION);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::free_stateid41(const RPCProcedure* proc, const NFS41::FREE_STATEID4args*, const NFS41::FREE_STATEID4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::FREE_STATEID);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::get_dir_delegation41(const RPCProcedure* proc, const NFS41::GET_DIR_DELEGATION4args*, const NFS41::GET_DIR_DELEGATION4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::GET_DIR_DELEGATION);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::getdeviceinfo41(const RPCProcedure* proc, const NFS41::GETDEVICEINFO4args*, const NFS41::GETDEVICEINFO4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::GETDEVICEINFO);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::getdevicelist41(const RPCProcedure* proc, const NFS41::GETDEVICELIST4args*, const NFS41::GETDEVICELIST4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::GETDEVICELIST);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::layoutcommit41(const RPCProcedure* proc, const NFS41::LAYOUTCOMMIT4args*, const NFS41::LAYOUTCOMMIT4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LAYOUTCOMMIT);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::layoutget41(const RPCProcedure* proc, const NFS41::LAYOUTGET4args*, const NFS41::LAYOUTGET4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LAYOUTGET);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::layoutreturn41(const RPCProcedure* proc, const NFS41::LAYOUTRETURN4args*, const NFS41::LAYOUTRETURN4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::LAYOUTRETURN);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::secinfo_no_name41(const RPCProcedure* proc, const NFS41::SECINFO_NO_NAME4args*, const NFS41::SECINFO_NO_NAME4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SECINFO_NO_NAME);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::sequence41(const RPCProcedure* proc, const NFS41::SEQUENCE4args*, const NFS41::SEQUENCE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SEQUENCE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::set_ssv41(const RPCProcedure* proc, const NFS41::SET_SSV4args*, const NFS41::SET_SSV4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::SET_SSV);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::test_stateid41(const RPCProcedure* proc, const NFS41::TEST_STATEID4args*, const NFS41::TEST_STATEID4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::TEST_STATEID);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::want_delegation41(const RPCProcedure* proc, const NFS41::WANT_DELEGATION4args*, const NFS41::WANT_DELEGATION4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::WANT_DELEGATION);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::destroy_clientid41(const RPCProcedure* proc, const NFS41::DESTROY_CLIENTID4args*, const NFS41::DESTROY_CLIENTID4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::DESTROY_CLIENTID);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::reclaim_complete41(const RPCProcedure* proc, const NFS41::RECLAIM_COMPLETE4args*, const NFS41::RECLAIM_COMPLETE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::RECLAIM_COMPLETE);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::illegal41(const RPCProcedure* proc, const NFS41::ILLEGAL4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS41::NFSProcedure::ILLEGAL);
+ }
+}
+
+void NFSv41BreakdownAnalyzer::flush_statistics()
+{
+ StatisticsCompositor stat(compound_stats, stats);
+ representer.flush_statistics(stat);
+}
diff --git a/analyzers/src/breakdown/nfsv41breakdownanalyzer.h b/analyzers/src/breakdown/nfsv41breakdownanalyzer.h
new file mode 100644
index 0000000..f5f1f9b
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv41breakdownanalyzer.h
@@ -0,0 +1,222 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: NFS v4.1 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV41BREAKDOWNANALYZER_H
+#define NFSV41BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "nfsv4representer.h"
+#include "statistics.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*! \brief Analyzer for NFS v4.1
+ * Handles NFS v4.1 commands
+ */
+class NFSv41BreakdownAnalyzer : virtual public IAnalyzer
+{
+ Statistics compound_stats; //!< Statistics
+ Statistics stats; //!< Statistics
+ NFSv4Representer representer; //!< Class for statistics representation
+public:
+ NFSv41BreakdownAnalyzer(std::ostream& o = std::cout);
+ // NFSv4.1 procedures
+ void compound41(const RPCProcedure* proc,
+ const struct NFS41::COMPOUND4args*,
+ const struct NFS41::COMPOUND4res*) override final;
+ // NFSv4.1 operations
+ void access41(const RPCProcedure* proc,
+ const struct NFS41::ACCESS4args*,
+ const struct NFS41::ACCESS4res* res) override final;
+
+ void close41(const RPCProcedure* proc,
+ const struct NFS41::CLOSE4args*,
+ const struct NFS41::CLOSE4res* res) override final;
+ void commit41(const RPCProcedure* proc,
+ const struct NFS41::COMMIT4args*,
+ const struct NFS41::COMMIT4res* res) override final;
+ void create41(const RPCProcedure* proc,
+ const struct NFS41::CREATE4args*,
+ const struct NFS41::CREATE4res* res) override final;
+ void delegpurge41(const RPCProcedure* proc,
+ const struct NFS41::DELEGPURGE4args*,
+ const struct NFS41::DELEGPURGE4res* res) override final;
+ void delegreturn41(const RPCProcedure* proc,
+ const struct NFS41::DELEGRETURN4args*,
+ const struct NFS41::DELEGRETURN4res* res) override final;
+ void getattr41(const RPCProcedure* proc,
+ const struct NFS41::GETATTR4args*,
+ const struct NFS41::GETATTR4res* res) override final;
+ void getfh41(const RPCProcedure* proc,
+ const struct NFS41::GETFH4res* res) override final;
+ void link41(const RPCProcedure* proc,
+ const struct NFS41::LINK4args*,
+ const struct NFS41::LINK4res* res) override final;
+ void lock41(const RPCProcedure* proc,
+ const struct NFS41::LOCK4args*,
+ const struct NFS41::LOCK4res* res) override final;
+ void lockt41(const RPCProcedure* proc,
+ const struct NFS41::LOCKT4args*,
+ const struct NFS41::LOCKT4res* res) override final;
+ void locku41(const RPCProcedure* proc,
+ const struct NFS41::LOCKU4args*,
+ const struct NFS41::LOCKU4res* res) override final;
+ void lookup41(const RPCProcedure* proc,
+ const struct NFS41::LOOKUP4args*,
+ const struct NFS41::LOOKUP4res* res) override final;
+ void lookupp41(const RPCProcedure* proc,
+ const struct NFS41::LOOKUPP4res* res) override final;
+ void nverify41(const RPCProcedure* proc,
+ const struct NFS41::NVERIFY4args*,
+ const struct NFS41::NVERIFY4res* res) override final;
+ void open41(const RPCProcedure* proc,
+ const struct NFS41::OPEN4args*,
+ const struct NFS41::OPEN4res* res) override final;
+ void openattr41(const RPCProcedure* proc,
+ const struct NFS41::OPENATTR4args*,
+ const struct NFS41::OPENATTR4res* res) override final;
+ void open_confirm41(const RPCProcedure* proc,
+ const struct NFS41::OPEN_CONFIRM4args*,
+ const struct NFS41::OPEN_CONFIRM4res* res) override final;
+ void open_downgrade41(const RPCProcedure* proc,
+ const struct NFS41::OPEN_DOWNGRADE4args*,
+ const struct NFS41::OPEN_DOWNGRADE4res* res) override final;
+ void putfh41(const RPCProcedure* proc,
+ const struct NFS41::PUTFH4args*,
+ const struct NFS41::PUTFH4res* res) override final;
+ void putpubfh41(const RPCProcedure* proc,
+ const struct NFS41::PUTPUBFH4res* res) override final;
+ void putrootfh41(const RPCProcedure* proc,
+ const struct NFS41::PUTROOTFH4res* res) override final;
+ void read41(const RPCProcedure* proc,
+ const struct NFS41::READ4args*,
+ const struct NFS41::READ4res* res) override final;
+ void readdir41(const RPCProcedure* proc,
+ const struct NFS41::READDIR4args*,
+ const struct NFS41::READDIR4res* res) override final;
+ void readlink41(const RPCProcedure* proc,
+ const struct NFS41::READLINK4res* res) override final;
+ void remove41(const RPCProcedure* proc,
+ const struct NFS41::REMOVE4args*,
+ const struct NFS41::REMOVE4res* res) override final;
+ void rename41(const RPCProcedure* proc,
+ const struct NFS41::RENAME4args*,
+ const struct NFS41::RENAME4res* res) override final;
+ void renew41(const RPCProcedure* proc,
+ const struct NFS41::RENEW4args*,
+ const struct NFS41::RENEW4res* res) override final;
+ void restorefh41(const RPCProcedure* proc,
+ const struct NFS41::RESTOREFH4res* res) override final;
+ void savefh41(const RPCProcedure* proc,
+ const struct NFS41::SAVEFH4res* res) override final;
+ void secinfo41(const RPCProcedure* proc,
+ const struct NFS41::SECINFO4args*,
+ const struct NFS41::SECINFO4res* res) override final;
+ void setattr41(const RPCProcedure* proc,
+ const struct NFS41::SETATTR4args*,
+ const struct NFS41::SETATTR4res* res) override final;
+ void setclientid41(const RPCProcedure* proc,
+ const struct NFS41::SETCLIENTID4args*,
+ const struct NFS41::SETCLIENTID4res* res) override final;
+ void setclientid_confirm41(const RPCProcedure* proc,
+ const struct NFS41::SETCLIENTID_CONFIRM4args*,
+ const struct NFS41::SETCLIENTID_CONFIRM4res* res) override final;
+ void verify41(const RPCProcedure* proc,
+ const struct NFS41::VERIFY4args*,
+ const struct NFS41::VERIFY4res* res) override final;
+ void write41(const RPCProcedure* proc,
+ const struct NFS41::WRITE4args*,
+ const struct NFS41::WRITE4res* res) override final;
+ void release_lockowner41(const RPCProcedure* proc,
+ const struct NFS41::RELEASE_LOCKOWNER4args*,
+ const struct NFS41::RELEASE_LOCKOWNER4res* res) override final;
+ void backchannel_ctl41(const RPCProcedure* proc,
+ const struct NFS41::BACKCHANNEL_CTL4args*,
+ const struct NFS41::BACKCHANNEL_CTL4res* res) override final;
+ void bind_conn_to_session41(const RPCProcedure* proc,
+ const struct NFS41::BIND_CONN_TO_SESSION4args*,
+ const struct NFS41::BIND_CONN_TO_SESSION4res* res) override final;
+ void exchange_id41(const RPCProcedure* proc,
+ const struct NFS41::EXCHANGE_ID4args*,
+ const struct NFS41::EXCHANGE_ID4res* res) override final;
+ void create_session41(const RPCProcedure* proc,
+ const struct NFS41::CREATE_SESSION4args*,
+ const struct NFS41::CREATE_SESSION4res* res) override final;
+ void destroy_session41(const RPCProcedure* proc,
+ const struct NFS41::DESTROY_SESSION4args*,
+ const struct NFS41::DESTROY_SESSION4res* res) override final;
+ void free_stateid41(const RPCProcedure* proc,
+ const struct NFS41::FREE_STATEID4args*,
+ const struct NFS41::FREE_STATEID4res* res) override final;
+ void get_dir_delegation41(const RPCProcedure* proc,
+ const struct NFS41::GET_DIR_DELEGATION4args*,
+ const struct NFS41::GET_DIR_DELEGATION4res* res) override final;
+ void getdeviceinfo41(const RPCProcedure* proc,
+ const struct NFS41::GETDEVICEINFO4args*,
+ const struct NFS41::GETDEVICEINFO4res* res) override final;
+ void getdevicelist41(const RPCProcedure* proc,
+ const struct NFS41::GETDEVICELIST4args*,
+ const struct NFS41::GETDEVICELIST4res* res) override final;
+ void layoutcommit41(const RPCProcedure* proc,
+ const struct NFS41::LAYOUTCOMMIT4args*,
+ const struct NFS41::LAYOUTCOMMIT4res* res) override final;
+ void layoutget41(const RPCProcedure* proc,
+ const struct NFS41::LAYOUTGET4args*,
+ const struct NFS41::LAYOUTGET4res* res) override final;
+ void layoutreturn41(const RPCProcedure* proc,
+ const struct NFS41::LAYOUTRETURN4args*,
+ const struct NFS41::LAYOUTRETURN4res* res) override final;
+ void secinfo_no_name41(const RPCProcedure* proc,
+ const NFS41::SECINFO_NO_NAME4args*,
+ const NFS41::SECINFO_NO_NAME4res* res) override final;
+ void sequence41(const RPCProcedure* proc,
+ const struct NFS41::SEQUENCE4args*,
+ const struct NFS41::SEQUENCE4res* res) override final;
+ void set_ssv41(const RPCProcedure* proc,
+ const struct NFS41::SET_SSV4args*,
+ const struct NFS41::SET_SSV4res* res) override final;
+ void test_stateid41(const RPCProcedure* proc,
+ const struct NFS41::TEST_STATEID4args*,
+ const struct NFS41::TEST_STATEID4res* res) override final;
+ void want_delegation41(const RPCProcedure* proc,
+ const struct NFS41::WANT_DELEGATION4args*,
+ const struct NFS41::WANT_DELEGATION4res* res) override final;
+ void destroy_clientid41(const RPCProcedure* proc,
+ const struct NFS41::DESTROY_CLIENTID4args*,
+ const struct NFS41::DESTROY_CLIENTID4res* res) override final;
+ void reclaim_complete41(const RPCProcedure* proc,
+ const struct NFS41::RECLAIM_COMPLETE4args*,
+ const struct NFS41::RECLAIM_COMPLETE4res* res) override final;
+ void illegal41(const RPCProcedure* proc,
+ const struct NFS41::ILLEGAL4res* res) override final;
+
+ void flush_statistics() override;
+};
+
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFSV41BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/nfsv41commands.cpp b/analyzers/src/breakdown/nfsv41commands.cpp
new file mode 100644
index 0000000..922370f
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv41commands.cpp
@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents NFS v4.1 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "nfsv41commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+const char* NST::breakdown::NFSv41Commands::command_description(int cmd_code)
+{
+ return print_nfs41_procedures(static_cast<ProcEnumNFS41::NFSProcedure>(cmd_code));
+}
+
+const char* NST::breakdown::NFSv41Commands::command_name(int cmd_code)
+{
+ return print_nfs41_procedures(static_cast<ProcEnumNFS41::NFSProcedure>(cmd_code));
+}
+
+const char* NST::breakdown::NFSv41Commands::protocol_name()
+{
+ return "NFS v4.1";
+}
+
+size_t NST::breakdown::NFSv41Commands::commands_count()
+{
+ return ProcEnumNFS41::count;
+}
diff --git a/analyzers/src/breakdown/nfsv41commands.h b/analyzers/src/breakdown/nfsv41commands.h
new file mode 100644
index 0000000..97c7c9c
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv41commands.h
@@ -0,0 +1,49 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents NFS v4.1 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV41COMMANDS_H
+#define NFSV41COMMANDS_H
+//------------------------------------------------------------------------------
+#include "commandrepresenter.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*!
+ * Represents NFS v 4.0 commands
+ * Converts commands to string
+ */
+class NFSv41Commands : public CommandRepresenter
+{
+public:
+ const char* command_description(int cmd_code);
+ const char* command_name(int cmd_code);
+ const char* protocol_name();
+ size_t commands_count();
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFSV41COMMANDS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/nfsv4breakdownanalyzer.cpp b/analyzers/src/breakdown/nfsv4breakdownanalyzer.cpp
new file mode 100644
index 0000000..b9f37af
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv4breakdownanalyzer.cpp
@@ -0,0 +1,366 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: NFS v4 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <assert.h>
+
+#include "nfsv4breakdownanalyzer.h"
+#include "nfsv4commands.h"
+#include "statisticscompositor.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+static const size_t space_for_cmd_name = 22;
+static const size_t count_of_compounds = 2;
+//------------------------------------------------------------------------------
+NFSv4BreakdownAnalyzer::NFSv4BreakdownAnalyzer(std::ostream& o)
+ : compound_stats(count_of_compounds)
+ , stats(NFSv4Commands().commands_count())
+ , representer(o, new NFSv4Commands(), space_for_cmd_name, count_of_compounds)
+{
+}
+
+void NFSv4BreakdownAnalyzer::null4(const RPCProcedure* proc, const NFS4::NULL4args*, const NFS4::NULL4res*)
+{
+ compound_stats.account(proc, ProcEnumNFS4::NFSProcedure::NFS_NULL);
+}
+
+void NFSv4BreakdownAnalyzer::compound4(const RPCProcedure* proc, const NFS4::COMPOUND4args*, const NFS4::COMPOUND4res*)
+{
+ compound_stats.account(proc, ProcEnumNFS4::NFSProcedure::COMPOUND);
+}
+
+void NFSv4BreakdownAnalyzer::access40(const RPCProcedure* proc, const NFS4::ACCESS4args*, const NFS4::ACCESS4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::ACCESS);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::close40(const RPCProcedure* proc, const NFS4::CLOSE4args*, const NFS4::CLOSE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::CLOSE);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::commit40(const RPCProcedure* proc, const NFS4::COMMIT4args*, const NFS4::COMMIT4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::COMMIT);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::create40(const RPCProcedure* proc, const NFS4::CREATE4args*, const NFS4::CREATE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::CREATE);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::delegpurge40(const RPCProcedure* proc, const NFS4::DELEGPURGE4args*, const NFS4::DELEGPURGE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::DELEGPURGE);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::delegreturn40(const RPCProcedure* proc, const NFS4::DELEGRETURN4args*, const NFS4::DELEGRETURN4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::DELEGRETURN);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::getattr40(const RPCProcedure* proc, const NFS4::GETATTR4args*, const NFS4::GETATTR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::GETATTR);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::getfh40(const RPCProcedure* proc, const NFS4::GETFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::GETFH);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::link40(const RPCProcedure* proc, const NFS4::LINK4args*, const NFS4::LINK4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::LINK);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::lock40(const RPCProcedure* proc, const NFS4::LOCK4args*, const NFS4::LOCK4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::LOCK);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::lockt40(const RPCProcedure* proc, const NFS4::LOCKT4args*, const NFS4::LOCKT4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::LOCKT);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::locku40(const RPCProcedure* proc, const NFS4::LOCKU4args*, const NFS4::LOCKU4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::LOCKU);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::lookup40(const RPCProcedure* proc, const NFS4::LOOKUP4args*, const NFS4::LOOKUP4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::LOOKUP);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::lookupp40(const RPCProcedure* proc, const NFS4::LOOKUPP4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::LOOKUPP);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::nverify40(const RPCProcedure* proc, const NFS4::NVERIFY4args*, const NFS4::NVERIFY4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::NVERIFY);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::open40(const RPCProcedure* proc, const NFS4::OPEN4args*, const NFS4::OPEN4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::OPEN);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::openattr40(const RPCProcedure* proc, const NFS4::OPENATTR4args*, const NFS4::OPENATTR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::OPENATTR);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::open_confirm40(const RPCProcedure* proc, const NFS4::OPEN_CONFIRM4args*, const NFS4::OPEN_CONFIRM4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::OPEN_CONFIRM);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::open_downgrade40(const RPCProcedure* proc, const NFS4::OPEN_DOWNGRADE4args*, const NFS4::OPEN_DOWNGRADE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::OPEN_DOWNGRADE);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::putfh40(const RPCProcedure* proc, const NFS4::PUTFH4args*, const NFS4::PUTFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::PUTFH);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::putpubfh40(const RPCProcedure* proc, const NFS4::PUTPUBFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::PUTPUBFH);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::putrootfh40(const RPCProcedure* proc, const NFS4::PUTROOTFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::PUTROOTFH);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::read40(const RPCProcedure* proc, const NFS4::READ4args*, const NFS4::READ4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::READ);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::readdir40(const RPCProcedure* proc, const NFS4::READDIR4args*, const NFS4::READDIR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::READDIR);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::readlink40(const RPCProcedure* proc, const NFS4::READLINK4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::READLINK);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::remove40(const RPCProcedure* proc, const NFS4::REMOVE4args*, const NFS4::REMOVE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::REMOVE);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::rename40(const RPCProcedure* proc, const NFS4::RENAME4args*, const NFS4::RENAME4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::RENAME);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::renew40(const RPCProcedure* proc, const NFS4::RENEW4args*, const NFS4::RENEW4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::RENEW);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::restorefh40(const RPCProcedure* proc, const NFS4::RESTOREFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::RESTOREFH);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::savefh40(const RPCProcedure* proc, const NFS4::SAVEFH4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::SAVEFH);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::secinfo40(const RPCProcedure* proc, const NFS4::SECINFO4args*, const NFS4::SECINFO4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::SECINFO);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::setattr40(const RPCProcedure* proc, const NFS4::SETATTR4args*, const NFS4::SETATTR4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::SETATTR);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::setclientid40(const RPCProcedure* proc, const NFS4::SETCLIENTID4args*, const NFS4::SETCLIENTID4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::SETCLIENTID);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::setclientid_confirm40(const RPCProcedure* proc, const NFS4::SETCLIENTID_CONFIRM4args*, const NFS4::SETCLIENTID_CONFIRM4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::SETCLIENTID_CONFIRM);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::verify40(const RPCProcedure* proc, const NFS4::VERIFY4args*, const NFS4::VERIFY4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::VERIFY);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::write40(const RPCProcedure* proc, const NFS4::WRITE4args*, const NFS4::WRITE4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::WRITE);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::release_lockowner40(const RPCProcedure* proc, const NFS4::RELEASE_LOCKOWNER4args*, const NFS4::RELEASE_LOCKOWNER4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::RELEASE_LOCKOWNER);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::get_dir_delegation40(const RPCProcedure* proc, const NFS4::GET_DIR_DELEGATION4args*, const NFS4::GET_DIR_DELEGATION4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::GET_DIR_DELEGATION);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::illegal40(const RPCProcedure* proc, const NFS4::ILLEGAL4res* res)
+{
+ if (res)
+ {
+ stats.account(proc, ProcEnumNFS4::NFSProcedure::ILLEGAL);
+ }
+}
+
+void NFSv4BreakdownAnalyzer::flush_statistics()
+{
+ StatisticsCompositor stat(compound_stats, stats);
+ representer.flush_statistics(stat);
+}
diff --git a/analyzers/src/breakdown/nfsv4breakdownanalyzer.h b/analyzers/src/breakdown/nfsv4breakdownanalyzer.h
new file mode 100644
index 0000000..14275e6
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv4breakdownanalyzer.h
@@ -0,0 +1,176 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: NFS v4 breakdown analyzer
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV4BREAKDOWNANALYZER_H
+#define NFSV4BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "nfsv4representer.h"
+#include "statistics.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*! \brief Analyzer for NFS v4
+ * Handles NFS v4 commands
+ */
+class NFSv4BreakdownAnalyzer : virtual public IAnalyzer
+{
+protected:
+private:
+ Statistics compound_stats; //!< Statistics
+ Statistics stats; //!< Statistics
+ NFSv4Representer representer; //!< stream to output
+public:
+ NFSv4BreakdownAnalyzer(std::ostream& o = std::cout);
+
+ // NFS4.0 procedures
+
+ void null4(const RPCProcedure* proc,
+ const struct NFS4::NULL4args*,
+ const struct NFS4::NULL4res*) override final;
+ void compound4(const RPCProcedure* proc,
+ const struct NFS4::COMPOUND4args*,
+ const struct NFS4::COMPOUND4res*) override final;
+
+ // NFS4.0 operations
+
+ void access40(const RPCProcedure* proc,
+ const struct NFS4::ACCESS4args*,
+ const struct NFS4::ACCESS4res* res) override final;
+
+ void close40(const RPCProcedure* proc,
+ const struct NFS4::CLOSE4args*,
+ const struct NFS4::CLOSE4res* res) override final;
+ void commit40(const RPCProcedure* proc,
+ const struct NFS4::COMMIT4args*,
+ const struct NFS4::COMMIT4res* res) override final;
+ void create40(const RPCProcedure* proc,
+ const struct NFS4::CREATE4args*,
+ const struct NFS4::CREATE4res* res) override final;
+ void delegpurge40(const RPCProcedure* proc,
+ const struct NFS4::DELEGPURGE4args*,
+ const struct NFS4::DELEGPURGE4res* res) override final;
+ void delegreturn40(const RPCProcedure* proc,
+ const struct NFS4::DELEGRETURN4args*,
+ const struct NFS4::DELEGRETURN4res* res) override final;
+ void getattr40(const RPCProcedure* proc,
+ const struct NFS4::GETATTR4args*,
+ const struct NFS4::GETATTR4res* res) override final;
+ void getfh40(const RPCProcedure* proc,
+ const struct NFS4::GETFH4res* res) override final;
+ void link40(const RPCProcedure* proc,
+ const struct NFS4::LINK4args*,
+ const struct NFS4::LINK4res* res) override final;
+ void lock40(const RPCProcedure* proc,
+ const struct NFS4::LOCK4args*,
+ const struct NFS4::LOCK4res* res) override final;
+ void lockt40(const RPCProcedure* proc,
+ const struct NFS4::LOCKT4args*,
+ const struct NFS4::LOCKT4res* res) override final;
+ void locku40(const RPCProcedure* proc,
+ const struct NFS4::LOCKU4args*,
+ const struct NFS4::LOCKU4res* res) override final;
+ void lookup40(const RPCProcedure* proc,
+ const struct NFS4::LOOKUP4args*,
+ const struct NFS4::LOOKUP4res* res) override final;
+ void lookupp40(const RPCProcedure* proc,
+ const struct NFS4::LOOKUPP4res* res) override final;
+ void nverify40(const RPCProcedure* proc,
+ const struct NFS4::NVERIFY4args*,
+ const struct NFS4::NVERIFY4res* res) override final;
+ void open40(const RPCProcedure* proc,
+ const struct NFS4::OPEN4args*,
+ const struct NFS4::OPEN4res* res) override final;
+ void openattr40(const RPCProcedure* proc,
+ const struct NFS4::OPENATTR4args*,
+ const struct NFS4::OPENATTR4res* res) override final;
+ void open_confirm40(const RPCProcedure* proc,
+ const struct NFS4::OPEN_CONFIRM4args*,
+ const struct NFS4::OPEN_CONFIRM4res* res) override final;
+ void open_downgrade40(const RPCProcedure* proc,
+ const struct NFS4::OPEN_DOWNGRADE4args*,
+ const struct NFS4::OPEN_DOWNGRADE4res* res) override final;
+ void putfh40(const RPCProcedure* proc,
+ const struct NFS4::PUTFH4args*,
+ const struct NFS4::PUTFH4res* res) override final;
+ void putpubfh40(const RPCProcedure* proc,
+ const struct NFS4::PUTPUBFH4res* res) override final;
+ void putrootfh40(const RPCProcedure* proc,
+ const struct NFS4::PUTROOTFH4res* res) override final;
+ void read40(const RPCProcedure* proc,
+ const struct NFS4::READ4args*,
+ const struct NFS4::READ4res* res) override final;
+ void readdir40(const RPCProcedure* proc,
+ const struct NFS4::READDIR4args*,
+ const struct NFS4::READDIR4res* res) override final;
+ void readlink40(const RPCProcedure* proc,
+ const struct NFS4::READLINK4res* res) override final;
+ void remove40(const RPCProcedure* proc,
+ const struct NFS4::REMOVE4args*,
+ const struct NFS4::REMOVE4res* res) override final;
+ void rename40(const RPCProcedure* proc,
+ const struct NFS4::RENAME4args*,
+ const struct NFS4::RENAME4res* res) override final;
+ void renew40(const RPCProcedure* proc,
+ const struct NFS4::RENEW4args*,
+ const struct NFS4::RENEW4res* res) override final;
+ void restorefh40(const RPCProcedure* proc,
+ const struct NFS4::RESTOREFH4res* res) override final;
+ void savefh40(const RPCProcedure* proc,
+ const struct NFS4::SAVEFH4res* res) override final;
+ void secinfo40(const RPCProcedure* proc,
+ const struct NFS4::SECINFO4args*,
+ const struct NFS4::SECINFO4res* res) override final;
+ void setattr40(const RPCProcedure* proc,
+ const struct NFS4::SETATTR4args*,
+ const struct NFS4::SETATTR4res* res) override final;
+ void setclientid40(const RPCProcedure* proc,
+ const struct NFS4::SETCLIENTID4args*,
+ const struct NFS4::SETCLIENTID4res* res) override final;
+ void setclientid_confirm40(const RPCProcedure* proc,
+ const struct NFS4::SETCLIENTID_CONFIRM4args*,
+ const struct NFS4::SETCLIENTID_CONFIRM4res* res) override final;
+ void verify40(const RPCProcedure* proc,
+ const struct NFS4::VERIFY4args*,
+ const struct NFS4::VERIFY4res* res) override final;
+ void write40(const RPCProcedure* proc,
+ const struct NFS4::WRITE4args*,
+ const struct NFS4::WRITE4res* res) override final;
+ void release_lockowner40(const RPCProcedure* proc,
+ const struct NFS4::RELEASE_LOCKOWNER4args*,
+ const struct NFS4::RELEASE_LOCKOWNER4res* res) override final;
+ void get_dir_delegation40(const RPCProcedure* proc,
+ const struct NFS4::GET_DIR_DELEGATION4args*,
+ const struct NFS4::GET_DIR_DELEGATION4res* res) override final;
+ void illegal40(const RPCProcedure* proc,
+ const struct NFS4::ILLEGAL4res* res) override final;
+ void flush_statistics() override;
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFSV4BREAKDOWNANALYZER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/nfsv4commands.cpp b/analyzers/src/breakdown/nfsv4commands.cpp
new file mode 100644
index 0000000..13d2871
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv4commands.cpp
@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents NFS v4 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h>
+
+#include "nfsv4commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+const char* NST::breakdown::NFSv4Commands::command_description(int cmd_code)
+{
+ return print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(cmd_code));
+}
+
+const char* NST::breakdown::NFSv4Commands::command_name(int cmd_code)
+{
+ return print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(cmd_code));
+}
+
+size_t NST::breakdown::NFSv4Commands::commands_count()
+{
+ return ProcEnumNFS4::count;
+}
+
+const char* NST::breakdown::NFSv4Commands::protocol_name()
+{
+ return "NFS v4.0";
+}
diff --git a/analyzers/src/breakdown/nfsv4commands.h b/analyzers/src/breakdown/nfsv4commands.h
new file mode 100644
index 0000000..2fcfa0e
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv4commands.h
@@ -0,0 +1,49 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Represents NFS v4 commands
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV4COMMANDS_H
+#define NFSV4COMMANDS_H
+//------------------------------------------------------------------------------
+#include "commandrepresenter.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*!
+ * Represents NFS v 4.0 commands
+ * Converts commands to string
+ */
+class NFSv4Commands : public CommandRepresenter
+{
+public:
+ const char* command_description(int cmd_code) override final;
+ const char* command_name(int cmd_code) override final;
+ size_t commands_count() override final;
+ const char* protocol_name();
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFSV4COMMANDS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/nfsv4representer.cpp b/analyzers/src/breakdown/nfsv4representer.cpp
new file mode 100644
index 0000000..e6410b6
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv4representer.cpp
@@ -0,0 +1,43 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Representer of NFSv4 statistics
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "nfsv4representer.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+NFSv4Representer::NFSv4Representer(std::ostream& o, CommandRepresenter* cmdRep, size_t space_for_cmd_name, size_t count_of_compounds)
+ : Representer(o, cmdRep, space_for_cmd_name), count_of_compounds(count_of_compounds)
+{
+}
+
+void NFSv4Representer::onProcedureInfoPrinted(std::ostream& o, const BreakdownCounter& breakdown, unsigned procedure) const
+{
+ if (procedure == 0)
+ {
+ o << "Total procedures: " << breakdown.get_total_count()
+ << ". Per procedure:" << std::endl;
+ }
+ if (procedure == count_of_compounds)
+ {
+ o << "Total operations: " << breakdown.get_total_count()
+ << ". Per operation:" << std::endl;
+ }
+}
diff --git a/analyzers/src/breakdown/nfsv4representer.h b/analyzers/src/breakdown/nfsv4representer.h
new file mode 100644
index 0000000..5bda9b1
--- /dev/null
+++ b/analyzers/src/breakdown/nfsv4representer.h
@@ -0,0 +1,48 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Representer of NFSv4 statistics
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV4REPRESENTER_H
+#define NFSV4REPRESENTER_H
+//------------------------------------------------------------------------------
+#include "representer.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/**
+ * @brief The NFSv4Representer class
+ * Splits output into commands/operations lists for NFS v4.* protocols
+ */
+class NFSv4Representer : public Representer
+{
+ const size_t count_of_compounds;
+public:
+ NFSv4Representer(std::ostream& o, CommandRepresenter* cmdRep, size_t space_for_cmd_name, size_t count_of_compounds);
+ void onProcedureInfoPrinted(std::ostream& o, const BreakdownCounter& breakdown, unsigned procedure) const override final;
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFSV4REPRESENTER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/representer.cpp b/analyzers/src/breakdown/representer.cpp
new file mode 100644
index 0000000..ca33062
--- /dev/null
+++ b/analyzers/src/breakdown/representer.cpp
@@ -0,0 +1,145 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Representer of statistics
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <fstream>
+#include <iostream>
+#include <sstream>
+
+#include "representer.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+NST::breakdown::Representer::Representer(std::ostream& o, NST::breakdown::CommandRepresenter* cmd_representer, size_t space_for_cmd_name)
+ : out(o)
+ , cmd_representer(cmd_representer)
+ , space_for_cmd_name(space_for_cmd_name)
+{
+}
+
+void Representer::flush_statistics(const Statistics& statistics)
+{
+ out << "### Breakdown analyzer ###"
+ << std::endl
+ << cmd_representer->protocol_name()
+ << " protocol"
+ << std::endl;
+
+ statistics.for_each_procedure([&](const BreakdownCounter& breakdown, size_t procedure)
+ {
+ onProcedureInfoPrinted(out, breakdown, procedure);
+ size_t procedure_count = breakdown[procedure].get_count();
+ out.width(space_for_cmd_name);
+ out << std::left
+ << cmd_representer->command_name(procedure);
+ out.width(5);
+ out << std::right
+ << procedure_count;
+ out.width(7);
+ out.setf(std::ios::fixed, std::ios::floatfield);
+ out.precision(2);
+ out << (breakdown.get_total_count() ? ((1.0 * procedure_count / breakdown.get_total_count()) * 100.0) : 0);
+ out.setf(std::ios::fixed | std::ios::scientific , std::ios::floatfield);
+ out << '%' << std::endl;
+ });
+
+ if (statistics.has_session()) // is not empty?
+ {
+ out << "Per connection info: " << std::endl;
+
+ statistics.for_each_session([&](const Session& session)
+ {
+ std::stringstream ssession;
+ print_session(ssession, session);
+ print_per_session(statistics, session, ssession.str());
+ std::ofstream file("breakdown_" + ssession.str() + ".dat", std::ios::out | std::ios::trunc);
+ store_per_session(file, statistics, session, ssession.str());
+ });
+ }
+}
+
+void Representer::store_per_session(std::ostream& file, const Statistics& statistics, const Session& session, const std::string& ssession) const
+{
+ //TODO: does it make sense to join store_per_session & print_per_session?
+ file << "Session: " << ssession << std::endl;
+
+ statistics.for_each_procedure_in_session(session, [&](const BreakdownCounter& breakdown, size_t procedure)
+ {
+ uint64_t s_total_proc = breakdown.get_total_count();
+ file << cmd_representer->command_name(procedure);
+ file << ' ' << breakdown[procedure].get_count() << ' ';
+ file << (s_total_proc ? (((long double)(breakdown[procedure].get_count()) / s_total_proc) * 100) : 0);
+ file << ' ' << to_sec(breakdown[procedure].get_min())
+ << ' ' << to_sec(breakdown[procedure].get_max())
+ << ' ' << breakdown[procedure].get_avg()
+ << ' ' << breakdown[procedure].get_st_dev()
+ << std::endl;
+ });
+}
+
+void Representer::print_per_session(const Statistics& statistics, const Session& session, const std::string& ssession) const
+{
+ out << "Session: " << ssession << std::endl;
+
+ statistics.for_each_procedure_in_session(session, [&](const BreakdownCounter& breakdown, size_t procedure)
+ {
+ uint64_t s_total_proc = breakdown.get_total_count();
+ onProcedureInfoPrinted(out, breakdown, procedure);
+ out.width(22);
+ out << std::left
+ << cmd_representer->command_name(procedure);
+ out.width(6);
+ out << " Count:";
+ out.width(5);
+ out << std::right
+ << breakdown[procedure].get_count()
+ << ' ';
+ out.precision(2);
+ out << '(';
+ out.width(6);
+ out << std::fixed
+ << (s_total_proc ? (static_cast<long double>(breakdown[procedure].get_count()) * 100 / s_total_proc) : 0);
+ out << "%) Min: ";
+ out.precision(3);
+ out << std::fixed
+ << to_sec(breakdown[procedure].get_min())
+ << " Max: "
+ << std::fixed
+ << to_sec(breakdown[procedure].get_max())
+ << " Avg: "
+ << std::fixed
+ << breakdown[procedure].get_avg();
+ out.precision(8);
+ out << " StDev: "
+ << std::fixed
+ << breakdown[procedure].get_st_dev()
+ << std::endl;
+ });
+}
+
+void Representer::onProcedureInfoPrinted(std::ostream& o, const BreakdownCounter& breakdown, unsigned procedure) const
+{
+ if (procedure == 0)
+ {
+ o << "Total operations: " << breakdown.get_total_count()
+ << ". Per operation:" << std::endl;
+ }
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/representer.h b/analyzers/src/breakdown/representer.h
new file mode 100644
index 0000000..3a216ca
--- /dev/null
+++ b/analyzers/src/breakdown/representer.h
@@ -0,0 +1,79 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Representer of statistics
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef REPRESENTER_H
+#define REPRESENTER_H
+//------------------------------------------------------------------------------
+#include <memory>
+#include <ostream>
+
+#include "commandrepresenter.h"
+#include "breakdowncounter.h"
+#include "statistics.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*! \class Represents statistics and sends it to screen
+ */
+class Representer
+{
+ std::ostream& out;
+ std::unique_ptr<CommandRepresenter> cmd_representer;
+ size_t space_for_cmd_name;
+
+ void store_per_session(std::ostream& file,
+ const Statistics& statistics,
+ const Session& session,
+ const std::string& ssession) const;
+
+ void print_per_session(const Statistics& statistics, const Session& session, const std::string& ssession) const;
+protected:
+ /**
+ * @brief handler of one procedure output event
+ * @param o - stream
+ * @param breakdown - current counter
+ * @param procedure - procedure ID
+ */
+ virtual void onProcedureInfoPrinted(std::ostream& o, const BreakdownCounter& breakdown, unsigned procedure) const;
+public:
+ /**
+ * @brief Representer's constructor
+ * @param o - output stream
+ * @param cmd_representer - command representer
+ * @param space_for_cmd_name - spaces amount in output table (column's wifth)
+ */
+ Representer(std::ostream& o, CommandRepresenter* cmd_representer, size_t space_for_cmd_name = 12);
+
+ /*!
+ * \brief flush_statistics outs statistics on screen
+ * \param statistics - statistics data
+ */
+ void flush_statistics(const Statistics& statistics);
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//REPRESENTER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/statistics.cpp b/analyzers/src/breakdown/statistics.cpp
new file mode 100644
index 0000000..5cbf51b
--- /dev/null
+++ b/analyzers/src/breakdown/statistics.cpp
@@ -0,0 +1,98 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Statistics structure
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "statistics.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+bool Less::operator()(const Session& a, const Session& b) const
+{
+ return ( (std::uint16_t)(a.ip_type) < (std::uint16_t)(b.ip_type) ) || // compare versions of IP address
+ ( ntohs(a.port[0]) < ntohs(b.port[0]) ) || // compare Source(client) ports
+ ( ntohs(a.port[1]) < ntohs(b.port[1]) ) || // compare Destination(server) ports
+
+ ( (a.ip_type == Session::IPType::v4) ? // compare IPv4
+ ((ntohl(a.ip.v4.addr[0]) < ntohl(b.ip.v4.addr[0])) || (ntohl(a.ip.v4.addr[1]) < ntohl(b.ip.v4.addr[1])))
+ :
+ (memcmp(&a.ip.v6, &b.ip.v6, sizeof(a.ip.v6)) < 0 )
+ );
+}
+
+Statistics::Statistics(size_t proc_types_count)
+ : proc_types_count(proc_types_count)
+ , counter(proc_types_count)
+{
+}
+
+void Statistics::for_each_procedure(std::function<void (const BreakdownCounter&, size_t)> on_procedure) const
+{
+ for (size_t procedure = 0; procedure < proc_types_count; ++procedure)
+ {
+ on_procedure(counter, procedure);
+ }
+}
+
+void Statistics::for_each_session(std::function<void (const Session&)> on_session) const
+{
+ for (auto& it : per_session_statistics)
+ {
+ on_session(it.first);
+ }
+}
+
+void Statistics::for_each_procedure_in_session(const Session& session, std::function<void (const BreakdownCounter&, size_t)> on_procedure) const
+{
+ if (per_session_statistics.find(session) == per_session_statistics.end())
+ {
+ return;
+ }
+
+ const BreakdownCounter& current = per_session_statistics.at(session);
+ for (size_t procedure = 0; procedure < proc_types_count; ++procedure)
+ {
+ on_procedure(current, procedure);
+ }
+}
+
+bool Statistics::has_session() const
+{
+ return !per_session_statistics.empty();
+}
+
+void Statistics::account(const int cmd_index, const Session& session, const timeval latency)
+{
+ counter[cmd_index].add(latency);
+
+ auto i = per_session_statistics.find(session);
+ if (i == per_session_statistics.end())
+ {
+ auto session_res = per_session_statistics.emplace(session, BreakdownCounter {proc_types_count});
+ if (session_res.second == false)
+ {
+ return;
+ }
+ i = session_res.first;
+ }
+
+ (i->second)[cmd_index].add(latency);
+
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/statistics.h b/analyzers/src/breakdown/statistics.h
new file mode 100644
index 0000000..6202386
--- /dev/null
+++ b/analyzers/src/breakdown/statistics.h
@@ -0,0 +1,112 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Statistics structure
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef STATISTICS_H
+#define STATISTICS_H
+//------------------------------------------------------------------------------
+#include <functional>
+#include <map>
+
+#include <api/plugin_api.h>
+
+#include "breakdowncounter.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/*! \brief Comparator for sessions
+ */
+struct Less
+{
+ bool operator() (const Session& a, const Session& b) const;
+};
+
+/*! \brief All statistics data's container
+ */
+struct Statistics
+{
+ using PerSessionStatistics = std::map<Session, BreakdownCounter, Less>;
+ using ProceduresCount = std::vector<int>;
+
+ const size_t proc_types_count; //!< Count of types of procedures
+
+ /**
+ * @brief Constructor
+ * @param proc_types_count - amount of types of procedures
+ */
+ Statistics(size_t proc_types_count);
+
+ /**
+ * @brief iterates by procedures
+ * @param on_procedure - callback
+ */
+ virtual void for_each_procedure(std::function<void(const BreakdownCounter&, size_t)> on_procedure) const;
+
+ /**
+ * @brief iterates by sessions
+ * @param on_session - callback
+ */
+ virtual void for_each_session(std::function<void(const Session&)> on_session) const;
+
+ /**
+ * @brief iterates by procedure in specific session
+ * @param session - specific session
+ * @param on_procedure - callback
+ */
+ virtual void for_each_procedure_in_session(const Session& session, std::function<void(const BreakdownCounter&, size_t)> on_procedure) const;
+
+ /**
+ * @brief checks is sessions are present
+ */
+ virtual bool has_session() const;
+
+ /**
+ * Saves statistics on commands receive
+ * @param proc - command
+ * @param cmd_code - commands code
+ * @param stats - statistics
+ */
+ template<typename Cmd, typename Code>
+ void account(const Cmd* proc, Code cmd_code)
+ {
+ timeval latency {0, 0};
+ const int cmd_index = static_cast<int>(cmd_code);
+ const Session& session = *proc->session;
+
+ // diff between 'reply' and 'call' timestamps
+ timersub(proc->rtimestamp, proc->ctimestamp, &latency);
+
+ account(cmd_index, session, latency);
+ }
+protected:
+ void account(const int cmd_index, const Session& session, const timeval latency);
+
+ BreakdownCounter counter; //!< Statistics for all sessions
+ PerSessionStatistics per_session_statistics; //!< Statistics for each session
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//STATISTICS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/breakdown/statisticscompositor.cpp b/analyzers/src/breakdown/statisticscompositor.cpp
new file mode 100644
index 0000000..653c1df
--- /dev/null
+++ b/analyzers/src/breakdown/statisticscompositor.cpp
@@ -0,0 +1,83 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Statistics compositor
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <assert.h>
+
+#include "statisticscompositor.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+//------------------------------------------------------------------------------
+StatisticsCompositor::StatisticsCompositor(Statistics& procedures_stats, Statistics& operations_stats)
+ : Statistics(operations_stats)
+ , procedures_stats(procedures_stats)
+{
+ procedures_stats.for_each_session([&](const Session& session)
+ {
+ auto i = per_session_statistics.find(session);
+ if (i == per_session_statistics.end())
+ {
+ per_session_statistics.emplace(session, BreakdownCounter {proc_types_count});
+ }
+ });
+}
+
+void StatisticsCompositor::for_each_procedure(std::function<void(const BreakdownCounter&, size_t)> on_procedure) const
+{
+ assert(procedures_stats.proc_types_count < proc_types_count);
+
+ procedures_stats.for_each_procedure(on_procedure);
+
+ for (size_t procedure = procedures_stats.proc_types_count; procedure < proc_types_count; ++procedure)
+ {
+ on_procedure(counter, procedure);
+ }
+}
+
+void StatisticsCompositor::for_each_procedure_in_session(const Session& session, std::function<void (const BreakdownCounter&, size_t)> on_procedure) const
+{
+ bool has_procedures_in_session = false;
+
+ procedures_stats.for_each_procedure_in_session(session, [&](const BreakdownCounter& breakdown, size_t proc)
+ {
+ on_procedure(breakdown, proc);
+ has_procedures_in_session = true;
+ });
+
+ if (!has_procedures_in_session)
+ {
+ BreakdownCounter empty(procedures_stats.proc_types_count);
+ for (size_t procedure = 0; procedure < procedures_stats.proc_types_count; ++procedure)
+ {
+ on_procedure(empty, procedure);
+ }
+ }
+
+ const BreakdownCounter& current = per_session_statistics.at(session);
+ for (size_t procedure = procedures_stats.proc_types_count; procedure < proc_types_count; ++procedure)
+ {
+ on_procedure(current, procedure);
+ }
+}
+
+bool StatisticsCompositor::has_session() const
+{
+ return !per_session_statistics.empty() || procedures_stats.has_session();
+}
diff --git a/analyzers/src/breakdown/statisticscompositor.h b/analyzers/src/breakdown/statisticscompositor.h
new file mode 100644
index 0000000..3b73182
--- /dev/null
+++ b/analyzers/src/breakdown/statisticscompositor.h
@@ -0,0 +1,50 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Statistics compositor
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef STATISTICSCOMPOSITOR_H
+#define STATISTICSCOMPOSITOR_H
+//------------------------------------------------------------------------------
+#include "statistics.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace breakdown
+{
+
+/**
+ * @brief Composes 2 statistics: for procedures and functions
+ * It is useful for NFS v4.* protocols
+ */
+class StatisticsCompositor : public Statistics
+{
+ Statistics& procedures_stats;
+public:
+ StatisticsCompositor(Statistics& procedures_stats, Statistics& operations_stats);
+ void for_each_procedure(std::function<void(const BreakdownCounter&, size_t)> on_procedure) const override;
+ void for_each_procedure_in_session(const Session& session, std::function<void(const BreakdownCounter&, size_t)> on_procedure) const override;
+ bool has_session() const override;
+};
+
+} // namespace breakdown
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//STATISTICSCOMPOSITOR_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/CMakeLists.txt b/analyzers/src/json/CMakeLists.txt
new file mode 100644
index 0000000..a1ab274
--- /dev/null
+++ b/analyzers/src/json/CMakeLists.txt
@@ -0,0 +1,17 @@
+set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
+find_package (JSON)
+
+if (JSON_FOUND)
+ project (json)
+ aux_source_directory ("." SRC_LIST)
+ add_library (${PROJECT_NAME} SHARED ${SRC_LIST}
+ ../../../src/utils/log.cpp
+ ../../../src/utils/out.cpp)
+ set_target_properties(${PROJECT_NAME} PROPERTIES
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/analyzers) # direct output to nfstrace common binary dir
+ include_directories (${JSON_INCLUDE_DIRS})
+ target_link_libraries (${PROJECT_NAME} ${JSON_LIBRARIES})
+ install (TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib/nfstrace)
+else ()
+ message (WARNING "JSON library not found - JSON analyzer plugin is not available!")
+endif ()
diff --git a/analyzers/src/json/abstract_tcp_service.cpp b/analyzers/src/json/abstract_tcp_service.cpp
new file mode 100644
index 0000000..15cd7e1
--- /dev/null
+++ b/analyzers/src/json/abstract_tcp_service.cpp
@@ -0,0 +1,205 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: Abstract TCP-service class definition
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cstring>
+#include <functional>
+#include <system_error>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include "abstract_tcp_service.h"
+#include "utils/log.h"
+//------------------------------------------------------------------------------
+
+AbstractTcpService::AbstractTcpService(std::size_t workersAmount, int port, const std::string& host, int backlog) :
+ _port{port},
+ _host{host},
+ _backlog{backlog},
+ _isRunning{true},
+ _threadPool{workersAmount},
+ _listenerThread{},
+ _serverSocket{0},
+ _tasksQueue{},
+ _tasksQueueMutex{},
+ _tasksQueueCond{}
+{
+}
+
+AbstractTcpService::~AbstractTcpService()
+{
+ // Disposing tasks which are still in queue
+ while (!_tasksQueue.empty())
+ {
+ delete _tasksQueue.front();
+ _tasksQueue.pop();
+ }
+}
+
+void AbstractTcpService::start()
+{
+ _isRunning = true;
+ // Setting up server TCP-socket
+ _serverSocket = socket(PF_INET, SOCK_STREAM, 0);
+ if (_serverSocket < 0)
+ {
+ throw std::system_error{errno, std::system_category(), "Opening server socket error"};
+ }
+ // Setting SO_REUSEADDR to true
+ int reuseAddr = 1;
+ if (setsockopt(_serverSocket, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr)) < 0)
+ {
+ throw std::system_error{errno, std::system_category(), "Setting SO_REUSEADDR socket option error"};
+ }
+ // Binding server socket to endpoint
+ IpEndpoint endpoint{_host.c_str(), _port};
+ if (bind(_serverSocket, endpoint.addrinfo()->ai_addr, endpoint.addrinfo()->ai_addrlen) != 0)
+ {
+ throw std::system_error{errno, std::system_category(), "Binding server socket error"};
+ }
+ // Converting socket to listening state
+ if (listen(_serverSocket, _backlog) != 0)
+ {
+ throw std::system_error{errno, std::system_category(), "Converting socket to listening state error"};
+ }
+ // Creating threads for thread-pool
+ for (auto & thr : _threadPool)
+ {
+ thr = std::thread{&AbstractTcpService::runWorker, this};
+ }
+ _listenerThread = std::thread{&AbstractTcpService::runListener, this};
+}
+
+void AbstractTcpService::stop()
+{
+ {
+ // Waking up all awaiting threads
+ std::unique_lock<std::mutex> lock{_tasksQueueMutex};
+ _isRunning = false;
+ _tasksQueueCond.notify_all();
+ }
+ // Joining to thread-pool threads and disposing them
+ for (auto & thr : _threadPool)
+ {
+ thr.join();
+ }
+ // Joining to listener thread and closing server socket
+ _listenerThread.join();
+ close(_serverSocket);
+}
+
+void AbstractTcpService::runWorker()
+{
+ while (true)
+ {
+ std::unique_ptr<AbstractTask> pendingTask;
+ {
+ std::unique_lock<std::mutex> lock{_tasksQueueMutex};
+ while (!pendingTask)
+ {
+ if (!_isRunning.load())
+ {
+ return;
+ }
+ if (!_tasksQueue.empty())
+ {
+ pendingTask.reset(_tasksQueue.front());
+ _tasksQueue.pop();
+ }
+ else
+ {
+ _tasksQueueCond.wait(lock);
+ }
+ }
+ }
+ pendingTask->execute();
+ }
+}
+
+void AbstractTcpService::runListener()
+{
+ while (_isRunning.load())
+ {
+ // Accepting incoming connection on socket
+ struct timespec acceptDuration;
+ fillDuration(acceptDuration);
+ fd_set readDescriptorsSet;
+ FD_ZERO(&readDescriptorsSet);
+ FD_SET(_serverSocket, &readDescriptorsSet);
+ int descriptorsCount = pselect(_serverSocket + 1, &readDescriptorsSet, NULL, NULL, &acceptDuration, NULL);
+ if (descriptorsCount == 0)
+ {
+ // Timeout expired
+ continue;
+ }
+ else if (descriptorsCount < 0)
+ {
+ std::system_error e{errno, std::system_category(), "Awaiting for incoming connection on server socket error"};
+ LOG("ERROR: %s", e.what());
+#ifdef __gnu_linux__
+ // Several first pselect(2) calls cause "Interrupted system call" error (errno == EINTR)
+ // if drop privileges option is used on Linux (see https://access.redhat.com/solutions/165483)
+ if (errno == EINTR)
+ {
+ continue;
+ }
+#endif
+ throw e;
+ }
+ // Extracting and returning pending connection
+ int pendingSocketDescriptor = accept(_serverSocket, NULL, NULL);
+ if (pendingSocketDescriptor < 0)
+ {
+ std::system_error e{errno, std::system_category(), "Accepting incoming connection on server socket error"};
+ LOG("ERROR: %s", e.what());
+ throw e;
+ }
+ // Create and enqueue task
+ std::unique_ptr<AbstractTask> newTask{createTask(pendingSocketDescriptor)};
+ {
+ std::unique_lock<std::mutex> lock(_tasksQueueMutex);
+ if (_tasksQueue.size() < MaxTasksQueueSize)
+ {
+ _tasksQueue.push(newTask.get());
+ newTask.release();
+ _tasksQueueCond.notify_one();
+ }
+ else
+ {
+ LOG("ERROR: TCP-service tasks queue overload has been detected")
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+
+AbstractTcpService::AbstractTask::AbstractTask(int socket) :
+ _socket{socket}
+{}
+
+AbstractTcpService::AbstractTask::~AbstractTask()
+{
+ close(_socket);
+}
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/abstract_tcp_service.h b/analyzers/src/json/abstract_tcp_service.h
new file mode 100644
index 0000000..8ef0e00
--- /dev/null
+++ b/analyzers/src/json/abstract_tcp_service.h
@@ -0,0 +1,127 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: Abstract TCP-service class declaration
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef ABSTRACT_TCP_SERVICE_H
+#define ABSTRACT_TCP_SERVICE_H
+//------------------------------------------------------------------------------
+#include <atomic>
+#include <condition_variable>
+#include <mutex>
+#include <queue>
+#include <thread>
+#include <vector>
+
+#include "ip_endpoint.h"
+//------------------------------------------------------------------------------
+//! TCP-service
+/*!
+ * Abstract task for TCP-service
+ */
+class AbstractTcpService
+{
+public:
+ static constexpr int DefaultBacklog = 15;
+
+ AbstractTcpService() = delete;
+ //! Constructs TCP-service
+ /*!
+ * \param workersAmount Amount of workers in thread-pool
+ * \param port Port to bind to
+ * \param host Hostname/IP-address to listen
+ * \param backlog Listen backlog - see listen(2)
+ */
+ AbstractTcpService(std::size_t workersAmount, int port, const std::string& host = IpEndpoint::WildcardAddress,
+ int backlog = DefaultBacklog);
+ //! Destructs stopped TCP-service
+ /*!
+ * \note Destruction of non-stopped TCP-service causes undefined behaviour
+ */
+ virtual ~AbstractTcpService();
+
+ //! Returns TRUE if service is in running state
+ inline bool isRunning() const
+ {
+ return _isRunning.load();
+ }
+ //! Fills 'struct timespec' value using clock timeout
+ inline static void fillDuration(struct timespec& ts)
+ {
+ ts.tv_sec = ClockTimeoutMs / 1000;
+ ts.tv_nsec = ClockTimeoutMs % 1000 * 1000000;
+ }
+
+ //! Starts TCP-service
+ virtual void start();
+ //! Stops TCP-service
+ virtual void stop();
+protected:
+ //! Asbtract TCP-service task
+ class AbstractTask
+ {
+ public:
+ //! Constructs TCP-service task
+ /*!
+ * \param socket Socket for I/O
+ */
+ AbstractTask(int socket);
+ AbstractTask() = delete;
+ //! Destructs TCP-service task and closes I/O socket
+ virtual ~AbstractTask();
+
+ //! Returns a socket for I/O
+ inline int socket() const
+ {
+ return _socket;
+ }
+
+ //! Task execution pure virtual method to override
+ virtual void execute() = 0;
+ private:
+ int _socket;
+ };
+
+ virtual AbstractTask* createTask(int socket) = 0;
+private:
+ using ThreadPool = std::vector<std::thread>;
+
+ static constexpr int ClockTimeoutMs = 100;
+ static constexpr std::size_t ReadBufferSize = 1024;
+ static constexpr std::size_t WriteBufferSize = 4096;
+ static constexpr std::size_t HeaderPartSize = 1024;
+ static constexpr int MaxTasksQueueSize = 128;
+
+ void runWorker();
+ void runListener();
+
+ const int _port;
+ const std::string _host;
+ const int _backlog;
+ std::atomic_bool _isRunning;
+ ThreadPool _threadPool;
+ std::thread _listenerThread;
+ int _serverSocket;
+ std::queue<AbstractTask*> _tasksQueue;
+ std::mutex _tasksQueueMutex;
+ std::condition_variable _tasksQueueCond;
+};
+//------------------------------------------------------------------------------
+#endif//ABSTRACT_TCP_SERVICE_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/ip_endpoint.cpp b/analyzers/src/json/ip_endpoint.cpp
new file mode 100644
index 0000000..777d16b
--- /dev/null
+++ b/analyzers/src/json/ip_endpoint.cpp
@@ -0,0 +1,64 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: TCP-endpoint class definition
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cstring>
+#include <stdexcept>
+
+#include <sys/socket.h>
+
+#include "ip_endpoint.h"
+//------------------------------------------------------------------------------
+
+IpEndpoint::IpEndpoint(const std::string& host, int port, bool hostAsAddress) :
+ _addrinfo{}
+{
+ struct addrinfo hints;
+ memset(&hints, 0, sizeof hints);
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags |= AI_NUMERICSERV;
+ std::string serviceStr{std::to_string(port)};
+ if (host == WildcardAddress)
+ {
+ hints.ai_flags |= AI_PASSIVE;
+ }
+ if ((host != WildcardAddress) && (host != LoopbackAddress))
+ {
+ hints.ai_flags |= AI_CANONNAME;
+ if (hostAsAddress)
+ {
+ hints.ai_flags |= AI_NUMERICHOST;
+ }
+ }
+ int status = getaddrinfo((host == LoopbackAddress) || (host == WildcardAddress) ? nullptr : host.c_str(),
+ serviceStr.c_str(), &hints, &_addrinfo);
+ if (status != 0)
+ {
+ throw std::runtime_error{gai_strerror(status)};
+ }
+}
+
+IpEndpoint::~IpEndpoint()
+{
+ freeaddrinfo(_addrinfo);
+}
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/ip_endpoint.h b/analyzers/src/json/ip_endpoint.h
new file mode 100644
index 0000000..a45c5f2
--- /dev/null
+++ b/analyzers/src/json/ip_endpoint.h
@@ -0,0 +1,59 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: TCP-endpoint class declaration
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef IP_ENDPOINT_H
+#define IP_ENDPOINT_H
+//------------------------------------------------------------------------------
+#include <string>
+
+#include <netdb.h>
+//------------------------------------------------------------------------------
+//! IP-endpoint (host:port) helper class to use in socket operations
+class IpEndpoint
+{
+public:
+ //! Loopback address name
+ static constexpr const char* LoopbackAddress = "localhost";
+ //! Wildcard address name
+ static constexpr const char* WildcardAddress = "*";
+
+ IpEndpoint() = delete;
+ //! Constructs TCP-endpoint
+ /*!
+ * \param host Hostname or IP-address of the endpoint
+ * \param port TCP-port
+ * \param hostAsAddress Consider host as IP-address flag
+ */
+ IpEndpoint(const std::string& host, int port, bool hostAsAddress = false);
+ //! Destructs TCP-endpoint
+ ~IpEndpoint();
+
+ //! Returns a pointer to 'struct addrinfo' structure for TCP-endpoint
+ struct addrinfo* addrinfo()
+ {
+ return _addrinfo;
+ }
+private:
+ struct addrinfo* _addrinfo;
+};
+//------------------------------------------------------------------------------
+#endif//IP_ENDPOINT_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/json_analyzer.cpp b/analyzers/src/json/json_analyzer.cpp
new file mode 100644
index 0000000..de6a1ab
--- /dev/null
+++ b/analyzers/src/json/json_analyzer.cpp
@@ -0,0 +1,886 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: JSON analyzer class definition
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "json_analyzer.h"
+//------------------------------------------------------------------------------
+
+JsonAnalyzer::JsonAnalyzer(std::size_t workersAmount, int port, const std::string& host, std::size_t maxServingDurationMs, int backlog) :
+ _jsonTcpService{*this, workersAmount, port, host, maxServingDurationMs, backlog},
+ _nfsV3Stat{},
+ _nfsV40Stat{},
+ _nfsV41Stat{}
+{
+ _jsonTcpService.start();
+}
+
+JsonAnalyzer::~JsonAnalyzer()
+{
+ _jsonTcpService.stop();
+}
+
+// NFS3
+// Procedures:
+
+void JsonAnalyzer::null(const RPCProcedure* /*proc*/,
+ const struct NFS3::NULL3args* /*args*/,
+ const struct NFS3::NULL3res* /*res*/)
+{
+ _nfsV3Stat.nullProcsAmount++;
+}
+
+void JsonAnalyzer::getattr3(const RPCProcedure* /*proc*/,
+ const struct NFS3::GETATTR3args* /*args*/,
+ const struct NFS3::GETATTR3res* /*res*/)
+{
+ _nfsV3Stat.getattrProcsAmount++;
+}
+
+void JsonAnalyzer::setattr3(const RPCProcedure* /*proc*/,
+ const struct NFS3::SETATTR3args* /*args*/,
+ const struct NFS3::SETATTR3res* /*res*/)
+{
+ _nfsV3Stat.setattrProcsAmount++;
+}
+
+void JsonAnalyzer::lookup3(const RPCProcedure* /*proc*/,
+ const struct NFS3::LOOKUP3args* /*args*/,
+ const struct NFS3::LOOKUP3res* /*res*/)
+{
+ _nfsV3Stat.lookupProcsAmount++;
+}
+
+void JsonAnalyzer::access3(const RPCProcedure* /*proc*/,
+ const struct NFS3::ACCESS3args* /*args*/,
+ const struct NFS3::ACCESS3res* /*res*/)
+{
+ _nfsV3Stat.accessProcsAmount++;
+}
+
+void JsonAnalyzer::readlink3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READLINK3args* /*args*/,
+ const struct NFS3::READLINK3res* /*res*/)
+{
+ _nfsV3Stat.readlinkProcsAmount++;
+}
+
+void JsonAnalyzer::read3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READ3args* /*args*/,
+ const struct NFS3::READ3res* /*res*/)
+{
+ _nfsV3Stat.readProcsAmount++;
+}
+
+void JsonAnalyzer::write3(const RPCProcedure* /*proc*/,
+ const struct NFS3::WRITE3args* /*args*/,
+ const struct NFS3::WRITE3res* /*res*/)
+{
+ _nfsV3Stat.writeProcsAmount++;
+}
+
+void JsonAnalyzer::create3(const RPCProcedure* /*proc*/,
+ const struct NFS3::CREATE3args* /*args*/,
+ const struct NFS3::CREATE3res* /*res*/)
+{
+ _nfsV3Stat.createProcsAmount++;
+}
+
+void JsonAnalyzer::mkdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::MKDIR3args* /*args*/,
+ const struct NFS3::MKDIR3res* /*res*/)
+{
+ _nfsV3Stat.mkdirProcsAmount++;
+}
+
+void JsonAnalyzer::symlink3(const RPCProcedure* /*proc*/,
+ const struct NFS3::SYMLINK3args* /*args*/,
+ const struct NFS3::SYMLINK3res* /*res*/)
+{
+ _nfsV3Stat.symlinkProcsAmount++;
+}
+
+void JsonAnalyzer::mknod3(const RPCProcedure* /*proc*/,
+ const struct NFS3::MKNOD3args* /*args*/,
+ const struct NFS3::MKNOD3res* /*res*/)
+{
+ _nfsV3Stat.mknodProcsAmount++;
+}
+
+void JsonAnalyzer::remove3(const RPCProcedure* /*proc*/,
+ const struct NFS3::REMOVE3args* /*args*/,
+ const struct NFS3::REMOVE3res* /*res*/)
+{
+ _nfsV3Stat.removeProcsAmount++;
+}
+
+void JsonAnalyzer::rmdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::RMDIR3args* /*args*/,
+ const struct NFS3::RMDIR3res* /*res*/)
+{
+ _nfsV3Stat.rmdirProcsAmount++;
+}
+
+void JsonAnalyzer::rename3(const RPCProcedure* /*proc*/,
+ const struct NFS3::RENAME3args* /*args*/,
+ const struct NFS3::RENAME3res* /*res*/)
+{
+ _nfsV3Stat.renameProcsAmount++;
+}
+
+void JsonAnalyzer::link3(const RPCProcedure* /*proc*/,
+ const struct NFS3::LINK3args* /*args*/,
+ const struct NFS3::LINK3res* /*res*/)
+{
+ _nfsV3Stat.linkProcsAmount++;
+}
+
+void JsonAnalyzer::readdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READDIR3args* /*args*/,
+ const struct NFS3::READDIR3res* /*res*/)
+{
+ _nfsV3Stat.readdirProcsAmount++;
+}
+
+void JsonAnalyzer::readdirplus3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READDIRPLUS3args* /*args*/,
+ const struct NFS3::READDIRPLUS3res* /*res*/)
+{
+ _nfsV3Stat.readdirplusProcsAmount++;
+}
+
+void JsonAnalyzer::fsstat3(const RPCProcedure* /*proc*/,
+ const struct NFS3::FSSTAT3args* /*args*/,
+ const struct NFS3::FSSTAT3res* /*res*/)
+{
+ _nfsV3Stat.fsstatProcsAmount++;
+}
+
+void JsonAnalyzer::fsinfo3(const RPCProcedure* /*proc*/,
+ const struct NFS3::FSINFO3args* /*args*/,
+ const struct NFS3::FSINFO3res* /*res*/)
+{
+ _nfsV3Stat.fsinfoProcsAmount++;
+}
+
+void JsonAnalyzer::pathconf3(const RPCProcedure* /*proc*/,
+ const struct NFS3::PATHCONF3args* /*args*/,
+ const struct NFS3::PATHCONF3res* /*res*/)
+{
+ _nfsV3Stat.pathconfProcsAmount++;
+}
+
+void JsonAnalyzer::commit3(const RPCProcedure* /*proc*/,
+ const struct NFS3::COMMIT3args* /*args*/,
+ const struct NFS3::COMMIT3res* /*res*/)
+{
+ _nfsV3Stat.commitProcsAmount++;
+}
+
+// NFS4.0
+// Procedures:
+
+void JsonAnalyzer::null4(const RPCProcedure* /*proc*/,
+ const struct NFS4::NULL4args* /*args*/,
+ const struct NFS4::NULL4res* /*res*/)
+{
+ _nfsV40Stat.nullProcsAmount++;
+}
+void JsonAnalyzer::compound4(const RPCProcedure* /*proc*/,
+ const struct NFS4::COMPOUND4args* /*args*/,
+ const struct NFS4::COMPOUND4res* /*res*/)
+{
+ _nfsV40Stat.compoundProcsAmount++;
+}
+
+// Operations:
+
+void JsonAnalyzer::access40(const RPCProcedure* /* proc */,
+ const struct NFS4::ACCESS4args* /* args */,
+ const struct NFS4::ACCESS4res* res)
+{
+ if(res) _nfsV40Stat.accessOpsAmount++;
+}
+
+void JsonAnalyzer::close40(const RPCProcedure* /* proc */,
+ const struct NFS4::CLOSE4args* /* args */,
+ const struct NFS4::CLOSE4res* res)
+{
+ if(res) _nfsV40Stat.closeOpsAmount++;
+}
+
+void JsonAnalyzer::commit40(const RPCProcedure* /* proc */,
+ const struct NFS4::COMMIT4args* /* args */,
+ const struct NFS4::COMMIT4res* res)
+{
+ if(res) _nfsV40Stat.commitOpsAmount++;
+}
+
+void JsonAnalyzer::create40(const RPCProcedure* /* proc */,
+ const struct NFS4::CREATE4args* /* args */,
+ const struct NFS4::CREATE4res* res)
+{
+ if(res) _nfsV40Stat.createOpsAmount++;
+}
+
+void JsonAnalyzer::delegpurge40(const RPCProcedure* /* proc */,
+ const struct NFS4::DELEGPURGE4args* /* args */,
+ const struct NFS4::DELEGPURGE4res* res)
+{
+ if(res) _nfsV40Stat.delegpurgeOpsAmount++;
+}
+
+void JsonAnalyzer::delegreturn40(const RPCProcedure* /* proc */,
+ const struct NFS4::DELEGRETURN4args* /* args */,
+ const struct NFS4::DELEGRETURN4res* res)
+{
+ if(res) _nfsV40Stat.delegreturnOpsAmount++;
+}
+
+void JsonAnalyzer::getattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::GETATTR4args* /* args */,
+ const struct NFS4::GETATTR4res* res)
+{
+ if(res) _nfsV40Stat.getattrOpsAmount++;
+}
+
+void JsonAnalyzer::getfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::GETFH4res* res)
+{
+ if(res) _nfsV40Stat.getfhOpsAmount++;
+}
+
+void JsonAnalyzer::link40(const RPCProcedure* /* proc */,
+ const struct NFS4::LINK4args* /* args */,
+ const struct NFS4::LINK4res* res)
+{
+ if(res) _nfsV40Stat.linkOpsAmount++;
+}
+
+void JsonAnalyzer::lock40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCK4args* /* args */,
+ const struct NFS4::LOCK4res* res)
+{
+ if(res) _nfsV40Stat.lockOpsAmount++;
+}
+
+void JsonAnalyzer::lockt40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCKT4args* /* args */,
+ const struct NFS4::LOCKT4res* res)
+{
+ if(res) _nfsV40Stat.locktOpsAmount++;
+}
+
+void JsonAnalyzer::locku40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCKU4args* /* args */,
+ const struct NFS4::LOCKU4res* res)
+{
+ if(res) _nfsV40Stat.lockuOpsAmount++;
+}
+
+void JsonAnalyzer::lookup40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOOKUP4args* /* args */,
+ const struct NFS4::LOOKUP4res* res)
+{
+ if(res) _nfsV40Stat.lookupOpsAmount++;
+}
+
+void JsonAnalyzer::lookupp40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOOKUPP4res* res)
+{
+ if(res) _nfsV40Stat.lookuppOpsAmount++;
+}
+
+void JsonAnalyzer::nverify40(const RPCProcedure* /* proc */,
+ const struct NFS4::NVERIFY4args* /* args */,
+ const struct NFS4::NVERIFY4res* res)
+{
+ if(res) _nfsV40Stat.nverifyOpsAmount++;
+}
+
+void JsonAnalyzer::open40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN4args* /* args */,
+ const struct NFS4::OPEN4res* res)
+{
+ if(res) _nfsV40Stat.openOpsAmount++;
+}
+
+void JsonAnalyzer::openattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPENATTR4args* /* args */,
+ const struct NFS4::OPENATTR4res* res)
+{
+ if(res) _nfsV40Stat.openattrOpsAmount++;
+}
+
+void JsonAnalyzer::open_confirm40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN_CONFIRM4args* /* args */,
+ const struct NFS4::OPEN_CONFIRM4res* res)
+{
+ if(res) _nfsV40Stat.open_confirmOpsAmount++;
+}
+
+void JsonAnalyzer::open_downgrade40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN_DOWNGRADE4args* /* args */,
+ const struct NFS4::OPEN_DOWNGRADE4res* res)
+{
+ if(res) _nfsV40Stat.open_downgradeOpsAmount++;
+}
+
+void JsonAnalyzer::putfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTFH4args* /* args */,
+ const struct NFS4::PUTFH4res* res)
+{
+ if(res) _nfsV40Stat.putfhOpsAmount++;
+}
+
+void JsonAnalyzer::putpubfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTPUBFH4res* res)
+{
+ if(res) _nfsV40Stat.putpubfhOpsAmount++;
+}
+
+void JsonAnalyzer::putrootfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTROOTFH4res* res)
+{
+ if(res) _nfsV40Stat.putrootfhOpsAmount++;
+}
+
+void JsonAnalyzer::read40(const RPCProcedure* /* proc */,
+ const struct NFS4::READ4args* /* args */,
+ const struct NFS4::READ4res* res)
+{
+ if(res) _nfsV40Stat.readOpsAmount++;
+}
+
+void JsonAnalyzer::readdir40(const RPCProcedure* /* proc */,
+ const struct NFS4::READDIR4args* /* args */,
+ const struct NFS4::READDIR4res* res)
+{
+ if(res) _nfsV40Stat.readdirOpsAmount++;
+}
+
+void JsonAnalyzer::readlink40(const RPCProcedure* /* proc */,
+ const struct NFS4::READLINK4res* res)
+{
+ if(res) _nfsV40Stat.readlinkOpsAmount++;
+}
+
+void JsonAnalyzer::remove40(const RPCProcedure* /* proc */,
+ const struct NFS4::REMOVE4args* /* args */,
+ const struct NFS4::REMOVE4res* res)
+{
+ if(res) _nfsV40Stat.removeOpsAmount++;
+}
+
+void JsonAnalyzer::rename40(const RPCProcedure* /* proc */,
+ const struct NFS4::RENAME4args* /* args */,
+ const struct NFS4::RENAME4res* res)
+{
+ if(res) _nfsV40Stat.renameOpsAmount++;
+}
+
+void JsonAnalyzer::renew40(const RPCProcedure* /* proc */,
+ const struct NFS4::RENEW4args* /* args */,
+ const struct NFS4::RENEW4res* res)
+{
+ if(res) _nfsV40Stat.renewOpsAmount++;
+}
+
+void JsonAnalyzer::restorefh40(const RPCProcedure* /* proc */,
+ const struct NFS4::RESTOREFH4res* res)
+{
+ if(res) _nfsV40Stat.restorefhOpsAmount++;
+}
+
+void JsonAnalyzer::savefh40(const RPCProcedure* /* proc */,
+ const struct NFS4::SAVEFH4res* res)
+{
+ if(res) _nfsV40Stat.savefhOpsAmount++;
+}
+
+void JsonAnalyzer::secinfo40(const RPCProcedure* /* proc */,
+ const struct NFS4::SECINFO4args* /* args */,
+ const struct NFS4::SECINFO4res* res)
+{
+ if(res) _nfsV40Stat.secinfoOpsAmount++;
+}
+
+void JsonAnalyzer::setattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETATTR4args* /* args */,
+ const struct NFS4::SETATTR4res* res)
+{
+ if(res) _nfsV40Stat.setattrOpsAmount++;
+}
+
+void JsonAnalyzer::setclientid40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETCLIENTID4args* /* args */,
+ const struct NFS4::SETCLIENTID4res* res)
+{
+ if(res) _nfsV40Stat.setclientidOpsAmount++;
+}
+
+void JsonAnalyzer::setclientid_confirm40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETCLIENTID_CONFIRM4args* /* args */,
+ const struct NFS4::SETCLIENTID_CONFIRM4res* res)
+{
+ if(res) _nfsV40Stat.setclientid_confirmOpsAmount++;
+}
+
+void JsonAnalyzer::verify40(const RPCProcedure* /* proc */,
+ const struct NFS4::VERIFY4args* /* args */,
+ const struct NFS4::VERIFY4res* res)
+{
+ if(res) _nfsV40Stat.verifyOpsAmount++;
+}
+
+void JsonAnalyzer::write40(const RPCProcedure* /* proc */,
+ const struct NFS4::WRITE4args* /* args */,
+ const struct NFS4::WRITE4res* res)
+{
+ if(res) _nfsV40Stat.writeOpsAmount++;
+}
+
+void JsonAnalyzer::release_lockowner40(const RPCProcedure* /* proc */,
+ const struct NFS4::RELEASE_LOCKOWNER4args* /* args */,
+ const struct NFS4::RELEASE_LOCKOWNER4res* res)
+{
+ if(res) _nfsV40Stat.release_lockownerOpsAmount++;
+}
+
+void JsonAnalyzer::get_dir_delegation40(const RPCProcedure* /* proc */,
+ const struct NFS4::GET_DIR_DELEGATION4args* /* args */,
+ const struct NFS4::GET_DIR_DELEGATION4res* res)
+{
+ if(res) _nfsV40Stat.get_dir_delegationOpsAmount++;
+}
+
+void JsonAnalyzer::illegal40(const RPCProcedure* /* proc */,
+ const struct NFS4::ILLEGAL4res* res)
+{
+ if(res) _nfsV40Stat.illegalOpsAmount++;
+}
+
+// NFS4.1
+// Procedures:
+
+void JsonAnalyzer::compound41(const RPCProcedure* /*proc*/,
+ const struct NFS41::COMPOUND4args* /*args*/,
+ const struct NFS41::COMPOUND4res* /*res*/)
+{
+ _nfsV41Stat.compoundProcsAmount++;
+}
+
+// Operations:
+
+void JsonAnalyzer::access41(const RPCProcedure* /* proc */,
+ const struct NFS41::ACCESS4args* /* args */,
+ const struct NFS41::ACCESS4res* res)
+{
+ if(res) _nfsV41Stat.accessOpsAmount++;
+}
+
+void JsonAnalyzer::close41(const RPCProcedure* /* proc */,
+ const struct NFS41::CLOSE4args* /* args */,
+ const struct NFS41::CLOSE4res* res)
+{
+ if(res) _nfsV41Stat.closeOpsAmount++;
+}
+
+void JsonAnalyzer::commit41(const RPCProcedure* /* proc */,
+ const struct NFS41::COMMIT4args* /* args */,
+ const struct NFS41::COMMIT4res* res)
+{
+ if(res) _nfsV41Stat.commitOpsAmount++;
+}
+
+void JsonAnalyzer::create41(const RPCProcedure* /* proc */,
+ const struct NFS41::CREATE4args* /* args */,
+ const struct NFS41::CREATE4res* res)
+{
+ if(res) _nfsV41Stat.createOpsAmount++;
+}
+
+void JsonAnalyzer::delegpurge41(const RPCProcedure* /* proc */,
+ const struct NFS41::DELEGPURGE4args* /* args */,
+ const struct NFS41::DELEGPURGE4res* res)
+{
+ if(res) _nfsV41Stat.delegpurgeOpsAmount++;
+}
+
+void JsonAnalyzer::delegreturn41(const RPCProcedure* /* proc */,
+ const struct NFS41::DELEGRETURN4args* /* args */,
+ const struct NFS41::DELEGRETURN4res* res)
+{
+ if(res) _nfsV41Stat.delegreturnOpsAmount++;
+}
+
+void JsonAnalyzer::getattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETATTR4args* /* args */,
+ const struct NFS41::GETATTR4res* res)
+{
+ if(res) _nfsV41Stat.getattrOpsAmount++;
+}
+
+void JsonAnalyzer::getfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETFH4res* res)
+{
+ if(res) _nfsV41Stat.getfhOpsAmount++;
+}
+
+void JsonAnalyzer::link41(const RPCProcedure* /* proc */,
+ const struct NFS41::LINK4args* /* args */,
+ const struct NFS41::LINK4res* res)
+{
+ if(res) _nfsV41Stat.linkOpsAmount++;
+}
+
+void JsonAnalyzer::lock41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCK4args* /* args */,
+ const struct NFS41::LOCK4res* res)
+{
+ if(res) _nfsV41Stat.lockOpsAmount++;
+}
+
+void JsonAnalyzer::lockt41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCKT4args* /* args */,
+ const struct NFS41::LOCKT4res* res)
+{
+ if(res) _nfsV41Stat.locktOpsAmount++;
+}
+
+void JsonAnalyzer::locku41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCKU4args* /* args */,
+ const struct NFS41::LOCKU4res* res)
+{
+ if(res) _nfsV41Stat.lockuOpsAmount++;
+}
+
+void JsonAnalyzer::lookup41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOOKUP4args* /* args */,
+ const struct NFS41::LOOKUP4res* res)
+{
+ if(res) _nfsV41Stat.lookupOpsAmount++;
+}
+
+void JsonAnalyzer::lookupp41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOOKUPP4res* res)
+{
+ if(res) _nfsV41Stat.lookuppOpsAmount++;
+}
+
+void JsonAnalyzer::nverify41(const RPCProcedure* /* proc */,
+ const struct NFS41::NVERIFY4args* /* args */,
+ const struct NFS41::NVERIFY4res* res)
+{
+ if(res) _nfsV41Stat.nverifyOpsAmount++;
+}
+
+void JsonAnalyzer::open41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN4args* /* args */,
+ const struct NFS41::OPEN4res* res)
+{
+ if(res) _nfsV41Stat.openOpsAmount++;
+}
+
+void JsonAnalyzer::openattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPENATTR4args* /* args */,
+ const struct NFS41::OPENATTR4res* res)
+{
+ if(res) _nfsV41Stat.openattrOpsAmount++;
+}
+
+void JsonAnalyzer::open_confirm41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN_CONFIRM4args* /* args */,
+ const struct NFS41::OPEN_CONFIRM4res* res)
+{
+ if(res) _nfsV41Stat.open_confirmOpsAmount++;
+}
+
+void JsonAnalyzer::open_downgrade41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN_DOWNGRADE4args* /* args */,
+ const struct NFS41::OPEN_DOWNGRADE4res* res)
+{
+ if(res) _nfsV41Stat.open_downgradeOpsAmount++;
+}
+
+void JsonAnalyzer::putfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTFH4args* /* args */,
+ const struct NFS41::PUTFH4res* res)
+{
+ if(res) _nfsV41Stat.putfhOpsAmount++;
+}
+
+void JsonAnalyzer::putpubfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTPUBFH4res* res)
+{
+ if(res) _nfsV41Stat.putpubfhOpsAmount++;
+}
+
+void JsonAnalyzer::putrootfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTROOTFH4res* res)
+{
+ if(res) _nfsV41Stat.putrootfhOpsAmount++;
+}
+
+void JsonAnalyzer::read41(const RPCProcedure* /* proc */,
+ const struct NFS41::READ4args* /* args */,
+ const struct NFS41::READ4res* res)
+{
+ if(res) _nfsV41Stat.readOpsAmount++;
+}
+
+void JsonAnalyzer::readdir41(const RPCProcedure* /* proc */,
+ const struct NFS41::READDIR4args* /* args */,
+ const struct NFS41::READDIR4res* res)
+{
+ if(res) _nfsV41Stat.readdirOpsAmount++;
+}
+
+void JsonAnalyzer::readlink41(const RPCProcedure* /* proc */,
+ const struct NFS41::READLINK4res* res)
+{
+ if(res) _nfsV41Stat.readlinkOpsAmount++;
+}
+
+void JsonAnalyzer::remove41(const RPCProcedure* /* proc */,
+ const struct NFS41::REMOVE4args* /* args */,
+ const struct NFS41::REMOVE4res* res)
+{
+ if(res) _nfsV41Stat.removeOpsAmount++;
+}
+
+void JsonAnalyzer::rename41(const RPCProcedure* /* proc */,
+ const struct NFS41::RENAME4args* /* args */,
+ const struct NFS41::RENAME4res* res)
+{
+ if(res) _nfsV41Stat.renameOpsAmount++;
+}
+
+void JsonAnalyzer::renew41(const RPCProcedure* /* proc */,
+ const struct NFS41::RENEW4args* /* args */,
+ const struct NFS41::RENEW4res* res)
+{
+ if(res) _nfsV41Stat.renewOpsAmount++;
+}
+
+void JsonAnalyzer::restorefh41(const RPCProcedure* /* proc */,
+ const struct NFS41::RESTOREFH4res* res)
+{
+ if(res) _nfsV41Stat.restorefhOpsAmount++;
+}
+
+void JsonAnalyzer::savefh41(const RPCProcedure* /* proc */,
+ const struct NFS41::SAVEFH4res* res)
+{
+ if(res) _nfsV41Stat.savefhOpsAmount++;
+}
+
+void JsonAnalyzer::secinfo41(const RPCProcedure* /* proc */,
+ const struct NFS41::SECINFO4args* /* args */,
+ const struct NFS41::SECINFO4res* res)
+{
+ if(res) _nfsV41Stat.secinfoOpsAmount++;
+}
+
+void JsonAnalyzer::setattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETATTR4args* /* args */,
+ const struct NFS41::SETATTR4res* res)
+{
+ if(res) _nfsV41Stat.setattrOpsAmount++;
+}
+
+void JsonAnalyzer::setclientid41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETCLIENTID4args* /* args */,
+ const struct NFS41::SETCLIENTID4res* res)
+{
+ if(res) _nfsV41Stat.setclientidOpsAmount++;
+}
+
+void JsonAnalyzer::setclientid_confirm41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETCLIENTID_CONFIRM4args* /* args */,
+ const struct NFS41::SETCLIENTID_CONFIRM4res* res)
+{
+ if(res) _nfsV41Stat.setclientid_confirmOpsAmount++;
+}
+
+void JsonAnalyzer::verify41(const RPCProcedure* /* proc */,
+ const struct NFS41::VERIFY4args* /* args */,
+ const struct NFS41::VERIFY4res* res)
+{
+ if(res) _nfsV41Stat.verifyOpsAmount++;
+}
+
+void JsonAnalyzer::write41(const RPCProcedure* /* proc */,
+ const struct NFS41::WRITE4args* /* args */,
+ const struct NFS41::WRITE4res* res)
+{
+ if(res) _nfsV41Stat.writeOpsAmount++;
+}
+
+void JsonAnalyzer::release_lockowner41(const RPCProcedure* /* proc */,
+ const struct NFS41::RELEASE_LOCKOWNER4args* /* args */,
+ const struct NFS41::RELEASE_LOCKOWNER4res* res)
+{
+ if(res) _nfsV41Stat.release_lockownerOpsAmount++;
+}
+
+void JsonAnalyzer::backchannel_ctl41(const RPCProcedure* /* proc */,
+ const struct NFS41::BACKCHANNEL_CTL4args* /* args */,
+ const struct NFS41::BACKCHANNEL_CTL4res* res)
+{
+ if(res) _nfsV41Stat.backchannel_ctlOpsAmount++;
+}
+
+void JsonAnalyzer::bind_conn_to_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::BIND_CONN_TO_SESSION4args* /* args */,
+ const struct NFS41::BIND_CONN_TO_SESSION4res* res)
+{
+ if(res) _nfsV41Stat.bind_conn_to_sessionOpsAmount++;
+}
+
+void JsonAnalyzer::exchange_id41(const RPCProcedure* /* proc */,
+ const struct NFS41::EXCHANGE_ID4args* /* args */,
+ const struct NFS41::EXCHANGE_ID4res* res)
+{
+ if(res) _nfsV41Stat.exchange_idOpsAmount++;
+}
+
+void JsonAnalyzer::create_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::CREATE_SESSION4args* /* args */,
+ const struct NFS41::CREATE_SESSION4res* res)
+{
+ if(res) _nfsV41Stat.create_sessionOpsAmount++;
+}
+
+void JsonAnalyzer::destroy_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::DESTROY_SESSION4args* /* args */,
+ const struct NFS41::DESTROY_SESSION4res* res)
+{
+ if(res) _nfsV41Stat.destroy_sessionOpsAmount++;
+}
+
+void JsonAnalyzer::free_stateid41(const RPCProcedure* /* proc */,
+ const struct NFS41::FREE_STATEID4args* /* args */,
+ const struct NFS41::FREE_STATEID4res* res)
+{
+ if(res) _nfsV41Stat.free_stateidOpsAmount++;
+}
+
+void JsonAnalyzer::get_dir_delegation41(const RPCProcedure* /* proc */,
+ const struct NFS41::GET_DIR_DELEGATION4args* /* args */,
+ const struct NFS41::GET_DIR_DELEGATION4res* res)
+{
+ if(res) _nfsV41Stat.get_dir_delegationOpsAmount++;
+}
+
+void JsonAnalyzer::getdeviceinfo41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETDEVICEINFO4args* /* args */,
+ const struct NFS41::GETDEVICEINFO4res* res)
+{
+ if(res) _nfsV41Stat.getdeviceinfoOpsAmount++;
+}
+
+void JsonAnalyzer::getdevicelist41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETDEVICELIST4args* /* args */,
+ const struct NFS41::GETDEVICELIST4res* res)
+{
+ if(res) _nfsV41Stat.getdevicelistOpsAmount++;
+}
+
+void JsonAnalyzer::layoutcommit41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTCOMMIT4args* /* args */,
+ const struct NFS41::LAYOUTCOMMIT4res* res)
+{
+ if(res) _nfsV41Stat.layoutcommitOpsAmount++;
+}
+
+void JsonAnalyzer::layoutget41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTGET4args* /* args */,
+ const struct NFS41::LAYOUTGET4res* res)
+{
+ if(res) _nfsV41Stat.layoutgetOpsAmount++;
+}
+
+void JsonAnalyzer::layoutreturn41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTRETURN4args* /* args */,
+ const struct NFS41::LAYOUTRETURN4res* res)
+{
+ if(res) _nfsV41Stat.layoutreturnOpsAmount++;
+}
+
+void JsonAnalyzer::secinfo_no_name41(const RPCProcedure* /* proc */,
+ const NFS41::SECINFO_NO_NAME4args* /* args */,
+ const NFS41::SECINFO_NO_NAME4res* res)
+{
+ if(res) _nfsV41Stat.secinfo_no_nameOpsAmount++;
+}
+
+void JsonAnalyzer::sequence41(const RPCProcedure* /* proc */,
+ const struct NFS41::SEQUENCE4args* /* args */,
+ const struct NFS41::SEQUENCE4res* res)
+{
+ if(res) _nfsV41Stat.sequenceOpsAmount++;
+}
+
+void JsonAnalyzer::set_ssv41(const RPCProcedure* /* proc */,
+ const struct NFS41::SET_SSV4args* /* args */,
+ const struct NFS41::SET_SSV4res* res)
+{
+ if(res) _nfsV41Stat.set_ssvOpsAmount++;
+}
+
+void JsonAnalyzer::test_stateid41(const RPCProcedure* /* proc */,
+ const struct NFS41::TEST_STATEID4args* /* args */,
+ const struct NFS41::TEST_STATEID4res* res)
+{
+ if(res) _nfsV41Stat.test_stateidOpsAmount++;
+}
+
+void JsonAnalyzer::want_delegation41(const RPCProcedure* /* proc */,
+ const struct NFS41::WANT_DELEGATION4args* /* args */,
+ const struct NFS41::WANT_DELEGATION4res* res)
+{
+ if(res) _nfsV41Stat.want_delegationOpsAmount++;
+}
+
+void JsonAnalyzer::destroy_clientid41(const RPCProcedure* /* proc */,
+ const struct NFS41::DESTROY_CLIENTID4args* /* args */,
+ const struct NFS41::DESTROY_CLIENTID4res* res)
+{
+ if(res) _nfsV41Stat.destroy_clientidOpsAmount++;
+}
+
+void JsonAnalyzer::reclaim_complete41(const RPCProcedure* /* proc */,
+ const struct NFS41::RECLAIM_COMPLETE4args* /* args */,
+ const struct NFS41::RECLAIM_COMPLETE4res* res)
+{
+ if(res) _nfsV41Stat.reclaim_completeOpsAmount++;
+}
+
+void JsonAnalyzer::illegal41(const RPCProcedure* /* proc */,
+ const struct NFS41::ILLEGAL4res* res)
+{
+ if(res) _nfsV41Stat.illegalOpsAmount++;
+}
+
+void JsonAnalyzer::flush_statistics()
+{
+}
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/json_analyzer.h b/analyzers/src/json/json_analyzer.h
new file mode 100644
index 0000000..ca7eed3
--- /dev/null
+++ b/analyzers/src/json/json_analyzer.h
@@ -0,0 +1,586 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: JSON analyzer class declaration
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef JSON_ANALYZER_H
+#define JSON_ANALYZER_H
+//------------------------------------------------------------------------------
+#include <atomic>
+
+#include "api/ianalyzer.h"
+#include "json_tcp_service.h"
+//------------------------------------------------------------------------------
+using namespace NST::API;
+
+class JsonAnalyzer : public IAnalyzer
+{
+public:
+ struct NfsV3Stat
+ {
+ // Procedures:
+ std::atomic_int nullProcsAmount = {0};
+ std::atomic_int getattrProcsAmount = {0};
+ std::atomic_int setattrProcsAmount = {0};
+ std::atomic_int lookupProcsAmount = {0};
+ std::atomic_int accessProcsAmount = {0};
+ std::atomic_int readlinkProcsAmount = {0};
+ std::atomic_int readProcsAmount = {0};
+ std::atomic_int writeProcsAmount = {0};
+ std::atomic_int createProcsAmount = {0};
+ std::atomic_int mkdirProcsAmount = {0};
+ std::atomic_int symlinkProcsAmount = {0};
+ std::atomic_int mknodProcsAmount = {0};
+ std::atomic_int removeProcsAmount = {0};
+ std::atomic_int rmdirProcsAmount = {0};
+ std::atomic_int renameProcsAmount = {0};
+ std::atomic_int linkProcsAmount = {0};
+ std::atomic_int readdirProcsAmount = {0};
+ std::atomic_int readdirplusProcsAmount = {0};
+ std::atomic_int fsstatProcsAmount = {0};
+ std::atomic_int fsinfoProcsAmount = {0};
+ std::atomic_int pathconfProcsAmount = {0};
+ std::atomic_int commitProcsAmount = {0};
+ };
+ struct NfsV40Stat
+ {
+ // Procedures:
+ std::atomic_int nullProcsAmount = {0};
+ std::atomic_int compoundProcsAmount = {0};
+
+ // Operations:
+ std::atomic_int accessOpsAmount = {0};
+ std::atomic_int closeOpsAmount = {0};
+ std::atomic_int commitOpsAmount = {0};
+ std::atomic_int createOpsAmount = {0};
+ std::atomic_int delegpurgeOpsAmount = {0};
+ std::atomic_int delegreturnOpsAmount = {0};
+ std::atomic_int getattrOpsAmount = {0};
+ std::atomic_int getfhOpsAmount = {0};
+ std::atomic_int linkOpsAmount = {0};
+ std::atomic_int lockOpsAmount = {0};
+ std::atomic_int locktOpsAmount = {0};
+ std::atomic_int lockuOpsAmount = {0};
+ std::atomic_int lookupOpsAmount = {0};
+ std::atomic_int lookuppOpsAmount = {0};
+ std::atomic_int nverifyOpsAmount = {0};
+ std::atomic_int openOpsAmount = {0};
+ std::atomic_int openattrOpsAmount = {0};
+ std::atomic_int open_confirmOpsAmount = {0};
+ std::atomic_int open_downgradeOpsAmount = {0};
+ std::atomic_int putfhOpsAmount = {0};
+ std::atomic_int putpubfhOpsAmount = {0};
+ std::atomic_int putrootfhOpsAmount = {0};
+ std::atomic_int readOpsAmount = {0};
+ std::atomic_int readdirOpsAmount = {0};
+ std::atomic_int readlinkOpsAmount = {0};
+ std::atomic_int removeOpsAmount = {0};
+ std::atomic_int renameOpsAmount = {0};
+ std::atomic_int renewOpsAmount = {0};
+ std::atomic_int restorefhOpsAmount = {0};
+ std::atomic_int savefhOpsAmount = {0};
+ std::atomic_int secinfoOpsAmount = {0};
+ std::atomic_int setattrOpsAmount = {0};
+ std::atomic_int setclientidOpsAmount = {0};
+ std::atomic_int setclientid_confirmOpsAmount = {0};
+ std::atomic_int verifyOpsAmount = {0};
+ std::atomic_int writeOpsAmount = {0};
+ std::atomic_int release_lockownerOpsAmount = {0};
+ std::atomic_int get_dir_delegationOpsAmount = {0};
+ std::atomic_int illegalOpsAmount = {0};
+ };
+ struct NfsV41Stat
+ {
+ // Procedures:
+ std::atomic_int nullProcsAmount = {0};
+ std::atomic_int compoundProcsAmount = {0};
+
+ // Operations:
+ std::atomic_int accessOpsAmount = {0};
+ std::atomic_int closeOpsAmount = {0};
+ std::atomic_int commitOpsAmount = {0};
+ std::atomic_int createOpsAmount = {0};
+ std::atomic_int delegpurgeOpsAmount = {0};
+ std::atomic_int delegreturnOpsAmount = {0};
+ std::atomic_int getattrOpsAmount = {0};
+ std::atomic_int getfhOpsAmount = {0};
+ std::atomic_int linkOpsAmount = {0};
+ std::atomic_int lockOpsAmount = {0};
+ std::atomic_int locktOpsAmount = {0};
+ std::atomic_int lockuOpsAmount = {0};
+ std::atomic_int lookupOpsAmount = {0};
+ std::atomic_int lookuppOpsAmount = {0};
+ std::atomic_int nverifyOpsAmount = {0};
+ std::atomic_int openOpsAmount = {0};
+ std::atomic_int openattrOpsAmount = {0};
+ std::atomic_int open_confirmOpsAmount = {0};
+ std::atomic_int open_downgradeOpsAmount = {0};
+ std::atomic_int putfhOpsAmount = {0};
+ std::atomic_int putpubfhOpsAmount = {0};
+ std::atomic_int putrootfhOpsAmount = {0};
+ std::atomic_int readOpsAmount = {0};
+ std::atomic_int readdirOpsAmount = {0};
+ std::atomic_int readlinkOpsAmount = {0};
+ std::atomic_int removeOpsAmount = {0};
+ std::atomic_int renameOpsAmount = {0};
+ std::atomic_int renewOpsAmount = {0};
+ std::atomic_int restorefhOpsAmount = {0};
+ std::atomic_int savefhOpsAmount = {0};
+ std::atomic_int secinfoOpsAmount = {0};
+ std::atomic_int setattrOpsAmount = {0};
+ std::atomic_int setclientidOpsAmount = {0};
+ std::atomic_int setclientid_confirmOpsAmount = {0};
+ std::atomic_int verifyOpsAmount = {0};
+ std::atomic_int writeOpsAmount = {0};
+ std::atomic_int release_lockownerOpsAmount = {0};
+ std::atomic_int backchannel_ctlOpsAmount = {0};
+ std::atomic_int bind_conn_to_sessionOpsAmount = {0};
+ std::atomic_int exchange_idOpsAmount = {0};
+ std::atomic_int create_sessionOpsAmount = {0};
+ std::atomic_int destroy_sessionOpsAmount = {0};
+ std::atomic_int free_stateidOpsAmount = {0};
+ std::atomic_int get_dir_delegationOpsAmount = {0};
+ std::atomic_int getdeviceinfoOpsAmount = {0};
+ std::atomic_int getdevicelistOpsAmount = {0};
+ std::atomic_int layoutcommitOpsAmount = {0};
+ std::atomic_int layoutgetOpsAmount = {0};
+ std::atomic_int layoutreturnOpsAmount = {0};
+ std::atomic_int secinfo_no_nameOpsAmount = {0};
+ std::atomic_int sequenceOpsAmount = {0};
+ std::atomic_int set_ssvOpsAmount = {0};
+ std::atomic_int test_stateidOpsAmount = {0};
+ std::atomic_int want_delegationOpsAmount = {0};
+ std::atomic_int destroy_clientidOpsAmount = {0};
+ std::atomic_int reclaim_completeOpsAmount = {0};
+ std::atomic_int illegalOpsAmount = {0};
+ };
+
+ JsonAnalyzer(std::size_t workersAmount, int port, const std::string& host, std::size_t maxServingDurationMs, int backlog);
+ ~JsonAnalyzer();
+
+ // NFSv3 procedures
+
+ void null(const RPCProcedure* /*proc*/,
+ const struct NFS3::NULL3args* /*args*/,
+ const struct NFS3::NULL3res* /*res*/) override final;
+
+ void getattr3(const RPCProcedure* /*proc*/,
+ const struct NFS3::GETATTR3args* /*args*/,
+ const struct NFS3::GETATTR3res* /*res*/) override final;
+
+ void setattr3(const RPCProcedure* /*proc*/,
+ const struct NFS3::SETATTR3args* /*args*/,
+ const struct NFS3::SETATTR3res* /*res*/) override final;
+
+ void lookup3(const RPCProcedure* /*proc*/,
+ const struct NFS3::LOOKUP3args* /*args*/,
+ const struct NFS3::LOOKUP3res* /*res*/) override final;
+
+ void access3(const RPCProcedure* /*proc*/,
+ const struct NFS3::ACCESS3args* /*args*/,
+ const struct NFS3::ACCESS3res* /*res*/) override final;
+
+ void readlink3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READLINK3args* /*args*/,
+ const struct NFS3::READLINK3res* /*res*/) override final;
+
+ void read3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READ3args* /*args*/,
+ const struct NFS3::READ3res* /*res*/) override final;
+
+ void write3(const RPCProcedure* /*proc*/,
+ const struct NFS3::WRITE3args* /*args*/,
+ const struct NFS3::WRITE3res* /*res*/) override final;
+
+ void create3(const RPCProcedure* /*proc*/,
+ const struct NFS3::CREATE3args* /*args*/,
+ const struct NFS3::CREATE3res* /*res*/) override final;
+
+ void mkdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::MKDIR3args* /*args*/,
+ const struct NFS3::MKDIR3res* /*res*/) override final;
+
+ void symlink3(const RPCProcedure* /*proc*/,
+ const struct NFS3::SYMLINK3args* /*args*/,
+ const struct NFS3::SYMLINK3res* /*res*/) override final;
+
+ void mknod3(const RPCProcedure* /*proc*/,
+ const struct NFS3::MKNOD3args* /*args*/,
+ const struct NFS3::MKNOD3res* /*res*/) override final;
+
+ void remove3(const RPCProcedure* /*proc*/,
+ const struct NFS3::REMOVE3args* /*args*/,
+ const struct NFS3::REMOVE3res* /*res*/) override final;
+
+ void rmdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::RMDIR3args* /*args*/,
+ const struct NFS3::RMDIR3res* /*res*/) override final;
+
+ void rename3(const RPCProcedure* /*proc*/,
+ const struct NFS3::RENAME3args* /*args*/,
+ const struct NFS3::RENAME3res* /*res*/) override final;
+
+ void link3(const RPCProcedure* /*proc*/,
+ const struct NFS3::LINK3args* /*args*/,
+ const struct NFS3::LINK3res* /*res*/) override final;
+
+ void readdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READDIR3args* /*args*/,
+ const struct NFS3::READDIR3res* /*res*/) override final;
+
+ void readdirplus3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READDIRPLUS3args* /*args*/,
+ const struct NFS3::READDIRPLUS3res* /*res*/) override final;
+
+ void fsstat3(const RPCProcedure* /*proc*/,
+ const struct NFS3::FSSTAT3args* /*args*/,
+ const struct NFS3::FSSTAT3res* /*res*/) override final;
+
+ void fsinfo3(const RPCProcedure* /*proc*/,
+ const struct NFS3::FSINFO3args* /*args*/,
+ const struct NFS3::FSINFO3res* /*res*/) override final;
+
+ void pathconf3(const RPCProcedure* /*proc*/,
+ const struct NFS3::PATHCONF3args* /*args*/,
+ const struct NFS3::PATHCONF3res* /*res*/) override final;
+
+ void commit3(const RPCProcedure* /*proc*/,
+ const struct NFS3::COMMIT3args* /*args*/,
+ const struct NFS3::COMMIT3res* /*res*/) override final;
+
+ // NFS4.0 procedures
+
+ void null4(const RPCProcedure* /*proc*/,
+ const struct NFS4::NULL4args* /*args*/,
+ const struct NFS4::NULL4res* /*res*/) override final;
+
+ void compound4(const RPCProcedure* /*proc*/,
+ const struct NFS4::COMPOUND4args* /*args*/,
+ const struct NFS4::COMPOUND4res* /*res*/) override final;
+
+ // NFS4.0 operations
+
+ void access40(const RPCProcedure* /* proc */,
+ const struct NFS4::ACCESS4args* /* args */,
+ const struct NFS4::ACCESS4res* res) override final;
+ void close40(const RPCProcedure* /* proc */,
+ const struct NFS4::CLOSE4args* /* args */,
+ const struct NFS4::CLOSE4res* res) override final;
+ void commit40(const RPCProcedure* /* proc */,
+ const struct NFS4::COMMIT4args* /* args */,
+ const struct NFS4::COMMIT4res* res) override final;
+ void create40(const RPCProcedure* /* proc */,
+ const struct NFS4::CREATE4args* /* args */,
+ const struct NFS4::CREATE4res* res) override final;
+ void delegpurge40(const RPCProcedure* /* proc */,
+ const struct NFS4::DELEGPURGE4args* /* args */,
+ const struct NFS4::DELEGPURGE4res* res) override final;
+ void delegreturn40(const RPCProcedure* /* proc */,
+ const struct NFS4::DELEGRETURN4args* /* args */,
+ const struct NFS4::DELEGRETURN4res* res) override final;
+ void getattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::GETATTR4args* /* args */,
+ const struct NFS4::GETATTR4res* res) override final;
+ void getfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::GETFH4res* res) override final;
+ void link40(const RPCProcedure* /* proc */,
+ const struct NFS4::LINK4args* /* args */,
+ const struct NFS4::LINK4res* res) override final;
+ void lock40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCK4args* /* args */,
+ const struct NFS4::LOCK4res* res) override final;
+ void lockt40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCKT4args* /* args */,
+ const struct NFS4::LOCKT4res* res) override final;
+ void locku40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCKU4args* /* args */,
+ const struct NFS4::LOCKU4res* res) override final;
+ void lookup40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOOKUP4args* /* args */,
+ const struct NFS4::LOOKUP4res* res) override final;
+ void lookupp40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOOKUPP4res* res) override final;
+ void nverify40(const RPCProcedure* /* proc */,
+ const struct NFS4::NVERIFY4args* /* args */,
+ const struct NFS4::NVERIFY4res* res) override final;
+ void open40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN4args* /* args */,
+ const struct NFS4::OPEN4res* res) override final;
+ void openattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPENATTR4args* /* args */,
+ const struct NFS4::OPENATTR4res* res) override final;
+ void open_confirm40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN_CONFIRM4args* /* args */,
+ const struct NFS4::OPEN_CONFIRM4res* res) override final;
+ void open_downgrade40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN_DOWNGRADE4args* /* args */,
+ const struct NFS4::OPEN_DOWNGRADE4res* res) override final;
+ void putfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTFH4args* /* args */,
+ const struct NFS4::PUTFH4res* res) override final;
+ void putpubfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTPUBFH4res* res) override final;
+ void putrootfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTROOTFH4res* res) override final;
+ void read40(const RPCProcedure* /* proc */,
+ const struct NFS4::READ4args* /* args */,
+ const struct NFS4::READ4res* res) override final;
+ void readdir40(const RPCProcedure* /* proc */,
+ const struct NFS4::READDIR4args* /* args */,
+ const struct NFS4::READDIR4res* res) override final;
+ void readlink40(const RPCProcedure* /* proc */,
+ const struct NFS4::READLINK4res* res) override final;
+ void remove40(const RPCProcedure* /* proc */,
+ const struct NFS4::REMOVE4args* /* args */,
+ const struct NFS4::REMOVE4res* res) override final;
+ void rename40(const RPCProcedure* /* proc */,
+ const struct NFS4::RENAME4args* /* args */,
+ const struct NFS4::RENAME4res* res) override final;
+ void renew40(const RPCProcedure* /* proc */,
+ const struct NFS4::RENEW4args* /* args */,
+ const struct NFS4::RENEW4res* res) override final;
+ void restorefh40(const RPCProcedure* /* proc */,
+ const struct NFS4::RESTOREFH4res* res) override final;
+ void savefh40(const RPCProcedure* /* proc */,
+ const struct NFS4::SAVEFH4res* res) override final;
+ void secinfo40(const RPCProcedure* /* proc */,
+ const struct NFS4::SECINFO4args* /* args */,
+ const struct NFS4::SECINFO4res* res) override final;
+ void setattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETATTR4args* /* args */,
+ const struct NFS4::SETATTR4res* res) override final;
+ void setclientid40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETCLIENTID4args* /* args */,
+ const struct NFS4::SETCLIENTID4res* res) override final;
+ void setclientid_confirm40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETCLIENTID_CONFIRM4args* /* args */,
+ const struct NFS4::SETCLIENTID_CONFIRM4res* res) override final;
+ void verify40(const RPCProcedure* /* proc */,
+ const struct NFS4::VERIFY4args* /* args */,
+ const struct NFS4::VERIFY4res* res) override final;
+ void write40(const RPCProcedure* /* proc */,
+ const struct NFS4::WRITE4args* /* args */,
+ const struct NFS4::WRITE4res* res) override final;
+ void release_lockowner40(const RPCProcedure* /* proc */,
+ const struct NFS4::RELEASE_LOCKOWNER4args* /* args */,
+ const struct NFS4::RELEASE_LOCKOWNER4res* res) override final;
+ void get_dir_delegation40(const RPCProcedure* /* proc */,
+ const struct NFS4::GET_DIR_DELEGATION4args* /* args */,
+ const struct NFS4::GET_DIR_DELEGATION4res* res) override final;
+ void illegal40(const RPCProcedure* /* proc */,
+ const struct NFS4::ILLEGAL4res* res) override final;
+
+ // NFSv4.1 procedures
+
+ void compound41(const RPCProcedure* /*proc*/,
+ const struct NFS41::COMPOUND4args* /*args*/,
+ const struct NFS41::COMPOUND4res* /*res*/) override final;
+
+ // NFSv4.1 operations
+
+ void access41(const RPCProcedure* /* proc */,
+ const struct NFS41::ACCESS4args* /* args */,
+ const struct NFS41::ACCESS4res* res) override final;
+ void close41(const RPCProcedure* /* proc */,
+ const struct NFS41::CLOSE4args* /* args */,
+ const struct NFS41::CLOSE4res* res) override final;
+ void commit41(const RPCProcedure* /* proc */,
+ const struct NFS41::COMMIT4args* /* args */,
+ const struct NFS41::COMMIT4res* res) override final;
+ void create41(const RPCProcedure* /* proc */,
+ const struct NFS41::CREATE4args* /* args */,
+ const struct NFS41::CREATE4res* res) override final;
+ void delegpurge41(const RPCProcedure* /* proc */,
+ const struct NFS41::DELEGPURGE4args* /* args */,
+ const struct NFS41::DELEGPURGE4res* res) override final;
+ void delegreturn41(const RPCProcedure* /* proc */,
+ const struct NFS41::DELEGRETURN4args* /* args */,
+ const struct NFS41::DELEGRETURN4res* res) override final;
+ void getattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETATTR4args* /* args */,
+ const struct NFS41::GETATTR4res* res) override final;
+ void getfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETFH4res* res) override final;
+ void link41(const RPCProcedure* /* proc */,
+ const struct NFS41::LINK4args* /* args */,
+ const struct NFS41::LINK4res* res) override final;
+ void lock41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCK4args* /* args */,
+ const struct NFS41::LOCK4res* res) override final;
+ void lockt41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCKT4args* /* args */,
+ const struct NFS41::LOCKT4res* res) override final;
+ void locku41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCKU4args* /* args */,
+ const struct NFS41::LOCKU4res* res) override final;
+ void lookup41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOOKUP4args* /* args */,
+ const struct NFS41::LOOKUP4res* res) override final;
+ void lookupp41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOOKUPP4res* res) override final;
+ void nverify41(const RPCProcedure* /* proc */,
+ const struct NFS41::NVERIFY4args* /* args */,
+ const struct NFS41::NVERIFY4res* res) override final;
+ void open41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN4args* /* args */,
+ const struct NFS41::OPEN4res* res) override final;
+ void openattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPENATTR4args* /* args */,
+ const struct NFS41::OPENATTR4res* res) override final;
+ void open_confirm41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN_CONFIRM4args* /* args */,
+ const struct NFS41::OPEN_CONFIRM4res* res) override final;
+ void open_downgrade41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN_DOWNGRADE4args* /* args */,
+ const struct NFS41::OPEN_DOWNGRADE4res* res) override final;
+ void putfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTFH4args* /* args */,
+ const struct NFS41::PUTFH4res* res) override final;
+ void putpubfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTPUBFH4res* res) override final;
+ void putrootfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTROOTFH4res* res) override final;
+ void read41(const RPCProcedure* /* proc */,
+ const struct NFS41::READ4args* /* args */,
+ const struct NFS41::READ4res* res) override final;
+ void readdir41(const RPCProcedure* /* proc */,
+ const struct NFS41::READDIR4args* /* args */,
+ const struct NFS41::READDIR4res* res) override final;
+ void readlink41(const RPCProcedure* /* proc */,
+ const struct NFS41::READLINK4res* res) override final;
+ void remove41(const RPCProcedure* /* proc */,
+ const struct NFS41::REMOVE4args* /* args */,
+ const struct NFS41::REMOVE4res* res) override final;
+ void rename41(const RPCProcedure* /* proc */,
+ const struct NFS41::RENAME4args* /* args */,
+ const struct NFS41::RENAME4res* res) override final;
+ void renew41(const RPCProcedure* /* proc */,
+ const struct NFS41::RENEW4args* /* args */,
+ const struct NFS41::RENEW4res* res) override final;
+ void restorefh41(const RPCProcedure* /* proc */,
+ const struct NFS41::RESTOREFH4res* res) override final;
+ void savefh41(const RPCProcedure* /* proc */,
+ const struct NFS41::SAVEFH4res* res) override final;
+ void secinfo41(const RPCProcedure* /* proc */,
+ const struct NFS41::SECINFO4args* /* args */,
+ const struct NFS41::SECINFO4res* res) override final;
+ void setattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETATTR4args* /* args */,
+ const struct NFS41::SETATTR4res* res) override final;
+ void setclientid41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETCLIENTID4args* /* args */,
+ const struct NFS41::SETCLIENTID4res* res) override final;
+ void setclientid_confirm41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETCLIENTID_CONFIRM4args* /* args */,
+ const struct NFS41::SETCLIENTID_CONFIRM4res* res) override final;
+ void verify41(const RPCProcedure* /* proc */,
+ const struct NFS41::VERIFY4args* /* args */,
+ const struct NFS41::VERIFY4res* res) override final;
+ void write41(const RPCProcedure* /* proc */,
+ const struct NFS41::WRITE4args* /* args */,
+ const struct NFS41::WRITE4res* res) override final;
+ void release_lockowner41(const RPCProcedure* /* proc */,
+ const struct NFS41::RELEASE_LOCKOWNER4args* /* args */,
+ const struct NFS41::RELEASE_LOCKOWNER4res* res) override final;
+ void backchannel_ctl41(const RPCProcedure* /* proc */,
+ const struct NFS41::BACKCHANNEL_CTL4args* /* args */,
+ const struct NFS41::BACKCHANNEL_CTL4res* res) override final;
+ void bind_conn_to_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::BIND_CONN_TO_SESSION4args* /* args */,
+ const struct NFS41::BIND_CONN_TO_SESSION4res* res) override final;
+ void exchange_id41(const RPCProcedure* /* proc */,
+ const struct NFS41::EXCHANGE_ID4args* /* args */,
+ const struct NFS41::EXCHANGE_ID4res* res) override final;
+ void create_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::CREATE_SESSION4args* /* args */,
+ const struct NFS41::CREATE_SESSION4res* res) override final;
+ void destroy_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::DESTROY_SESSION4args* /* args */,
+ const struct NFS41::DESTROY_SESSION4res* res) override final;
+ void free_stateid41(const RPCProcedure* /* proc */,
+ const struct NFS41::FREE_STATEID4args* /* args */,
+ const struct NFS41::FREE_STATEID4res* res) override final;
+ void get_dir_delegation41(const RPCProcedure* /* proc */,
+ const struct NFS41::GET_DIR_DELEGATION4args* /* args */,
+ const struct NFS41::GET_DIR_DELEGATION4res* res) override final;
+ void getdeviceinfo41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETDEVICEINFO4args* /* args */,
+ const struct NFS41::GETDEVICEINFO4res* res) override final;
+ void getdevicelist41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETDEVICELIST4args* /* args */,
+ const struct NFS41::GETDEVICELIST4res* res) override final;
+ void layoutcommit41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTCOMMIT4args* /* args */,
+ const struct NFS41::LAYOUTCOMMIT4res* res) override final;
+ void layoutget41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTGET4args* /* args */,
+ const struct NFS41::LAYOUTGET4res* res) override final;
+ void layoutreturn41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTRETURN4args* /* args */,
+ const struct NFS41::LAYOUTRETURN4res* res) override final;
+ void secinfo_no_name41(const RPCProcedure* /* proc */,
+ const NFS41::SECINFO_NO_NAME4args* /* args */,
+ const NFS41::SECINFO_NO_NAME4res* res) override final;
+ void sequence41(const RPCProcedure* /* proc */,
+ const struct NFS41::SEQUENCE4args* /* args */,
+ const struct NFS41::SEQUENCE4res* res) override final;
+ void set_ssv41(const RPCProcedure* /* proc */,
+ const struct NFS41::SET_SSV4args* /* args */,
+ const struct NFS41::SET_SSV4res* res) override final;
+ void test_stateid41(const RPCProcedure* /* proc */,
+ const struct NFS41::TEST_STATEID4args* /* args */,
+ const struct NFS41::TEST_STATEID4res* res) override final;
+ void want_delegation41(const RPCProcedure* /* proc */,
+ const struct NFS41::WANT_DELEGATION4args* /* args */,
+ const struct NFS41::WANT_DELEGATION4res* res) override final;
+ void destroy_clientid41(const RPCProcedure* /* proc */,
+ const struct NFS41::DESTROY_CLIENTID4args* /* args */,
+ const struct NFS41::DESTROY_CLIENTID4res* res) override final;
+ void reclaim_complete41(const RPCProcedure* /* proc */,
+ const struct NFS41::RECLAIM_COMPLETE4args* /* args */,
+ const struct NFS41::RECLAIM_COMPLETE4res* res) override final;
+ void illegal41(const RPCProcedure* /* proc */,
+ const struct NFS41::ILLEGAL4res* res) override final;
+
+ void flush_statistics() override final;
+
+ inline const NfsV3Stat& getNfsV3Stat() const
+ {
+ return _nfsV3Stat;
+ }
+
+ inline const NfsV40Stat& getNfsV40Stat() const
+ {
+ return _nfsV40Stat;
+ }
+
+ inline const NfsV41Stat& getNfsV41Stat() const
+ {
+ return _nfsV41Stat;
+ }
+
+private:
+ JsonTcpService _jsonTcpService;
+ NfsV3Stat _nfsV3Stat;
+ NfsV40Stat _nfsV40Stat;
+ NfsV41Stat _nfsV41Stat;
+};
+//------------------------------------------------------------------------------
+#endif//JSON_ANALYZER_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/json_plugin.cpp b/analyzers/src/json/json_plugin.cpp
new file mode 100644
index 0000000..8eace3c
--- /dev/null
+++ b/analyzers/src/json/json_plugin.cpp
@@ -0,0 +1,123 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: JSON analyzer plugin
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "api/plugin_api.h" // include plugin development definitions
+#include "json_analyzer.h"
+//------------------------------------------------------------------------------
+
+static constexpr int DefaultPort = 8888;
+static constexpr const char * DefaultHost = IpEndpoint::WildcardAddress;
+static constexpr std::size_t DefaultWorkersAmount = 10U;
+static constexpr int DefaultBacklog = 15;
+static constexpr std::size_t DefaultMaxServingDurationMs = 500U;
+
+extern "C"
+{
+
+ const char* usage()
+ {
+ return "host - Network interface to listen (default is to listen all interfaces)\n"
+ "port - IP-port to bind to (default is 8888)\n"
+ "workers - Amount of worker threads (default is 10)\n"
+ "duration - Max serving duration in milliseconds (default is 500 ms)\n"
+ "backlog - Listen backlog (default is 15)";
+ }
+
+ IAnalyzer* create(const char* opts)
+ {
+ // Initializing plugin options with default values
+ int backlog = DefaultBacklog;
+ std::size_t maxServingDurationMs = DefaultMaxServingDurationMs;
+ std::string host{DefaultHost};
+ int port = DefaultPort;
+ std::size_t workersAmount = DefaultWorkersAmount;
+ // Parising plugin options
+ enum
+ {
+ BACKLOG_SUBOPT_INDEX = 0,
+ DURATION_SUBOPT_INDEX,
+ HOST_SUBOPT_INDEX,
+ PORT_SUBOPT_INDEX,
+ WORKERS_SUBOPT_INDEX
+ };
+ char backlogSubOptName[] = "backlog";
+ char durationSubOptName[] = "duration";
+ char hostSubOptName[] = "host";
+ char portSubOptName[] = "port";
+ char workersSubOptName[] = "workers";
+ char* const tokens[] =
+ {
+ backlogSubOptName,
+ durationSubOptName,
+ hostSubOptName,
+ portSubOptName,
+ workersSubOptName,
+ NULL
+ };
+ std::size_t optsLen = strlen(opts);
+ std::vector<char> optsBuf{opts, opts + optsLen + 2};
+ char* optionp = &optsBuf[0];
+ char* valuep;
+ int optIndex;
+ while ((optIndex = getsubopt(&optionp, tokens, &valuep)) >= 0)
+ {
+ try
+ {
+ switch (optIndex)
+ {
+ case BACKLOG_SUBOPT_INDEX:
+ backlog = std::stoi(valuep);
+ break;
+ case DURATION_SUBOPT_INDEX:
+ maxServingDurationMs = std::stoul(valuep);
+ break;
+ case HOST_SUBOPT_INDEX:
+ host = valuep;
+ break;
+ case PORT_SUBOPT_INDEX:
+ port = std::stoi(valuep);
+ break;
+ case WORKERS_SUBOPT_INDEX:
+ workersAmount = std::stoul(valuep);
+ break;
+ default:
+ throw std::runtime_error{std::string{"Invalid suboption index: "} + std::to_string(optIndex)};
+ }
+ }
+ catch (std::logic_error& e)
+ {
+ throw std::runtime_error{std::string{"Invalid value provided for '"} + tokens[optIndex] + "' suboption"};
+ }
+ }
+ // Creating and returning plugin
+ return new JsonAnalyzer{workersAmount, port, host, maxServingDurationMs, backlog};
+ }
+
+ void destroy(IAnalyzer* instance)
+ {
+ delete instance;
+ }
+
+ NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy, nullptr)
+
+} //extern "C"
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/json_tcp_service.cpp b/analyzers/src/json/json_tcp_service.cpp
new file mode 100644
index 0000000..2e4cc30
--- /dev/null
+++ b/analyzers/src/json/json_tcp_service.cpp
@@ -0,0 +1,239 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: JSON analyzer TCP-service definition
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <chrono>
+
+#include <json.h>
+
+#include "json_analyzer.h"
+#include "json_tcp_service.h"
+#include "utils/log.h"
+//------------------------------------------------------------------------------
+
+JsonTcpService::JsonTcpService(JsonAnalyzer& analyzer, std::size_t workersAmount, int port, const std::string& host,
+ std::size_t maxServingDurationMs, int backlog) :
+ AbstractTcpService{workersAmount, port, host, backlog},
+ _analyzer(analyzer),
+ _maxServingDurationMs{maxServingDurationMs}
+{}
+
+AbstractTcpService::AbstractTask* JsonTcpService::createTask(int socket)
+{
+ return new Task(*this, socket);
+}
+
+//------------------------------------------------------------------------------
+
+JsonTcpService::Task::Task(JsonTcpService& service, int socket) :
+ AbstractTask{socket},
+ _service(service)
+{}
+
+void JsonTcpService::Task::execute()
+{
+ std::chrono::system_clock::time_point servingStarted = std::chrono::system_clock::now();
+ // Composing JSON with statistics
+ struct json_object* root = json_object_new_object();
+ struct json_object* nfsV3Stat = json_object_new_object();
+ // NFS3 procedures:
+ json_object_object_add(nfsV3Stat, "null", json_object_new_int64(_service._analyzer.getNfsV3Stat().nullProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "getattr", json_object_new_int64(_service._analyzer.getNfsV3Stat().getattrProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "setattr", json_object_new_int64(_service._analyzer.getNfsV3Stat().setattrProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "lookup", json_object_new_int64(_service._analyzer.getNfsV3Stat().lookupProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "access", json_object_new_int64(_service._analyzer.getNfsV3Stat().accessProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "readlink", json_object_new_int64(_service._analyzer.getNfsV3Stat().readlinkProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "read", json_object_new_int64(_service._analyzer.getNfsV3Stat().readProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "write", json_object_new_int64(_service._analyzer.getNfsV3Stat().writeProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "create", json_object_new_int64(_service._analyzer.getNfsV3Stat().createProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "mkdir", json_object_new_int64(_service._analyzer.getNfsV3Stat().mkdirProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "symlink", json_object_new_int64(_service._analyzer.getNfsV3Stat().symlinkProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "mkdnod", json_object_new_int64(_service._analyzer.getNfsV3Stat().mknodProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "remove", json_object_new_int64(_service._analyzer.getNfsV3Stat().removeProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "rmdir", json_object_new_int64(_service._analyzer.getNfsV3Stat().rmdirProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "rename", json_object_new_int64(_service._analyzer.getNfsV3Stat().renameProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "link", json_object_new_int64(_service._analyzer.getNfsV3Stat().linkProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "readdir", json_object_new_int64(_service._analyzer.getNfsV3Stat().readdirProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "readdirplus", json_object_new_int64(_service._analyzer.getNfsV3Stat().readdirplusProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "fsstat", json_object_new_int64(_service._analyzer.getNfsV3Stat().fsstatProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "fsinfo", json_object_new_int64(_service._analyzer.getNfsV3Stat().fsinfoProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "pathconf", json_object_new_int64(_service._analyzer.getNfsV3Stat().pathconfProcsAmount.load()));
+ json_object_object_add(nfsV3Stat, "commit", json_object_new_int64(_service._analyzer.getNfsV3Stat().commitProcsAmount.load()));
+ json_object_object_add(root, "nfs_v3", nfsV3Stat);
+ struct json_object* nfsV40Stat = json_object_new_object();
+ // NFS4.0 procedures:
+ json_object_object_add(nfsV40Stat, "null", json_object_new_int64(_service._analyzer.getNfsV40Stat().nullProcsAmount.load()));
+ json_object_object_add(nfsV40Stat, "compound", json_object_new_int64(_service._analyzer.getNfsV40Stat().compoundProcsAmount.load()));
+ // NFS4.0 operations:
+ json_object_object_add(nfsV40Stat, "access", json_object_new_int64(_service._analyzer.getNfsV40Stat().accessOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "close", json_object_new_int64(_service._analyzer.getNfsV40Stat().closeOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "commit", json_object_new_int64(_service._analyzer.getNfsV40Stat().commitOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "create", json_object_new_int64(_service._analyzer.getNfsV40Stat().createOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "delegpurge", json_object_new_int64(_service._analyzer.getNfsV40Stat().delegpurgeOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "delegreturn", json_object_new_int64(_service._analyzer.getNfsV40Stat().delegreturnOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "getattr", json_object_new_int64(_service._analyzer.getNfsV40Stat().getattrOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "getfh", json_object_new_int64(_service._analyzer.getNfsV40Stat().getfhOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "link", json_object_new_int64(_service._analyzer.getNfsV40Stat().linkOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "lock", json_object_new_int64(_service._analyzer.getNfsV40Stat().lockOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "lockt", json_object_new_int64(_service._analyzer.getNfsV40Stat().locktOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "locku", json_object_new_int64(_service._analyzer.getNfsV40Stat().lockuOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "lookup", json_object_new_int64(_service._analyzer.getNfsV40Stat().lookupOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "lookupp", json_object_new_int64(_service._analyzer.getNfsV40Stat().lookuppOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "nverify", json_object_new_int64(_service._analyzer.getNfsV40Stat().nverifyOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "open", json_object_new_int64(_service._analyzer.getNfsV40Stat().openOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "openattr", json_object_new_int64(_service._analyzer.getNfsV40Stat().openattrOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "open_confirm", json_object_new_int64(_service._analyzer.getNfsV40Stat().open_confirmOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "open_downgrade", json_object_new_int64(_service._analyzer.getNfsV40Stat().open_downgradeOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "putfh", json_object_new_int64(_service._analyzer.getNfsV40Stat().putfhOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "putpubfh", json_object_new_int64(_service._analyzer.getNfsV40Stat().putpubfhOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "putrootfh", json_object_new_int64(_service._analyzer.getNfsV40Stat().putrootfhOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "read", json_object_new_int64(_service._analyzer.getNfsV40Stat().readOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "readdir", json_object_new_int64(_service._analyzer.getNfsV40Stat().readdirOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "readlink", json_object_new_int64(_service._analyzer.getNfsV40Stat().readlinkOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "remove", json_object_new_int64(_service._analyzer.getNfsV40Stat().removeOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "rename", json_object_new_int64(_service._analyzer.getNfsV40Stat().renameOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "renew", json_object_new_int64(_service._analyzer.getNfsV40Stat().renewOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "restorefh", json_object_new_int64(_service._analyzer.getNfsV40Stat().restorefhOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "savefh", json_object_new_int64(_service._analyzer.getNfsV40Stat().savefhOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "secinfo", json_object_new_int64(_service._analyzer.getNfsV40Stat().secinfoOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "setattr", json_object_new_int64(_service._analyzer.getNfsV40Stat().setattrOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "setclientid", json_object_new_int64(_service._analyzer.getNfsV40Stat().setclientidOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "setclientid_confirm", json_object_new_int64(_service._analyzer.getNfsV40Stat().setclientid_confirmOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "verify", json_object_new_int64(_service._analyzer.getNfsV40Stat().verifyOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "write", json_object_new_int64(_service._analyzer.getNfsV40Stat().writeOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "release_lockowner", json_object_new_int64(_service._analyzer.getNfsV40Stat().release_lockownerOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "get_dir_delegation", json_object_new_int64(_service._analyzer.getNfsV40Stat().get_dir_delegationOpsAmount.load()));
+ json_object_object_add(nfsV40Stat, "illegal", json_object_new_int64(_service._analyzer.getNfsV40Stat().illegalOpsAmount.load()));
+ json_object_object_add(root, "nfs_v40", nfsV40Stat);
+ struct json_object* nfsV41Stat = json_object_new_object();
+ // NFS4.1 procedures:
+ json_object_object_add(nfsV41Stat, "null", json_object_new_int64(_service._analyzer.getNfsV41Stat().nullProcsAmount.load()));
+ json_object_object_add(nfsV41Stat, "compound", json_object_new_int64(_service._analyzer.getNfsV41Stat().compoundProcsAmount.load()));
+ // NFS4.1 operations:
+ json_object_object_add(nfsV41Stat, "access", json_object_new_int64(_service._analyzer.getNfsV41Stat().accessOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "close", json_object_new_int64(_service._analyzer.getNfsV41Stat().closeOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "commit", json_object_new_int64(_service._analyzer.getNfsV41Stat().commitOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "create", json_object_new_int64(_service._analyzer.getNfsV41Stat().createOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "delegpurge", json_object_new_int64(_service._analyzer.getNfsV41Stat().delegpurgeOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "delegreturn", json_object_new_int64(_service._analyzer.getNfsV41Stat().delegreturnOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "getattr", json_object_new_int64(_service._analyzer.getNfsV41Stat().getattrOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "getfh", json_object_new_int64(_service._analyzer.getNfsV41Stat().getfhOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "link", json_object_new_int64(_service._analyzer.getNfsV41Stat().linkOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "lock", json_object_new_int64(_service._analyzer.getNfsV41Stat().lockOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "lockt", json_object_new_int64(_service._analyzer.getNfsV41Stat().locktOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "locku", json_object_new_int64(_service._analyzer.getNfsV41Stat().lockuOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "lookup", json_object_new_int64(_service._analyzer.getNfsV41Stat().lookupOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "lookupp", json_object_new_int64(_service._analyzer.getNfsV41Stat().lookuppOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "nverify", json_object_new_int64(_service._analyzer.getNfsV41Stat().nverifyOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "open", json_object_new_int64(_service._analyzer.getNfsV41Stat().openOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "openattr", json_object_new_int64(_service._analyzer.getNfsV41Stat().openattrOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "open_confirm", json_object_new_int64(_service._analyzer.getNfsV41Stat().open_confirmOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "open_downgrade", json_object_new_int64(_service._analyzer.getNfsV41Stat().open_downgradeOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "putfh", json_object_new_int64(_service._analyzer.getNfsV41Stat().putfhOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "putpubfh", json_object_new_int64(_service._analyzer.getNfsV41Stat().putpubfhOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "putrootfh", json_object_new_int64(_service._analyzer.getNfsV41Stat().putrootfhOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "read", json_object_new_int64(_service._analyzer.getNfsV41Stat().readOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "readdir", json_object_new_int64(_service._analyzer.getNfsV41Stat().readdirOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "readlink", json_object_new_int64(_service._analyzer.getNfsV41Stat().readlinkOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "remove", json_object_new_int64(_service._analyzer.getNfsV41Stat().removeOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "rename", json_object_new_int64(_service._analyzer.getNfsV41Stat().renameOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "renew", json_object_new_int64(_service._analyzer.getNfsV41Stat().renewOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "restorefh", json_object_new_int64(_service._analyzer.getNfsV41Stat().restorefhOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "savefh", json_object_new_int64(_service._analyzer.getNfsV41Stat().savefhOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "secinfo", json_object_new_int64(_service._analyzer.getNfsV41Stat().secinfoOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "setattr", json_object_new_int64(_service._analyzer.getNfsV41Stat().setattrOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "setclientid", json_object_new_int64(_service._analyzer.getNfsV41Stat().setclientidOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "setclientid_confirm", json_object_new_int64(_service._analyzer.getNfsV41Stat().setclientid_confirmOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "verify", json_object_new_int64(_service._analyzer.getNfsV41Stat().verifyOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "write", json_object_new_int64(_service._analyzer.getNfsV41Stat().writeOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "release_lockowner", json_object_new_int64(_service._analyzer.getNfsV41Stat().release_lockownerOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "backchannel_ctl", json_object_new_int64(_service._analyzer.getNfsV41Stat().backchannel_ctlOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "bind_conn_to_session", json_object_new_int64(_service._analyzer.getNfsV41Stat().bind_conn_to_sessionOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "exchange_id", json_object_new_int64(_service._analyzer.getNfsV41Stat().exchange_idOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "create_session", json_object_new_int64(_service._analyzer.getNfsV41Stat().create_sessionOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "destroy_session", json_object_new_int64(_service._analyzer.getNfsV41Stat().destroy_sessionOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "free_stateid", json_object_new_int64(_service._analyzer.getNfsV41Stat().free_stateidOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "get_dir_delegation", json_object_new_int64(_service._analyzer.getNfsV41Stat().get_dir_delegationOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "getdeviceinfo", json_object_new_int64(_service._analyzer.getNfsV41Stat().getdeviceinfoOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "getdevicelist", json_object_new_int64(_service._analyzer.getNfsV41Stat().getdevicelistOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "layoutcommit", json_object_new_int64(_service._analyzer.getNfsV41Stat().layoutcommitOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "layoutget", json_object_new_int64(_service._analyzer.getNfsV41Stat().layoutgetOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "layoutreturn", json_object_new_int64(_service._analyzer.getNfsV41Stat().layoutreturnOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "secinfo_no_name", json_object_new_int64(_service._analyzer.getNfsV41Stat().secinfo_no_nameOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "sequence", json_object_new_int64(_service._analyzer.getNfsV41Stat().sequenceOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "set_ssv", json_object_new_int64(_service._analyzer.getNfsV41Stat().set_ssvOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "test_stateid", json_object_new_int64(_service._analyzer.getNfsV41Stat().test_stateidOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "want_delegation", json_object_new_int64(_service._analyzer.getNfsV41Stat().want_delegationOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "destroy_clientid", json_object_new_int64(_service._analyzer.getNfsV41Stat().destroy_clientidOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "reclaim_complete", json_object_new_int64(_service._analyzer.getNfsV41Stat().reclaim_completeOpsAmount.load()));
+ json_object_object_add(nfsV41Stat, "illegal", json_object_new_int64(_service._analyzer.getNfsV41Stat().illegalOpsAmount.load()));
+ json_object_object_add(root, "nfs_v41", nfsV41Stat);
+ std::string json(json_object_to_json_string_ext(root, JSON_C_TO_STRING_PRETTY));
+ json_object_put(root);
+
+ // Sending JSON to the client
+ std::size_t totalBytesSent = 0U;
+ while (totalBytesSent < json.length())
+ {
+ if (!_service.isRunning())
+ {
+ LOG("WARNING: Service shutdown detected - terminating task execution");
+ return;
+ }
+ if (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - servingStarted).count() >
+ static_cast<std::chrono::milliseconds::rep>(_service._maxServingDurationMs))
+ {
+ // TODO: Use general logging
+ LOG("WARNING: A client is too slow - terminating task execution");
+ return;
+ }
+ struct timespec writeDuration;
+ AbstractTcpService::fillDuration(writeDuration);
+ fd_set writeDescriptorsSet;
+ FD_ZERO(&writeDescriptorsSet);
+ FD_SET(socket(), &writeDescriptorsSet);
+ int descriptorsCount = pselect(socket() + 1, NULL, &writeDescriptorsSet, NULL, &writeDuration, NULL);
+ if (descriptorsCount < 0)
+ {
+ throw std::system_error{errno, std::system_category(), "Error awaiting for sending data availability on socket"};
+ }
+ else if (descriptorsCount == 0)
+ {
+ // Timeout expired
+ continue;
+ }
+ ssize_t bytesSent = send(socket(), json.data() + totalBytesSent, json.length() - totalBytesSent, MSG_NOSIGNAL);
+ if (bytesSent < 0)
+ {
+ std::system_error e{errno, std::system_category(), "Sending data to client error"};
+ LOG("WARNING: %s", e.what());
+ return;
+ }
+ else if (bytesSent == 0)
+ {
+ LOG("WARNING: Connection has been aborted by client while sending data");
+ return;
+ }
+ totalBytesSent += bytesSent;
+ }
+ LOG("INFO: Serving of client has been completed");
+}
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/json/json_tcp_service.h b/analyzers/src/json/json_tcp_service.h
new file mode 100644
index 0000000..1403a6f
--- /dev/null
+++ b/analyzers/src/json/json_tcp_service.h
@@ -0,0 +1,52 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: JSON analyzer TCP-service declaration
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef JSON_TCP_SERVICE_H
+#define JSON_TCP_SERVICE_H
+//------------------------------------------------------------------------------
+#include "abstract_tcp_service.h"
+//------------------------------------------------------------------------------
+class JsonTcpService : public AbstractTcpService
+{
+public:
+ JsonTcpService() = delete;
+ JsonTcpService(class JsonAnalyzer& analyzer, std::size_t workersAmount, int port, const std::string& host,
+ std::size_t maxServingDurationMs, int backlog);
+private:
+ class Task : public AbstractTask
+ {
+ public:
+ Task(JsonTcpService& service, int socket);
+ Task() = delete;
+
+ void execute() override final;
+ private:
+ JsonTcpService& _service;
+ };
+
+ AbstractTask* createTask(int socket) override final;
+
+ JsonAnalyzer& _analyzer;
+ std::size_t _maxServingDurationMs;
+};
+//------------------------------------------------------------------------------
+#endif//JSON_TCP_SERVICE_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/ofdws/file_rw_op.cpp b/analyzers/src/ofdws/file_rw_op.cpp
deleted file mode 100644
index d828bb2..0000000
--- a/analyzers/src/ofdws/file_rw_op.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Hash-table hold info about read/write operations.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include "file_rw_op.h"
-//------------------------------------------------------------------------------
-uint32_t FileRWOp::block_size {0};
-uint32_t FileRWOp::bucket_size {0};
-
-FileRWOp::~FileRWOp()
-{
- Iterator i = buckets.begin();
- Iterator end = buckets.end();
- for(; i != end; ++i)
- delete [] i->second;
-}
-
-void FileRWOp::calculate(ProcEnumNFS3::NFSProcedure op, uint64_t o, uint32_t c, uint32_t)
-{
- if(op == ProcEnumNFS3::READ)
- read_total += c;
- else
- write_total += c;
-
- uint64_t bl_ind = o / block_size;
- uint64_t bl_end = (o + c) / block_size;
- if((o + c) % block_size)
- ++bl_end;
-
- uint64_t b_ind = bl_ind / bucket_size;
- uint64_t b_end = bl_end / bucket_size;
- if(bl_end % bucket_size)
- ++b_end;
-
- for(uint64_t bl_cur = bl_ind; b_ind < b_end; ++b_ind)
- {
- Iterator it = buckets.find(b_ind);
- if(it == buckets.end())
- {
- Inserted ins = buckets.insert(Pair(b_ind, new RWTime[bucket_size]));
- if(ins.second == false)
- throw int();
- it = ins.first;
- }
- RWTime* bucket = it->second;
-
- uint64_t start = bl_cur % bucket_size;
- uint64_t end = bucket_size;
- if(bl_cur / bucket_size == b_end - 1)
- {
- end = bl_end % bucket_size;
- if(!end)
- end = bucket_size;
- }
- if(op == ProcEnumNFS3::READ)
- for(uint64_t i = start; i < end; ++i)
- bucket[i].inc_read_freq();
- else
- for(uint64_t i = start; i < end; ++i)
- bucket[i].inc_write_freq();
- bl_cur += end - start;
- }
-}
-//------------------------------------------------------------------------------
diff --git a/analyzers/src/ofdws/file_rw_op.h b/analyzers/src/ofdws/file_rw_op.h
deleted file mode 100644
index c8fda12..0000000
--- a/analyzers/src/ofdws/file_rw_op.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Hash-table hold info about read/write operations.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#ifndef FILE_RW_OP_H
-#define FILE_RW_OP_H
-//------------------------------------------------------------------------------
-#include <vector>
-#include <unordered_map>
-
-#include <api/plugin_api.h>
-//------------------------------------------------------------------------------
-class FileRWOp
-{
-public:
- class RWTime
- {
- public:
- RWTime() : read_freq{0}, write_freq{0} {}
-
- inline void inc_read_freq(uint32_t count = 1) { read_freq += count; }
- inline void inc_write_freq(uint32_t count = 1) { write_freq += count; }
-
- inline uint32_t get_read_freq() const { return read_freq; }
- inline uint32_t get_write_freq() const { return write_freq; }
- inline uint32_t get_total_freq() const { return read_freq + write_freq; }
- private:
- RWTime(const RWTime&);
- void operator=(const RWTime&);
-
- uint32_t read_freq;
- uint32_t write_freq;
- };
-
- typedef std::unordered_map<uint64_t, RWTime*> BucketTable;
- typedef BucketTable::const_iterator ConstIterator;
- typedef BucketTable::iterator Iterator;
- typedef BucketTable::value_type Pair;
- typedef std::pair<Iterator, bool> Inserted;
-
- inline FileRWOp() : read_total{0}, write_total{0} {}
- ~FileRWOp();
-
- void calculate(ProcEnumNFS3::NFSProcedure op,
- uint64_t offset,
- uint32_t count,
- uint32_t time = 0);
-
- inline uint64_t get_read_total() const { return read_total; }
- inline uint64_t get_write_total() const { return write_total; }
- inline uint64_t get_total() const { return read_total + write_total; }
-
- inline Iterator begin() { return buckets.begin(); }
- inline Iterator end() { return buckets.end(); }
- inline ConstIterator begin() const { return buckets.begin(); }
- inline ConstIterator end() const { return buckets.end(); }
-
- static inline uint32_t get_block_size() { return block_size; }
- static inline uint32_t get_bucket_size() { return bucket_size; }
-
- static inline void set_block_size(uint32_t bl_s) { block_size = bl_s; }
- static inline void set_bucket_size(uint32_t b_s) { bucket_size = b_s; }
-
-private:
- FileRWOp(const FileRWOp&);
- void operator=(const FileRWOp&);
-
- BucketTable buckets;
- uint64_t read_total;
- uint64_t write_total;
- static uint32_t block_size;
- static uint32_t bucket_size;
-};
-//------------------------------------------------------------------------------
-#endif//FILE_RW_OP_H
-//------------------------------------------------------------------------------
diff --git a/analyzers/src/ofdws/ofdws_analyzer.cpp b/analyzers/src/ofdws/ofdws_analyzer.cpp
deleted file mode 100644
index b9e679a..0000000
--- a/analyzers/src/ofdws/ofdws_analyzer.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Overall File Data Working Set (OFDWS) analyzer. Provide information about unique data accessed.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include <algorithm> //std::sort
-#include <cstdlib>
-#include <fstream> //std::ofstream
-#include <vector>
-
-#include "ofdws_analyzer.h"
-//------------------------------------------------------------------------------
-OFDWSAnalyzer::OFDWSAnalyzer(int32_t bl_size,
- int32_t bu_size)
-: read_total{0}
-, write_total{0}
-, out(std::cout)
-
-{
- FileRWOp::set_block_size(bl_size * 1024);
- FileRWOp::set_bucket_size(bu_size);
-}
-
-OFDWSAnalyzer::~OFDWSAnalyzer()
-{
- Iterator i = ofdws_stat.begin();
- Iterator end = ofdws_stat.end();
- for(; i != end; ++i)
- delete i->second;
-}
-
-void OFDWSAnalyzer::read3(const struct RPCProcedure*,
- const struct rpcgen::READ3args* args,
- const struct rpcgen::READ3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- read_total += res->READ3res_u.resok.count;
-
- Iterator i = get_file_rw_op(args->file);
- i->second->calculate(ProcEnumNFS3::READ, args->offset, res->READ3res_u.resok.count);
- }
-}
-
-void OFDWSAnalyzer::write3(const struct RPCProcedure*,
- const struct rpcgen::WRITE3args* args,
- const struct rpcgen::WRITE3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- write_total += res->WRITE3res_u.resok.count;
-
- Iterator i = get_file_rw_op(args->file);
- i->second->calculate(ProcEnumNFS3::WRITE, args->offset, res->WRITE3res_u.resok.count);
- }
-}
-
-void OFDWSAnalyzer::flush_statistics()
-{
- out << "### OFDWS Analyzer ###" << std::endl;
- out << "Read total: " << read_total << " Write total: " << write_total << std::endl;
- if(read_total != 0 || write_total != 0)
- {
- out << "File ranked:\n";
- print_file_ranked(out);
- out << "Once accessed: ";
- print_data_usage(out);
- store_files_rw_records();
- }
-}
-
-void OFDWSAnalyzer::store_files_rw_records() const
-{
- ConstIterator i = ofdws_stat.begin();
- ConstIterator i_end = ofdws_stat.end();
- std::ofstream fout;
- for(; i != i_end; ++i)
- {
- std::string fh = i->first.to_string();
- fout.open(fh.c_str(), std::ios_base::out | std::ios_base::trunc);
- print_rw_records(fout, *i->second);
- fout.close();
- }
-}
-
-void OFDWSAnalyzer::print_rw_records(std::ostream& out, const FileRWOp& file_rw_op) const
-{
- FileRWOp::ConstIterator j = file_rw_op.begin();
- FileRWOp::ConstIterator j_end = file_rw_op.end();
- for(; j != j_end; ++j)
- {
- uint64_t offset = j->first;
- FileRWOp::RWTime* bucket = j->second;
- for(uint32_t k = 0; k < FileRWOp::get_bucket_size(); ++k)
- out << offset * FileRWOp::get_bucket_size() + k << ' ' << bucket[k].get_total_freq() << '\n';
- }
-}
-
-void OFDWSAnalyzer::print_data_usage(std::ostream& out) const
-{
- uint64_t once {0};
- uint64_t mult {0}; // mult = multiple
- uint32_t used {0};
- ConstIterator i = ofdws_stat.begin();
- ConstIterator i_end = ofdws_stat.end();
- for(; i != i_end; ++i)
- {
- FileRWOp::ConstIterator j = i->second->begin();
- FileRWOp::ConstIterator j_end = i->second->end();
- for(; j != j_end; ++j)
- {
- FileRWOp::RWTime* bucket = j->second;
- for(uint32_t k = 0; k < FileRWOp::get_bucket_size(); ++k)
- {
- used = bucket[k].get_read_freq() + bucket[k].get_write_freq();
- if(used > 0)
- {
- if(used == 1)
- ++once;
- else
- ++mult;
- }
- }
- }
- }
- out.precision(2);
- out << std::fixed << float(once)/(once + mult) * 100 << '%' << std::endl;
-}
-
-void OFDWSAnalyzer::print_file_ranked(std::ostream& out) const
-{
- uint32_t size = ofdws_stat.size();
- std::vector< ConstIterator > v(size);
- ConstIterator i = ofdws_stat.begin();
- ConstIterator end = ofdws_stat.end();
- for(uint32_t j = 0; i != end; ++i, ++j)
- v[j] = i;
- std::sort(v.begin(), v.end(), const_iterator_comp);
- for(uint32_t j = size; j > 0; --j)
- out << v[j-1]->first << ' ' << v[j-1]->second->get_read_total() << ' ' << v[j-1]->second->get_write_total() << '\n';
-}
-
-OFDWSAnalyzer::Iterator OFDWSAnalyzer::get_file_rw_op(const rpcgen::nfs_fh3& key)
-{
- Iterator i = ofdws_stat.find(key);
- if(i == ofdws_stat.end())
- {
- Inserted ins = ofdws_stat.insert(Pair(key, new FileRWOp()));
- if(ins.second == false)
- throw int();
- i = ins.first;
- }
- return i;
-}
-
-extern "C"
-{
-
-const char* usage()
-{
- return "bu_size - for specifying amount of buckets. Range: 1..32767 [16 by default]\n"
- "bl_size - for specifying block size [KB]. Range: 1..31 [8 by default]";
-}
-
-IAnalyzer* create(const char* optarg)
-{
- enum
- {
- bu_size = 0,
- bl_size
- };
- const char* token[] = {
- "bu_size",
- "bl_size",
- NULL
- };
-
- char* value {NULL};
- int32_t bucket_size = g_def_bu_size;
- int32_t block_size = g_def_bl_size;
- while (*optarg != '\0')
- {
- int supopt = getsubopt((char**)&optarg, (char**)token, &value);
- if(value == NULL)
- return NULL;
-
- switch(supopt)
- {
- case bu_size:
- bucket_size = atoi(value);
- if(bucket_size < 1 || block_size > 32767)
- return NULL;
- break;
-
- case bl_size:
- block_size = atoi(value);
- if(block_size < 1 || block_size > 31)
- return NULL;
- break;
-
- default:
- return NULL;
- }
- value = NULL;
- }
- return new OFDWSAnalyzer(bucket_size, block_size);
-}
-
-void destroy(IAnalyzer* instance)
-{
- delete instance;
-}
-
-NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy)
-
-}
-//------------------------------------------------------------------------------
diff --git a/analyzers/src/ofdws/ofdws_analyzer.h b/analyzers/src/ofdws/ofdws_analyzer.h
deleted file mode 100644
index f8b7c16..0000000
--- a/analyzers/src/ofdws/ofdws_analyzer.h
+++ /dev/null
@@ -1,154 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Overall File Data Working Set (OFDWS) analyzer. Provide information about unique data accessed.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#ifndef OFDWS_ANALYZER_H
-#define OFDWS_ANALYZER_H
-//------------------------------------------------------------------------------
-#include <cstring>
-#include <unordered_map>
-
-#include "file_rw_op.h"
-//------------------------------------------------------------------------------
-static const int32_t g_def_bl_size {8}; // [KB]
-static const int32_t g_def_bu_size {16};
-
-struct FH
-{
- uint32_t len {};
- char data[rpcgen::NFS3_FHSIZE];
-
- struct FH_Eq
- {
- bool operator()(const FH& a, const FH& b) const;
- };
- struct FH_Hash
- {
- int operator()(const FH& fh) const;
- };
-
- inline FH(const rpcgen::nfs_fh3& obj)
- {
- len = obj.data.data_len;
- memcpy(data, obj.data.data_val, len);
- }
- inline FH(const FH& obj)
- {
- len = obj.len;
- memcpy(data, obj.data, len);
- }
- std::string to_string() const;
-
- friend std::ostream& operator<<(std::ostream& out, const FH& obj);
-
-
-private:
- static inline char to_char(uint8_t hex)
- {
- if(hex < 0xA)
- return hex + '0';
- else
- return hex + 'a' - 0xA;
- }
-};
-
-inline int FH::FH_Hash::operator()(const FH& fh) const
-{
- int hash = 0;
- for(uint32_t i = 0; i < fh.len; ++i)
- hash += fh.data[i];
- return hash;
-}
-
-inline bool FH::FH_Eq::operator()(const FH& a, const FH& b) const
-{
- if(a.len != b.len)
- return false;
-
- for(uint32_t i = 0; i < a.len; ++i)
- if(a.data[i] != b.data[i])
- return false;
- return true;
-}
-
-inline std::string FH::to_string() const
-{
- std::string str;
- str.reserve(rpcgen::NFS3_FHSIZE * 2 + 1); // One byte holds two symbols.
- for(uint32_t i = 0; i < len; ++i)
- {
- str += to_char((data[i] >> 4) & 0xf);
- str += to_char(data[i] & 0xf);
- }
- return str;
-}
-
-inline std::ostream& operator<<(std::ostream& out, const FH& fh)
-{
- print_nfs_fh(out, fh.data, fh.len);
- return out;
-}
-
-class OFDWSAnalyzer : public IAnalyzer
-{
- typedef std::unordered_map<FH, FileRWOp*, FH::FH_Hash, FH::FH_Eq> OFDWS;
- typedef OFDWS::const_iterator ConstIterator;
- typedef OFDWS::iterator Iterator;
- typedef OFDWS::value_type Pair;
- typedef std::pair<Iterator, bool> Inserted;
-
- struct ConstIterator_Comp
- {
- inline bool operator()(const ConstIterator& a, const ConstIterator& b) const
- {
- return (a->second->get_total() < b->second->get_total());
- }
- } const_iterator_comp;
-
-public:
- OFDWSAnalyzer(int32_t bl_size,
- int32_t bu_size);
- virtual ~OFDWSAnalyzer();
-
- void read3(const struct RPCProcedure* proc,
- const struct rpcgen::READ3args* args,
- const struct rpcgen::READ3res* res) override final;
- void write3(const struct RPCProcedure* proc,
- const struct rpcgen::WRITE3args* args,
- const struct rpcgen::WRITE3res* res) override final;
-
- virtual void flush_statistics();
-
-private:
- Iterator get_file_rw_op(const rpcgen::nfs_fh3& key);
- void print_file_ranked(std::ostream& out) const;
- void print_data_usage(std::ostream& out) const;
- void print_rw_records(std::ostream& out,
- const FileRWOp& file_rw_op) const;
- void store_files_rw_records() const;
-
- OFDWS ofdws_stat;
- uint64_t read_total;
- uint64_t write_total;
- std::ostream& out;
-};
-//------------------------------------------------------------------------------
-#endif//OFDWS_ANALYZER_H
-//------------------------------------------------------------------------------
diff --git a/analyzers/src/ofws/ofws_analyzer.cpp b/analyzers/src/ofws/ofws_analyzer.cpp
deleted file mode 100644
index a85371c..0000000
--- a/analyzers/src/ofws/ofws_analyzer.cpp
+++ /dev/null
@@ -1,350 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Overall File Working Set (OFWS) analyzer. Enumerate the overall set of files accessed by clients.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include <algorithm>
-#include <vector>
-
-#include "ofws_analyzer.h"
-//------------------------------------------------------------------------------
-OFWSAnalyzer::~OFWSAnalyzer()
-{
- Iterator i = ofws_stat.begin();
- Iterator end = ofws_stat.end();
- for(; i != end;)
- {
- delete i->second;
- i = ofws_stat.erase(i);
- }
-}
-
-void OFWSAnalyzer::getattr3(const RPCProcedure*,
- const struct rpcgen::GETATTR3args* args,
- const struct rpcgen::GETATTR3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->object);
- (*i->second).inc(ProcEnumNFS3::GETATTR);
- }
-}
-
-void OFWSAnalyzer::setattr3(const RPCProcedure*,
- const struct rpcgen::SETATTR3args* args,
- const struct rpcgen::SETATTR3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->object);
- (*i->second).inc(ProcEnumNFS3::SETATTR);
- }
-}
-
-void OFWSAnalyzer::lookup3(const RPCProcedure*,
- const struct rpcgen::LOOKUP3args*,
- const struct rpcgen::LOOKUP3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(res->LOOKUP3res_u.resok.object);
- (*i->second).inc(ProcEnumNFS3::LOOKUP);
- }
-}
-
-void OFWSAnalyzer::access3(const struct RPCProcedure*,
- const struct rpcgen::ACCESS3args* args,
- const struct rpcgen::ACCESS3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->object);
- (*i->second).inc(ProcEnumNFS3::ACCESS);
- }
-}
-
-void OFWSAnalyzer::readlink3(const struct RPCProcedure*,
- const struct rpcgen::READLINK3args* args,
- const struct rpcgen::READLINK3res* res)
-{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->symlink);
- (*i->second).inc(ProcEnumNFS3::READLINK);
- }
-}
-
-void OFWSAnalyzer::read3(const struct RPCProcedure*,
- const struct rpcgen::READ3args* args,
- const struct rpcgen::READ3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->file);
- (*i->second).inc(ProcEnumNFS3::READ);
- }
-}
-
-void OFWSAnalyzer::write3(const struct RPCProcedure*,
- const struct rpcgen::WRITE3args* args,
- const struct rpcgen::WRITE3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->file);
- (*i->second).inc(ProcEnumNFS3::WRITE);
- }
-}
-
-void OFWSAnalyzer::create3(const struct RPCProcedure*,
- const struct rpcgen::CREATE3args*,
- const struct rpcgen::CREATE3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- if(res->CREATE3res_u.resok.obj.handle_follows)
- {
- Iterator i = find_or_create_op_counter(res->CREATE3res_u.resok.obj.post_op_fh3_u.handle);
- (*i->second).inc(ProcEnumNFS3::CREATE);
- }
- }
-}
-
-void OFWSAnalyzer::mkdir3(const struct RPCProcedure*,
- const struct rpcgen::MKDIR3args*,
- const struct rpcgen::MKDIR3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- if(res->MKDIR3res_u.resok.obj.handle_follows)
- {
- Iterator i = find_or_create_op_counter(res->MKDIR3res_u.resok.obj.post_op_fh3_u.handle);
- (*i->second).inc(ProcEnumNFS3::MKDIR);
- }
- }
-}
-
-void OFWSAnalyzer::symlink3(const struct RPCProcedure*,
- const struct rpcgen::SYMLINK3args*,
- const struct rpcgen::SYMLINK3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- if(res->SYMLINK3res_u.resok.obj.handle_follows)
- {
- Iterator i = find_or_create_op_counter(res->SYMLINK3res_u.resok.obj.post_op_fh3_u.handle);
- (*i->second).inc(ProcEnumNFS3::SYMLINK);
- }
- }
-}
-
-void OFWSAnalyzer::mknod3(const struct RPCProcedure*,
- const struct rpcgen::MKNOD3args*,
- const struct rpcgen::MKNOD3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- if(res->MKNOD3res_u.resok.obj.handle_follows)
- {
- Iterator i = find_or_create_op_counter(res->MKNOD3res_u.resok.obj.post_op_fh3_u.handle);
- (*i->second).inc(ProcEnumNFS3::MKNOD);
- }
- }
-}
-
-void OFWSAnalyzer::remove3(const struct RPCProcedure*,
- const struct rpcgen::REMOVE3args* args,
- const struct rpcgen::REMOVE3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->object.dir);
- (*i->second).inc(ProcEnumNFS3::REMOVE);
- }
-}
-
-void OFWSAnalyzer::rmdir3(const struct RPCProcedure*,
- const struct rpcgen::RMDIR3args* args,
- const struct rpcgen::RMDIR3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->object.dir);
- (*i->second).inc(ProcEnumNFS3::RMDIR);
- }
-}
-
-void OFWSAnalyzer::rename3(const struct RPCProcedure*,
- const struct rpcgen::RENAME3args* args,
- const struct rpcgen::RENAME3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->from.dir);
- (*i->second).inc(ProcEnumNFS3::RENAME);
- }
-}
-
-void OFWSAnalyzer::link3(const struct RPCProcedure*,
- const struct rpcgen::LINK3args* args,
- const struct rpcgen::LINK3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->file);
- (*i->second).inc(ProcEnumNFS3::LINK);
- }
-}
-
-void OFWSAnalyzer::readdir3(const struct RPCProcedure*,
- const struct rpcgen::READDIR3args* args,
- const struct rpcgen::READDIR3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->dir);
- (*i->second).inc(ProcEnumNFS3::READDIR);
- }
-}
-
-void OFWSAnalyzer::readdirplus3(const struct RPCProcedure*,
- const struct rpcgen::READDIRPLUS3args* args,
- const struct rpcgen::READDIRPLUS3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->dir);
- (*i->second).inc(ProcEnumNFS3::READDIRPLUS);
- }
-}
-
-void OFWSAnalyzer::fsstat3(const struct RPCProcedure*,
- const struct rpcgen::FSSTAT3args* args,
- const struct rpcgen::FSSTAT3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->fsroot);
- (*i->second).inc(ProcEnumNFS3::FSSTAT);
- }
-}
-
-void OFWSAnalyzer::fsinfo3(const struct RPCProcedure*,
- const struct rpcgen::FSINFO3args* args,
- const struct rpcgen::FSINFO3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->fsroot);
- (*i->second).inc(ProcEnumNFS3::FSINFO);
- }
-}
-
-void OFWSAnalyzer::pathconf3(const struct RPCProcedure*,
- const struct rpcgen::PATHCONF3args* args,
- const struct rpcgen::PATHCONF3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->object);
- (*i->second).inc(ProcEnumNFS3::PATHCONF);
- }
-}
-
-void OFWSAnalyzer::commit3(const struct RPCProcedure*,
- const struct rpcgen::COMMIT3args* args,
- const struct rpcgen::COMMIT3res* res)
-{
- if(res && res->status == rpcgen::nfsstat3::NFS3_OK)
- {
- Iterator i = find_or_create_op_counter(args->file);
- (*i->second).inc(ProcEnumNFS3::COMMIT);
- }
-}
-
-void OFWSAnalyzer::flush_statistics()
-{
- uint32_t size = ofws_stat.size();
- std::vector< Iterator > v(size);
- Iterator i = ofws_stat.begin();
- Iterator end = ofws_stat.end();
- for(uint32_t j = 0; i != end; ++i, ++j)
- {
- v[j] = i;
- }
- std::sort(v.begin(), v.end(), iterator_comp);
-
- out << "### Overall File Working Set (OFWS) analyzer ###" << std::endl;
- out << "Total number of files accessed: " << size << std::endl;
- out << "FileHandle" << ",NFS Ops";
- for(int32_t j = 0; j < ProcEnumNFS3::count; ++j)
- {
- out << ',' << print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(j));
- }
- out << '\n';
-
- for(uint32_t i = 0; i != size; ++i)
- {
- Iterator& iterator = v[i];
- const OpCounter* opcounter = iterator->second;
-
- out << iterator->first << ',' << opcounter->get_total();
- for(int32_t j = 0; j < ProcEnumNFS3::count; ++j)
- {
- out << ',' << (*opcounter)[j];
- }
- out << '\n';
- }
-}
-
-OFWSAnalyzer::Iterator OFWSAnalyzer::find_or_create_op_counter(const rpcgen::nfs_fh3& key)
-{
- Iterator i = ofws_stat.find(key);
- if(i == ofws_stat.end())
- {
- Inserted ins = ofws_stat.insert(Pair(key, new OpCounter()));
- if(ins.second == false)
- throw int();
- i = ins.first;
- }
- return i;
-}
-
-extern "C"
-{
-
-const char* usage()
-{
- return "Arguments aren't supported. TODO: add description of OFWS Analyser";
-}
-
-IAnalyzer* create(const char* /*opts*/)
-{
- return new OFWSAnalyzer();
-}
-
-void destroy(IAnalyzer* instance)
-{
- delete instance;
-}
-
-NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy)
-
-}
-//------------------------------------------------------------------------------
diff --git a/analyzers/src/ofws/ofws_analyzer.h b/analyzers/src/ofws/ofws_analyzer.h
deleted file mode 100644
index 1c1beb5..0000000
--- a/analyzers/src/ofws/ofws_analyzer.h
+++ /dev/null
@@ -1,226 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Overall File Working Set (OFWS) analyzer. Enumerate the overall set of files accessed by clients.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#ifndef OFWS_ANALYZER_H
-#define OFWS_ANALYZER_H
-//------------------------------------------------------------------------------
-#include <cstdint>
-#include <iomanip>
-#include <ostream>
-#include <cstring>
-#include <unordered_map>
-
-#include <api/plugin_api.h>
-//------------------------------------------------------------------------------
-struct FH
-{
- uint32_t len {};
- char data[rpcgen::NFS3_FHSIZE] {};
-
- struct FH_Eq
- {
- bool operator()(const FH& a, const FH& b) const;
- };
- struct FH_Hash
- {
- int operator()(const FH& fh) const;
- };
-
- inline FH(const rpcgen::nfs_fh3& obj)
- {
- len = obj.data.data_len;
- memcpy(data, obj.data.data_val, len);
- }
- inline FH(const FH& obj)
- {
- len = obj.len;
- memcpy(data, obj.data, len);
- }
- std::string to_string() const;
-
- friend std::ostream& operator<<(std::ostream& out, const FH& obj);
-
-
-private:
- static inline char to_char(uint8_t hex)
- {
- if(hex < 0xA)
- return hex + '0';
- else
- return hex + 'a' - 0xA;
- }
-};
-
-inline int FH::FH_Hash::operator()(const FH& fh) const
-{
- int hash = 0;
- for(uint32_t i = 0; i < fh.len; ++i)
- hash += fh.data[i];
- return hash;
-}
-
-inline bool FH::FH_Eq::operator()(const FH& a, const FH& b) const
-{
- if(a.len != b.len)
- return false;
-
- for(uint32_t i = 0; i < a.len; ++i)
- if(a.data[i] != b.data[i])
- return false;
- return true;
-}
-
-inline std::string FH::to_string() const
-{
- std::string str;
- str.reserve(rpcgen::NFS3_FHSIZE * 2 + 1); // One byte holds two symbols.
- for(uint32_t i = 0; i < len; ++i)
- {
- str += to_char((data[i] >> 4) & 0xf);
- str += to_char(data[i] & 0xf);
- }
- return str;
-}
-
-inline std::ostream& operator<<(std::ostream& out, const FH& fh)
-{
- print_nfs_fh(out, fh.data, fh.len);
- return out;
-}
-
-class OFWSAnalyzer : public IAnalyzer
-{
- class OpCounter
- {
- public:
- inline OpCounter() : total{0}
- {
- std::memset(counters, 0, sizeof(counters));
- }
- inline ~OpCounter() {}
- inline void inc(ProcEnumNFS3::NFSProcedure op, uint32_t size = 1)
- {
- total += size;
- counters[op] += size;
- }
- inline uint64_t get_total() const { return total; }
- inline uint32_t operator[](uint32_t op) const { return counters[op]; }
- private:
- OpCounter(const OpCounter&);
- void operator=(const OpCounter&);
-
- uint32_t counters[ProcEnumNFS3::count];
- uint64_t total;
- };
-
- typedef std::unordered_map<FH, OpCounter*, FH::FH_Hash, FH::FH_Eq> OFWS;
- typedef OFWS::value_type Pair;
- typedef OFWS::iterator Iterator;
- typedef OFWS::const_iterator ConstIterator;
- typedef std::pair<Iterator, bool> Inserted;
-
- struct Iterator_Comp
- {
- inline bool operator()(const Iterator& a, const Iterator& b) const
- {
- return (a->second->get_total() < b->second->get_total());
- }
- } iterator_comp;
-
-public:
- inline OFWSAnalyzer():out(std::cout) {}
- virtual ~OFWSAnalyzer();
-
- void getattr3(const struct RPCProcedure* proc,
- const struct rpcgen::GETATTR3args* args,
- const struct rpcgen::GETATTR3res* res) override final;
- void setattr3(const struct RPCProcedure* proc,
- const struct rpcgen::SETATTR3args* args,
- const struct rpcgen::SETATTR3res* res) override final;
- void lookup3(const struct RPCProcedure* proc,
- const struct rpcgen::LOOKUP3args* args,
- const struct rpcgen::LOOKUP3res* res) override final;
- void access3(const struct RPCProcedure* proc,
- const struct rpcgen::ACCESS3args* args,
- const struct rpcgen::ACCESS3res* res) override final;
- void readlink3(const struct RPCProcedure* proc,
- const struct rpcgen::READLINK3args* args,
- const struct rpcgen::READLINK3res* res) override final;
- void read3(const struct RPCProcedure* proc,
- const struct rpcgen::READ3args* args,
- const struct rpcgen::READ3res* res) override final;
- void write3(const struct RPCProcedure* proc,
- const struct rpcgen::WRITE3args* args,
- const struct rpcgen::WRITE3res* res) override final;
- void create3(const struct RPCProcedure* proc,
- const struct rpcgen::CREATE3args* args,
- const struct rpcgen::CREATE3res* res) override final;
- void mkdir3(const struct RPCProcedure* proc,
- const struct rpcgen::MKDIR3args* args,
- const struct rpcgen::MKDIR3res* res) override final;
- void symlink3(const struct RPCProcedure* proc,
- const struct rpcgen::SYMLINK3args* args,
- const struct rpcgen::SYMLINK3res* res) override final;
- void mknod3(const struct RPCProcedure* proc,
- const struct rpcgen::MKNOD3args* args,
- const struct rpcgen::MKNOD3res* res) override final;
- void remove3(const struct RPCProcedure* proc,
- const struct rpcgen::REMOVE3args* args,
- const struct rpcgen::REMOVE3res* res) override final;
- void rmdir3(const struct RPCProcedure* proc,
- const struct rpcgen::RMDIR3args* args,
- const struct rpcgen::RMDIR3res* res) override final;
- void rename3(const struct RPCProcedure* proc,
- const struct rpcgen::RENAME3args* args,
- const struct rpcgen::RENAME3res* res) override final;
- void link3(const struct RPCProcedure* proc,
- const struct rpcgen::LINK3args* args,
- const struct rpcgen::LINK3res* res) override final;
- void readdir3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIR3args* args,
- const struct rpcgen::READDIR3res* res) override final;
- void readdirplus3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIRPLUS3args* args,
- const struct rpcgen::READDIRPLUS3res* res) override final;
- void fsstat3(const struct RPCProcedure* proc,
- const struct rpcgen::FSSTAT3args* args,
- const struct rpcgen::FSSTAT3res* res) override final;
- void fsinfo3(const struct RPCProcedure* proc,
- const struct rpcgen::FSINFO3args* args,
- const struct rpcgen::FSINFO3res* res) override final;
- void pathconf3(const struct RPCProcedure* proc,
- const struct rpcgen::PATHCONF3args* args,
- const struct rpcgen::PATHCONF3res* res) override final;
- void commit3(const struct RPCProcedure* proc,
- const struct rpcgen::COMMIT3args* args,
- const struct rpcgen::COMMIT3res* res) override final;
-
- virtual void flush_statistics();
-
-private:
- Iterator find_or_create_op_counter(const rpcgen::nfs_fh3& key);
-
- OFWS ofws_stat;
- std::ostream& out;
-};
-//------------------------------------------------------------------------------
-#endif//OFWS_ANALYZER_H
-//------------------------------------------------------------------------------
diff --git a/analyzers/src/test/test_analyzer.cpp b/analyzers/src/test/test_analyzer.cpp
index f969199..7d7bb06 100644
--- a/analyzers/src/test/test_analyzer.cpp
+++ b/analyzers/src/test/test_analyzer.cpp
@@ -37,173 +37,752 @@ public:
std::cout << "TestAnalyzer::~TestAnalyzer()" << std::endl;
}
- void null(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::NULL3args* /*args*/,
- const struct rpcgen::NULL3res* /*res*/) override final
+ // NFSv3 procedures
+
+ void null(const RPCProcedure* /*proc*/,
+ const struct NFS3::NULL3args* /*args*/,
+ const struct NFS3::NULL3res* /*res*/) override final
{
std::cout << "TestAnalyzer::null()" << std::endl;
}
- void getattr3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::GETATTR3args* /*args*/,
- const struct rpcgen::GETATTR3res* /*res*/) override final
+ void getattr3(const RPCProcedure* /*proc*/,
+ const struct NFS3::GETATTR3args* /*args*/,
+ const struct NFS3::GETATTR3res* /*res*/) override final
{
std::cout << "TestAnalyzer::getattr3()" << std::endl;
}
- void setattr3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::SETATTR3args* /*args*/,
- const struct rpcgen::SETATTR3res* /*res*/) override final
+ void setattr3(const RPCProcedure* /*proc*/,
+ const struct NFS3::SETATTR3args* /*args*/,
+ const struct NFS3::SETATTR3res* /*res*/) override final
{
std::cout << "TestAnalyzer::setattr3()" << std::endl;
}
- void lookup3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::LOOKUP3args* /*args*/,
- const struct rpcgen::LOOKUP3res* /*res*/) override final
+ void lookup3(const RPCProcedure* /*proc*/,
+ const struct NFS3::LOOKUP3args* /*args*/,
+ const struct NFS3::LOOKUP3res* /*res*/) override final
{
std::cout << "TestAnalyzer::lookup3()" << std::endl;
}
- void access3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::ACCESS3args* /*args*/,
- const struct rpcgen::ACCESS3res* /*res*/) override final
+ void access3(const RPCProcedure* /*proc*/,
+ const struct NFS3::ACCESS3args* /*args*/,
+ const struct NFS3::ACCESS3res* /*res*/) override final
{
std::cout << "TestAnalyzer::access3()" << std::endl;
}
- void readlink3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::READLINK3args* /*args*/,
- const struct rpcgen::READLINK3res* /*res*/) override final
+ void readlink3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READLINK3args* /*args*/,
+ const struct NFS3::READLINK3res* /*res*/) override final
{
std::cout << "TestAnalyzer::readlink3()" << std::endl;
}
- void read3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::READ3args* /*args*/,
- const struct rpcgen::READ3res* /*res*/) override final
+ void read3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READ3args* /*args*/,
+ const struct NFS3::READ3res* /*res*/) override final
{
std::cout << "TestAnalyzer::read3()" << std::endl;
}
- void write3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::WRITE3args* /*args*/,
- const struct rpcgen::WRITE3res* /*res*/) override final
+ void write3(const RPCProcedure* /*proc*/,
+ const struct NFS3::WRITE3args* /*args*/,
+ const struct NFS3::WRITE3res* /*res*/) override final
{
std::cout << "TestAnalyzer::write3()" << std::endl;
}
- void create3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::CREATE3args* /*args*/,
- const struct rpcgen::CREATE3res* /*res*/) override final
+ void create3(const RPCProcedure* /*proc*/,
+ const struct NFS3::CREATE3args* /*args*/,
+ const struct NFS3::CREATE3res* /*res*/) override final
{
std::cout << "TestAnalyzer::create3()" << std::endl;
}
- void mkdir3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::MKDIR3args* /*args*/,
- const struct rpcgen::MKDIR3res* /*res*/) override final
+ void mkdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::MKDIR3args* /*args*/,
+ const struct NFS3::MKDIR3res* /*res*/) override final
{
std::cout << "TestAnalyzer::mkdir3()" << std::endl;
}
- void symlink3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::SYMLINK3args* /*args*/,
- const struct rpcgen::SYMLINK3res* /*res*/) override final
+ void symlink3(const RPCProcedure* /*proc*/,
+ const struct NFS3::SYMLINK3args* /*args*/,
+ const struct NFS3::SYMLINK3res* /*res*/) override final
{
std::cout << "TestAnalyzer::symlink3()" << std::endl;
}
- void mknod3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::MKNOD3args* /*args*/,
- const struct rpcgen::MKNOD3res* /*res*/) override final
+ void mknod3(const RPCProcedure* /*proc*/,
+ const struct NFS3::MKNOD3args* /*args*/,
+ const struct NFS3::MKNOD3res* /*res*/) override final
{
std::cout << "TestAnalyzer::mknod3()" << std::endl;
}
- void remove3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::REMOVE3args* /*args*/,
- const struct rpcgen::REMOVE3res* /*res*/) override final
+ void remove3(const RPCProcedure* /*proc*/,
+ const struct NFS3::REMOVE3args* /*args*/,
+ const struct NFS3::REMOVE3res* /*res*/) override final
{
std::cout << "TestAnalyzer::remove3()" << std::endl;
}
- void rmdir3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::RMDIR3args* /*args*/,
- const struct rpcgen::RMDIR3res* /*res*/) override final
+ void rmdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::RMDIR3args* /*args*/,
+ const struct NFS3::RMDIR3res* /*res*/) override final
{
std::cout << "TestAnalyzer::rmdir3()" << std::endl;
}
- void rename3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::RENAME3args* /*args*/,
- const struct rpcgen::RENAME3res* /*res*/) override final
+ void rename3(const RPCProcedure* /*proc*/,
+ const struct NFS3::RENAME3args* /*args*/,
+ const struct NFS3::RENAME3res* /*res*/) override final
{
std::cout << "TestAnalyzer::rename3()" << std::endl;
}
- void link3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::LINK3args* /*args*/,
- const struct rpcgen::LINK3res* /*res*/) override final
+ void link3(const RPCProcedure* /*proc*/,
+ const struct NFS3::LINK3args* /*args*/,
+ const struct NFS3::LINK3res* /*res*/) override final
{
std::cout << "TestAnalyzer::link3()" << std::endl;
}
- void readdir3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::READDIR3args* /*args*/,
- const struct rpcgen::READDIR3res* /*res*/) override final
+ void readdir3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READDIR3args* /*args*/,
+ const struct NFS3::READDIR3res* /*res*/) override final
{
std::cout << "TestAnalyzer::readdir3()" << std::endl;
}
- void readdirplus3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::READDIRPLUS3args* /*args*/,
- const struct rpcgen::READDIRPLUS3res* /*res*/) override final
+ void readdirplus3(const RPCProcedure* /*proc*/,
+ const struct NFS3::READDIRPLUS3args* /*args*/,
+ const struct NFS3::READDIRPLUS3res* /*res*/) override final
{
std::cout << "TestAnalyzer::readdirplus3()" << std::endl;
}
- void fsstat3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::FSSTAT3args* /*args*/,
- const struct rpcgen::FSSTAT3res* /*res*/) override final
+ void fsstat3(const RPCProcedure* /*proc*/,
+ const struct NFS3::FSSTAT3args* /*args*/,
+ const struct NFS3::FSSTAT3res* /*res*/) override final
{
std::cout << "TestAnalyzer::fsstat3()" << std::endl;
}
- void fsinfo3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::FSINFO3args* /*args*/,
- const struct rpcgen::FSINFO3res* /*res*/) override final
+ void fsinfo3(const RPCProcedure* /*proc*/,
+ const struct NFS3::FSINFO3args* /*args*/,
+ const struct NFS3::FSINFO3res* /*res*/) override final
{
std::cout << "TestAnalyzer::fsinfo3()" << std::endl;
}
- void pathconf3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::PATHCONF3args* /*args*/,
- const struct rpcgen::PATHCONF3res* /*res*/) override final
+ void pathconf3(const RPCProcedure* /*proc*/,
+ const struct NFS3::PATHCONF3args* /*args*/,
+ const struct NFS3::PATHCONF3res* /*res*/) override final
{
std::cout << "TestAnalyzer::pathconf3()" << std::endl;
}
- void commit3(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::COMMIT3args* /*args*/,
- const struct rpcgen::COMMIT3res* /*res*/) override final
+ void commit3(const RPCProcedure* /*proc*/,
+ const struct NFS3::COMMIT3args* /*args*/,
+ const struct NFS3::COMMIT3res* /*res*/) override final
{
std::cout << "TestAnalyzer::commit3()" << std::endl;
}
- void null(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::NULL4args* /*args*/,
- const struct rpcgen::NULL4res* /*res*/) override final
+ // NFSv4.0 procedures
+
+ void null4(const RPCProcedure* /*proc*/,
+ const struct NFS4::NULL4args* /*args*/,
+ const struct NFS4::NULL4res* /*res*/) override final
{
- std::cout << "TestAnalyzer::null()" << std::endl;
+ std::cout << "TestAnalyzer::null4()" << std::endl;
+ }
+ void compound4(const RPCProcedure* /*proc*/,
+ const struct NFS4::COMPOUND4args* /*args*/,
+ const struct NFS4::COMPOUND4res* /*res*/) override final
+ {
+ std::cout << "TestAnalyzer::compound4()" << std::endl;
+ }
+
+ // NFSv4.0 operations
+
+ void access40(const RPCProcedure* /* proc */,
+ const struct NFS4::ACCESS4args* /* args */,
+ const struct NFS4::ACCESS4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void close40(const RPCProcedure* /* proc */,
+ const struct NFS4::CLOSE4args* /* args */,
+ const struct NFS4::CLOSE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void commit40(const RPCProcedure* /* proc */,
+ const struct NFS4::COMMIT4args* /* args */,
+ const struct NFS4::COMMIT4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void create40(const RPCProcedure* /* proc */,
+ const struct NFS4::CREATE4args* /* args */,
+ const struct NFS4::CREATE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void delegpurge40(const RPCProcedure* /* proc */,
+ const struct NFS4::DELEGPURGE4args* /* args */,
+ const struct NFS4::DELEGPURGE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void delegreturn40(const RPCProcedure* /* proc */,
+ const struct NFS4::DELEGRETURN4args* /* args */,
+ const struct NFS4::DELEGRETURN4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void getattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::GETATTR4args* /* args */,
+ const struct NFS4::GETATTR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void getfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::GETFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void link40(const RPCProcedure* /* proc */,
+ const struct NFS4::LINK4args* /* args */,
+ const struct NFS4::LINK4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lock40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCK4args* /* args */,
+ const struct NFS4::LOCK4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lockt40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCKT4args* /* args */,
+ const struct NFS4::LOCKT4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void locku40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOCKU4args* /* args */,
+ const struct NFS4::LOCKU4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lookup40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOOKUP4args* /* args */,
+ const struct NFS4::LOOKUP4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lookupp40(const RPCProcedure* /* proc */,
+ const struct NFS4::LOOKUPP4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void nverify40(const RPCProcedure* /* proc */,
+ const struct NFS4::NVERIFY4args* /* args */,
+ const struct NFS4::NVERIFY4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void open40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN4args* /* args */,
+ const struct NFS4::OPEN4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void openattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPENATTR4args* /* args */,
+ const struct NFS4::OPENATTR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void open_confirm40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN_CONFIRM4args* /* args */,
+ const struct NFS4::OPEN_CONFIRM4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void open_downgrade40(const RPCProcedure* /* proc */,
+ const struct NFS4::OPEN_DOWNGRADE4args* /* args */,
+ const struct NFS4::OPEN_DOWNGRADE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void putfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTFH4args* /* args */,
+ const struct NFS4::PUTFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void putpubfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTPUBFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void putrootfh40(const RPCProcedure* /* proc */,
+ const struct NFS4::PUTROOTFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
}
- void compound4(const struct RPCProcedure* /*proc*/,
- const struct rpcgen::COMPOUND4args* /*args*/,
- const struct rpcgen::COMPOUND4res* /*res*/) override final
+ void read40(const RPCProcedure* /* proc */,
+ const struct NFS4::READ4args* /* args */,
+ const struct NFS4::READ4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void readdir40(const RPCProcedure* /* proc */,
+ const struct NFS4::READDIR4args* /* args */,
+ const struct NFS4::READDIR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void readlink40(const RPCProcedure* /* proc */,
+ const struct NFS4::READLINK4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void remove40(const RPCProcedure* /* proc */,
+ const struct NFS4::REMOVE4args* /* args */,
+ const struct NFS4::REMOVE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void rename40(const RPCProcedure* /* proc */,
+ const struct NFS4::RENAME4args* /* args */,
+ const struct NFS4::RENAME4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void renew40(const RPCProcedure* /* proc */,
+ const struct NFS4::RENEW4args* /* args */,
+ const struct NFS4::RENEW4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void restorefh40(const RPCProcedure* /* proc */,
+ const struct NFS4::RESTOREFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void savefh40(const RPCProcedure* /* proc */,
+ const struct NFS4::SAVEFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void secinfo40(const RPCProcedure* /* proc */,
+ const struct NFS4::SECINFO4args* /* args */,
+ const struct NFS4::SECINFO4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void setattr40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETATTR4args* /* args */,
+ const struct NFS4::SETATTR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void setclientid40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETCLIENTID4args* /* args */,
+ const struct NFS4::SETCLIENTID4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void setclientid_confirm40(const RPCProcedure* /* proc */,
+ const struct NFS4::SETCLIENTID_CONFIRM4args* /* args */,
+ const struct NFS4::SETCLIENTID_CONFIRM4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void verify40(const RPCProcedure* /* proc */,
+ const struct NFS4::VERIFY4args* /* args */,
+ const struct NFS4::VERIFY4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void write40(const RPCProcedure* /* proc */,
+ const struct NFS4::WRITE4args* /* args */,
+ const struct NFS4::WRITE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void release_lockowner40(const RPCProcedure* /* proc */,
+ const struct NFS4::RELEASE_LOCKOWNER4args* /* args */,
+ const struct NFS4::RELEASE_LOCKOWNER4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void get_dir_delegation40(const RPCProcedure* /* proc */,
+ const struct NFS4::GET_DIR_DELEGATION4args* /* args */,
+ const struct NFS4::GET_DIR_DELEGATION4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void illegal40(const RPCProcedure* /* proc */,
+ const struct NFS4::ILLEGAL4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+
+ // NFSv4.1 procedures
+
+ void compound41(const RPCProcedure* /*proc*/,
+ const struct NFS41::COMPOUND4args* /*args*/,
+ const struct NFS41::COMPOUND4res* /*res*/) override final
{
std::cout << "TestAnalyzer::compound4()" << std::endl;
}
+ // NFSv4.1 operations
+
+ void access41(const RPCProcedure* /* proc */,
+ const struct NFS41::ACCESS4args* /* args */,
+ const struct NFS41::ACCESS4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void close41(const RPCProcedure* /* proc */,
+ const struct NFS41::CLOSE4args* /* args */,
+ const struct NFS41::CLOSE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void commit41(const RPCProcedure* /* proc */,
+ const struct NFS41::COMMIT4args* /* args */,
+ const struct NFS41::COMMIT4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void create41(const RPCProcedure* /* proc */,
+ const struct NFS41::CREATE4args* /* args */,
+ const struct NFS41::CREATE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void delegpurge41(const RPCProcedure* /* proc */,
+ const struct NFS41::DELEGPURGE4args* /* args */,
+ const struct NFS41::DELEGPURGE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void delegreturn41(const RPCProcedure* /* proc */,
+ const struct NFS41::DELEGRETURN4args* /* args */,
+ const struct NFS41::DELEGRETURN4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void getattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETATTR4args* /* args */,
+ const struct NFS41::GETATTR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void getfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void link41(const RPCProcedure* /* proc */,
+ const struct NFS41::LINK4args* /* args */,
+ const struct NFS41::LINK4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lock41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCK4args* /* args */,
+ const struct NFS41::LOCK4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lockt41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCKT4args* /* args */,
+ const struct NFS41::LOCKT4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void locku41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOCKU4args* /* args */,
+ const struct NFS41::LOCKU4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lookup41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOOKUP4args* /* args */,
+ const struct NFS41::LOOKUP4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void lookupp41(const RPCProcedure* /* proc */,
+ const struct NFS41::LOOKUPP4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void nverify41(const RPCProcedure* /* proc */,
+ const struct NFS41::NVERIFY4args* /* args */,
+ const struct NFS41::NVERIFY4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void open41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN4args* /* args */,
+ const struct NFS41::OPEN4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void openattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPENATTR4args* /* args */,
+ const struct NFS41::OPENATTR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void open_confirm41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN_CONFIRM4args* /* args */,
+ const struct NFS41::OPEN_CONFIRM4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void open_downgrade41(const RPCProcedure* /* proc */,
+ const struct NFS41::OPEN_DOWNGRADE4args* /* args */,
+ const struct NFS41::OPEN_DOWNGRADE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void putfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTFH4args* /* args */,
+ const struct NFS41::PUTFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void putpubfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTPUBFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void putrootfh41(const RPCProcedure* /* proc */,
+ const struct NFS41::PUTROOTFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void read41(const RPCProcedure* /* proc */,
+ const struct NFS41::READ4args* /* args */,
+ const struct NFS41::READ4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void readdir41(const RPCProcedure* /* proc */,
+ const struct NFS41::READDIR4args* /* args */,
+ const struct NFS41::READDIR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void readlink41(const RPCProcedure* /* proc */,
+ const struct NFS41::READLINK4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void remove41(const RPCProcedure* /* proc */,
+ const struct NFS41::REMOVE4args* /* args */,
+ const struct NFS41::REMOVE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void rename41(const RPCProcedure* /* proc */,
+ const struct NFS41::RENAME4args* /* args */,
+ const struct NFS41::RENAME4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void renew41(const RPCProcedure* /* proc */,
+ const struct NFS41::RENEW4args* /* args */,
+ const struct NFS41::RENEW4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void restorefh41(const RPCProcedure* /* proc */,
+ const struct NFS41::RESTOREFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void savefh41(const RPCProcedure* /* proc */,
+ const struct NFS41::SAVEFH4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void secinfo41(const RPCProcedure* /* proc */,
+ const struct NFS41::SECINFO4args* /* args */,
+ const struct NFS41::SECINFO4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void setattr41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETATTR4args* /* args */,
+ const struct NFS41::SETATTR4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void setclientid41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETCLIENTID4args* /* args */,
+ const struct NFS41::SETCLIENTID4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void setclientid_confirm41(const RPCProcedure* /* proc */,
+ const struct NFS41::SETCLIENTID_CONFIRM4args* /* args */,
+ const struct NFS41::SETCLIENTID_CONFIRM4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void verify41(const RPCProcedure* /* proc */,
+ const struct NFS41::VERIFY4args* /* args */,
+ const struct NFS41::VERIFY4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void write41(const RPCProcedure* /* proc */,
+ const struct NFS41::WRITE4args* /* args */,
+ const struct NFS41::WRITE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void release_lockowner41(const RPCProcedure* /* proc */,
+ const struct NFS41::RELEASE_LOCKOWNER4args* /* args */,
+ const struct NFS41::RELEASE_LOCKOWNER4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void backchannel_ctl41(const RPCProcedure* /* proc */,
+ const struct NFS41::BACKCHANNEL_CTL4args* /* args */,
+ const struct NFS41::BACKCHANNEL_CTL4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void bind_conn_to_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::BIND_CONN_TO_SESSION4args* /* args */,
+ const struct NFS41::BIND_CONN_TO_SESSION4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void exchange_id41(const RPCProcedure* /* proc */,
+ const struct NFS41::EXCHANGE_ID4args* /* args */,
+ const struct NFS41::EXCHANGE_ID4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void create_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::CREATE_SESSION4args* /* args */,
+ const struct NFS41::CREATE_SESSION4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void destroy_session41(const RPCProcedure* /* proc */,
+ const struct NFS41::DESTROY_SESSION4args* /* args */,
+ const struct NFS41::DESTROY_SESSION4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void free_stateid41(const RPCProcedure* /* proc */,
+ const struct NFS41::FREE_STATEID4args* /* args */,
+ const struct NFS41::FREE_STATEID4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void get_dir_delegation41(const RPCProcedure* /* proc */,
+ const struct NFS41::GET_DIR_DELEGATION4args* /* args */,
+ const struct NFS41::GET_DIR_DELEGATION4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void getdeviceinfo41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETDEVICEINFO4args* /* args */,
+ const struct NFS41::GETDEVICEINFO4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void getdevicelist41(const RPCProcedure* /* proc */,
+ const struct NFS41::GETDEVICELIST4args* /* args */,
+ const struct NFS41::GETDEVICELIST4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void layoutcommit41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTCOMMIT4args* /* args */,
+ const struct NFS41::LAYOUTCOMMIT4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void layoutget41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTGET4args* /* args */,
+ const struct NFS41::LAYOUTGET4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void layoutreturn41(const RPCProcedure* /* proc */,
+ const struct NFS41::LAYOUTRETURN4args* /* args */,
+ const struct NFS41::LAYOUTRETURN4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void secinfo_no_name41(const RPCProcedure* /* proc */,
+ const NFS41::SECINFO_NO_NAME4args* /* args */,
+ const NFS41::SECINFO_NO_NAME4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void sequence41(const RPCProcedure* /* proc */,
+ const struct NFS41::SEQUENCE4args* /* args */,
+ const struct NFS41::SEQUENCE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void set_ssv41(const RPCProcedure* /* proc */,
+ const struct NFS41::SET_SSV4args* /* args */,
+ const struct NFS41::SET_SSV4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void test_stateid41(const RPCProcedure* /* proc */,
+ const struct NFS41::TEST_STATEID4args* /* args */,
+ const struct NFS41::TEST_STATEID4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void want_delegation41(const RPCProcedure* /* proc */,
+ const struct NFS41::WANT_DELEGATION4args* /* args */,
+ const struct NFS41::WANT_DELEGATION4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void destroy_clientid41(const RPCProcedure* /* proc */,
+ const struct NFS41::DESTROY_CLIENTID4args* /* args */,
+ const struct NFS41::DESTROY_CLIENTID4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void reclaim_complete41(const RPCProcedure* /* proc */,
+ const struct NFS41::RECLAIM_COMPLETE4args* /* args */,
+ const struct NFS41::RECLAIM_COMPLETE4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+ void illegal41(const RPCProcedure* /* proc */,
+ const struct NFS41::ILLEGAL4res* /* res */) override final
+ {
+ std::cout << "TestAnalyzer" << std::endl;
+ }
+
virtual void flush_statistics()
{
std::cout << "TestAnalyzer::flush_statistics()" << std::endl;
@@ -230,7 +809,13 @@ void destroy(IAnalyzer* instance)
delete instance;
}
-NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy)
+const AnalyzerRequirements* requirements()
+{
+ static const AnalyzerRequirements requirements{true};
+ return &requirements;
+}
+
+NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy, nullptr)
}//extern "C"
//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/CMakeLists.txt b/analyzers/src/watch/CMakeLists.txt
index 4bf7841..ce1ceb6 100644
--- a/analyzers/src/watch/CMakeLists.txt
+++ b/analyzers/src/watch/CMakeLists.txt
@@ -2,15 +2,15 @@ cmake_minimum_required (VERSION 2.8.12)
project (watch)
# check system dependencies instructions =======================================
+set (CURSES_NEED_NCURSES TRUE)
find_package (Curses) # find ncurses library
# build instructions ===========================================================
if (CURSES_FOUND)
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
include_directories (${CURSES_INCLUDE_DIR})
- file (GLOB_RECURSE UTILS ../utils/*.cpp)
file (GLOB_RECURSE SRCS ./*.cpp)
- add_library (${PROJECT_NAME} SHARED ${UTILS} ${SRCS})
+ add_library (${PROJECT_NAME} SHARED ${SRCS})
set_target_properties(${PROJECT_NAME}
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/analyzers # direct output to nfstrace common binary dir
NO_SONAME ON)
diff --git a/analyzers/src/watch/Doxyfile b/analyzers/src/watch/Doxyfile
new file mode 100644
index 0000000..ae497a4
--- /dev/null
+++ b/analyzers/src/watch/Doxyfile
@@ -0,0 +1,2303 @@
+# Doxyfile 1.8.6
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = "nfstrace libwatch plugin"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF = "NFS tracing/monitoring/capturing/analyzing tool"
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = docs
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C.
+#
+# Note For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. Do not use file names with spaces, bibtex cannot handle them. See
+# also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+INPUT =
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
+FILE_PATTERNS = *.cpp *.h
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER ) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
+# defined cascading style sheet that is included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet file to the output directory. For an example
+# see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the stylesheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = NO
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavours of web server based searching depending on the
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
+# searching and an index file used by the script. When EXTERNAL_SEARCH is
+# enabled the indexing and searching needs to be provided by external tools. See
+# the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
+# replace them by respectively the title of the page, the current date and time,
+# only the current date, the version number of doxygen, the project name (see
+# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = YES
+
+# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .8
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
+# Definitions (see http://autogen.sf.net) file that captures the structure of
+# the code including all documentation. Note that this feature is still
+# experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
+# in the source code. If set to NO only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all refrences to function-like macros that are alone on a line, have an
+# all uppercase name, and do not end with a semicolon. Such function macros are
+# typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have an unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
+# class index. If set to NO only the inherited external classes will be listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
+# the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = NO
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font n the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = svg
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = YES
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP = YES
diff --git a/analyzers/src/watch/nc_windows/header_window.cpp b/analyzers/src/watch/nc_windows/header_window.cpp
new file mode 100644
index 0000000..368d6cd
--- /dev/null
+++ b/analyzers/src/watch/nc_windows/header_window.cpp
@@ -0,0 +1,102 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for descripne ncurses header window.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <algorithm>
+#include <ctime>
+#include <stdexcept>
+
+#include <unistd.h>
+
+#include "header_window.h"
+#include "nc_window_const.h"
+//------------------------------------------------------------------------------
+namespace HEADER
+{
+const int MEMO_LINE = 1;
+const int HOST_LINE = 2;
+const int DATE_LINE = 3;
+const int ELAPSED_LINE = 4;
+const int HOST_SIZE = 128;
+}
+
+void HeaderWindow::destroy()
+{
+ if (_window == nullptr)
+ {
+ return;
+ }
+ werase(_window);
+ wclear(_window);
+ delwin(_window);
+ _window = nullptr;
+}
+
+HeaderWindow::HeaderWindow(MainWindow& w)
+: _start_time {time(NULL)}
+{
+ if (w._window == nullptr)
+ {
+ throw std::runtime_error("Initialization of Header window failed.");
+ }
+ resize(w);
+}
+
+HeaderWindow::~HeaderWindow()
+{
+}
+
+void HeaderWindow::update()
+{
+ if (_window == nullptr)
+ {
+ return;
+ }
+ time_t actual_time = time(nullptr);
+ tm* t = localtime(&actual_time);
+ time_t shift_time = actual_time - _start_time;
+ /* tm starts with 0 month and 1900 year*/
+ mvwprintw(_window, HEADER::DATE_LINE, FIRST_CHAR_POS, "Date: \t %d.%d.%d \t Time: %d:%d:%d ", t->tm_mday, t->tm_mon + 1, t->tm_year + 1900, t->tm_hour, t->tm_min, t->tm_sec);
+ mvwprintw(_window, HEADER::ELAPSED_LINE, FIRST_CHAR_POS, "Elapsed time: \t %d days; %d:%d:%d times",
+ shift_time / SECINDAY, shift_time % SECINDAY / SECINHOUR, shift_time % SECINHOUR / SECINMIN, shift_time % SECINMIN);
+ wrefresh (_window);
+}
+
+void HeaderWindow::resize(MainWindow& m)
+{
+ if (_window != nullptr)
+ {
+ destroy();
+ }
+ if (m._window != nullptr)
+ {
+ _window = subwin(m._window, std::min(static_cast<int>(m._window->_maxy), GUI_HEADER_HEIGHT), std::min(static_cast<int>(m._window->_maxx), GUI_LENGTH), 0, 0);
+ }
+ if (_window != nullptr)
+ {
+ werase(_window);
+ wborder(_window, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER , ACS_LLCORNER, ACS_LRCORNER);
+ char HOST_NAME[HEADER::HOST_SIZE];
+ gethostname(HOST_NAME, HEADER::HOST_SIZE);
+ mvwprintw(_window, HEADER::MEMO_LINE, FIRST_CHAR_POS, "%s", "Nfstrace watch plugin. To scroll press up or down keys. Ctrl + c to exit.");
+ mvwprintw(_window, HEADER::HOST_LINE, FIRST_CHAR_POS, "Host name:\t %s", HOST_NAME);
+ }
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/nc_windows/header_window.h b/analyzers/src/watch/nc_windows/header_window.h
new file mode 100644
index 0000000..5ced588
--- /dev/null
+++ b/analyzers/src/watch/nc_windows/header_window.h
@@ -0,0 +1,50 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for describe ncurses header window.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef HEADER_WINDOWS_H
+#define HEADER_WINDOWS_H
+//------------------------------------------------------------------------------
+#include <ncurses.h>
+
+#include "main_window.h"
+//------------------------------------------------------------------------------
+class HeaderWindow
+{
+ WINDOW* _window;
+ time_t _start_time;
+ void destroy();
+
+public:
+ HeaderWindow() = delete;
+ HeaderWindow(MainWindow&);
+ ~HeaderWindow();
+
+ /*! Update Header Window
+ */
+ void update();
+
+ /*! Resize Header Window
+ */
+ void resize(MainWindow&);
+};
+//------------------------------------------------------------------------------
+#endif//HEADER_WINDOWS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/nc_windows/main_window.cpp b/analyzers/src/watch/nc_windows/main_window.cpp
new file mode 100644
index 0000000..3c992c3
--- /dev/null
+++ b/analyzers/src/watch/nc_windows/main_window.cpp
@@ -0,0 +1,111 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for describe ncurses main window.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <stdexcept>
+
+#include <unistd.h>
+
+#include "main_window.h"
+//------------------------------------------------------------------------------
+void MainWindow::init()
+{
+ if (_window != nullptr)
+ {
+ destroy();
+ }
+ _window = initscr();
+ if (_window == nullptr)
+ {
+ throw std::runtime_error("Initialization of Main window failed.");
+ }
+ noecho();
+ cbreak();
+ intrflush(stdscr, false); // flush main window
+ curs_set(0); // disable blinking cursore
+
+ keypad(_window, true); // init keyboard
+ timeout(200); // set keyboard timeout
+
+ start_color(); // set background color
+ if (_window != nullptr)
+ {
+ werase(_window);
+ }
+}
+
+void MainWindow::destroy()
+{
+ nocbreak();
+ echo();
+ clrtoeol();
+ refresh();
+ endwin();
+ _window = nullptr;
+}
+
+void MainWindow::cleanStdin(int key)
+{
+ while ((key != EOF) && (key != '\n') && (key != ' '))
+ {
+ key = getch();
+ }
+}
+
+MainWindow::MainWindow()
+: _window {nullptr}
+{
+ init();
+}
+
+MainWindow::~MainWindow()
+{
+ destroy();
+}
+
+int MainWindow::inputKeys()
+{
+ int key = wgetch(_window);
+
+ if (key != KEY_UP && key != KEY_DOWN && key != KEY_LEFT && key != KEY_RIGHT)
+ {
+ key = 0;
+ }
+ cleanStdin(key);
+ return key;
+}
+
+void MainWindow::resize()
+{
+ if (_window != nullptr)
+ {
+ destroy();
+ }
+ init();
+}
+
+void MainWindow::update() const
+{
+ if (_window != nullptr)
+ {
+ refresh();
+ }
+}
+//------------------------------------------------------------------------------ \ No newline at end of file
diff --git a/analyzers/src/watch/nc_windows/main_window.h b/analyzers/src/watch/nc_windows/main_window.h
new file mode 100644
index 0000000..4c1afc5
--- /dev/null
+++ b/analyzers/src/watch/nc_windows/main_window.h
@@ -0,0 +1,56 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for describe ncurses main window.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef MAIN_WINDOW_H
+#define MAIN_WINDOW_H
+//------------------------------------------------------------------------------
+#include <ncurses.h>
+//------------------------------------------------------------------------------
+class MainWindow
+{
+ friend class HeaderWindow;
+ friend class StatisticsWindow;
+ WINDOW* _window;
+
+ void init();
+ void destroy();
+ static void cleanStdin(int);
+
+public:
+
+ MainWindow();
+ ~MainWindow();
+
+ /*! Get iput keys
+ */
+ int inputKeys();
+
+ /*! Resize Main Window
+ */
+ void resize();
+
+ /*! Update Main Window
+ */
+ void update() const;
+};
+//------------------------------------------------------------------------------
+#endif//MAIN_WINDOW_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/nc_windows/nc_window_const.h b/analyzers/src/watch/nc_windows/nc_window_const.h
new file mode 100644
index 0000000..124436d
--- /dev/null
+++ b/analyzers/src/watch/nc_windows/nc_window_const.h
@@ -0,0 +1,48 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for description all ncurses windows constants.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NC_WINDOW_CONST_H
+#define NC_WINDOW_CONST_H
+//------------------------------------------------------------------------------
+namespace
+{
+
+const unsigned int SECINMIN = 60;
+const unsigned int SECINHOUR = 60 * 60;
+const unsigned int SECINDAY = 60 * 60 * 24;
+
+const unsigned int BORDER_SIZE = 1;
+
+const int MAXSHIFT = 25;
+const int SHIFTCU = 1;
+
+const int GUI_LENGTH = 80;
+const int GUI_HEADER_HEIGHT = 6;
+const int PERSENT_POS = 29;
+const int COUNTERS_POS = 22;
+
+const int FIRST_CHAR_POS = 1;
+const int EMPTY_LINE = 1;
+
+}
+//------------------------------------------------------------------------------
+#endif//NC_WINDOW_CONST_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/nc_windows/statistics_window.cpp b/analyzers/src/watch/nc_windows/statistics_window.cpp
new file mode 100644
index 0000000..d4496c2
--- /dev/null
+++ b/analyzers/src/watch/nc_windows/statistics_window.cpp
@@ -0,0 +1,198 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for describe ncurses statistics window.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <algorithm>
+#include <numeric>
+
+#include <unistd.h>
+
+#include "nc_window_const.h"
+#include "statistics_window.h"
+//------------------------------------------------------------------------------
+namespace STATISTICS
+{
+const int PROTOCOLS_LINE = 1;
+const int FIRST_OPERATION_LINE = 3;
+const int DEFAULT_LINES = 10;
+const int DEFAULT_GROUP = 1;
+}
+
+void StatisticsWindow::destroy()
+{
+ if (_window == nullptr)
+ {
+ return;
+ }
+ werase(_window);
+ wclear(_window);
+ delwin(_window);
+ _window = nullptr;
+}
+
+bool StatisticsWindow::canWrite(unsigned int i)
+{
+ return (i >= _scrollOffset.at(_activeProtocol) + STATISTICS::FIRST_OPERATION_LINE && i - _scrollOffset.at(_activeProtocol) + BORDER_SIZE < static_cast<unsigned int>(_window->_maxy));
+}
+
+StatisticsWindow::StatisticsWindow(MainWindow& w, StatisticsContainers& c)
+: _window {nullptr}
+, _activeProtocol {nullptr}
+{
+ if (w._window == nullptr)
+ {
+ throw std::runtime_error("Initialization of Header window failed.");
+ }
+ for (auto i : c)
+ {
+ _allProtocols.push_back((i.first)->getProtocolName());
+ _scrollOffset.insert(std::make_pair<AbstractProtocol*, std::size_t>(reinterpret_cast<AbstractProtocol*>(i.first), 0));
+ };
+ _activeProtocol = (c.begin())->first;
+ _statistic = c.at(_activeProtocol);
+ resize(w);
+}
+
+StatisticsWindow::~StatisticsWindow()
+{
+}
+
+void StatisticsWindow::scrollContent(int i)
+{
+ if (i > 0 && _scrollOffset.at(_activeProtocol) <= MAXSHIFT - SHIFTCU)
+ {
+ _scrollOffset.at(_activeProtocol) += SHIFTCU;
+ updateProtocol(_activeProtocol);
+ }
+ else if (i < 0 && _scrollOffset.at(_activeProtocol) >= SHIFTCU)
+ {
+ _scrollOffset.at(_activeProtocol) -= SHIFTCU;
+ updateProtocol(_activeProtocol);
+ }
+}
+
+void StatisticsWindow::updateProtocol(AbstractProtocol* p)
+{
+ if(p != nullptr)
+ _activeProtocol = p;
+ if (_window == nullptr)
+ {
+ return;
+ }
+ werase(_window);
+ wborder(_window, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER , ACS_LLCORNER, ACS_LRCORNER);
+
+ std::string tmp(" ");
+ for_each (_allProtocols.begin(), _allProtocols.end(), [&](std::string& s)
+ {
+ if (!s.compare(_activeProtocol->getProtocolName()))
+ {
+ tmp += std::string(" < ") + s + std::string(" > ");
+ }
+ else
+ {
+ tmp += std::string(" ") + s + std::string(" ");
+ }
+
+ });
+ mvwprintw(_window, STATISTICS::PROTOCOLS_LINE , FIRST_CHAR_POS, "%s", tmp.c_str());
+
+ unsigned int line = STATISTICS::FIRST_OPERATION_LINE;
+ for(unsigned int i = STATISTICS::DEFAULT_GROUP; i <= _activeProtocol->getGroups(); i++)
+ {
+ if ( canWrite(line))
+ {
+ mvwprintw(_window, line - (_scrollOffset.at(p)), FIRST_CHAR_POS, "%s", "Total:");
+ }
+ line++;
+ for (unsigned int j = _activeProtocol->getGroupBegin(i); j < _activeProtocol->getGroupBegin(i + 1); j++)
+ {
+ if ( canWrite(line))
+ {
+ mvwprintw(_window, line - (_scrollOffset.at(p)), FIRST_CHAR_POS, "%s", p->printProcedure(j));
+ }
+ line++;
+ }
+ line++;
+ }
+
+}
+
+void StatisticsWindow::update(const ProtocolStatistic& d)
+{
+ _statistic = d;
+ if (_statistic.empty() || _window == nullptr)
+ {
+ return;
+ }
+
+ unsigned int line = STATISTICS::FIRST_OPERATION_LINE;
+ for(unsigned int i = STATISTICS::DEFAULT_GROUP; i <= _activeProtocol->getGroups(); i++)
+ {
+ std::size_t m = 0; // sum of all counters
+
+ for(std::size_t tmp = _activeProtocol->getGroupBegin(i); tmp < _activeProtocol->getGroupBegin(i + 1); tmp++)
+ {
+ m += _statistic[tmp];
+ }
+ if ( canWrite(line))
+ {
+ mvwprintw(_window, line - (_scrollOffset.at(_activeProtocol)), FIRST_CHAR_POS + 25, "%d", m);
+ }
+ line++;
+ for (unsigned int j = _activeProtocol->getGroupBegin(i); j < _activeProtocol->getGroupBegin(i + 1); j++)
+ {
+ if ( canWrite(line))
+ {
+ mvwprintw(_window, line - _scrollOffset.at(_activeProtocol), COUNTERS_POS, "%lu ", _statistic[j]);
+ mvwprintw(_window, line - _scrollOffset.at(_activeProtocol), PERSENT_POS, "%-3.2f%% ",
+ m > 0 ? static_cast<double>(_statistic[j]) / static_cast<double>(m) * 100.0 : 0.0);
+ }
+ line++;
+ }
+ line++;
+ }
+ wrefresh(_window);
+}
+
+void StatisticsWindow::resize(MainWindow& m)
+{
+ if (_window != nullptr)
+ {
+ destroy();
+ }
+ int tmp_size = STATISTICS::DEFAULT_LINES;
+ if (_activeProtocol != nullptr)
+ {
+ tmp_size = _activeProtocol->getAmount() + 2 * BORDER_SIZE + 2 * EMPTY_LINE + STATISTICS::PROTOCOLS_LINE + _activeProtocol->getGroups() * EMPTY_LINE * _activeProtocol->getGroups();
+ }
+ if (m._window != nullptr && m._window->_maxy > GUI_HEADER_HEIGHT)
+ {
+ _window = subwin(m._window, std::min(static_cast<int>(m._window->_maxy - GUI_HEADER_HEIGHT), tmp_size),
+ std::min(static_cast<int>(m._window->_maxx), GUI_LENGTH), GUI_HEADER_HEIGHT - BORDER_SIZE, 0);
+ updateProtocol(_activeProtocol);
+ }
+}
+
+void StatisticsWindow::setProtocol(AbstractProtocol* p)
+{
+ _activeProtocol = (p);
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/nc_windows/statistics_window.h b/analyzers/src/watch/nc_windows/statistics_window.h
new file mode 100644
index 0000000..e95bd85
--- /dev/null
+++ b/analyzers/src/watch/nc_windows/statistics_window.h
@@ -0,0 +1,72 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for describe ncurses statistic window.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef STATISTICS_WINDOW_H
+#define STATISTICS_WINDOW_H
+//------------------------------------------------------------------------------
+#include <unordered_map>
+#include <vector>
+
+#include "../protocols/abstract_protocol.h"
+#include "main_window.h"
+//------------------------------------------------------------------------------
+class StatisticsWindow
+{
+ using ProtocolStatistic = std::vector<std::size_t>;
+ using StatisticsContainers = std::unordered_map<AbstractProtocol*, ProtocolStatistic>;
+
+private:
+ WINDOW* _window;
+ AbstractProtocol* _activeProtocol;
+ std::vector<std::string> _allProtocols;
+ std::unordered_map<AbstractProtocol*, unsigned int> _scrollOffset;
+ ProtocolStatistic _statistic;
+ void destroy();
+ bool canWrite(unsigned int);
+
+public:
+ StatisticsWindow() = delete;
+ StatisticsWindow(MainWindow&, StatisticsContainers&);
+ ~StatisticsWindow();
+
+ /*! Scroll content of Statistic Winodow Up or Down
+ */
+ void scrollContent(int);
+
+ /*! Change active protocol. Print new protocl's commands.
+ */
+ void updateProtocol(AbstractProtocol*);
+
+ /*! Update counters on Statistics Window
+ */
+ void update(const ProtocolStatistic&);
+
+ /*! Resize Statistic Window
+ */
+ void resize(MainWindow&);
+
+ /*! Only set active protocol, do not update new protocol's commands.
+ */
+ void setProtocol(AbstractProtocol*);
+};
+//------------------------------------------------------------------------------
+#endif//STATISTICS_WINDOWS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/plotter.cpp b/analyzers/src/watch/plotter.cpp
deleted file mode 100644
index 287fc71..0000000
--- a/analyzers/src/watch/plotter.cpp
+++ /dev/null
@@ -1,381 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Vitali Adamenka
-// Description: Header for WatchAnalyzer based on TestAnalyzer.h
-// Copyright (c) 2014 EPAM Systems. All Rights Reserved.
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include <exception>
-#include <iostream>
-#include <system_error>
-
-#include <unistd.h>
-#include <signal.h>
-#include <time.h>
-
-#include <api/plugin_api.h>
-#include "plotter.h"
-//------------------------------------------------------------------------------
-const time_t Plotter::start_time = time(NULL);
-const uint32_t Plotter::SECINMIN = 60;
-const uint32_t Plotter::SECINHOUR = 60*60;
-const uint32_t Plotter::SECINDAY = 60*60*24;
-
-int Plotter::resize = 0;
-
-operation_data nfsv3_total {1, 1, NULL, 28 , 2, 10 ,0 , 0, 0};
-operation_data nfsv3_proc {1, 3, NULL, 18 , 2, 10 ,0 , 0, 0};
-operation_data nfsv4_op_total{1, 1, NULL, 28 , 2, 9 ,0 , 0, 0};
-operation_data nfsv4_oper {1, 3, NULL, 22 , 2, 9 ,0 , 0, 0};
-operation_data nfsv4_pr_total{1, 1, NULL, 28 , 2, 9 ,0 , 0, 0};
-operation_data nfsv4_proc {1, 3, NULL, 22 , 2, 9 ,0 , 0, 0};
-
-operation_data date_time {1, 8, NULL, 1 , 2, 9 ,999, 0, 0};
-operation_data el_time {1, 8, NULL, 1 , 2, 9 ,999, 0, 0};
-operation_data packets {1, 8, NULL, 1 , 2, 9 ,999, 0, 0};
-//------------------------------------------------------------------------------
-Plotter::Plotter()
-: all_windows(3, NULL)
-, scroll_shift {0}
-, column_shift {0}
-{
- try
- {
- monitor_running.test_and_set();
- std::cout << "\n\n";
- initPlot();
- designPlot();
- signal(SIGWINCH, enableResize);
- keyboard_proc = std::thread(&Plotter::keyboard_thread, this);
- }
- catch (std::runtime_error& err)
- {
- monitor_running.clear();
- keyboard_proc.join();
- destroyPlot();
- std::cerr << "Error in libwatch plugin: " << err.what();
- throw std::runtime_error("Error in Plotter screen initialization.");
- }
-}
-Plotter::~Plotter()
-{
- monitor_running.clear();
- keyboard_proc.join();
- destroyPlot();
-}
-
-void Plotter::updatePlot(const uint64_t &nfs3_total, const std::vector<int> &nfs3_pr_count,
- const uint64_t &nfs4_ops_total, const uint64_t &nfs4_pr_total,
- const std::vector<int> &nfs4_op_count)
-{
- if(resize)
- {
- destroyPlot();
- initPlot();
- designPlot();
- if(resize > 0) resize--;
- }
- uint16_t counter = nfsv3_total.start_y;
- if(nfsv3_total.max_y + scroll_shift > counter && counter > scroll_shift)
- {
- mvwprintw( nfsv3_total.my_win, counter - scroll_shift, nfsv3_total.mod_pos, "%lu", nfs3_total);
- counter++;
- }
-
- counter = nfsv3_proc.start_y;
- if(counter > scroll_shift)
- counter++;
-
- for(auto i : nfs3_pr_count)
- {
- if(nfsv3_proc.max_y + scroll_shift > counter && counter > scroll_shift)
- mvwprintw(nfsv3_proc.my_win, counter - scroll_shift, nfsv3_proc.mod_pos ,"%lu", i);
- if(nfsv3_proc.max_y + scroll_shift > counter && counter > scroll_shift)
- mvwprintw(nfsv3_proc.my_win, counter - scroll_shift, nfsv3_proc.mod_pos + nfsv3_proc.st_colum ,"%s", " ");
- if(nfsv3_proc.max_y + scroll_shift > counter && counter > scroll_shift)
- mvwprintw(nfsv3_proc.my_win, counter -scroll_shift, nfsv3_proc.mod_pos + nfsv3_proc.st_colum ,"%-3.2f%%",
- (double) (nfs3_total > 0 ? (double)i / (double)nfs3_total * 100 : 0));
- counter++;
- }
-
- counter = nfsv4_pr_total.start_y;
- if(nfsv4_pr_total.max_y + scroll_shift > counter && counter > scroll_shift)
- {
- mvwprintw(nfsv4_pr_total.my_win, counter - scroll_shift, nfsv4_pr_total.mod_pos ,"%lu",nfs4_pr_total);
- counter++;
- }
-
- if(counter > scroll_shift)
- counter++;
-
- for(uint16_t i = 0; i < ProcEnumNFS4::count_proc && i <= nfs4_op_count.size(); i++)
- {
- if(nfsv4_proc.max_y + scroll_shift > counter && counter > scroll_shift )
- mvwprintw(nfsv4_proc.my_win, counter - scroll_shift, nfsv4_proc.mod_pos ,"%lu",nfs4_op_count[i]);
- if(nfsv4_proc.max_y + scroll_shift > counter && counter > scroll_shift)
- mvwprintw(nfsv4_proc.my_win, counter - scroll_shift, nfsv4_proc.mod_pos + nfsv4_proc.st_colum ,"%s", " ");
- if(nfsv4_proc.max_y + scroll_shift> counter && counter > scroll_shift)
- mvwprintw(nfsv4_proc.my_win, counter - scroll_shift,nfsv4_proc.mod_pos + nfsv4_proc.st_colum ,"%-3.2f%%",
- (double) (nfs4_pr_total > 0 ? (double)nfs4_op_count[i] / (double)nfs4_pr_total * 100 : 0) );
- counter++;
- }
-
- counter = nfsv4_op_total.start_y;
- if(nfsv4_op_total.max_y + scroll_shift> counter && counter > scroll_shift)
- {
- mvwprintw(nfsv4_op_total.my_win, counter - scroll_shift, nfsv4_op_total.mod_pos ,"%lu", nfs4_ops_total);
- counter++;
- }
-
- if(counter > scroll_shift)
- counter++;
-
- for(uint16_t i = ProcEnumNFS4::count_proc ; i < ProcEnumNFS4::count && i <= nfs4_op_count.size(); i++)
- {
- if(nfsv4_proc.max_y + scroll_shift> counter && counter > scroll_shift)
- mvwprintw(nfsv4_oper.my_win, counter - scroll_shift, nfsv4_oper.mod_pos ,"%lu",nfs4_op_count[i]);
- if(nfsv4_proc.max_y + scroll_shift> counter && counter > scroll_shift)
- mvwprintw(nfsv4_oper.my_win, counter - scroll_shift, nfsv4_oper.mod_pos + nfsv4_proc.st_colum ,"%s", " ");
- if(nfsv4_proc.max_y + scroll_shift> counter && counter > scroll_shift)
- mvwprintw(nfsv4_oper.my_win, counter - scroll_shift, nfsv4_oper.mod_pos + nfsv4_oper.st_colum ,"%-3.2f%%",
- (double) (nfs4_pr_total > 0 ? (double)nfs4_op_count[i] / (double)nfs4_pr_total * 100 : 0) );
- counter++;
- }
- chronoUpdate();
- updateAll();
-}
-
-uint16_t Plotter::inputData()
-{
- int c = wgetch(all_windows[0]);
- return (c == KEY_UP || c == KEY_DOWN) ? c : 0;
-}
-
-void Plotter::enableResize(int)
-{
- resize ++;
-}
-
-void Plotter::keyboard_thread()
-{
- while(monitor_running.test_and_set())
- {
- int key = inputData();
-
- if(key != 0 )
- {
- if(key == KEY_UP)
- {
- if(scroll_shift > 0)
- {
- scroll_shift--;
- resize++;
- }
- }
- else if(key == KEY_DOWN)
- {
- if(scroll_shift < 25)
- {
- scroll_shift++;
- resize++;
- }
- }
- }
- sleep(1);
- }
-}
-
-void Plotter::chronoUpdate()
-{
- time_t actual_time = time(NULL);
- tm* t = localtime(&actual_time);
- time_t shift_time = actual_time - start_time;
- mvprintw(date_time.start_y, date_time.start_x,"Date: \t %d.%d.%d \t Time: %d:%d:%d",t->tm_mday, t->tm_mon + 1, t->tm_year + 1900,t->tm_hour, t->tm_min, t->tm_sec);
- mvprintw(el_time.start_y, el_time.start_x,"Elapsed time: \t %d days; %d:%d:%d times",
- shift_time/SECINDAY, shift_time%SECINDAY/SECINHOUR, shift_time%SECINHOUR/SECINMIN, shift_time%SECINMIN);
-// mvprintw(packets.start_y, packets.start_x,"Total packets: %lu(network) %lu(to host) %lu(dropped)", 999, 999 , 999);
-}
-
-void Plotter::designPlot()
-{
- char HOST_NAME[128];
- gethostname(HOST_NAME, 128);
- clear();
- column_shift = 0;
- mvprintw(column_shift, 1,"%s","Nfstrace watch plugin. To scroll press up or down keys. Ctrl + c to exit.");
- column_shift++;
- mvprintw(column_shift, 1,"Host name:\t %s",HOST_NAME);
- column_shift++;
- date_time.start_y = column_shift;
- column_shift++;
- el_time.start_y = column_shift;
- column_shift++;
- packets.start_y = column_shift;
- column_shift++;
- chronoUpdate();
-
- WINDOW* f_win = NULL;
- WINDOW* s_win = NULL;
- uint16_t column_hei = 0;
- uint16_t column_hei_base = 0;
-
- // all columns has similar y start position and similar hight
- column_hei_base = ProcEnumNFS3::count > ProcEnumNFS4::count ? ProcEnumNFS3::count :ProcEnumNFS4::count + nfsv3_total.start_y + 1;
-
- if(column_hei_base + column_shift > y_max) column_hei = y_max - column_shift;
- else column_hei = column_hei_base;
-
- if( column_hei > column_hei_base - scroll_shift && column_hei ) column_hei = column_hei_base - scroll_shift;
-
- f_win = subwin(all_windows[0], column_hei, 40, column_shift, 1);
- all_windows[1] = f_win;
- nfsv3_proc.max_y = column_hei - 1;
- nfsv3_total.max_y = column_hei - 1;
- nfsv4_proc.max_y = column_hei - 1;
- nfsv4_pr_total.max_y = column_hei - 1;
- nfsv3_proc.y_board_shift = column_shift + 1;
- nfsv3_total.y_board_shift = column_shift + 1;
- nfsv4_proc.y_board_shift = column_shift + 1;
- nfsv4_pr_total.y_board_shift = column_shift + 1;
-
- s_win = subwin(all_windows[0], column_hei, 40, column_shift, 40);
- all_windows[2] = s_win;
- nfsv4_op_total.max_y = column_hei - 1;
- nfsv4_oper.max_y = column_hei - 1;
- nfsv4_op_total.y_board_shift = column_shift + 1;
- nfsv4_oper.y_board_shift = column_shift + 1;
-
- nfsv3_proc.my_win = f_win;
- nfsv3_total.my_win = f_win;
- nfsv4_pr_total.my_win = f_win;
- nfsv4_proc.my_win = f_win;
- nfsv4_op_total.my_win = s_win;
- nfsv4_oper.my_win = s_win;
-
- int tmp = 1;
- wborder(f_win, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER , ACS_LLCORNER, ACS_LRCORNER);
- wborder(s_win, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER , ACS_LLCORNER, ACS_LRCORNER);
-
- nfsv3_total.start_y = tmp;
- if(nfsv3_total.max_y + scroll_shift > tmp && tmp > scroll_shift)
- {
- mvwprintw(f_win, tmp - scroll_shift, 2, "NFSv3 total procedures:");
- tmp++;
- }
-
- nfsv3_proc.start_y = tmp;
- if(nfsv3_proc.max_y + scroll_shift > tmp && tmp > scroll_shift)
- {
- mvwprintw(f_win, tmp - scroll_shift, 2, "Per procedure:");
- tmp++;
- }
-
- for(int i = 0; i < ProcEnumNFS3::count; i++)
- {
- if(nfsv3_proc.max_y + scroll_shift > tmp && tmp > scroll_shift)
- mvwprintw(f_win, tmp - scroll_shift, 2, "%s", print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(i)));
- tmp++;
- }
-
- if(tmp > scroll_shift)
- {
- mvwhline(f_win, tmp - scroll_shift, 1, ACS_HLINE, 38);
- tmp++;
- }
- tmp++;
-
- nfsv4_pr_total.start_y = tmp;
- if(nfsv4_pr_total.max_y + scroll_shift > tmp && tmp > scroll_shift)
- {
- mvwprintw(f_win, tmp - scroll_shift, 2, "NFSv4 total procedures:");
- tmp++;
- }
-
- if(nfsv4_proc.max_y + scroll_shift> tmp && tmp > scroll_shift)
- {
- mvwprintw(f_win, tmp - scroll_shift, 2, "Per procedure:");
- tmp++;
- }
- for(int i = 0; i < ProcEnumNFS4::count_proc; i++)
- {
- if(nfsv4_proc.max_y + scroll_shift> tmp && tmp > scroll_shift)
- {
- mvwprintw(f_win, tmp - scroll_shift, 2, "%s", print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(i)));
- }
- tmp++;
- }
-
- tmp = 1;
- nfsv4_op_total.start_y = tmp;
- if(nfsv4_op_total.max_y + scroll_shift > tmp && tmp > scroll_shift)
- {
- mvwprintw(s_win, tmp - scroll_shift,2,"NFSv4 total operations:");
- tmp++;
- }
-
- nfsv4_oper.start_y = tmp;
- if(nfsv4_oper.max_y + scroll_shift> tmp && tmp > scroll_shift)
- {
- mvwprintw(s_win, tmp - scroll_shift, 2, "Per operation:");
- tmp++;
- }
- for(int i = ProcEnumNFS4::count_proc ; i < ProcEnumNFS4::count; i++)
- {
- if(nfsv4_oper.max_y + scroll_shift> tmp && tmp > scroll_shift)
- {
- mvwprintw(s_win, tmp - scroll_shift, 2,"%s", print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(i)));
- }
- tmp++;
- }
- updateAll();
-}
-
-void Plotter::destroyPlot()
-{
- nocbreak();
- echo();
- clrtoeol();
- refresh();
- endwin();
-}
-
-void Plotter::initPlot()
-{
- WINDOW *ww = initscr();
- all_windows[0] = ww;
- if(ww == NULL)
- {
- throw std::runtime_error("Initialization of main window failed.");
- }
- x_max = ww->_maxx;
- y_max = ww->_maxy;
- noecho();
- cbreak();
- intrflush(stdscr, false); // flush main window
- curs_set(0); // disable blinking cursore
-
- keypad(all_windows[0], true); // init keyboard
- timeout(200); // set keyboard timeout
-}
-
-void Plotter::updateAll()
-{
- for(auto i : all_windows)
- {
- wrefresh(i);
- }
-}
diff --git a/analyzers/src/watch/plotter.h b/analyzers/src/watch/plotter.h
deleted file mode 100644
index 2a99da6..0000000
--- a/analyzers/src/watch/plotter.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Vitali Adamenka
-// Description: Header for WatchAnalyzer based on TestAnalyzer.h
-// Copyright (c) 2014 EPAM Systems. All Rights Reserved.
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#ifndef PLOTTER_H
-#define PLOTTER_H
-//------------------------------------------------------------------------------
-#include <atomic>
-#include <cstdlib>
-#include <vector>
-#include <thread>
-
-#include <ncurses.h>
-//------------------------------------------------------------------------------
-struct operation_data
-{
- uint16_t start_x;
- uint16_t start_y;
-
- WINDOW* my_win;
- uint16_t mod_pos;
- uint16_t n_colum;
- uint16_t st_colum;
- uint16_t max_y;
- uint16_t y_board_shift;
- uint16_t x_board_shift;
-};
-//------------------------------------------------------------------------------
-class Plotter
-{
-public:
- Plotter();
- virtual ~Plotter();
- void updatePlot(const uint64_t &nfs3_total, const std::vector<int> &nfs3_pr_count,
- const uint64_t &nfs4_ops_total, const uint64_t &nfs4_pr_total,
- const std::vector<int> &nfs4_pr_count);
-
- uint16_t inputData();
- static void enableResize(int);
- inline void keyboard_thread();
-
- const static time_t start_time;
- const static uint32_t SECINMIN;
- const static uint32_t SECINHOUR;
- const static uint32_t SECINDAY;
-
-private:
- void chronoUpdate();
- void designPlot();
- void destroyPlot();
- void initPlot();
- void updateAll();
-
- static int resize;
- std::atomic_flag monitor_running;
- std::thread keyboard_proc;
-
- std::vector<WINDOW*> all_windows;
- uint16_t scroll_shift;
- uint16_t x_max;
- uint16_t y_max;
-
- uint16_t column_shift;
-};
-//------------------------------------------------------------------------------
-#endif // PLOTTER_H
-//------------------------------------------------------------------------------ \ No newline at end of file
diff --git a/analyzers/src/watch/protocols/abstract_protocol.cpp b/analyzers/src/watch/protocols/abstract_protocol.cpp
new file mode 100644
index 0000000..48a4cd8
--- /dev/null
+++ b/analyzers/src/watch/protocols/abstract_protocol.cpp
@@ -0,0 +1,68 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for abstract protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "abstract_protocol.h"
+#include <api/plugin_api.h> // include plugin development definitions
+//------------------------------------------------------------------------------
+namespace
+{
+ const int EMPTY_GROUP = 1;
+}
+
+AbstractProtocol::AbstractProtocol(const char* n, std::size_t i)
+: name {n}
+, amount {i}
+{
+}
+
+AbstractProtocol::~AbstractProtocol()
+{
+}
+
+const char* AbstractProtocol::printProcedure(std::size_t)
+{
+ return nullptr;
+}
+
+std::string AbstractProtocol::getProtocolName() const
+{
+ return name;
+}
+
+unsigned int AbstractProtocol::getAmount() const
+{
+ return amount;
+}
+
+std::size_t AbstractProtocol::getGroups()
+{
+ return EMPTY_GROUP;
+}
+
+std::size_t AbstractProtocol::getGroupBegin(std::size_t i)
+{
+ if( i == EMPTY_GROUP)
+ return 0;
+ else
+ return amount;
+}
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/abstract_protocol.h b/analyzers/src/watch/protocols/abstract_protocol.h
new file mode 100644
index 0000000..4e0649b
--- /dev/null
+++ b/analyzers/src/watch/protocols/abstract_protocol.h
@@ -0,0 +1,66 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for abstract protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef ABSTRACT_PROTOCOL_H
+#define ABSTRACT_PROTOCOL_H
+//------------------------------------------------------------------------------
+#include <cstdlib>
+#include <string>
+//------------------------------------------------------------------------------
+class AbstractProtocol
+{
+public:
+ AbstractProtocol() = delete;
+ AbstractProtocol(const char*, std::size_t);
+ virtual ~AbstractProtocol();
+
+ /*!
+ * Use to conver number of operation to it's name.
+ */
+ virtual const char* printProcedure(std::size_t);
+
+ /*!
+ * Return number of groups
+ */
+ virtual std::size_t getGroups();
+
+ /*!
+ * Return first counter of group
+ */
+ virtual std::size_t getGroupBegin(std::size_t);
+
+ /*!
+ * Return amount of operations.
+ */
+ unsigned int getAmount() const;
+
+ /*!
+ * Return protocol's name.
+ */
+ std::string getProtocolName() const;
+
+private:
+ std::string name;
+ std::size_t amount;
+};
+//------------------------------------------------------------------------------
+#endif//ABSTRACT_PROTOCOL_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/cifsv1_protocol.cpp b/analyzers/src/watch/protocols/cifsv1_protocol.cpp
new file mode 100644
index 0000000..ac456ee
--- /dev/null
+++ b/analyzers/src/watch/protocols/cifsv1_protocol.cpp
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Sourcefor CIFSv1 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h> // include plugin development definitions
+#include "cifsv1_protocol.h"
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+CIFSv1Protocol::CIFSv1Protocol()
+: AbstractProtocol {"CIFS v1", static_cast<std::size_t>(SMBv1::SMBv1Commands::CMD_COUNT)}
+{
+}
+
+CIFSv1Protocol::~CIFSv1Protocol()
+{
+}
+
+const char* CIFSv1Protocol::printProcedure(std::size_t i)
+{
+ if ( i >= static_cast<std::size_t>(SMBv1::SMBv1Commands::CMD_COUNT)) { return nullptr; }
+ return print_cifs1_procedures(static_cast<SMBv1::SMBv1Commands>(i));
+}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/cifsv1_protocol.h b/analyzers/src/watch/protocols/cifsv1_protocol.h
new file mode 100644
index 0000000..6176318
--- /dev/null
+++ b/analyzers/src/watch/protocols/cifsv1_protocol.h
@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for CIFSv1 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFSV1_PROTOCOL_H
+#define CIFSV1_PROTOCOL_H
+//------------------------------------------------------------------------------
+#include "abstract_protocol.h"
+//------------------------------------------------------------------------------
+class CIFSv1Protocol : public AbstractProtocol
+{
+public:
+ CIFSv1Protocol();
+ ~CIFSv1Protocol();
+ virtual const char* printProcedure(std::size_t);
+};
+//------------------------------------------------------------------------------
+#endif//CIFSV1_PROTOCOL_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/cifsv2_protocol.cpp b/analyzers/src/watch/protocols/cifsv2_protocol.cpp
new file mode 100644
index 0000000..39a3f6a
--- /dev/null
+++ b/analyzers/src/watch/protocols/cifsv2_protocol.cpp
@@ -0,0 +1,41 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for CIFSv2 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h> // include plugin development definitions
+#include "cifsv2_protocol.h"
+//------------------------------------------------------------------------------
+CIFSv2Protocol::CIFSv2Protocol()
+: AbstractProtocol {"CIFS v2", static_cast<std::size_t>(SMBv2::SMBv2Commands::CMD_COUNT)}
+{
+}
+
+CIFSv2Protocol::~CIFSv2Protocol()
+{
+}
+
+const char* CIFSv2Protocol::printProcedure(std::size_t i)
+{
+ if ( i >= static_cast<std::size_t>(SMBv2::SMBv2Commands::CMD_COUNT)) { return nullptr; }
+ return print_cifs2_procedures(static_cast<SMBv2::SMBv2Commands>(i));
+}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/cifsv2_protocol.h b/analyzers/src/watch/protocols/cifsv2_protocol.h
new file mode 100644
index 0000000..b95a740
--- /dev/null
+++ b/analyzers/src/watch/protocols/cifsv2_protocol.h
@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for CIFSv2 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFSV2_PROTOCOL_H
+#define CIFSV2_PROTOCOL_H
+//------------------------------------------------------------------------------
+#include "abstract_protocol.h"
+//------------------------------------------------------------------------------
+class CIFSv2Protocol : public AbstractProtocol
+{
+public:
+ CIFSv2Protocol();
+ ~CIFSv2Protocol();
+ virtual const char* printProcedure(std::size_t);
+};
+//------------------------------------------------------------------------------
+#endif//CIFSV2_PROTOCOL_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/nfsv3_protocol.cpp b/analyzers/src/watch/protocols/nfsv3_protocol.cpp
new file mode 100644
index 0000000..39de02b
--- /dev/null
+++ b/analyzers/src/watch/protocols/nfsv3_protocol.cpp
@@ -0,0 +1,39 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for NFSv3 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h> // include plugin development definitions
+#include "nfsv3_protocol.h"
+//------------------------------------------------------------------------------
+NFSv3Protocol::NFSv3Protocol()
+: AbstractProtocol {"NFS v3", ProcEnumNFS3::count}
+{
+}
+
+NFSv3Protocol::~NFSv3Protocol()
+{
+}
+
+const char* NFSv3Protocol::printProcedure(std::size_t i)
+{
+ if ( i > ProcEnumNFS3::count) { return nullptr; }
+ return print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(i));
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/nfsv3_protocol.h b/analyzers/src/watch/protocols/nfsv3_protocol.h
new file mode 100644
index 0000000..d4e5119
--- /dev/null
+++ b/analyzers/src/watch/protocols/nfsv3_protocol.h
@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for NFSv3 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV3_PROTOCOL_H
+#define NFSV3_PROTOCOL_H
+//------------------------------------------------------------------------------
+#include "abstract_protocol.h"
+//------------------------------------------------------------------------------
+class NFSv3Protocol : public AbstractProtocol
+{
+public:
+ NFSv3Protocol();
+ ~NFSv3Protocol();
+ virtual const char* printProcedure(std::size_t);
+};
+//------------------------------------------------------------------------------
+#endif//NFSV3_PROTOCOL_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/nfsv41_protocol.cpp b/analyzers/src/watch/protocols/nfsv41_protocol.cpp
new file mode 100644
index 0000000..fbc7251
--- /dev/null
+++ b/analyzers/src/watch/protocols/nfsv41_protocol.cpp
@@ -0,0 +1,61 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for NFSv41 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h> // include plugin development definitions
+#include "nfsv41_protocol.h"
+//------------------------------------------------------------------------------
+namespace
+{
+const int NFSV41_NUMBEROFGROUPS = 2;
+const int PROCEDURES_GROUP = 1;
+const int OPERATIONS_GROUP = 2;
+}
+
+NFSv41Protocol::NFSv41Protocol()
+: AbstractProtocol {"NFS v41", ProcEnumNFS41::count}
+{
+}
+
+NFSv41Protocol::~NFSv41Protocol()
+{
+}
+
+const char* NFSv41Protocol::printProcedure(std::size_t i)
+{
+ if ( i > ProcEnumNFS41::count) { return nullptr; }
+ return print_nfs41_procedures(static_cast<ProcEnumNFS41::NFSProcedure>(i));
+}
+
+std::size_t NFSv41Protocol::getGroups()
+{
+ return NFSV41_NUMBEROFGROUPS;
+}
+
+std::size_t NFSv41Protocol::getGroupBegin(std::size_t i)
+{
+ if(i == PROCEDURES_GROUP)
+ return 0;
+ else if(i == OPERATIONS_GROUP)
+ return ProcEnumNFS4::count_proc;
+ else
+ return getAmount();
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/nfsv41_protocol.h b/analyzers/src/watch/protocols/nfsv41_protocol.h
new file mode 100644
index 0000000..8b74ab4
--- /dev/null
+++ b/analyzers/src/watch/protocols/nfsv41_protocol.h
@@ -0,0 +1,38 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for NFSv41 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV41_PROTOCOL_H
+#define NFSV41_PROTOCOL_H
+//------------------------------------------------------------------------------
+#include "abstract_protocol.h"
+//------------------------------------------------------------------------------
+class NFSv41Protocol : public AbstractProtocol
+{
+public:
+ NFSv41Protocol();
+ ~NFSv41Protocol();
+ virtual const char* printProcedure(std::size_t);
+ virtual std::size_t getGroups();
+ virtual std::size_t getGroupBegin(std::size_t);
+};
+//------------------------------------------------------------------------------
+#endif//NFSV41_PROTOCOL_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/nfsv4_protocol.cpp b/analyzers/src/watch/protocols/nfsv4_protocol.cpp
new file mode 100644
index 0000000..d22bcfc
--- /dev/null
+++ b/analyzers/src/watch/protocols/nfsv4_protocol.cpp
@@ -0,0 +1,61 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for NFSv4 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <api/plugin_api.h> // include plugin development definitions
+#include "nfsv4_protocol.h"
+//------------------------------------------------------------------------------
+namespace
+{
+const int NFSV4_NUMBER_OF_GROUPS = 2;
+const int PROCEDURES_GROUP = 1;
+const int OPERATIONS_GROUP = 2;
+}
+
+NFSv4Protocol::NFSv4Protocol()
+: AbstractProtocol {"NFS v4", ProcEnumNFS4::count}
+{
+}
+
+NFSv4Protocol::~NFSv4Protocol()
+{
+}
+
+const char* NFSv4Protocol::printProcedure(std::size_t i)
+{
+ if ( i > ProcEnumNFS4::count) { return nullptr; }
+ return print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(i));
+}
+
+std::size_t NFSv4Protocol::getGroups()
+{
+ return NFSV4_NUMBER_OF_GROUPS;
+}
+
+std::size_t NFSv4Protocol::getGroupBegin(std::size_t i)
+{
+ if(i == PROCEDURES_GROUP)
+ return 0;
+ else if(i == OPERATIONS_GROUP)
+ return ProcEnumNFS4::count_proc;
+ else
+ return getAmount();
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/protocols/nfsv4_protocol.h b/analyzers/src/watch/protocols/nfsv4_protocol.h
new file mode 100644
index 0000000..bc39391
--- /dev/null
+++ b/analyzers/src/watch/protocols/nfsv4_protocol.h
@@ -0,0 +1,38 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for NFSv4 protocol.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFSV4_PROTOCOL_H
+#define NFSV4_PROTOCOL_H
+//------------------------------------------------------------------------------
+#include "abstract_protocol.h"
+//------------------------------------------------------------------------------
+class NFSv4Protocol : public AbstractProtocol
+{
+public:
+ NFSv4Protocol();
+ ~NFSv4Protocol();
+ virtual const char* printProcedure(std::size_t);
+ virtual std::size_t getGroups();
+ virtual std::size_t getGroupBegin(std::size_t);
+};
+//------------------------------------------------------------------------------
+#endif//PROTOCOLS_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/user_gui.cpp b/analyzers/src/watch/user_gui.cpp
new file mode 100644
index 0000000..6e7d6de
--- /dev/null
+++ b/analyzers/src/watch/user_gui.cpp
@@ -0,0 +1,211 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Source for UserGui.
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <algorithm>
+#include <exception>
+#include <iostream>
+#include <system_error>
+
+#include <unistd.h>
+
+#include <api/plugin_api.h>
+#include "nc_windows/header_window.h"
+#include "nc_windows/main_window.h"
+#include "nc_windows/statistics_window.h"
+#include "user_gui.h"
+//-----------------------------------------------------------------------------
+namespace
+{
+const int SCROLL_UP = 1;
+const int SCROLL_DOWN = -1;
+const int MSEC = 1000000;
+}
+//------------------------------------------------------------------------------
+void UserGUI::run()
+{
+ try
+ {
+ // prepare for select
+ fd_set rfds;
+
+ MainWindow mainWindow;
+ HeaderWindow headerWindow(mainWindow);
+ StatisticsWindow statisticsWindow(mainWindow, _statisticsContainers);
+
+ /* Watch stdin (fd 0) to see when it has input. */
+ FD_ZERO(&rfds);
+ FD_SET(STDIN_FILENO, &rfds);
+
+ /* Set wait time. */
+ struct timeval tv = getTimeval();
+
+ uint16_t key = 0;
+
+ std::vector<std::size_t> tmp;
+
+ statisticsWindow.updateProtocol(_activeProtocol);
+
+ while (_running.test_and_set())
+ {
+ if (_shouldResize)
+ {
+ mainWindow.resize();
+ headerWindow.resize(mainWindow);
+ statisticsWindow.resize(mainWindow);
+ statisticsWindow.updateProtocol(_activeProtocol);
+
+ _shouldResize = false;
+ }
+ if (_running.test_and_set())
+ {
+ std::unique_lock<std::mutex>lck(_statisticsDeltaMutex);
+ tmp = _statisticsContainers.at(_activeProtocol);
+ }
+ headerWindow.update();
+ statisticsWindow.update(tmp);
+ mainWindow.update();
+
+ if( select(STDIN_FILENO + 1, &rfds, nullptr, nullptr, &tv) == -1)
+ {
+ break;
+ }
+ else
+ {
+ key = mainWindow.inputKeys();
+ if (key == KEY_LEFT || key == KEY_RIGHT)
+ {
+ auto it = find_if (_allProtocols.begin(), _allProtocols.end(), [&](std::string s)
+ {
+ return !(s.compare(_activeProtocol->getProtocolName()));
+ });
+ if (it != _allProtocols.end())
+ {
+ if (key == KEY_LEFT)
+ {
+ if (it + 1 == _allProtocols.end())
+ it = _allProtocols.begin();
+ else
+ ++it;
+ }
+ else if (key == KEY_RIGHT)
+ {
+ if (it == _allProtocols.begin())
+ it = _allProtocols.end() - 1;
+ else
+ --it;
+ }
+ auto a = find_if ( _statisticsContainers.begin(), _statisticsContainers.end(),[&](std::pair<AbstractProtocol*, std::vector<std::size_t> > p)
+ {
+ return !(p.first->getProtocolName().compare(*it));
+ });
+ if (a != _statisticsContainers.end())
+ {
+ _activeProtocol = a->first;
+ statisticsWindow.setProtocol(_activeProtocol);
+ statisticsWindow.resize(mainWindow);
+ {
+ std::unique_lock<std::mutex>lck(_statisticsDeltaMutex);
+ tmp = a->second;
+ }
+ statisticsWindow.update(tmp);
+ }
+ }
+ }
+ else if (key == KEY_UP)
+ {
+ statisticsWindow.scrollContent(SCROLL_UP);
+ statisticsWindow.update(tmp);
+ }
+ else if (key == KEY_DOWN)
+ {
+ statisticsWindow.scrollContent(SCROLL_DOWN);
+ statisticsWindow.update(tmp);
+ }
+ }
+ tv = getTimeval();
+ }
+ }
+ catch (std::runtime_error& e)
+ {
+ std::cerr << "Watch plugin error: " << e.what();
+ }
+}
+
+timeval UserGUI::getTimeval() const
+{
+ struct timeval tv;
+ tv.tv_sec = _refresh_delta / MSEC;
+ tv.tv_usec = _refresh_delta % MSEC;
+ return tv;
+}
+
+UserGUI::UserGUI(const char* opts, std::vector<AbstractProtocol* >& data)
+: _refresh_delta {900000}
+, _shouldResize {false}
+, _running {ATOMIC_FLAG_INIT}
+, _activeProtocol(nullptr)
+{
+ try
+ {
+ if (opts != nullptr && *opts != '\0' )
+ {
+ _refresh_delta = std::stoul(opts);
+ }
+ for (auto it = data.begin(); it != data.end(); ++it)
+ {
+ _allProtocols.push_back((*it)->getProtocolName());
+ _statisticsContainers.insert(std::make_pair<AbstractProtocol*, std::vector<std::size_t> >((AbstractProtocol*&&)(*it), std::vector<std::size_t>((*it)->getAmount(), 0)));
+ }
+ if (_activeProtocol == nullptr && ! data.empty())
+ {
+ _activeProtocol = data.back();
+ }
+ }
+ catch (std::exception& e)
+ {
+ throw std::runtime_error {std::string{"Error in plugin options processing. OPTS: "} + opts + std::string(" Error: ") + e.what()};
+ }
+ _running.test_and_set();
+ _guiThread = std::thread(&UserGUI::run, this);
+}
+
+UserGUI::~UserGUI()
+{
+ _running.clear();
+ _guiThread.join();
+}
+
+void UserGUI::update(AbstractProtocol* p, std::vector<std::size_t>& d)
+{
+ std::vector<std::size_t>::iterator it;
+ std::vector<std::size_t>::iterator st;
+ std::unique_lock<std::mutex>lck(_statisticsDeltaMutex);
+ for (it = (_statisticsContainers.at(p)).begin(), st = d.begin(); it != (_statisticsContainers.at(p)).end() && st != d.end(); ++it, ++st)
+ {
+ (*it) += (*st);
+ }
+}
+
+void UserGUI::enableUpdate()
+{
+ _shouldResize = true;
+}
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/user_gui.h b/analyzers/src/watch/user_gui.h
new file mode 100644
index 0000000..b40dd52
--- /dev/null
+++ b/analyzers/src/watch/user_gui.h
@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// Author: Vitali Adamenka
+// Description: Header for UserGUI
+// Copyright (c) 2015 EPAM Systems. All Rights Reserved.
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef USERGUI_H
+#define USERGUI_H
+//------------------------------------------------------------------------------
+#include <atomic>
+#include <cstdlib>
+#include <mutex>
+#include <thread>
+#include <vector>
+
+#include <ncurses.h>
+#include "protocols/abstract_protocol.h"
+//------------------------------------------------------------------------------
+class UserGUI
+{
+public:
+ using ProtocolStatistic = std::vector<std::size_t>;
+ using StatisticsContainers = std::unordered_map<AbstractProtocol*, ProtocolStatistic>;
+
+private:
+ unsigned long _refresh_delta; // in microseconds
+
+ std::atomic<bool> _shouldResize;
+ std::mutex _statisticsDeltaMutex;
+ std::atomic_flag _running;
+
+ StatisticsContainers _statisticsContainers;
+
+ AbstractProtocol* _activeProtocol;
+ std::thread _guiThread;
+ std::vector<std::string> _allProtocols;
+ void run();
+ timeval getTimeval() const;
+public:
+
+ UserGUI() = delete;
+ UserGUI(const char*, std::vector<AbstractProtocol* >&);
+ ~UserGUI();
+
+ /*! Update Protocol's data.
+ */
+ void update(AbstractProtocol*, std::vector<std::size_t>&);
+
+ /*! Enable screen full update. Use for resize main window.
+ */
+ void enableUpdate();
+};
+//------------------------------------------------------------------------------
+#endif//USERGUI_H
+//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/watch_analyzer.cpp b/analyzers/src/watch/watch_analyzer.cpp
index c831fe1..26dd4f9 100644
--- a/analyzers/src/watch/watch_analyzer.cpp
+++ b/analyzers/src/watch/watch_analyzer.cpp
@@ -1,6 +1,6 @@
//------------------------------------------------------------------------------
// Author: Vitali Adamenka
-// Description: Source file for WatchAnalyzer based on TestAnalyzer.cpp
+// Description: Source file for WatchAnalyzer based on TestAnalyzer.cpp
// Copyright (c) 2014 EPAM Systems. All Rights Reserved.
//------------------------------------------------------------------------------
/*
@@ -19,226 +19,961 @@
along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
+#include <algorithm>
#include <iostream>
#include <string>
+#include <unordered_map>
#include <unistd.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
#include "watch_analyzer.h"
//------------------------------------------------------------------------------
WatchAnalyzer::WatchAnalyzer(const char* opts)
-: nfs3_proc_total {0}
-, nfs3_proc_count (ProcEnumNFS3::count, 0)
-, nfs4_proc_total {0}
-, nfs4_ops_total {0}
-, nfs4_proc_count (ProcEnumNFS4::count, 0)
-, monitor_running {ATOMIC_FLAG_INIT}
-, refresh_delta {2000}
-, max_read {5}
-, read_counter {0}
-{
- monitor_running.test_and_set();
- if(*opts != '\0') try
- {
- refresh_delta = std::stoul(opts);
- }
- catch(std::exception& e)
- {
- throw std::runtime_error{std::string{"Error in plugin options processing. OPTS: "} + opts + " Error: " + e.what()};
- }
- monitor_thread = std::thread(&WatchAnalyzer::thread, this);
+: _cifsv2 {}
+, _cifsv1 {}
+, _nfsv41 {}
+, _nfsv4 {}
+, _nfsv3 {}
+, protocols {&_cifsv2, &_cifsv1, &_nfsv41, &_nfsv4, &_nfsv3}
+, gui {opts, protocols}
+{
}
WatchAnalyzer::~WatchAnalyzer()
{
- if (monitor_thread.joinable())
- {
- monitor_running.clear();
- monitor_thread.join();
- }
}
-void WatchAnalyzer::null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL3args*,
- const struct rpcgen::NULL3res*) { account(proc);}
-void WatchAnalyzer::getattr3(const struct RPCProcedure* proc,
- const struct rpcgen::GETATTR3args*,
- const struct rpcgen::GETATTR3res*) { account(proc);}
-void WatchAnalyzer::setattr3(const struct RPCProcedure* proc,
- const struct rpcgen::SETATTR3args*,
- const struct rpcgen::SETATTR3res*) { account(proc);}
-void WatchAnalyzer::lookup3(const struct RPCProcedure* proc,
- const struct rpcgen::LOOKUP3args*,
- const struct rpcgen::LOOKUP3res*) { account(proc);}
-void WatchAnalyzer::access3(const struct RPCProcedure* proc,
- const struct rpcgen::ACCESS3args*,
- const struct rpcgen::ACCESS3res*) { account(proc);}
-void WatchAnalyzer::readlink3(const struct RPCProcedure* proc,
- const struct rpcgen::READLINK3args*,
- const struct rpcgen::READLINK3res*) { account(proc);}
-void WatchAnalyzer::read3(const struct RPCProcedure* proc,
- const struct rpcgen::READ3args*,
- const struct rpcgen::READ3res*) { account(proc);}
-void WatchAnalyzer::write3(const struct RPCProcedure* proc,
- const struct rpcgen::WRITE3args*,
- const struct rpcgen::WRITE3res*) { account(proc);}
-void WatchAnalyzer::create3(const struct RPCProcedure* proc,
- const struct rpcgen::CREATE3args*,
- const struct rpcgen::CREATE3res*) { account(proc);}
-void WatchAnalyzer::mkdir3(const struct RPCProcedure* proc,
- const struct rpcgen::MKDIR3args*,
- const struct rpcgen::MKDIR3res*) { account(proc);}
-void WatchAnalyzer::symlink3(const struct RPCProcedure* proc,
- const struct rpcgen::SYMLINK3args*,
- const struct rpcgen::SYMLINK3res*) { account(proc);}
-void WatchAnalyzer::mknod3(const struct RPCProcedure* proc,
- const struct rpcgen::MKNOD3args*,
- const struct rpcgen::MKNOD3res*) { account(proc);}
-void WatchAnalyzer::remove3(const struct RPCProcedure* proc,
- const struct rpcgen::REMOVE3args*,
- const struct rpcgen::REMOVE3res*) { account(proc);}
-void WatchAnalyzer::rmdir3(const struct RPCProcedure* proc,
- const struct rpcgen::RMDIR3args*,
- const struct rpcgen::RMDIR3res*) { account(proc);}
-void WatchAnalyzer::rename3(const struct RPCProcedure* proc,
- const struct rpcgen::RENAME3args*,
- const struct rpcgen::RENAME3res*) { account(proc);}
-void WatchAnalyzer::link3(const struct RPCProcedure* proc,
- const struct rpcgen::LINK3args*,
- const struct rpcgen::LINK3res*) { account(proc);}
-void WatchAnalyzer::readdir3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIR3args*,
- const struct rpcgen::READDIR3res*) { account(proc);}
-void WatchAnalyzer::readdirplus3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIRPLUS3args*,
- const struct rpcgen::READDIRPLUS3res*) { account(proc);}
-void WatchAnalyzer::fsstat3(const struct RPCProcedure* proc,
- const struct rpcgen::FSSTAT3args*,
- const struct rpcgen::FSSTAT3res*) { account(proc);}
-void WatchAnalyzer::fsinfo3(const struct RPCProcedure* proc,
- const struct rpcgen::FSINFO3args*,
- const struct rpcgen::FSINFO3res*) { account(proc);}
-void WatchAnalyzer::pathconf3(const struct RPCProcedure* proc,
- const struct rpcgen::PATHCONF3args*,
- const struct rpcgen::PATHCONF3res*) { account(proc);}
-void WatchAnalyzer::commit3(const struct RPCProcedure* proc,
- const struct rpcgen::COMMIT3args*,
- const struct rpcgen::COMMIT3res*) { account(proc);}
-
-void WatchAnalyzer::null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL4args*,
- const struct rpcgen::NULL4res*) { account(proc);}
-void WatchAnalyzer::compound4(const struct RPCProcedure* proc,
- const struct rpcgen::COMPOUND4args*,
- const struct rpcgen::COMPOUND4res* res) { account(proc, res);}
+void WatchAnalyzer::null(const RPCProcedure* proc,
+ const struct NFS3::NULL3args*,
+ const struct NFS3::NULL3res*) { nfs_account(proc); }
+void WatchAnalyzer::getattr3(const RPCProcedure* proc,
+ const struct NFS3::GETATTR3args*,
+ const struct NFS3::GETATTR3res*) { nfs_account(proc); }
+void WatchAnalyzer::setattr3(const RPCProcedure* proc,
+ const struct NFS3::SETATTR3args*,
+ const struct NFS3::SETATTR3res*) { nfs_account(proc); }
+void WatchAnalyzer::lookup3(const RPCProcedure* proc,
+ const struct NFS3::LOOKUP3args*,
+ const struct NFS3::LOOKUP3res*) { nfs_account(proc); }
+void WatchAnalyzer::access3(const RPCProcedure* proc,
+ const struct NFS3::ACCESS3args*,
+ const struct NFS3::ACCESS3res*) { nfs_account(proc); }
+void WatchAnalyzer::readlink3(const RPCProcedure* proc,
+ const struct NFS3::READLINK3args*,
+ const struct NFS3::READLINK3res*) { nfs_account(proc); }
+void WatchAnalyzer::read3(const RPCProcedure* proc,
+ const struct NFS3::READ3args*,
+ const struct NFS3::READ3res*) { nfs_account(proc); }
+void WatchAnalyzer::write3(const RPCProcedure* proc,
+ const struct NFS3::WRITE3args*,
+ const struct NFS3::WRITE3res*) { nfs_account(proc); }
+void WatchAnalyzer::create3(const RPCProcedure* proc,
+ const struct NFS3::CREATE3args*,
+ const struct NFS3::CREATE3res*) { nfs_account(proc); }
+void WatchAnalyzer::mkdir3(const RPCProcedure* proc,
+ const struct NFS3::MKDIR3args*,
+ const struct NFS3::MKDIR3res*) { nfs_account(proc); }
+void WatchAnalyzer::symlink3(const RPCProcedure* proc,
+ const struct NFS3::SYMLINK3args*,
+ const struct NFS3::SYMLINK3res*) { nfs_account(proc); }
+void WatchAnalyzer::mknod3(const RPCProcedure* proc,
+ const struct NFS3::MKNOD3args*,
+ const struct NFS3::MKNOD3res*) { nfs_account(proc); }
+void WatchAnalyzer::remove3(const RPCProcedure* proc,
+ const struct NFS3::REMOVE3args*,
+ const struct NFS3::REMOVE3res*) { nfs_account(proc); }
+void WatchAnalyzer::rmdir3(const RPCProcedure* proc,
+ const struct NFS3::RMDIR3args*,
+ const struct NFS3::RMDIR3res*) { nfs_account(proc); }
+void WatchAnalyzer::rename3(const RPCProcedure* proc,
+ const struct NFS3::RENAME3args*,
+ const struct NFS3::RENAME3res*) { nfs_account(proc); }
+void WatchAnalyzer::link3(const RPCProcedure* proc,
+ const struct NFS3::LINK3args*,
+ const struct NFS3::LINK3res*) { nfs_account(proc); }
+void WatchAnalyzer::readdir3(const RPCProcedure* proc,
+ const struct NFS3::READDIR3args*,
+ const struct NFS3::READDIR3res*) { nfs_account(proc); }
+void WatchAnalyzer::readdirplus3(const RPCProcedure* proc,
+ const struct NFS3::READDIRPLUS3args*,
+ const struct NFS3::READDIRPLUS3res*) { nfs_account(proc); }
+void WatchAnalyzer::fsstat3(const RPCProcedure* proc,
+ const struct NFS3::FSSTAT3args*,
+ const struct NFS3::FSSTAT3res*) { nfs_account(proc); }
+void WatchAnalyzer::fsinfo3(const RPCProcedure* proc,
+ const struct NFS3::FSINFO3args*,
+ const struct NFS3::FSINFO3res*) { nfs_account(proc); }
+void WatchAnalyzer::pathconf3(const RPCProcedure* proc,
+ const struct NFS3::PATHCONF3args*,
+ const struct NFS3::PATHCONF3res*) { nfs_account(proc); }
+void WatchAnalyzer::commit3(const RPCProcedure* proc,
+ const struct NFS3::COMMIT3args*,
+ const struct NFS3::COMMIT3res*) { nfs_account(proc); }
-void WatchAnalyzer::flush_statistics()
+// NFS4.0 procedures
+
+void WatchAnalyzer::null4(const RPCProcedure* proc,
+ const struct NFS4::NULL4args*,
+ const struct NFS4::NULL4res*) { nfs_account(proc, NFS_V40); }
+void WatchAnalyzer::compound4(const RPCProcedure* proc,
+ const struct NFS4::COMPOUND4args*,
+ const struct NFS4::COMPOUND4res*) { nfs_account(proc, NFS_V40); }
+
+// NFS4.0 operations
+
+void WatchAnalyzer::access40(const RPCProcedure* proc,
+ const struct NFS4::ACCESS4args*,
+ const struct NFS4::ACCESS4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::ACCESS); } }
+
+void WatchAnalyzer::close40(const RPCProcedure* proc,
+ const struct NFS4::CLOSE4args*,
+ const struct NFS4::CLOSE4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::CLOSE); } }
+void WatchAnalyzer::commit40(const RPCProcedure* proc,
+ const struct NFS4::COMMIT4args*,
+ const struct NFS4::COMMIT4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::COMMIT); } }
+void WatchAnalyzer::create40(const RPCProcedure* proc,
+ const struct NFS4::CREATE4args*,
+ const struct NFS4::CREATE4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::CREATE); } }
+void WatchAnalyzer::delegpurge40(const RPCProcedure* proc,
+ const struct NFS4::DELEGPURGE4args*,
+ const struct NFS4::DELEGPURGE4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::DELEGPURGE); } }
+void WatchAnalyzer::delegreturn40(const RPCProcedure* proc,
+ const struct NFS4::DELEGRETURN4args*,
+ const struct NFS4::DELEGRETURN4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::DELEGRETURN); } }
+void WatchAnalyzer::getattr40(const RPCProcedure* proc,
+ const struct NFS4::GETATTR4args*,
+ const struct NFS4::GETATTR4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::GETATTR); } }
+void WatchAnalyzer::getfh40(const RPCProcedure* proc,
+ const struct NFS4::GETFH4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::GETFH); } }
+void WatchAnalyzer::link40(const RPCProcedure* proc,
+ const struct NFS4::LINK4args*,
+ const struct NFS4::LINK4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::LINK); } }
+void WatchAnalyzer::lock40(const RPCProcedure* proc,
+ const struct NFS4::LOCK4args*,
+ const struct NFS4::LOCK4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::LOCK); } }
+void WatchAnalyzer::lockt40(const RPCProcedure* proc,
+ const struct NFS4::LOCKT4args*,
+ const struct NFS4::LOCKT4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::LOCKT); } }
+void WatchAnalyzer::locku40(const RPCProcedure* proc,
+ const struct NFS4::LOCKU4args*,
+ const struct NFS4::LOCKU4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::LOCKU); } }
+void WatchAnalyzer::lookup40(const RPCProcedure* proc,
+ const struct NFS4::LOOKUP4args*,
+ const struct NFS4::LOOKUP4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::LOOKUP); } }
+void WatchAnalyzer::lookupp40(const RPCProcedure* proc,
+ const struct NFS4::LOOKUPP4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::LOOKUPP); } }
+void WatchAnalyzer::nverify40(const RPCProcedure* proc,
+ const struct NFS4::NVERIFY4args*,
+ const struct NFS4::NVERIFY4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::NVERIFY); } }
+void WatchAnalyzer::open40(const RPCProcedure* proc,
+ const struct NFS4::OPEN4args*,
+ const struct NFS4::OPEN4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::OPEN); } }
+void WatchAnalyzer::openattr40(const RPCProcedure* proc,
+ const struct NFS4::OPENATTR4args*,
+ const struct NFS4::OPENATTR4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::OPENATTR); } }
+void WatchAnalyzer::open_confirm40(const RPCProcedure* proc,
+ const struct NFS4::OPEN_CONFIRM4args*,
+ const struct NFS4::OPEN_CONFIRM4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::OPEN_CONFIRM); } }
+void WatchAnalyzer::open_downgrade40(const RPCProcedure* proc,
+ const struct NFS4::OPEN_DOWNGRADE4args*,
+ const struct NFS4::OPEN_DOWNGRADE4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::OPEN_DOWNGRADE); } }
+void WatchAnalyzer::putfh40(const RPCProcedure* proc,
+ const struct NFS4::PUTFH4args*,
+ const struct NFS4::PUTFH4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::PUTFH); } }
+void WatchAnalyzer::putpubfh40(const RPCProcedure* proc,
+ const struct NFS4::PUTPUBFH4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::PUTPUBFH); } }
+void WatchAnalyzer::putrootfh40(const RPCProcedure* proc,
+ const struct NFS4::PUTROOTFH4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::PUTROOTFH); } }
+void WatchAnalyzer::read40(const RPCProcedure* proc,
+ const struct NFS4::READ4args*,
+ const struct NFS4::READ4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::READ); } }
+void WatchAnalyzer::readdir40(const RPCProcedure* proc,
+ const struct NFS4::READDIR4args*,
+ const struct NFS4::READDIR4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::READDIR); } }
+void WatchAnalyzer::readlink40(const RPCProcedure* proc,
+ const struct NFS4::READLINK4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::READLINK); } }
+void WatchAnalyzer::remove40(const RPCProcedure* proc,
+ const struct NFS4::REMOVE4args*,
+ const struct NFS4::REMOVE4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::REMOVE); } }
+void WatchAnalyzer::rename40(const RPCProcedure* proc,
+ const struct NFS4::RENAME4args*,
+ const struct NFS4::RENAME4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::RENAME); } }
+void WatchAnalyzer::renew40(const RPCProcedure* proc,
+ const struct NFS4::RENEW4args*,
+ const struct NFS4::RENEW4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::RENEW); } }
+void WatchAnalyzer::restorefh40(const RPCProcedure* proc,
+ const struct NFS4::RESTOREFH4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::RESTOREFH); } }
+void WatchAnalyzer::savefh40(const RPCProcedure* proc,
+ const struct NFS4::SAVEFH4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::SAVEFH); } }
+void WatchAnalyzer::secinfo40(const RPCProcedure* proc,
+ const struct NFS4::SECINFO4args*,
+ const struct NFS4::SECINFO4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::SECINFO); } }
+void WatchAnalyzer::setattr40(const RPCProcedure* proc,
+ const struct NFS4::SETATTR4args*,
+ const struct NFS4::SETATTR4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::SETATTR); } }
+void WatchAnalyzer::setclientid40(const RPCProcedure* proc,
+ const struct NFS4::SETCLIENTID4args*,
+ const struct NFS4::SETCLIENTID4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::SETCLIENTID); } }
+void WatchAnalyzer::setclientid_confirm40(const RPCProcedure* proc,
+ const struct NFS4::SETCLIENTID_CONFIRM4args*,
+ const struct NFS4::SETCLIENTID_CONFIRM4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::SETCLIENTID_CONFIRM); } }
+void WatchAnalyzer::verify40(const RPCProcedure* proc,
+ const struct NFS4::VERIFY4args*,
+ const struct NFS4::VERIFY4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::VERIFY); } }
+void WatchAnalyzer::write40(const RPCProcedure* proc,
+ const struct NFS4::WRITE4args*,
+ const struct NFS4::WRITE4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::WRITE); } }
+void WatchAnalyzer::release_lockowner40(const RPCProcedure* proc,
+ const struct NFS4::RELEASE_LOCKOWNER4args*,
+ const struct NFS4::RELEASE_LOCKOWNER4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::RELEASE_LOCKOWNER); } }
+void WatchAnalyzer::get_dir_delegation40(const RPCProcedure* proc,
+ const struct NFS4::GET_DIR_DELEGATION4args*,
+ const struct NFS4::GET_DIR_DELEGATION4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::GET_DIR_DELEGATION); } }
+void WatchAnalyzer::illegal40(const RPCProcedure* proc,
+ const struct NFS4::ILLEGAL4res* res) { if (res) { account40_op(proc, ProcEnumNFS4::NFSProcedure::ILLEGAL); } }
+
+// NFSv4.1 procedures
+
+void WatchAnalyzer::compound41(const RPCProcedure* proc,
+ const struct NFS41::COMPOUND4args*,
+ const struct NFS41::COMPOUND4res*) { nfs_account(proc, NFS_V41); }
+
+// NFSv4.1 operations
+void WatchAnalyzer::access41(const RPCProcedure* proc,
+ const struct NFS41::ACCESS4args*,
+ const struct NFS41::ACCESS4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::ACCESS); } }
+
+void WatchAnalyzer::close41(const RPCProcedure* proc,
+ const struct NFS41::CLOSE4args*,
+ const struct NFS41::CLOSE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::CLOSE); } }
+void WatchAnalyzer::commit41(const RPCProcedure* proc,
+ const struct NFS41::COMMIT4args*,
+ const struct NFS41::COMMIT4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::COMMIT); } }
+void WatchAnalyzer::create41(const RPCProcedure* proc,
+ const struct NFS41::CREATE4args*,
+ const struct NFS41::CREATE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::CREATE); } }
+void WatchAnalyzer::delegpurge41(const RPCProcedure* proc,
+ const struct NFS41::DELEGPURGE4args*,
+ const struct NFS41::DELEGPURGE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::DELEGPURGE); } }
+void WatchAnalyzer::delegreturn41(const RPCProcedure* proc,
+ const struct NFS41::DELEGRETURN4args*,
+ const struct NFS41::DELEGRETURN4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::DELEGRETURN); } }
+void WatchAnalyzer::getattr41(const RPCProcedure* proc,
+ const struct NFS41::GETATTR4args*,
+ const struct NFS41::GETATTR4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::GETATTR); } }
+void WatchAnalyzer::getfh41(const RPCProcedure* proc,
+ const struct NFS41::GETFH4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::GETFH); } }
+void WatchAnalyzer::link41(const RPCProcedure* proc,
+ const struct NFS41::LINK4args*,
+ const struct NFS41::LINK4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LINK); } }
+void WatchAnalyzer::lock41(const RPCProcedure* proc,
+ const struct NFS41::LOCK4args*,
+ const struct NFS41::LOCK4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LOCK); } }
+void WatchAnalyzer::lockt41(const RPCProcedure* proc,
+ const struct NFS41::LOCKT4args*,
+ const struct NFS41::LOCKT4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LOCKT); } }
+void WatchAnalyzer::locku41(const RPCProcedure* proc,
+ const struct NFS41::LOCKU4args*,
+ const struct NFS41::LOCKU4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LOCKU); } }
+void WatchAnalyzer::lookup41(const RPCProcedure* proc,
+ const struct NFS41::LOOKUP4args*,
+ const struct NFS41::LOOKUP4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LOOKUP); } }
+void WatchAnalyzer::lookupp41(const RPCProcedure* proc,
+ const struct NFS41::LOOKUPP4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LOOKUPP); } }
+void WatchAnalyzer::nverify41(const RPCProcedure* proc,
+ const struct NFS41::NVERIFY4args*,
+ const struct NFS41::NVERIFY4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::NVERIFY); } }
+void WatchAnalyzer::open41(const RPCProcedure* proc,
+ const struct NFS41::OPEN4args*,
+ const struct NFS41::OPEN4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::OPEN); } }
+void WatchAnalyzer::openattr41(const RPCProcedure* proc,
+ const struct NFS41::OPENATTR4args*,
+ const struct NFS41::OPENATTR4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::OPENATTR); } }
+void WatchAnalyzer::open_confirm41(const RPCProcedure* proc,
+ const struct NFS41::OPEN_CONFIRM4args*,
+ const struct NFS41::OPEN_CONFIRM4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::OPEN_CONFIRM); } }
+void WatchAnalyzer::open_downgrade41(const RPCProcedure* proc,
+ const struct NFS41::OPEN_DOWNGRADE4args*,
+ const struct NFS41::OPEN_DOWNGRADE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::OPEN_DOWNGRADE); } }
+void WatchAnalyzer::putfh41(const RPCProcedure* proc,
+ const struct NFS41::PUTFH4args*,
+ const struct NFS41::PUTFH4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::PUTFH); } }
+void WatchAnalyzer::putpubfh41(const RPCProcedure* proc,
+ const struct NFS41::PUTPUBFH4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::PUTPUBFH); } }
+void WatchAnalyzer::putrootfh41(const RPCProcedure* proc,
+ const struct NFS41::PUTROOTFH4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::PUTROOTFH); } }
+void WatchAnalyzer::read41(const RPCProcedure* proc,
+ const struct NFS41::READ4args*,
+ const struct NFS41::READ4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::READ); } }
+void WatchAnalyzer::readdir41(const RPCProcedure* proc,
+ const struct NFS41::READDIR4args*,
+ const struct NFS41::READDIR4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::READDIR); } }
+void WatchAnalyzer::readlink41(const RPCProcedure* proc,
+ const struct NFS41::READLINK4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::READLINK); } }
+void WatchAnalyzer::remove41(const RPCProcedure* proc,
+ const struct NFS41::REMOVE4args*,
+ const struct NFS41::REMOVE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::REMOVE); } }
+void WatchAnalyzer::rename41(const RPCProcedure* proc,
+ const struct NFS41::RENAME4args*,
+ const struct NFS41::RENAME4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::RENAME); } }
+void WatchAnalyzer::renew41(const RPCProcedure* proc,
+ const struct NFS41::RENEW4args*,
+ const struct NFS41::RENEW4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::RENEW); } }
+void WatchAnalyzer::restorefh41(const RPCProcedure* proc,
+ const struct NFS41::RESTOREFH4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::RESTOREFH); } }
+void WatchAnalyzer::savefh41(const RPCProcedure* proc,
+ const struct NFS41::SAVEFH4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SAVEFH); } }
+void WatchAnalyzer::secinfo41(const RPCProcedure* proc,
+ const struct NFS41::SECINFO4args*,
+ const struct NFS41::SECINFO4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SECINFO); } }
+void WatchAnalyzer::setattr41(const RPCProcedure* proc,
+ const struct NFS41::SETATTR4args*,
+ const struct NFS41::SETATTR4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SETATTR); } }
+void WatchAnalyzer::setclientid41(const RPCProcedure* proc,
+ const struct NFS41::SETCLIENTID4args*,
+ const struct NFS41::SETCLIENTID4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SETCLIENTID); } }
+void WatchAnalyzer::setclientid_confirm41(const RPCProcedure* proc,
+ const struct NFS41::SETCLIENTID_CONFIRM4args*,
+ const struct NFS41::SETCLIENTID_CONFIRM4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SETCLIENTID_CONFIRM); } }
+void WatchAnalyzer::verify41(const RPCProcedure* proc,
+ const struct NFS41::VERIFY4args*,
+ const struct NFS41::VERIFY4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::VERIFY); } }
+void WatchAnalyzer::write41(const RPCProcedure* proc,
+ const struct NFS41::WRITE4args*,
+ const struct NFS41::WRITE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::WRITE); } }
+void WatchAnalyzer::release_lockowner41(const RPCProcedure* proc,
+ const struct NFS41::RELEASE_LOCKOWNER4args*,
+ const struct NFS41::RELEASE_LOCKOWNER4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::RELEASE_LOCKOWNER); } }
+void WatchAnalyzer::backchannel_ctl41(const RPCProcedure* proc,
+ const struct NFS41::BACKCHANNEL_CTL4args*,
+ const struct NFS41::BACKCHANNEL_CTL4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::BACKCHANNEL_CTL); } }
+void WatchAnalyzer::bind_conn_to_session41(const RPCProcedure* proc,
+ const struct NFS41::BIND_CONN_TO_SESSION4args*,
+ const struct NFS41::BIND_CONN_TO_SESSION4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::BIND_CONN_TO_SESSION); } }
+void WatchAnalyzer::exchange_id41(const RPCProcedure* proc,
+ const struct NFS41::EXCHANGE_ID4args*,
+ const struct NFS41::EXCHANGE_ID4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::EXCHANGE_ID); } }
+void WatchAnalyzer::create_session41(const RPCProcedure* proc,
+ const struct NFS41::CREATE_SESSION4args*,
+ const struct NFS41::CREATE_SESSION4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::CREATE_SESSION); } }
+void WatchAnalyzer::destroy_session41(const RPCProcedure* proc,
+ const struct NFS41::DESTROY_SESSION4args*,
+ const struct NFS41::DESTROY_SESSION4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::DESTROY_SESSION); } }
+void WatchAnalyzer::free_stateid41(const RPCProcedure* proc,
+ const struct NFS41::FREE_STATEID4args*,
+ const struct NFS41::FREE_STATEID4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::FREE_STATEID); } }
+void WatchAnalyzer::get_dir_delegation41(const RPCProcedure* proc,
+ const struct NFS41::GET_DIR_DELEGATION4args*,
+ const struct NFS41::GET_DIR_DELEGATION4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::GET_DIR_DELEGATION); } }
+void WatchAnalyzer::getdeviceinfo41(const RPCProcedure* proc,
+ const struct NFS41::GETDEVICEINFO4args*,
+ const struct NFS41::GETDEVICEINFO4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::GETDEVICEINFO); } }
+void WatchAnalyzer::getdevicelist41(const RPCProcedure* proc,
+ const struct NFS41::GETDEVICELIST4args*,
+ const struct NFS41::GETDEVICELIST4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::GETDEVICELIST); } }
+void WatchAnalyzer::layoutcommit41(const RPCProcedure* proc,
+ const struct NFS41::LAYOUTCOMMIT4args*,
+ const struct NFS41::LAYOUTCOMMIT4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LAYOUTCOMMIT); } }
+void WatchAnalyzer::layoutget41(const RPCProcedure* proc,
+ const struct NFS41::LAYOUTGET4args*,
+ const struct NFS41::LAYOUTGET4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LAYOUTGET); } }
+void WatchAnalyzer::layoutreturn41(const RPCProcedure* proc,
+ const struct NFS41::LAYOUTRETURN4args*,
+ const struct NFS41::LAYOUTRETURN4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::LAYOUTRETURN); } }
+void WatchAnalyzer::secinfo_no_name41(const RPCProcedure* proc,
+ const NFS41::SECINFO_NO_NAME4args*,
+ const NFS41::SECINFO_NO_NAME4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SECINFO_NO_NAME); } }
+void WatchAnalyzer::sequence41(const RPCProcedure* proc,
+ const struct NFS41::SEQUENCE4args*,
+ const struct NFS41::SEQUENCE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SEQUENCE); } }
+void WatchAnalyzer::set_ssv41(const RPCProcedure* proc,
+ const struct NFS41::SET_SSV4args*,
+ const struct NFS41::SET_SSV4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::SET_SSV); } }
+void WatchAnalyzer::test_stateid41(const RPCProcedure* proc,
+ const struct NFS41::TEST_STATEID4args*,
+ const struct NFS41::TEST_STATEID4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::TEST_STATEID); } }
+void WatchAnalyzer::want_delegation41(const RPCProcedure* proc,
+ const struct NFS41::WANT_DELEGATION4args*,
+ const struct NFS41::WANT_DELEGATION4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::WANT_DELEGATION); } }
+void WatchAnalyzer::destroy_clientid41(const RPCProcedure* proc,
+ const struct NFS41::DESTROY_CLIENTID4args*,
+ const struct NFS41::DESTROY_CLIENTID4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::DESTROY_CLIENTID); } }
+void WatchAnalyzer::reclaim_complete41(const RPCProcedure* proc,
+ const struct NFS41::RECLAIM_COMPLETE4args*,
+ const struct NFS41::RECLAIM_COMPLETE4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::RECLAIM_COMPLETE); } }
+void WatchAnalyzer::illegal41(const RPCProcedure* proc,
+ const struct NFS41::ILLEGAL4res* res) { if (res) { account41_op(proc, ProcEnumNFS41::NFSProcedure::ILLEGAL); } }
+// CIFS v1
+void WatchAnalyzer::createDirectorySMBv1(const SMBv1::CreateDirectoryCommand* /*cmd*/, const SMBv1::CreateDirectoryArgumentType*, const SMBv1::CreateDirectoryResultType*)
{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CREATE_DIRECTORY));
}
-void WatchAnalyzer::account(const struct RPCProcedure* proc,
- const struct rpcgen::COMPOUND4res* res)
+void WatchAnalyzer::deleteDirectorySMBv1(const SMBv1::DeleteDirectoryCommand* /*cmd*/, const SMBv1::DeleteDirectoryArgumentType*, const SMBv1::DeleteDirectoryResultType*)
{
- const u_int nfs_proc = proc->rpc_call.ru.RM_cmb.cb_proc;
- const u_int nfs_vers = proc->rpc_call.ru.RM_cmb.cb_vers;
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_DELETE_DIRECTORY));
+}
- for(uint16_t i = 0; i < max_read; i++)
- {
- UpRead();
- }
- if(nfs_vers == NFS_V4)
- {
- ++nfs4_proc_total;
- ++nfs4_proc_count[nfs_proc];
- if(res)
- {
- nfs4_ops_total += res->resarray.resarray_len;
- rpcgen::nfs_resop4* current_el = res->resarray.resarray_val;
- for(unsigned j = 0; j < (res->resarray.resarray_len); j++, current_el++)
- {
- // In all cases we suppose, that NFSv4 operation ILLEGAL(10044)
- // has the second position in ProcEnumNFS4
- u_int nfs_oper = current_el->resop;
- if(nfs_oper == ProcEnumNFS4::NFSProcedure::ILLEGAL) nfs_oper = 2;
- ++nfs4_proc_count[nfs_oper];
- }
- }
- }
+void WatchAnalyzer::openSMBv1(const SMBv1::OpenCommand* /*cmd*/, const SMBv1::OpenArgumentType*, const SMBv1::OpenResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_OPEN));
+}
- if(nfs_vers == NFS_V3)
- {
- ++nfs3_proc_total;
- ++nfs3_proc_count[nfs_proc];
- }
- for(uint16_t i = 0; i < max_read; i++)
- {
- DownRead();
- }
+void WatchAnalyzer::createSMBv1(const SMBv1::CreateCommand* /*cmd*/, const SMBv1::CreateArgumentType*, const SMBv1::CreateResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CREATE));
+}
+
+void WatchAnalyzer::closeSMBv1(const SMBv1::CloseCommand* /*cmd*/, const SMBv1::CloseArgumentType*, const SMBv1::CloseResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CLOSE));
+}
+
+void WatchAnalyzer::flushSMBv1(const SMBv1::FlushCommand* /*cmd*/, const SMBv1::FlushArgumentType*, const SMBv1::FlushResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_FLUSH));
+}
+
+void WatchAnalyzer::deleteSMBv1(const SMBv1::DeleteCommand* /*cmd*/, const SMBv1::DeleteArgumentType*, const SMBv1::DeleteResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_DELETE));
+}
+
+void WatchAnalyzer::renameSMBv1(const SMBv1::RenameCommand* /*cmd*/, const SMBv1::RenameArgumentType*, const SMBv1::RenameResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_RENAME));
+}
+
+void WatchAnalyzer::queryInfoSMBv1(const SMBv1::QueryInformationCommand* /*cmd*/, const SMBv1::QueryInformationArgumentType*, const SMBv1::QueryInformationResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_QUERY_INFORMATION));
+}
+
+void WatchAnalyzer::setInfoSMBv1(const SMBv1::SetInformationCommand* /*cmd*/, const SMBv1::SetInformationArgumentType*, const SMBv1::SetInformationResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_SET_INFORMATION));
+}
+
+void WatchAnalyzer::readSMBv1(const SMBv1::ReadCommand* /*cmd*/, const SMBv1::ReadArgumentType*, const SMBv1::ReadResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_READ));
+}
+
+void WatchAnalyzer::writeSMBv1(const SMBv1::WriteCommand* /*cmd*/, const SMBv1::WriteArgumentType*, const SMBv1::WriteResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE));
+}
+
+void WatchAnalyzer::lockByteRangeSMBv1(const SMBv1::LockByteRangeCommand* /*cmd*/, const SMBv1::LockByteRangeArgumentType*, const SMBv1::LockByteRangeResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_LOCK_BYTE_RANGE));
+}
+
+void WatchAnalyzer::unlockByteRangeSMBv1(const SMBv1::UnlockByteRangeCommand* /*cmd*/, const SMBv1::UnlockByteRangeArgumentType*, const SMBv1::UnlockByteRangeResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_UNLOCK_BYTE_RANGE));
+}
+
+void WatchAnalyzer::createTmpSMBv1(const SMBv1::CreateTemporaryCommand* /*cmd*/, const SMBv1::CreateTemporaryArgumentType*, const SMBv1::CreateTemporaryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CREATE_TEMPORARY));
+}
+
+void WatchAnalyzer::createNewSMBv1(const SMBv1::CreateNewCommand* /*cmd*/, const SMBv1::CreateNewArgumentType*, const SMBv1::CreateNewResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CREATE_NEW));
+}
+
+void WatchAnalyzer::checkDirectorySMBv1(const SMBv1::CheckDirectoryCommand* /*cmd*/, const SMBv1::CheckDirectoryArgumentType*, const SMBv1::CheckDirectoryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CHECK_DIRECTORY));
+}
+
+void WatchAnalyzer::processExitSMBv1(const SMBv1::ProcessExitCommand* /*cmd*/, const SMBv1::ProcessExitArgumentType*, const SMBv1::ProcessExitResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_PROCESS_EXIT));
+}
+
+void WatchAnalyzer::seekSMBv1(const SMBv1::SeekCommand* /*cmd*/, const SMBv1::SeekArgumentType*, const SMBv1::SeekResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_SEEK));
+}
+
+void WatchAnalyzer::lockAndReadSMBv1(const SMBv1::LockAndReadCommand* /*cmd*/, const SMBv1::LockAndReadArgumentType*, const SMBv1::LockAndReadResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_LOCK_AND_READ));
+}
+
+void WatchAnalyzer::writeAndUnlockSMBv1(const SMBv1::WriteAndUnlockCommand* /*cmd*/, const SMBv1::WriteAndUnlockArgumentType*, const SMBv1::WriteAndUnlockResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_AND_UNLOCK));
+}
+
+void WatchAnalyzer::readRawSMBv1(const SMBv1::ReadRawCommand* /*cmd*/, const SMBv1::ReadRawArgumentType*, const SMBv1::ReadRawResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_READ_RAW));
+}
+
+void WatchAnalyzer::readMpxSMBv1(const SMBv1::ReadMpxCommand* /*cmd*/, const SMBv1::ReadMpxArgumentType*, const SMBv1::ReadMpxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_READ_MPX));
+}
+
+void WatchAnalyzer::readMpxSecondarySMBv1(const SMBv1::ReadMpxSecondaryCommand* /*cmd*/, const SMBv1::ReadMpxSecondaryArgumentType*, const SMBv1::ReadMpxSecondaryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_READ_MPX_SECONDARY));
+}
+
+void WatchAnalyzer::writeRawSMBv1(const SMBv1::WriteRawCommand* /*cmd*/, const SMBv1::WriteRawArgumentType*, const SMBv1::WriteRawResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_RAW));
+}
+
+void WatchAnalyzer::writeMpxSMBv1(const SMBv1::WriteMpxCommand* /*cmd*/, const SMBv1::WriteMpxArgumentType*, const SMBv1::WriteMpxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_MPX));
+}
+
+void WatchAnalyzer::writeMpxSecondarySMBv1(const SMBv1::WriteMpxSecondaryCommand* /*cmd*/, const SMBv1::WriteMpxSecondaryArgumentType*, const SMBv1::WriteMpxSecondaryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_MPX_SECONDARY));
+}
+
+void WatchAnalyzer::writeCompleteSMBv1(const SMBv1::WriteCompleteCommand* /*cmd*/, const SMBv1::WriteCompleteArgumentType*, const SMBv1::WriteCompleteResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_COMPLETE));
+}
+
+void WatchAnalyzer::queryServerSMBv1(const SMBv1::QueryServerCommand* /*cmd*/, const SMBv1::QueryServerArgumentType*, const SMBv1::QueryServerResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_QUERY_SERVER));
+}
+
+void WatchAnalyzer::setInfo2SMBv1(const SMBv1::SetInformation2Command* /*cmd*/, const SMBv1::SetInformation2ArgumentType*, const SMBv1::SetInformation2ResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_SET_INFORMATION2));
+}
+
+void WatchAnalyzer::queryInfo2SMBv1(const SMBv1::QueryInformation2Command* /*cmd*/, const SMBv1::QueryInformation2ArgumentType*, const SMBv1::QueryInformation2ResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_QUERY_INFORMATION2));
+}
+
+void WatchAnalyzer::lockingAndxSMBv1(const SMBv1::LockingAndxCommand* /*cmd*/, const SMBv1::LockingAndxArgumentType*, const SMBv1::LockingAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_LOCKING_ANDX));
+}
+
+void WatchAnalyzer::transactionSMBv1(const SMBv1::TransactionCommand* /*cmd*/, const SMBv1::TransactionArgumentType*, const SMBv1::TransactionResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_TRANSACTION));
+}
+
+void WatchAnalyzer::transactionSecondarySMBv1(const SMBv1::TransactionSecondaryCommand* /*cmd*/, const SMBv1::TransactionSecondaryArgumentType*, const SMBv1::TransactionSecondaryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_TRANSACTION_SECONDARY));
+}
+
+void WatchAnalyzer::ioctlSMBv1(const SMBv1::IoctlCommand* /*cmd*/, const SMBv1::IoctlArgumentType*, const SMBv1::IoctlResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_IOCTL));
+}
+
+void WatchAnalyzer::ioctlSecondarySMBv1(const SMBv1::IoctlSecondaryCommand* /*cmd*/, const SMBv1::IoctlSecondaryArgumentType*, const SMBv1::IoctlSecondaryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_IOCTL_SECONDARY));
+}
+
+void WatchAnalyzer::copySMBv1(const SMBv1::CopyCommand* /*cmd*/, const SMBv1::CopyArgumentType*, const SMBv1::CopyResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_COPY));
+}
+
+void WatchAnalyzer::moveSMBv1(const SMBv1::MoveCommand* /*cmd*/, const SMBv1::MoveArgumentType*, const SMBv1::MoveResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_MOVE));
+}
+
+void WatchAnalyzer::echoSMBv1(const SMBv1::EchoCommand* /*cmd*/, const SMBv1::EchoArgumentType*, const SMBv1::EchoResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_ECHO));
+}
+
+void WatchAnalyzer::writeAndCloseSMBv1(const SMBv1::WriteAndCloseCommand* /*cmd*/, const SMBv1::WriteAndCloseArgumentType*, const SMBv1::WriteAndCloseResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_AND_CLOSE));
+}
+
+void WatchAnalyzer::openAndxSMBv1(const SMBv1::OpenAndxCommand* /*cmd*/, const SMBv1::OpenAndxArgumentType*, const SMBv1::OpenAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_OPEN_ANDX));
+}
+
+void WatchAnalyzer::readAndxSMBv1(const SMBv1::ReadAndxCommand* /*cmd*/, const SMBv1::ReadAndxArgumentType*, const SMBv1::ReadAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_READ_ANDX));
+}
+
+void WatchAnalyzer::writeAndxSMBv1(const SMBv1::WriteAndxCommand* /*cmd*/, const SMBv1::WriteAndxArgumentType*, const SMBv1::WriteAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_ANDX));
+}
+
+void WatchAnalyzer::newFileSizeSMBv1(const SMBv1::NewFileSizeCommand* /*cmd*/, const SMBv1::NewFileSizeArgumentType*, const SMBv1::NewFileSizeResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NEW_FILE_SIZE));
+}
+
+void WatchAnalyzer::closeAndTreeDiscSMBv1(const SMBv1::CloseAndTreeDiscCommand* /*cmd*/, const SMBv1::CloseAndTreeDiscArgumentType*, const SMBv1::CloseAndTreeDiscResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CLOSE_AND_TREE_DISC));
+}
+
+void WatchAnalyzer::transaction2SMBv1(const SMBv1::Transaction2Command* /*cmd*/, const SMBv1::Transaction2ArgumentType*, const SMBv1::Transaction2ResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_TRANSACTION2));
+}
+
+void WatchAnalyzer::transaction2SecondarySMBv1(const SMBv1::Transaction2SecondaryCommand* /*cmd*/, const SMBv1::Transaction2SecondaryArgumentType*, const SMBv1::Transaction2SecondaryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_TRANSACTION2_SECONDARY));
+}
+
+void WatchAnalyzer::findClose2SMBv1(const SMBv1::FindClose2Command* /*cmd*/, const SMBv1::FindClose2ArgumentType*, const SMBv1::FindClose2ResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_FIND_CLOSE2));
+}
+
+void WatchAnalyzer::findNotifyCloseSMBv1(const SMBv1::FindNotifyCloseCommand* /*cmd*/, const SMBv1::FindNotifyCloseArgumentType*, const SMBv1::FindNotifyCloseResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_FIND_NOTIFY_CLOSE));
+}
+
+void WatchAnalyzer::treeConnectSMBv1(const SMBv1::TreeConnectCommand* /*cmd*/, const SMBv1::TreeConnectArgumentType*, const SMBv1::TreeConnectResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_TREE_CONNECT));
+}
+
+void WatchAnalyzer::treeDisconnectSMBv1(const SMBv1::TreeDisconnectCommand* /*cmd*/, const SMBv1::TreeDisconnectArgumentType*, const SMBv1::TreeDisconnectResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_TREE_DISCONNECT));
+}
+
+void WatchAnalyzer::negotiateSMBv1(const SMBv1::NegotiateCommand* /*cmd*/, const SMBv1::NegotiateArgumentType*, const SMBv1::NegotiateResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NEGOTIATE));
+}
+
+void WatchAnalyzer::sessionSetupAndxSMBv1(const SMBv1::SessionSetupAndxCommand* /*cmd*/, const SMBv1::SessionSetupAndxArgumentType*, const SMBv1::SessionSetupAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_SESSION_SETUP_ANDX));
+}
+
+void WatchAnalyzer::logoffAndxSMBv1(const SMBv1::LogoffAndxCommand* /*cmd*/, const SMBv1::LogoffAndxArgumentType*, const SMBv1::LogoffAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_LOGOFF_ANDX));
+}
+
+void WatchAnalyzer::treeConnectAndxSMBv1(const SMBv1::TreeConnectAndxCommand* /*cmd*/, const SMBv1::TreeConnectAndxArgumentType*, const SMBv1::TreeConnectAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_TREE_CONNECT_ANDX));
+}
+
+void WatchAnalyzer::securityPackageAndxSMBv1(const SMBv1::SecurityPackageAndxCommand* /*cmd*/, const SMBv1::SecurityPackageAndxArgumentType*, const SMBv1::SecurityPackageAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_SECURITY_PACKAGE_ANDX));
+}
+
+void WatchAnalyzer::queryInformationDiskSMBv1(const SMBv1::QueryInformationDiskCommand* /*cmd*/, const SMBv1::QueryInformationDiskArgumentType*, const SMBv1::QueryInformationDiskResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_QUERY_INFORMATION_DISK));
+}
+
+void WatchAnalyzer::searchSMBv1(const SMBv1::SearchCommand* /*cmd*/, const SMBv1::SearchArgumentType*, const SMBv1::SearchResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_SEARCH));
+}
+
+void WatchAnalyzer::findSMBv1(const SMBv1::FindCommand* /*cmd*/, const SMBv1::FindArgumentType*, const SMBv1::FindResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_FIND));
+}
+
+void WatchAnalyzer::findUniqueSMBv1(const SMBv1::FindUniqueCommand* /*cmd*/, const SMBv1::FindUniqueArgumentType*, const SMBv1::FindUniqueResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_FIND_UNIQUE));
+}
+
+void WatchAnalyzer::findCloseSMBv1(const SMBv1::FindCloseCommand* /*cmd*/, const SMBv1::FindCloseArgumentType*, const SMBv1::FindCloseResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_FIND_CLOSE));
+}
+
+void WatchAnalyzer::ntTransactSMBv1(const SMBv1::NtTransactCommand* /*cmd*/, const SMBv1::NtTransactArgumentType*, const SMBv1::NtTransactResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NT_TRANSACT));
+}
+
+void WatchAnalyzer::ntTransactSecondarySMBv1(const SMBv1::NtTransactSecondaryCommand* /*cmd*/, const SMBv1::NtTransactSecondaryArgumentType*, const SMBv1::NtTransactSecondaryResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NT_TRANSACT_SECONDARY));
+}
+
+void WatchAnalyzer::ntCreateAndxSMBv1(const SMBv1::NtCreateAndxCommand* /*cmd*/, const SMBv1::NtCreateAndxArgumentType*, const SMBv1::NtCreateAndxResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NT_CREATE_ANDX));
+}
+
+void WatchAnalyzer::ntCancelSMBv1(const SMBv1::NtCancelCommand* /*cmd*/, const SMBv1::NtCancelArgumentType*, const SMBv1::NtCancelResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NT_CANCEL));
+}
+
+void WatchAnalyzer::ntRenameSMBv1(const SMBv1::NtRenameCommand* /*cmd*/, const SMBv1::NtRenameArgumentType*, const SMBv1::NtRenameResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NT_RENAME));
+}
+
+void WatchAnalyzer::openPrintFileSMBv1(const SMBv1::OpenPrintFileCommand* /*cmd*/, const SMBv1::OpenPrintFileArgumentType*, const SMBv1::OpenPrintFileResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_OPEN_PRINT_FILE));
+}
+
+void WatchAnalyzer::writePrintFileSMBv1(const SMBv1::WritePrintFileCommand* /*cmd*/, const SMBv1::WritePrintFileArgumentType*, const SMBv1::WritePrintFileResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_PRINT_FILE));
+}
+
+void WatchAnalyzer::closePrintFileSMBv1(const SMBv1::ClosePrintFileCommand* /*cmd*/, const SMBv1::ClosePrintFileArgumentType*, const SMBv1::ClosePrintFileResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_CLOSE_PRINT_FILE));
+}
+
+void WatchAnalyzer::getPrintQueueSMBv1(const SMBv1::GetPrintQueueCommand* /*cmd*/, const SMBv1::GetPrintQueueArgumentType*, const SMBv1::GetPrintQueueResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_GET_PRINT_QUEUE));
+}
+
+void WatchAnalyzer::readBulkSMBv1(const SMBv1::ReadBulkCommand* /*cmd*/, const SMBv1::ReadBulkArgumentType*, const SMBv1::ReadBulkResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_READ_BULK));
+}
+
+void WatchAnalyzer::writeBulkSMBv1(const SMBv1::WriteBulkCommand* /*cmd*/, const SMBv1::WriteBulkArgumentType*, const SMBv1::WriteBulkResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_BULK));
+}
+
+void WatchAnalyzer::writeBulkDataSMBv1(const SMBv1::WriteBulkDataCommand* /*cmd*/, const SMBv1::WriteBulkDataArgumentType*, const SMBv1::WriteBulkDataResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_WRITE_BULK_DATA));
+}
+
+void WatchAnalyzer::invalidSMBv1(const SMBv1::InvalidCommand* /*cmd*/, const SMBv1::InvalidArgumentType*, const SMBv1::InvalidResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_INVALID));
+}
+
+void WatchAnalyzer::noAndxCommandSMBv1(const SMBv1::NoAndxCommand* /*cmd*/, const SMBv1::NoAndxCmdArgumentType*, const SMBv1::NoAndxCmdResultType*)
+{
+ cifs_account(_cifsv1, static_cast<int>(SMBv1::SMBv1Commands::SMB_COM_NO_ANDX_COMMAND));
+}
+
+// CIFS v2
+
+void WatchAnalyzer::closeFileSMBv2(const SMBv2::CloseFileCommand* /*cmd*/, const SMBv2::CloseRequest*, const SMBv2::CloseResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::CLOSE));
+}
+
+void WatchAnalyzer::negotiateSMBv2(const SMBv2::NegotiateCommand* /*cmd*/, const SMBv2::NegotiateRequest*, const SMBv2::NegotiateResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::NEGOTIATE));
}
-void WatchAnalyzer::UpRead()
+void WatchAnalyzer::sessionSetupSMBv2(const SMBv2::SessionSetupCommand* /*cmd*/, const SMBv2::SessionSetupRequest*, const SMBv2::SessionSetupResponse*)
{
- std::unique_lock<std::mutex> lck(mut);
- cv.wait(lck,[this](){ return read_counter < max_read;});
- read_counter++;
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::SESSION_SETUP));
}
-void WatchAnalyzer::DownRead()
+void WatchAnalyzer::logOffSMBv2(const SMBv2::LogOffCommand* /*cmd*/, const SMBv2::LogOffRequest*, const SMBv2::LogOffResponse*)
{
- std::unique_lock<std::mutex> lck(mut);
- cv.wait(lck,[this](){ return read_counter > 0;});
- read_counter--;
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::LOGOFF));
}
-//----------------------------------------------------------------------------
-inline void WatchAnalyzer::thread()
+void WatchAnalyzer::treeConnectSMBv2(const SMBv2::TreeConnectCommand* /*cmd*/, const SMBv2::TreeConnectRequest*, const SMBv2::TreeConnectResponse*)
{
- try
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::TREE_CONNECT));
+}
+
+void WatchAnalyzer::treeDisconnectSMBv2(const SMBv2::TreeDisconnectCommand* /*cmd*/, const SMBv2::TreeDisconnectRequest*, const SMBv2::TreeDisconnectResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::TREE_DISCONNECT));
+}
+
+void WatchAnalyzer::createSMBv2(const SMBv2::CreateCommand* /*cmd*/, const SMBv2::CreateRequest*, const SMBv2::CreateResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::CREATE));
+}
+
+void WatchAnalyzer::flushSMBv2(const SMBv2::FlushCommand* /*cmd*/, const SMBv2::FlushRequest*, const SMBv2::FlushResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::FLUSH));
+}
+
+void WatchAnalyzer::readSMBv2(const SMBv2::ReadCommand* /*cmd*/, const SMBv2::ReadRequest*, const SMBv2::ReadResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::READ));
+}
+
+void WatchAnalyzer::writeSMBv2(const SMBv2::WriteCommand* /*cmd*/, const SMBv2::WriteRequest*, const SMBv2::WriteResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::WRITE));
+}
+
+void WatchAnalyzer::lockSMBv2(const SMBv2::LockCommand* /*cmd*/, const SMBv2::LockRequest*, const SMBv2::LockResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::LOCK));
+}
+
+void WatchAnalyzer::ioctlSMBv2(const SMBv2::IoctlCommand* /*cmd*/, const SMBv2::IoCtlRequest*, const SMBv2::IoCtlResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::IOCTL));
+}
+
+void WatchAnalyzer::cancelSMBv2(const SMBv2::CancelCommand* /*cmd*/, const SMBv2::CancelRequest*, const SMBv2::CancelResponce*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::CANCEL));
+}
+
+void WatchAnalyzer::echoSMBv2(const SMBv2::EchoCommand* /*cmd*/, const SMBv2::EchoRequest*, const SMBv2::EchoResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::ECHO));
+}
+
+void WatchAnalyzer::queryDirSMBv2(const SMBv2::QueryDirCommand* /*cmd*/, const SMBv2::QueryDirRequest*, const SMBv2::QueryDirResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::QUERY_DIRECTORY));
+}
+
+void WatchAnalyzer::changeNotifySMBv2(const SMBv2::ChangeNotifyCommand* /*cmd*/, const SMBv2::ChangeNotifyRequest*, const SMBv2::ChangeNotifyResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::CHANGE_NOTIFY));
+}
+
+void WatchAnalyzer::queryInfoSMBv2(const SMBv2::QueryInfoCommand* /*cmd*/, const SMBv2::QueryInfoRequest*, const SMBv2::QueryInfoResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::QUERY_INFO));
+}
+
+void WatchAnalyzer::setInfoSMBv2(const SMBv2::SetInfoCommand* /*cmd*/, const SMBv2::SetInfoRequest*, const SMBv2::SetInfoResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::SET_INFO));
+}
+
+void WatchAnalyzer::breakOplockSMBv2(const SMBv2::BreakOpLockCommand* /*cmd*/, const SMBv2::OplockAcknowledgment*, const SMBv2::OplockResponse*)
+{
+ cifs_account(_cifsv2, static_cast<int>(SMBv2::SMBv2Commands::OPLOCK_BREAK));
+}
+
+void WatchAnalyzer::flush_statistics()
+{
+}
+
+void WatchAnalyzer::on_unix_signal(int signo)
+{
+ if (signo == SIGWINCH)
{
- while (monitor_running.test_and_set())
- {
- UpRead();
- uint64_t nfs3_proc_total_copy(nfs3_proc_total);
- uint64_t nfs4_proc_total_copy(nfs4_ops_total);
- uint64_t nfs4_oper_total_copy(nfs4_proc_total);
- std::vector<int> nfs3_count_copy(nfs3_proc_count);
- std::vector<int> nfs4_count_copy(nfs4_proc_count);
- DownRead();
- pl.updatePlot(nfs3_proc_total_copy, nfs3_count_copy, nfs4_oper_total_copy, nfs4_proc_total_copy, nfs4_count_copy);
- std::this_thread::sleep_for(std::chrono::milliseconds(refresh_delta));
- }
- } catch(...) {
- DownRead();
- std::cerr << "Watch plugin Unidentifying exception.";
+ gui.enableUpdate();
}
}
-//------------------------------------------------------------------------------
-extern "C"
-{
-const char* usage()
+void WatchAnalyzer::cifs_account(AbstractProtocol &protocol, int cmd_code)
{
- return "User can set chrono output timeout in msec.";
+ std::vector<std::size_t> cifs_proc_count (static_cast<std::size_t>(protocol.getAmount()), 0);
+ ++cifs_proc_count[cmd_code];
+ gui.update(&protocol, cifs_proc_count);
}
-IAnalyzer* create(const char* opts)
+void WatchAnalyzer::nfs_account(const RPCProcedure* proc, const unsigned int nfs_minor_vers)
{
- try
+ const u_int nfs_proc = proc->call.ru.RM_cmb.cb_proc;
+ const u_int nfs_vers = proc->call.ru.RM_cmb.cb_vers;
+
+ if (nfs_vers == NFS_V4)
{
- return new WatchAnalyzer(opts);
+ if (nfs_minor_vers == NFS_V40)
+ {
+ std::vector<std::size_t> nfs4_proc_count (ProcEnumNFS4::count, 0);
+ ++nfs4_proc_count[nfs_proc];
+ gui.update(&_nfsv4, nfs4_proc_count);
+ }
+
+ if (nfs_minor_vers == NFS_V41 || nfs_proc == ProcEnumNFS4::NFS_NULL)
+ {
+ std::vector<std::size_t> nfs41_proc_count (ProcEnumNFS41::count, 0);
+ ++nfs41_proc_count[nfs_proc];
+ gui.update(&_nfsv41, nfs41_proc_count);
+ }
}
- catch(std::exception& e)
+ else if (nfs_vers == NFS_V3)
{
- std::cerr << "Can't initalize plugin: " << e.what() << std::endl;
- return nullptr;
+ std::vector<std::size_t> nfs3_proc_count (ProcEnumNFS3::count, 0);
+ ++nfs3_proc_count[nfs_proc];
+ gui.update(&_nfsv3, nfs3_proc_count);
}
}
-void destroy(IAnalyzer* instance)
+void WatchAnalyzer::account40_op(const RPCProcedure* /*proc*/, const ProcEnumNFS4::NFSProcedure operation)
{
- delete instance;
+ std::vector<std::size_t> nfs4_proc_count (ProcEnumNFS4::count, 0);
+ ++nfs4_proc_count[operation];
+ gui.update(&_nfsv4, nfs4_proc_count);
}
-NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy)
+void WatchAnalyzer::account41_op(const RPCProcedure* /*proc*/, const ProcEnumNFS41::NFSProcedure operation)
+{
+ std::vector<std::size_t> nfs41_proc_count (ProcEnumNFS41::count, 0);
+ ++nfs41_proc_count[operation];
+ gui.update(&_nfsv41, nfs41_proc_count);
+}
+//------------------------------------------------------------------------------
+extern "C"
+{
+
+ const char* usage()
+ {
+ return "User can set chrono output timeout in msec.\n"
+ "You have to run nfstrace with verbosity level set to 0 (nfstrace -v 0 ...)";
+ }
+
+ IAnalyzer* create(const char* opts)
+ {
+ try
+ {
+ return new WatchAnalyzer(opts);
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Can't initalize plugin: " << e.what() << std::endl;
+ return nullptr;
+ }
+ }
+
+ void destroy(IAnalyzer* instance)
+ {
+ delete instance;
+ }
+
+ const AnalyzerRequirements* requirements()
+ {
+ static const AnalyzerRequirements requirements{true};
+ return &requirements;
+ }
+
+ NST_PLUGIN_ENTRY_POINTS (&usage, &create, &destroy, &requirements)
}
//------------------------------------------------------------------------------
diff --git a/analyzers/src/watch/watch_analyzer.h b/analyzers/src/watch/watch_analyzer.h
index 6de2b66..9635f7c 100644
--- a/analyzers/src/watch/watch_analyzer.h
+++ b/analyzers/src/watch/watch_analyzer.h
@@ -1,6 +1,6 @@
//------------------------------------------------------------------------------
// Author: Vitali Adamenka
-// Description: Header for WatchAnalyzer based on TestAnalyzer.h
+// Description: Header for WatchAnalyzer based on TestAnalyzer.h
// Copyright (c) 2014 EPAM Systems. All Rights Reserved.
//------------------------------------------------------------------------------
/*
@@ -20,13 +20,18 @@
*/
//------------------------------------------------------------------------------
#ifndef WATCH_ANALYZER_H
-#define WATCH_ANALYZER_H
+#define WATCH_ANALYZER_H
//------------------------------------------------------------------------------
#include <atomic>
#include <condition_variable>
#include <api/plugin_api.h> // include plugin development definitions
-#include "plotter.h"
+#include "protocols/nfsv3_protocol.h"
+#include "protocols/nfsv4_protocol.h"
+#include "protocols/nfsv41_protocol.h"
+#include "protocols/cifsv1_protocol.h"
+#include "protocols/cifsv2_protocol.h"
+#include "user_gui.h"
//------------------------------------------------------------------------------
class WatchAnalyzer : public IAnalyzer
{
@@ -34,109 +39,476 @@ public:
WatchAnalyzer(const char* opts);
~WatchAnalyzer();
- void flush_statistics() override final;
+ void flush_statistics() override final;
+ void on_unix_signal(int signo) override final;
+ // NFS v3
+ virtual void null(const RPCProcedure*,
+ const struct NFS3::NULL3args*,
+ const struct NFS3::NULL3res*) override final;
+ virtual void getattr3(const RPCProcedure*,
+ const struct NFS3::GETATTR3args*,
+ const struct NFS3::GETATTR3res*) override final;
+ virtual void setattr3(const RPCProcedure*,
+ const struct NFS3::SETATTR3args*,
+ const struct NFS3::SETATTR3res*) override final;
+ virtual void lookup3(const RPCProcedure*,
+ const struct NFS3::LOOKUP3args*,
+ const struct NFS3::LOOKUP3res*) override final;
+ virtual void access3(const RPCProcedure*,
+ const struct NFS3::ACCESS3args*,
+ const struct NFS3::ACCESS3res*) override final;
+ virtual void readlink3(const RPCProcedure*,
+ const struct NFS3::READLINK3args*,
+ const struct NFS3::READLINK3res*) override final;
+ virtual void read3(const RPCProcedure*,
+ const struct NFS3::READ3args*,
+ const struct NFS3::READ3res*) override final;
+ virtual void write3(const RPCProcedure*,
+ const struct NFS3::WRITE3args*,
+ const struct NFS3::WRITE3res*) override final;
+ virtual void create3(const RPCProcedure*,
+ const struct NFS3::CREATE3args*,
+ const struct NFS3::CREATE3res*) override final;
+ virtual void mkdir3(const RPCProcedure*,
+ const struct NFS3::MKDIR3args*,
+ const struct NFS3::MKDIR3res*) override final;
+ virtual void symlink3(const RPCProcedure*,
+ const struct NFS3::SYMLINK3args*,
+ const struct NFS3::SYMLINK3res*) override final;
+ virtual void mknod3(const RPCProcedure*,
+ const struct NFS3::MKNOD3args*,
+ const struct NFS3::MKNOD3res*) override final;
+ virtual void remove3(const RPCProcedure*,
+ const struct NFS3::REMOVE3args*,
+ const struct NFS3::REMOVE3res*) override final;
+ virtual void rmdir3(const RPCProcedure*,
+ const struct NFS3::RMDIR3args*,
+ const struct NFS3::RMDIR3res*) override final;
+ virtual void rename3(const RPCProcedure*,
+ const struct NFS3::RENAME3args*,
+ const struct NFS3::RENAME3res*) override final;
+ virtual void link3(const RPCProcedure*,
+ const struct NFS3::LINK3args*,
+ const struct NFS3::LINK3res*) override final;
+ virtual void readdir3(const RPCProcedure*,
+ const struct NFS3::READDIR3args*,
+ const struct NFS3::READDIR3res*) override final;
+ virtual void readdirplus3(const RPCProcedure*,
+ const struct NFS3::READDIRPLUS3args*,
+ const struct NFS3::READDIRPLUS3res*) override final;
+ virtual void fsstat3(const RPCProcedure*,
+ const struct NFS3::FSSTAT3args*,
+ const struct NFS3::FSSTAT3res*) override final;
+ virtual void fsinfo3(const RPCProcedure*,
+ const struct NFS3::FSINFO3args*,
+ const struct NFS3::FSINFO3res*) override final;
+ virtual void pathconf3(const RPCProcedure*,
+ const struct NFS3::PATHCONF3args*,
+ const struct NFS3::PATHCONF3res*) override final;
+ virtual void commit3(const RPCProcedure*,
+ const struct NFS3::COMMIT3args*,
+ const struct NFS3::COMMIT3res*) override final;
+ // NFS v4
+ virtual void null4(const RPCProcedure*,
+ const struct NFS4::NULL4args*,
+ const struct NFS4::NULL4res*) override final;
+ virtual void compound4(const RPCProcedure*,
+ const struct NFS4::COMPOUND4args*,
+ const struct NFS4::COMPOUND4res*) override final;
- void null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL3args*,
- const struct rpcgen::NULL3res*) override final;
- void getattr3(const struct RPCProcedure* proc,
- const struct rpcgen::GETATTR3args*,
- const struct rpcgen::GETATTR3res*) override final;
- void setattr3(const struct RPCProcedure* proc,
- const struct rpcgen::SETATTR3args*,
- const struct rpcgen::SETATTR3res*) override final;
- void lookup3(const struct RPCProcedure* proc,
- const struct rpcgen::LOOKUP3args*,
- const struct rpcgen::LOOKUP3res*) override final;
- void access3(const struct RPCProcedure* proc,
- const struct rpcgen::ACCESS3args*,
- const struct rpcgen::ACCESS3res*) override final;
- void readlink3(const struct RPCProcedure* proc,
- const struct rpcgen::READLINK3args*,
- const struct rpcgen::READLINK3res*) override final;
- void read3(const struct RPCProcedure* proc,
- const struct rpcgen::READ3args*,
- const struct rpcgen::READ3res*) override final;
- void write3(const struct RPCProcedure* proc,
- const struct rpcgen::WRITE3args*,
- const struct rpcgen::WRITE3res*) override final;
- void create3(const struct RPCProcedure* proc,
- const struct rpcgen::CREATE3args*,
- const struct rpcgen::CREATE3res*) override final;
- void mkdir3(const struct RPCProcedure* proc,
- const struct rpcgen::MKDIR3args*,
- const struct rpcgen::MKDIR3res*) override final;
- void symlink3(const struct RPCProcedure* proc,
- const struct rpcgen::SYMLINK3args*,
- const struct rpcgen::SYMLINK3res*) override final;
- void mknod3(const struct RPCProcedure* proc,
- const struct rpcgen::MKNOD3args*,
- const struct rpcgen::MKNOD3res*) override final;
- void remove3(const struct RPCProcedure* proc,
- const struct rpcgen::REMOVE3args*,
- const struct rpcgen::REMOVE3res*) override final;
- void rmdir3(const struct RPCProcedure* proc,
- const struct rpcgen::RMDIR3args*,
- const struct rpcgen::RMDIR3res*) override final;
- void rename3(const struct RPCProcedure* proc,
- const struct rpcgen::RENAME3args*,
- const struct rpcgen::RENAME3res*) override final;
- void link3(const struct RPCProcedure* proc,
- const struct rpcgen::LINK3args*,
- const struct rpcgen::LINK3res*) override final;
- void readdir3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIR3args*,
- const struct rpcgen::READDIR3res*) override final;
- void readdirplus3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIRPLUS3args*,
- const struct rpcgen::READDIRPLUS3res*) override final;
- void fsstat3(const struct RPCProcedure* proc,
- const struct rpcgen::FSSTAT3args*,
- const struct rpcgen::FSSTAT3res*) override final;
- void fsinfo3(const struct RPCProcedure* proc,
- const struct rpcgen::FSINFO3args*,
- const struct rpcgen::FSINFO3res*) override final;
- void pathconf3(const struct RPCProcedure* proc,
- const struct rpcgen::PATHCONF3args*,
- const struct rpcgen::PATHCONF3res*) override final;
- void commit3(const struct RPCProcedure* proc,
- const struct rpcgen::COMMIT3args*,
- const struct rpcgen::COMMIT3res*) override final;
+ virtual void access40(const RPCProcedure*,
+ const struct NFS4::ACCESS4args*,
+ const struct NFS4::ACCESS4res*) override final;
+ virtual void close40(const RPCProcedure*,
+ const struct NFS4::CLOSE4args*,
+ const struct NFS4::CLOSE4res*) override final;
+ virtual void commit40(const RPCProcedure*,
+ const struct NFS4::COMMIT4args*,
+ const struct NFS4::COMMIT4res*) override final;
+ virtual void create40(const RPCProcedure*,
+ const struct NFS4::CREATE4args*,
+ const struct NFS4::CREATE4res*) override final;
+ virtual void delegpurge40(const RPCProcedure*,
+ const struct NFS4::DELEGPURGE4args*,
+ const struct NFS4::DELEGPURGE4res*) override final;
+ virtual void delegreturn40(const RPCProcedure*,
+ const struct NFS4::DELEGRETURN4args*,
+ const struct NFS4::DELEGRETURN4res*) override final;
+ virtual void getattr40(const RPCProcedure*,
+ const struct NFS4::GETATTR4args*,
+ const struct NFS4::GETATTR4res*) override final;
+ virtual void getfh40(const RPCProcedure*,
+ const struct NFS4::GETFH4res*) override final;
+ virtual void link40(const RPCProcedure*,
+ const struct NFS4::LINK4args*,
+ const struct NFS4::LINK4res*) override final;
+ virtual void lock40(const RPCProcedure*,
+ const struct NFS4::LOCK4args*,
+ const struct NFS4::LOCK4res*) override final;
+ virtual void lockt40(const RPCProcedure*,
+ const struct NFS4::LOCKT4args*,
+ const struct NFS4::LOCKT4res*) override final;
+ virtual void locku40(const RPCProcedure*,
+ const struct NFS4::LOCKU4args*,
+ const struct NFS4::LOCKU4res*) override final;
+ virtual void lookup40(const RPCProcedure*,
+ const struct NFS4::LOOKUP4args*,
+ const struct NFS4::LOOKUP4res*) override final;
+ virtual void lookupp40(const RPCProcedure*,
+ const struct NFS4::LOOKUPP4res*) override final;
+ virtual void nverify40(const RPCProcedure*,
+ const struct NFS4::NVERIFY4args*,
+ const struct NFS4::NVERIFY4res*) override final;
+ virtual void open40(const RPCProcedure*,
+ const struct NFS4::OPEN4args*,
+ const struct NFS4::OPEN4res*) override final;
+ virtual void openattr40(const RPCProcedure*,
+ const struct NFS4::OPENATTR4args*,
+ const struct NFS4::OPENATTR4res*) override final;
+ virtual void open_confirm40(const RPCProcedure*,
+ const struct NFS4::OPEN_CONFIRM4args*,
+ const struct NFS4::OPEN_CONFIRM4res*) override final;
+ virtual void open_downgrade40(const RPCProcedure*,
+ const struct NFS4::OPEN_DOWNGRADE4args*,
+ const struct NFS4::OPEN_DOWNGRADE4res*) override final;
+ virtual void putfh40(const RPCProcedure*,
+ const struct NFS4::PUTFH4args*,
+ const struct NFS4::PUTFH4res*) override final;
+ virtual void putpubfh40(const RPCProcedure*,
+ const struct NFS4::PUTPUBFH4res*) override final;
+ virtual void putrootfh40(const RPCProcedure*,
+ const struct NFS4::PUTROOTFH4res*) override final;
+ virtual void read40(const RPCProcedure*,
+ const struct NFS4::READ4args*,
+ const struct NFS4::READ4res*) override final;
+ virtual void readdir40(const RPCProcedure*,
+ const struct NFS4::READDIR4args*,
+ const struct NFS4::READDIR4res*) override final;
+ virtual void readlink40(const RPCProcedure*,
+ const struct NFS4::READLINK4res*) override final;
+ virtual void remove40(const RPCProcedure*,
+ const struct NFS4::REMOVE4args*,
+ const struct NFS4::REMOVE4res*) override final;
+ virtual void rename40(const RPCProcedure*,
+ const struct NFS4::RENAME4args*,
+ const struct NFS4::RENAME4res*) override final;
+ virtual void renew40(const RPCProcedure*,
+ const struct NFS4::RENEW4args*,
+ const struct NFS4::RENEW4res*) override final;
+ virtual void restorefh40(const RPCProcedure*,
+ const struct NFS4::RESTOREFH4res*) override final;
+ virtual void savefh40(const RPCProcedure*,
+ const struct NFS4::SAVEFH4res*) override final;
+ virtual void secinfo40(const RPCProcedure*,
+ const struct NFS4::SECINFO4args*,
+ const struct NFS4::SECINFO4res*) override final;
+ virtual void setattr40(const RPCProcedure*,
+ const struct NFS4::SETATTR4args*,
+ const struct NFS4::SETATTR4res*) override final;
+ virtual void setclientid40(const RPCProcedure*,
+ const struct NFS4::SETCLIENTID4args*,
+ const struct NFS4::SETCLIENTID4res*) override final;
+ virtual void setclientid_confirm40(const RPCProcedure*,
+ const struct NFS4::SETCLIENTID_CONFIRM4args*,
+ const struct NFS4::SETCLIENTID_CONFIRM4res*) override final;
+ virtual void verify40(const RPCProcedure*,
+ const struct NFS4::VERIFY4args*,
+ const struct NFS4::VERIFY4res*) override final;
+ virtual void write40(const RPCProcedure*,
+ const struct NFS4::WRITE4args*,
+ const struct NFS4::WRITE4res*) override final;
+ virtual void release_lockowner40(const RPCProcedure*,
+ const struct NFS4::RELEASE_LOCKOWNER4args*,
+ const struct NFS4::RELEASE_LOCKOWNER4res*) override final;
+ virtual void get_dir_delegation40(const RPCProcedure*,
+ const struct NFS4::GET_DIR_DELEGATION4args*,
+ const struct NFS4::GET_DIR_DELEGATION4res*) override final;
+ virtual void illegal40(const RPCProcedure*,
+ const struct NFS4::ILLEGAL4res*) override final;
+ // NFS v41
+ virtual void compound41(const RPCProcedure*,
+ const struct NFS41::COMPOUND4args*,
+ const struct NFS41::COMPOUND4res*) override final;
- void null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL4args*,
- const struct rpcgen::NULL4res*) override final;
- void compound4(const struct RPCProcedure* proc,
- const struct rpcgen::COMPOUND4args*,
- const struct rpcgen::COMPOUND4res*) override final;
-private:
- inline void thread();
- void count_proc(const struct RPCProcedure* proc);
- void account(const struct RPCProcedure*,
- const struct rpcgen::COMPOUND4res* res = nullptr);
-
- void UpRead();
- void DownRead();
+ virtual void access41(const RPCProcedure*,
+ const struct NFS41::ACCESS4args*,
+ const struct NFS41::ACCESS4res*) override final;
+ virtual void close41(const RPCProcedure*,
+ const struct NFS41::CLOSE4args*,
+ const struct NFS41::CLOSE4res*) override final;
+ virtual void commit41(const RPCProcedure*,
+ const struct NFS41::COMMIT4args*,
+ const struct NFS41::COMMIT4res*) override final;
+ virtual void create41(const RPCProcedure*,
+ const struct NFS41::CREATE4args*,
+ const struct NFS41::CREATE4res*) override final;
+ virtual void delegpurge41(const RPCProcedure*,
+ const struct NFS41::DELEGPURGE4args*,
+ const struct NFS41::DELEGPURGE4res*) override final;
+ virtual void delegreturn41(const RPCProcedure*,
+ const struct NFS41::DELEGRETURN4args*,
+ const struct NFS41::DELEGRETURN4res*) override final;
+ virtual void getattr41(const RPCProcedure*,
+ const struct NFS41::GETATTR4args*,
+ const struct NFS41::GETATTR4res*) override final;
+ virtual void getfh41(const RPCProcedure*,
+ const struct NFS41::GETFH4res*) override final;
+ virtual void link41(const RPCProcedure*,
+ const struct NFS41::LINK4args*,
+ const struct NFS41::LINK4res*) override final;
+ virtual void lock41(const RPCProcedure*,
+ const struct NFS41::LOCK4args*,
+ const struct NFS41::LOCK4res*) override final;
+ virtual void lockt41(const RPCProcedure*,
+ const struct NFS41::LOCKT4args*,
+ const struct NFS41::LOCKT4res*) override final;
+ virtual void locku41(const RPCProcedure*,
+ const struct NFS41::LOCKU4args*,
+ const struct NFS41::LOCKU4res*) override final;
+ virtual void lookup41(const RPCProcedure*,
+ const struct NFS41::LOOKUP4args*,
+ const struct NFS41::LOOKUP4res*) override final;
+ virtual void lookupp41(const RPCProcedure*,
+ const struct NFS41::LOOKUPP4res*) override final;
+ virtual void nverify41(const RPCProcedure*,
+ const struct NFS41::NVERIFY4args*,
+ const struct NFS41::NVERIFY4res*) override final;
+ virtual void open41(const RPCProcedure*,
+ const struct NFS41::OPEN4args*,
+ const struct NFS41::OPEN4res*) override final;
+ virtual void openattr41(const RPCProcedure*,
+ const struct NFS41::OPENATTR4args*,
+ const struct NFS41::OPENATTR4res*) override final;
+ virtual void open_confirm41(const RPCProcedure*,
+ const struct NFS41::OPEN_CONFIRM4args*,
+ const struct NFS41::OPEN_CONFIRM4res*) override final;
+ virtual void open_downgrade41(const RPCProcedure*,
+ const struct NFS41::OPEN_DOWNGRADE4args*,
+ const struct NFS41::OPEN_DOWNGRADE4res*) override final;
+ virtual void putfh41(const RPCProcedure*,
+ const struct NFS41::PUTFH4args*,
+ const struct NFS41::PUTFH4res*) override final;
+ virtual void putpubfh41(const RPCProcedure*,
+ const struct NFS41::PUTPUBFH4res*) override final;
+ virtual void putrootfh41(const RPCProcedure*,
+ const struct NFS41::PUTROOTFH4res*) override final;
+ virtual void read41(const RPCProcedure*,
+ const struct NFS41::READ4args*,
+ const struct NFS41::READ4res*) override final;
+ virtual void readdir41(const RPCProcedure*,
+ const struct NFS41::READDIR4args*,
+ const struct NFS41::READDIR4res*) override final;
+ virtual void readlink41(const RPCProcedure*,
+ const struct NFS41::READLINK4res*) override final;
+ virtual void remove41(const RPCProcedure*,
+ const struct NFS41::REMOVE4args*,
+ const struct NFS41::REMOVE4res*) override final;
+ virtual void rename41(const RPCProcedure*,
+ const struct NFS41::RENAME4args*,
+ const struct NFS41::RENAME4res*) override final;
+ virtual void renew41(const RPCProcedure*,
+ const struct NFS41::RENEW4args*,
+ const struct NFS41::RENEW4res*) override final;
+ virtual void restorefh41(const RPCProcedure*,
+ const struct NFS41::RESTOREFH4res*) override final;
+ virtual void savefh41(const RPCProcedure*,
+ const struct NFS41::SAVEFH4res*) override final;
+ virtual void secinfo41(const RPCProcedure*,
+ const struct NFS41::SECINFO4args*,
+ const struct NFS41::SECINFO4res*) override final;
+ virtual void setattr41(const RPCProcedure*,
+ const struct NFS41::SETATTR4args*,
+ const struct NFS41::SETATTR4res*) override final;
+ virtual void setclientid41(const RPCProcedure*,
+ const struct NFS41::SETCLIENTID4args*,
+ const struct NFS41::SETCLIENTID4res*) override final;
+ virtual void setclientid_confirm41(const RPCProcedure*,
+ const struct NFS41::SETCLIENTID_CONFIRM4args*,
+ const struct NFS41::SETCLIENTID_CONFIRM4res*) override final;
+ virtual void verify41(const RPCProcedure*,
+ const struct NFS41::VERIFY4args*,
+ const struct NFS41::VERIFY4res*) override final;
+ virtual void write41(const RPCProcedure*,
+ const struct NFS41::WRITE4args*,
+ const struct NFS41::WRITE4res*) override final;
+ virtual void release_lockowner41(const RPCProcedure*,
+ const struct NFS41::RELEASE_LOCKOWNER4args*,
+ const struct NFS41::RELEASE_LOCKOWNER4res*) override final;
+ virtual void backchannel_ctl41(const RPCProcedure*,
+ const struct NFS41::BACKCHANNEL_CTL4args*,
+ const struct NFS41::BACKCHANNEL_CTL4res*) override final;
+ virtual void bind_conn_to_session41(const RPCProcedure*,
+ const struct NFS41::BIND_CONN_TO_SESSION4args*,
+ const struct NFS41::BIND_CONN_TO_SESSION4res*) override final;
+ virtual void exchange_id41(const RPCProcedure*,
+ const struct NFS41::EXCHANGE_ID4args*,
+ const struct NFS41::EXCHANGE_ID4res*) override final;
+ virtual void create_session41(const RPCProcedure*,
+ const struct NFS41::CREATE_SESSION4args*,
+ const struct NFS41::CREATE_SESSION4res*) override final;
+ virtual void destroy_session41(const RPCProcedure*,
+ const struct NFS41::DESTROY_SESSION4args*,
+ const struct NFS41::DESTROY_SESSION4res*) override final;
+ virtual void free_stateid41(const RPCProcedure*,
+ const struct NFS41::FREE_STATEID4args*,
+ const struct NFS41::FREE_STATEID4res*) override final;
+ virtual void get_dir_delegation41(const RPCProcedure*,
+ const struct NFS41::GET_DIR_DELEGATION4args*,
+ const struct NFS41::GET_DIR_DELEGATION4res*) override final;
+ virtual void getdeviceinfo41(const RPCProcedure*,
+ const struct NFS41::GETDEVICEINFO4args*,
+ const struct NFS41::GETDEVICEINFO4res*) override final;
+ virtual void getdevicelist41(const RPCProcedure*,
+ const struct NFS41::GETDEVICELIST4args*,
+ const struct NFS41::GETDEVICELIST4res*) override final;
+ virtual void layoutcommit41(const RPCProcedure*,
+ const struct NFS41::LAYOUTCOMMIT4args*,
+ const struct NFS41::LAYOUTCOMMIT4res*) override final;
+ virtual void layoutget41(const RPCProcedure*,
+ const struct NFS41::LAYOUTGET4args*,
+ const struct NFS41::LAYOUTGET4res*) override final;
+ virtual void layoutreturn41(const RPCProcedure*,
+ const struct NFS41::LAYOUTRETURN4args*,
+ const struct NFS41::LAYOUTRETURN4res*) override final;
+ virtual void secinfo_no_name41(const RPCProcedure*,
+ const NFS41::SECINFO_NO_NAME4args*,
+ const NFS41::SECINFO_NO_NAME4res*) override final;
+ virtual void sequence41(const RPCProcedure*,
+ const struct NFS41::SEQUENCE4args*,
+ const struct NFS41::SEQUENCE4res*) override final;
+ virtual void set_ssv41(const RPCProcedure*,
+ const struct NFS41::SET_SSV4args*,
+ const struct NFS41::SET_SSV4res*) override final;
+ virtual void test_stateid41(const RPCProcedure*,
+ const struct NFS41::TEST_STATEID4args*,
+ const struct NFS41::TEST_STATEID4res*) override final;
+ virtual void want_delegation41(const RPCProcedure*,
+ const struct NFS41::WANT_DELEGATION4args*,
+ const struct NFS41::WANT_DELEGATION4res*) override final;
+ virtual void destroy_clientid41(const RPCProcedure*,
+ const struct NFS41::DESTROY_CLIENTID4args*,
+ const struct NFS41::DESTROY_CLIENTID4res*) override final;
+ virtual void reclaim_complete41(const RPCProcedure*,
+ const struct NFS41::RECLAIM_COMPLETE4args*,
+ const struct NFS41::RECLAIM_COMPLETE4res*) override final;
+ virtual void illegal41(const RPCProcedure*,
+ const struct NFS41::ILLEGAL4res*) override final;
+ // CIFS v1
+ void createDirectorySMBv1(const SMBv1::CreateDirectoryCommand* cmd, const SMBv1::CreateDirectoryArgumentType*, const SMBv1::CreateDirectoryResultType*) override final;
+ void deleteDirectorySMBv1(const SMBv1::DeleteDirectoryCommand* cmd, const SMBv1::DeleteDirectoryArgumentType*, const SMBv1::DeleteDirectoryResultType*) override final;
+ void openSMBv1(const SMBv1::OpenCommand* cmd, const SMBv1::OpenArgumentType*, const SMBv1::OpenResultType*) override final;
+ void createSMBv1(const SMBv1::CreateCommand* cmd, const SMBv1::CreateArgumentType*, const SMBv1::CreateResultType*) override final;
+ void closeSMBv1(const SMBv1::CloseCommand* cmd, const SMBv1::CloseArgumentType*, const SMBv1::CloseResultType*) override final;
+ void flushSMBv1(const SMBv1::FlushCommand* cmd, const SMBv1::FlushArgumentType*, const SMBv1::FlushResultType*) override final;
+ void deleteSMBv1(const SMBv1::DeleteCommand* cmd, const SMBv1::DeleteArgumentType*, const SMBv1::DeleteResultType*) override final;
+ void renameSMBv1(const SMBv1::RenameCommand* cmd, const SMBv1::RenameArgumentType*, const SMBv1::RenameResultType*) override final;
+ void queryInfoSMBv1(const SMBv1::QueryInformationCommand* cmd, const SMBv1::QueryInformationArgumentType*, const SMBv1::QueryInformationResultType*) override final;
+ void setInfoSMBv1(const SMBv1::SetInformationCommand* cmd, const SMBv1::SetInformationArgumentType*, const SMBv1::SetInformationResultType*) override final;
+ void readSMBv1(const SMBv1::ReadCommand* cmd, const SMBv1::ReadArgumentType*, const SMBv1::ReadResultType*) override final;
+ void writeSMBv1(const SMBv1::WriteCommand* cmd, const SMBv1::WriteArgumentType*, const SMBv1::WriteResultType*) override final;
+ void lockByteRangeSMBv1(const SMBv1::LockByteRangeCommand* cmd, const SMBv1::LockByteRangeArgumentType*, const SMBv1::LockByteRangeResultType*) override final;
+ void unlockByteRangeSMBv1(const SMBv1::UnlockByteRangeCommand* cmd, const SMBv1::UnlockByteRangeArgumentType*, const SMBv1::UnlockByteRangeResultType*) override final;
+ void createTmpSMBv1(const SMBv1::CreateTemporaryCommand* cmd, const SMBv1::CreateTemporaryArgumentType*, const SMBv1::CreateTemporaryResultType*) override final;
+ void createNewSMBv1(const SMBv1::CreateNewCommand* cmd, const SMBv1::CreateNewArgumentType*, const SMBv1::CreateNewResultType*) override final;
+ void checkDirectorySMBv1(const SMBv1::CheckDirectoryCommand* cmd, const SMBv1::CheckDirectoryArgumentType*, const SMBv1::CheckDirectoryResultType*) override final;
+ void processExitSMBv1(const SMBv1::ProcessExitCommand* cmd, const SMBv1::ProcessExitArgumentType*, const SMBv1::ProcessExitResultType*) override final;
+ void seekSMBv1(const SMBv1::SeekCommand* cmd, const SMBv1::SeekArgumentType*, const SMBv1::SeekResultType*) override final;
+ void lockAndReadSMBv1(const SMBv1::LockAndReadCommand* cmd, const SMBv1::LockAndReadArgumentType*, const SMBv1::LockAndReadResultType*) override final;
+ void writeAndUnlockSMBv1(const SMBv1::WriteAndUnlockCommand* cmd, const SMBv1::WriteAndUnlockArgumentType*, const SMBv1::WriteAndUnlockResultType*) override final;
+ void readRawSMBv1(const SMBv1::ReadRawCommand* cmd, const SMBv1::ReadRawArgumentType*, const SMBv1::ReadRawResultType*) override final;
+ void readMpxSMBv1(const SMBv1::ReadMpxCommand* cmd, const SMBv1::ReadMpxArgumentType*, const SMBv1::ReadMpxResultType*) override final;
+ void readMpxSecondarySMBv1(const SMBv1::ReadMpxSecondaryCommand* cmd, const SMBv1::ReadMpxSecondaryArgumentType*, const SMBv1::ReadMpxSecondaryResultType*) override final;
+ void writeRawSMBv1(const SMBv1::WriteRawCommand* cmd, const SMBv1::WriteRawArgumentType*, const SMBv1::WriteRawResultType*) override final;
+ void writeMpxSMBv1(const SMBv1::WriteMpxCommand* cmd, const SMBv1::WriteMpxArgumentType*, const SMBv1::WriteMpxResultType*) override final;
+ void writeMpxSecondarySMBv1(const SMBv1::WriteMpxSecondaryCommand* cmd, const SMBv1::WriteMpxSecondaryArgumentType*, const SMBv1::WriteMpxSecondaryResultType*) override final;
+ void writeCompleteSMBv1(const SMBv1::WriteCompleteCommand* cmd, const SMBv1::WriteCompleteArgumentType*, const SMBv1::WriteCompleteResultType*) override final;
+ void queryServerSMBv1(const SMBv1::QueryServerCommand* cmd, const SMBv1::QueryServerArgumentType*, const SMBv1::QueryServerResultType*) override final;
+ void setInfo2SMBv1(const SMBv1::SetInformation2Command* cmd, const SMBv1::SetInformation2ArgumentType*, const SMBv1::SetInformation2ResultType*) override final;
+ void queryInfo2SMBv1(const SMBv1::QueryInformation2Command* cmd, const SMBv1::QueryInformation2ArgumentType*, const SMBv1::QueryInformation2ResultType*) override final;
+ void lockingAndxSMBv1(const SMBv1::LockingAndxCommand* cmd, const SMBv1::LockingAndxArgumentType*, const SMBv1::LockingAndxResultType*) override final;
+ void transactionSMBv1(const SMBv1::TransactionCommand* cmd, const SMBv1::TransactionArgumentType*, const SMBv1::TransactionResultType*) override final;
+ void transactionSecondarySMBv1(const SMBv1::TransactionSecondaryCommand* cmd, const SMBv1::TransactionSecondaryArgumentType*, const SMBv1::TransactionSecondaryResultType*) override final;
+ void ioctlSMBv1(const SMBv1::IoctlCommand* cmd, const SMBv1::IoctlArgumentType*, const SMBv1::IoctlResultType*) override final;
+ void ioctlSecondarySMBv1(const SMBv1::IoctlSecondaryCommand* cmd, const SMBv1::IoctlSecondaryArgumentType*, const SMBv1::IoctlSecondaryResultType*) override final;
+ void copySMBv1(const SMBv1::CopyCommand* cmd, const SMBv1::CopyArgumentType*, const SMBv1::CopyResultType*) override final;
+ void moveSMBv1(const SMBv1::MoveCommand* cmd, const SMBv1::MoveArgumentType*, const SMBv1::MoveResultType*) override final;
+ void echoSMBv1(const SMBv1::EchoCommand* cmd, const SMBv1::EchoArgumentType*, const SMBv1::EchoResultType*) override final;
+ void writeAndCloseSMBv1(const SMBv1::WriteAndCloseCommand* cmd, const SMBv1::WriteAndCloseArgumentType*, const SMBv1::WriteAndCloseResultType*) override final;
+ void openAndxSMBv1(const SMBv1::OpenAndxCommand* cmd, const SMBv1::OpenAndxArgumentType*, const SMBv1::OpenAndxResultType*) override final;
+ void readAndxSMBv1(const SMBv1::ReadAndxCommand* cmd, const SMBv1::ReadAndxArgumentType*, const SMBv1::ReadAndxResultType*) override final;
+ void writeAndxSMBv1(const SMBv1::WriteAndxCommand* cmd, const SMBv1::WriteAndxArgumentType*, const SMBv1::WriteAndxResultType*) override final;
+ void newFileSizeSMBv1(const SMBv1::NewFileSizeCommand* cmd, const SMBv1::NewFileSizeArgumentType*, const SMBv1::NewFileSizeResultType*) override final;
+ void closeAndTreeDiscSMBv1(const SMBv1::CloseAndTreeDiscCommand* cmd, const SMBv1::CloseAndTreeDiscArgumentType*, const SMBv1::CloseAndTreeDiscResultType*) override final;
+ void transaction2SMBv1(const SMBv1::Transaction2Command* cmd, const SMBv1::Transaction2ArgumentType*, const SMBv1::Transaction2ResultType*) override final;
+ void transaction2SecondarySMBv1(const SMBv1::Transaction2SecondaryCommand* cmd, const SMBv1::Transaction2SecondaryArgumentType*, const SMBv1::Transaction2SecondaryResultType*) override final;
+ void findClose2SMBv1(const SMBv1::FindClose2Command* cmd, const SMBv1::FindClose2ArgumentType*, const SMBv1::FindClose2ResultType*) override final;
+ void findNotifyCloseSMBv1(const SMBv1::FindNotifyCloseCommand* cmd, const SMBv1::FindNotifyCloseArgumentType*, const SMBv1::FindNotifyCloseResultType*) override final;
+ void treeConnectSMBv1(const SMBv1::TreeConnectCommand* cmd, const SMBv1::TreeConnectArgumentType*, const SMBv1::TreeConnectResultType*) override final;
+ void treeDisconnectSMBv1(const SMBv1::TreeDisconnectCommand* cmd, const SMBv1::TreeDisconnectArgumentType*, const SMBv1::TreeDisconnectResultType*) override final;
+ void negotiateSMBv1(const SMBv1::NegotiateCommand* cmd, const SMBv1::NegotiateArgumentType*, const SMBv1::NegotiateResultType*) override final;
+ void sessionSetupAndxSMBv1(const SMBv1::SessionSetupAndxCommand* cmd, const SMBv1::SessionSetupAndxArgumentType*, const SMBv1::SessionSetupAndxResultType*) override final;
+ void logoffAndxSMBv1(const SMBv1::LogoffAndxCommand* cmd, const SMBv1::LogoffAndxArgumentType*, const SMBv1::LogoffAndxResultType*) override final;
+ void treeConnectAndxSMBv1(const SMBv1::TreeConnectAndxCommand* cmd, const SMBv1::TreeConnectAndxArgumentType*, const SMBv1::TreeConnectAndxResultType*) override final;
+ void securityPackageAndxSMBv1(const SMBv1::SecurityPackageAndxCommand* cmd, const SMBv1::SecurityPackageAndxArgumentType*, const SMBv1::SecurityPackageAndxResultType*) override final;
+ void queryInformationDiskSMBv1(const SMBv1::QueryInformationDiskCommand* cmd, const SMBv1::QueryInformationDiskArgumentType*, const SMBv1::QueryInformationDiskResultType*) override final;
+ void searchSMBv1(const SMBv1::SearchCommand* cmd, const SMBv1::SearchArgumentType*, const SMBv1::SearchResultType*) override final;
+ void findSMBv1(const SMBv1::FindCommand* cmd, const SMBv1::FindArgumentType*, const SMBv1::FindResultType*) override final;
+ void findUniqueSMBv1(const SMBv1::FindUniqueCommand* cmd, const SMBv1::FindUniqueArgumentType*, const SMBv1::FindUniqueResultType*) override final;
+ void findCloseSMBv1(const SMBv1::FindCloseCommand* cmd, const SMBv1::FindCloseArgumentType*, const SMBv1::FindCloseResultType*) override final;
+ void ntTransactSMBv1(const SMBv1::NtTransactCommand* cmd, const SMBv1::NtTransactArgumentType*, const SMBv1::NtTransactResultType*) override final;
+ void ntTransactSecondarySMBv1(const SMBv1::NtTransactSecondaryCommand* cmd, const SMBv1::NtTransactSecondaryArgumentType*, const SMBv1::NtTransactSecondaryResultType*) override final;
+ void ntCreateAndxSMBv1(const SMBv1::NtCreateAndxCommand* cmd, const SMBv1::NtCreateAndxArgumentType*, const SMBv1::NtCreateAndxResultType*) override final;
+ void ntCancelSMBv1(const SMBv1::NtCancelCommand* cmd, const SMBv1::NtCancelArgumentType*, const SMBv1::NtCancelResultType*) override final;
+ void ntRenameSMBv1(const SMBv1::NtRenameCommand* cmd, const SMBv1::NtRenameArgumentType*, const SMBv1::NtRenameResultType*) override final;
+ void openPrintFileSMBv1(const SMBv1::OpenPrintFileCommand* cmd, const SMBv1::OpenPrintFileArgumentType*, const SMBv1::OpenPrintFileResultType*) override final;
+ void writePrintFileSMBv1(const SMBv1::WritePrintFileCommand* cmd, const SMBv1::WritePrintFileArgumentType*, const SMBv1::WritePrintFileResultType*) override final;
+ void closePrintFileSMBv1(const SMBv1::ClosePrintFileCommand* cmd, const SMBv1::ClosePrintFileArgumentType*, const SMBv1::ClosePrintFileResultType*) override final;
+ void getPrintQueueSMBv1(const SMBv1::GetPrintQueueCommand* cmd, const SMBv1::GetPrintQueueArgumentType*, const SMBv1::GetPrintQueueResultType*) override final;
+ void readBulkSMBv1(const SMBv1::ReadBulkCommand* cmd, const SMBv1::ReadBulkArgumentType*, const SMBv1::ReadBulkResultType*) override final;
+ void writeBulkSMBv1(const SMBv1::WriteBulkCommand* cmd, const SMBv1::WriteBulkArgumentType*, const SMBv1::WriteBulkResultType*) override final;
+ void writeBulkDataSMBv1(const SMBv1::WriteBulkDataCommand* cmd, const SMBv1::WriteBulkDataArgumentType*, const SMBv1::WriteBulkDataResultType*) override final;
+ void invalidSMBv1(const SMBv1::InvalidCommand* cmd, const SMBv1::InvalidArgumentType*, const SMBv1::InvalidResultType*) override final;
+ void noAndxCommandSMBv1(const SMBv1::NoAndxCommand* cmd, const SMBv1::NoAndxCmdArgumentType*, const SMBv1::NoAndxCmdResultType*) override final;
- uint64_t nfs3_proc_total;
- std::vector<int> nfs3_proc_count;
+ // CIFS v2
+ virtual void closeFileSMBv2(const SMBv2::CloseFileCommand*, const SMBv2::CloseRequest*, const SMBv2::CloseResponse*) override final;
+ virtual void negotiateSMBv2(const SMBv2::NegotiateCommand*, const SMBv2::NegotiateRequest*, const SMBv2::NegotiateResponse*) override final;
+ virtual void sessionSetupSMBv2(const SMBv2::SessionSetupCommand*, const SMBv2::SessionSetupRequest*, const SMBv2::SessionSetupResponse*) override final;
+ virtual void logOffSMBv2(const SMBv2::LogOffCommand*, const SMBv2::LogOffRequest*, const SMBv2::LogOffResponse*) override final;
+ virtual void treeConnectSMBv2(const SMBv2::TreeConnectCommand*, const SMBv2::TreeConnectRequest*, const SMBv2::TreeConnectResponse*) override final;
+ virtual void treeDisconnectSMBv2(const SMBv2::TreeDisconnectCommand*, const SMBv2::TreeDisconnectRequest*, const SMBv2::TreeDisconnectResponse*) override final;
+ virtual void createSMBv2(const SMBv2::CreateCommand*, const SMBv2::CreateRequest*, const SMBv2::CreateResponse*) override final;
+ virtual void flushSMBv2(const SMBv2::FlushCommand*, const SMBv2::FlushRequest*, const SMBv2::FlushResponse*) override final;
+ virtual void readSMBv2(const SMBv2::ReadCommand*, const SMBv2::ReadRequest*, const SMBv2::ReadResponse*) override final;
+ virtual void writeSMBv2(const SMBv2::WriteCommand*, const SMBv2::WriteRequest*, const SMBv2::WriteResponse*) override final;
+ virtual void lockSMBv2(const SMBv2::LockCommand*, const SMBv2::LockRequest*, const SMBv2::LockResponse*) override final;
+ virtual void ioctlSMBv2(const SMBv2::IoctlCommand*, const SMBv2::IoCtlRequest*, const SMBv2::IoCtlResponse*) override final;
+ virtual void cancelSMBv2(const SMBv2::CancelCommand*, const SMBv2::CancelRequest*, const SMBv2::CancelResponce*) override final;
+ virtual void echoSMBv2(const SMBv2::EchoCommand*, const SMBv2::EchoRequest*, const SMBv2::EchoResponse*) override final;
+ virtual void queryDirSMBv2(const SMBv2::QueryDirCommand*, const SMBv2::QueryDirRequest*, const SMBv2::QueryDirResponse*) override final;
+ virtual void changeNotifySMBv2(const SMBv2::ChangeNotifyCommand*, const SMBv2::ChangeNotifyRequest*, const SMBv2::ChangeNotifyResponse*) override final;
+ virtual void queryInfoSMBv2(const SMBv2::QueryInfoCommand*, const SMBv2::QueryInfoRequest*, const SMBv2::QueryInfoResponse*) override final;
+ virtual void setInfoSMBv2(const SMBv2::SetInfoCommand*, const SMBv2::SetInfoRequest*, const SMBv2::SetInfoResponse*) override final;
+ virtual void breakOplockSMBv2(const SMBv2::BreakOpLockCommand*, const SMBv2::OplockAcknowledgment*, const SMBv2::OplockResponse*) override final;
- uint64_t nfs4_proc_total;
- uint64_t nfs4_ops_total;
- std::vector<int> nfs4_proc_count;
-
- std::thread monitor_thread;
- std::atomic_flag monitor_running;
+private:
- long int refresh_delta;
+ void count_proc(const RPCProcedure* proc);
+ void cifs_account(AbstractProtocol &protocol, int cmd_code);
+ void nfs_account(const RPCProcedure*,
+ const unsigned int nfs_minor_vers = NFS_V41);
+ void account40_op(const RPCProcedure*, const ProcEnumNFS4::NFSProcedure);
+ void account41_op(const RPCProcedure*, const ProcEnumNFS41::NFSProcedure);
- const uint16_t max_read;
- std::atomic<uint16_t> read_counter;
- std::condition_variable cv;
- std::mutex mut;
+ CIFSv2Protocol _cifsv2;
+ CIFSv1Protocol _cifsv1;
+ NFSv41Protocol _nfsv41;
+ NFSv4Protocol _nfsv4;
+ NFSv3Protocol _nfsv3;
- Plotter pl;
+ std::vector<AbstractProtocol* > protocols;
+ UserGUI gui;
};
//------------------------------------------------------------------------------
-#endif //WATCH_ANALYZER_H
+#endif//WATCH_ANALYZER_H
//------------------------------------------------------------------------------
diff --git a/astyle.cfg b/astyle.cfg
new file mode 100644
index 0000000..f33bce3
--- /dev/null
+++ b/astyle.cfg
@@ -0,0 +1,23 @@
+# Bracket style
+--style=ansi
+
+# Tab
+--indent=spaces=4
+
+# Indentation
+--indent-preprocessor
+--max-instatement-indent=80
+
+# Padding
+--pad-oper
+--pad-header
+--align-pointer=type
+--align-reference=type
+
+# Formatting
+--add-brackets
+--keep-one-line-blocks
+--convert-tabs
+
+# Other
+--lineend=linux
diff --git a/ci/ci_build.sh b/ci/ci_build.sh
new file mode 100755
index 0000000..1e336a0
--- /dev/null
+++ b/ci/ci_build.sh
@@ -0,0 +1,336 @@
+#!/bin/sh
+#
+# Author: Ilya Storozhilov
+# Description: Main CI-cycle script
+# Copyright (c) 2013-2014 EPAM Systems
+#
+# This file is part of Nfstrace.
+#
+# Nfstrace is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, version 2 of the License.
+#
+# Nfstrace is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+
+# Platform identification
+
+PLATFORM=$(uname)
+if [ $? -ne 0 ] ; then
+ echo ">>> Platform identification error"
+ exit 1
+fi
+if [ "$PLATFORM" = "Linux" ] ; then
+ OS_RELEASE_FILE="/etc/os-release"
+ if [ ! -r "$OS_RELEASE_FILE" ] ; then
+ echo ">>> Linux distro identification error: file '$OS_RELEASE_FILE' not found" >&2
+ exit 1
+ fi
+ LINUX_DISTRO=$(grep "^NAME=" "$OS_RELEASE_FILE" | sed -e 's/NAME=//g' | sed -e 's/"//g')
+ echo ">>> Running CI-cycle on '$LINUX_DISTRO' platform"
+else
+ echo ">>> Running CI-cycle on '$PLATFORM' platform"
+fi
+
+# Pulling environment variables using default values
+
+: ${WORKSPACE:="$(pwd)/$(dirname $0)/.."}
+
+# Processing CLI arguments
+
+SKIP_CPPCHECK=false
+SKIP_SCAN_BUILD=false
+SKIP_MEMCHECK=false
+SKIP_PACKAGING=false
+SKIP_COVERAGE=false
+
+for CLI_OPT in "$@" ; do
+ case $CLI_OPT in
+ --skip-cppcheck) SKIP_CPPCHECK=true ;;
+ --skip-scan-build) SKIP_SCAN_BUILD=true ;;
+ --skip-memcheck) SKIP_MEMCHECK=true ;;
+ --skip-packaging) SKIP_PACKAGING=true ;;
+ --skip-coverage) SKIP_COVERAGE=true ;;
+ esac
+done
+
+# Generating cppcheck report
+
+if [ "$SKIP_CPPCHECK" = true ] ; then
+ echo ">>> Skipping cppcheck report generation"
+else
+ cd $WORKSPACE
+ echo ">>> Generating cppcheck report"
+ cppcheck --enable=all --std=c++11 --inconclusive --xml --xml-version=2 src analyzers/src 2> cppcheck.xml
+ if [ $? -ne 0 ] ; then
+ echo ">>> Cppcheck report generation error"
+ exit 1
+ fi
+fi
+
+# Generating scan-build report
+
+if [ "$SKIP_SCAN_BUILD" = true ] ; then
+ echo ">>> Skipping scan-build report generation"
+elif [ "$LINUX_DISTRO" = "openSUSE" ] ; then
+ echo ">>> Will not generate scan-build report - OpenSUSE is not supported at the moment"
+else
+ SCAN_BUILD_TMPDIR=$(mktemp -d /tmp/scan-build.XXXXXX)
+ SCAN_BUILD_ARCHIVE=$WORKSPACE/scan-build-archive
+ SCAN_BUILD_DIR=$WORKSPACE/scan-build
+
+ if [ "$PLATFORM" = "FreeBSD" ] ; then
+ CCC_ANALYZER=ccc-analyzer35
+ CXX_ANALYZER=c++-analyzer35
+ SCAN_BUILD=/usr/local/llvm35/bin/scan-build
+ elif [ "$LINUX_DISTRO" = "Ubuntu" ] ; then
+ # Different Ubuntu versions have different locations for CLang analyser binaries
+ CCC_ANALYZER=$(find /usr/share/clang/ -name ccc-analyzer)
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build C language analyzer executable lookup error"
+ exit 1
+ fi
+ CXX_ANALYZER=$(find /usr/share/clang/ -name c++-analyzer)
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build C++ language analyzer executable lookup error"
+ exit 1
+ fi
+ SCAN_BUILD=scan-build
+ elif [ "$LINUX_DISTRO" = "ALT Linux" ] ; then
+ CCC_ANALYZER=/usr/lib64/clang-analyzer/scan-build/ccc-analyzer
+ CXX_ANALYZER=/usr/lib64/clang-analyzer/scan-build/c++-analyzer
+ SCAN_BUILD=scan-build
+ elif [ "$LINUX_DISTRO" = "CentOS Linux" ] ; then
+ CCC_ANALYZER=/usr/libexec/clang-analyzer/scan-build/ccc-analyzer
+ CXX_ANALYZER=/usr/libexec/clang-analyzer/scan-build/c++-analyzer
+ SCAN_BUILD=scan-build
+ else
+ echo ">>> WARNING: Scan-build binaries supposed to be in PATH environment variable due to unknown platform"
+ CCC_ANALYZER=ccc-analyzer
+ CXX_ANALYZER=c++-analyzer
+ SCAN_BUILD=scan-build
+ fi
+
+ echo ">>> Generating scan-build report"
+ rm -rf $SCAN_BUILD_DIR
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build directory removal error"
+ exit 1
+ fi
+ mkdir $SCAN_BUILD_DIR
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build directory creation error"
+ exit 1
+ fi
+ cd $SCAN_BUILD_DIR
+ cmake -DCMAKE_BUILD_TYPE=Debug \
+ -DCMAKE_C_COMPILER=$CCC_ANALYZER \
+ -DCMAKE_CXX_COMPILER=$CXX_ANALYZER ../
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build configuration error"
+ exit 1
+ fi
+ $SCAN_BUILD --use-analyzer=/usr/bin/clang++ \
+ -analyze-headers \
+ -o ${SCAN_BUILD_TMPDIR} \
+ -enable-checker alpha.core \
+ -enable-checker alpha.cplusplus \
+ -enable-checker alpha.deadcode \
+ -enable-checker alpha.security \
+ -enable-checker alpha.unix \
+ -enable-checker security \
+ make
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build report generation error"
+ exit 1
+ fi
+ # Get the directory name of the report created by scan-build
+ SCAN_BUILD_REPORT=$(find $SCAN_BUILD_TMPDIR -maxdepth 1 -not -empty -not -name `basename $SCAN_BUILD_TMPDIR`)
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build report output directory identification error"
+ exit 1
+ fi
+ if [ -z "$SCAN_BUILD_REPORT" ]; then
+ echo ">>> No scan-build report has been generated"
+ else
+ echo ">>> Scan-build report has been generated in '$SCAN_BUILD_REPORT' directory"
+ if [ ! -d "$SCAN_BUILD_ARCHIVE" ]; then
+ mkdir "$SCAN_BUILD_ARCHIVE"
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build report archive directory creation error"
+ exit 1
+ fi
+ else
+ rm -rf $SCAN_BUILD_ARCHIVE/*
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build report archive directory cleanup error"
+ exit 1
+ fi
+ fi
+ echo ">>> Archiving scan-build report to '$SCAN_BUILD_ARCHIVE' directory"
+ mv $SCAN_BUILD_REPORT/* $SCAN_BUILD_ARCHIVE/
+ if [ $? -ne 0 ] ; then
+ echo ">>> Scan-build report archiving error"
+ exit 1
+ fi
+ rm -rf "$SCAN_BUILD_TMPDIR"
+ fi
+fi
+
+INCLUDE_COVERAGE=true
+if [ "$SKIP_COVERAGE" = true ] ; then
+ INCLUDE_COVERAGE=false
+ echo ">>> Skipping coverage info generation (gcc --coverage)"
+fi
+
+# Doing Debug build
+
+DEBUG_BUILD_DIR=$WORKSPACE/debug
+echo ">>> Doing Debug build in '$DEBUG_BUILD_DIR' directory"
+rm -rf $DEBUG_BUILD_DIR
+if [ $? -ne 0 ] ; then
+ echo ">>> Debug build directory removal error"
+ exit 1
+fi
+mkdir $DEBUG_BUILD_DIR
+if [ $? -ne 0 ] ; then
+ echo ">>> Debug build directory creation error"
+ exit 1
+fi
+cd $DEBUG_BUILD_DIR
+
+cmake -DINCLUDE_COVERAGE_INFO="${INCLUDE_COVERAGE}" -DCMAKE_BUILD_TYPE=Debug -DGMOCK_SOURCE_DIR="$HOME/gmock-1.7.0" ../
+
+if [ $? -ne 0 ] ; then
+ echo ">>> Debug build configuration error"
+ exit 1
+fi
+make
+if [ $? -ne 0 ] ; then
+ echo ">>> Debug build compilation error"
+ exit 1
+fi
+CTEST_OUTPUT_ON_FAILURE=TRUE make test
+if [ $? -ne 0 ] ; then
+ echo ">>> Running tests on Debug build error"
+ exit 1
+fi
+if [ "$PLATFORM" = "FreeBSD" ] ; then
+ # TODO: Support for code coverage on FreeBSD
+ echo ">>> Coverage report generation is not supported on FreeBSD at the moment"
+else
+ if [ "$SKIP_COVERAGE" = false ] ; then
+ make coverage
+ if [ $? -ne 0 ] ; then
+ echo ">>> Code coverage report creation error"
+ exit 1
+ fi
+ fi
+fi
+
+# Running valgrind/memcheck
+
+if [ "$SKIP_MEMCHECK" = true ] ; then
+ echo ">>> Skipping valgrind/memcheck report generation"
+elif [ "$PLATFORM" = "FreeBSD" ] ; then
+ # TODO: Valgrind causes error on FreeBSD, see https://bugs.kde.org/show_bug.cgi?id=306235
+ echo ">>> Valgrind/memcheck report generation is not supported on FreeBSD, see https://bugs.kde.org/show_bug.cgi?id=306235"
+elif [ "$LINUX_DISTRO" = "ALT Linux" ] ; then
+ # TODO: Jenkins causes error on ALT Linux on publish valgrind report phase
+ echo ">>> Valgrind/memcheck report generation is not supported on ALT Linux"
+else
+ echo ">>> Generating valgrind/memcheck report"
+ make memcheck-report-xml
+fi
+
+# Doing Release build
+
+RELEASE_BUILD_DIR=$WORKSPACE/release
+echo ">>> Doing Release build in '$RELEASE_BUILD_DIR' directory"
+cd $WORKSPACE
+rm -rf $RELEASE_BUILD_DIR
+if [ $? -ne 0 ] ; then
+ echo ">>> Release build directory removal error"
+ exit 1
+fi
+mkdir $RELEASE_BUILD_DIR
+if [ $? -ne 0 ] ; then
+ echo ">>> Release build directory creation error"
+ exit 1
+fi
+cd $RELEASE_BUILD_DIR
+cmake -DCMAKE_BUILD_TYPE=Release -DGMOCK_SOURCE_DIR="$HOME/gmock-1.7.0" ../
+if [ $? -ne 0 ] ; then
+ echo ">>> Release build configuration error"
+ exit 1
+fi
+make
+if [ $? -ne 0 ] ; then
+ echo ">>> Release build compilation error"
+ exit 1
+fi
+CTEST_OUTPUT_ON_FAILURE=TRUE make test
+if [ $? -ne 0 ] ; then
+ echo ">>> Running tests on Release build error"
+ exit 1
+fi
+
+# Packaging
+
+if [ "$SKIP_PACKAGING" = true ] ; then
+ echo ">>> Skipping packaging"
+elif [ "$LINUX_DISTRO" = "ALT Linux" ] ; then
+ # TODO: Packaging support on ALT Linux
+ echo ">>> Packaging is not supported on ALT Linux at the moment"
+elif [ "$LINUX_DISTRO" = "Ubuntu" -o "$LINUX_DISTRO" = "Debian" ] ; then
+ echo ">>> Making DEB-package"
+ cpack -G DEB
+ if [ $? -ne 0 ] ; then
+ echo ">>> Making DEB-package error"
+ exit 1
+ fi
+ echo ">>> Installing DEB-package"
+ sudo dpkg -i *.deb
+ if [ $? -ne 0 ] ; then
+ echo ">>> Installing DEB-package error"
+ exit 1
+ fi
+ echo ">>> Uninstalling DEB-package"
+ sudo dpkg -r nfstrace
+ if [ $? -ne 0 ] ; then
+ echo ">>> Uninstalling DEB-package error"
+ exit 1
+ fi
+#elif [ "$LINUX_DISTRO" = "CentOS Linux" -o "$LINUX_DISTRO" = "openSUSE" -o "$LINUX_DISTRO" = "ALT Linux" ] ; then
+elif [ "$LINUX_DISTRO" = "CentOS Linux" -o "$LINUX_DISTRO" = "openSUSE" ] ; then
+ echo ">>> Making RPM-package"
+ cpack -G RPM
+ echo ">>> Installing RPM-package"
+ sudo rpm -i nfstrace*.rpm
+ echo ">>> Uninstalling RPM-package"
+ sudo rpm -e nfstrace
+else
+ echo ">>> Making archived package"
+ make package
+ if [ $? -ne 0 ] ; then
+ echo ">>> Making archived package error"
+ exit 1
+ fi
+ echo ">>> Installing NFSTrace"
+ sudo make install
+ if [ $? -ne 0 ] ; then
+ echo ">>> NFSTrace installation error"
+ exit 1
+ fi
+ echo ">>> Uninstalling NFSTrace"
+ sudo xargs rm < install_manifest.txt
+ if [ $? -ne 0 ] ; then
+ echo ">>> NFSTrace uninstallation error"
+ exit 1
+ fi
+fi
diff --git a/cmake/FindJSON.cmake b/cmake/FindJSON.cmake
new file mode 100644
index 0000000..955564f
--- /dev/null
+++ b/cmake/FindJSON.cmake
@@ -0,0 +1,39 @@
+# - Find json
+# Find the native JSON headers and libraries.
+# This module defines
+# JSON_INCLUDE_DIRS - the json include directory
+# JSON_LIBRARIES - the libraries needed to use json
+# JSON_FOUND - system has the json library
+#
+# Copyright (c) 2013 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# See:
+# https://github.com/json-c/json-c/wiki
+# $ sudo apt-get install libjson0-dev
+# in sid:
+# $ sudo apt-get install libjson-c-dev
+
+find_path(JSON_INCLUDE_DIR NAMES json-c/json.h json/json.h)
+find_library(JSON_LIBRARY NAMES json-c json)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(JSON DEFAULT_MSG
+ JSON_LIBRARY
+ JSON_INCLUDE_DIR
+)
+
+if(JSON_FOUND)
+ set(JSON_LIBRARIES ${JSON_LIBRARY})
+ # hack to get old and new layout working:
+ set(JSON_INCLUDE_DIRS ${JSON_INCLUDE_DIR}/json-c
+ ${JSON_INCLUDE_DIR}/json)
+endif()
+
+mark_as_advanced(
+ JSON_LIBRARY
+ JSON_INCLUDE_DIR
+)
diff --git a/cmake/options.cmake b/cmake/options.cmake
new file mode 100644
index 0000000..4197373
--- /dev/null
+++ b/cmake/options.cmake
@@ -0,0 +1,7 @@
+# Profiling
+option(PROFILING "help string describing option" OFF)
+if (PROFILING)
+ add_definitions(-DPROFILING)
+else ()
+ message(STATUS "To enable code self-profiling set option PROFILING=ON and build in Release mode")
+endif()
diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake
new file mode 100644
index 0000000..4d0fc96
--- /dev/null
+++ b/cmake/packaging.cmake
@@ -0,0 +1,37 @@
+set (CPACK_PACKAGE_VERSION ${NST_VERSION})
+set (CPACK_PACKAGING_INSTALL_PREFIX "/usr")
+set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "NFS tracing/monitoring/capturing/statistic tool")
+set (CPACK_PACKAGE_CONTACT "Nfstrace developers <nfstrace@epam.com>")
+
+set (CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
+set (CPACK_RPM_PACKAGE_LICENSE "GPLv2")
+set (CPACK_RPM_PACKAGE_VENDOR "EPAM Systems")
+set (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/share/man /usr/share/man/man8)
+set (CPACK_RPM_PACKAGE_REQUIRES "libpcap >= 1.3.0-1")
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND EXISTS "/etc/os-release")
+ execute_process (
+ COMMAND grep "^NAME=" /etc/os-release
+ COMMAND sed -e "s/NAME=//g"
+ COMMAND sed -e "s/\"//g"
+ RESULT_VARIABLE DIFINE_LINUX_DISTRO_RESULT
+ OUTPUT_VARIABLE LINUX_DISTRO
+ )
+ if (NOT ${DIFINE_LINUX_DISTRO_RESULT} EQUAL 0)
+ message (FATAL_ERROR "Linux distro identification error")
+ endif ()
+endif ()
+# libjson package has different names on different RPM-based distros
+if (${LINUX_DISTRO} MATCHES "openSUSE")
+ set (CPACK_RPM_PACKAGE_REQUIRES "libjson-c2 >= 0.11")
+elseif (${LINUX_DISTRO} MATCHES "ALT Linux")
+ set (CPACK_RPM_PACKAGE_REQUIRES "libjson-c >= 0.11")
+else ()
+ # CentOS/Fedora/etc.
+ set (CPACK_RPM_PACKAGE_REQUIRES "json-c >= 0.11")
+endif ()
+
+set (CPACK_DEBIAN_PACKAGE_SECTION "admin")
+set (CPACK_DEBIAN_PACKAGE_DEPENDS "libpcap0.8 (>=1.3.0-1)")
+set (CPACK_DEBIAN_PACKAGE_DEPENDS "libjson-c2 (>=0.11)")
+
+include (CPack)
diff --git a/cmake/valgrind.cmake b/cmake/valgrind.cmake
new file mode 100644
index 0000000..1a00bc0
--- /dev/null
+++ b/cmake/valgrind.cmake
@@ -0,0 +1,82 @@
+find_program (VALGRIND_PATH valgrind)
+
+if (VALGRIND_PATH)
+ add_custom_target (memcheck-report)
+ add_custom_target (memcheck-report-xml)
+ add_custom_target (helgrind-report)
+ add_custom_target (helgrind-report-xml)
+
+ foreach (PROTOCOL IN ITEMS "nfsv3" "nfsv4")
+ # Preparing trace file
+ set (ARCHIVED_TRACE_FILENAME "${CMAKE_SOURCE_DIR}/traces/breakdown/eth-ipv4-tcp-${PROTOCOL}.pcap.bz2")
+ set (TRACE_FILENAME "${CMAKE_BINARY_DIR}/eth-ipv4-tcp-${PROTOCOL}.pcap")
+ set (UNZIP_TRACE_TARGET_NAME "${PROTOCOL}_trace")
+ add_custom_target (${UNZIP_TRACE_TARGET_NAME}
+ COMMAND bzcat ${ARCHIVED_TRACE_FILENAME} > ${TRACE_FILENAME}
+ DEPENDS ${ARCHIVED_TRACE_FILENAME})
+ add_dependencies (memcheck-report ${UNZIP_TRACE_TARGET_NAME})
+ add_dependencies (memcheck-report-xml ${UNZIP_TRACE_TARGET_NAME})
+ add_dependencies (helgrind-report ${UNZIP_TRACE_TARGET_NAME})
+ add_dependencies (helgrind-report-xml ${UNZIP_TRACE_TARGET_NAME})
+
+ # Memcheck report
+ add_custom_command (TARGET memcheck-report
+ POST_BUILD
+ COMMAND valgrind --tool=memcheck --leak-check=full --show-reachable=yes
+ --undef-value-errors=yes --track-origins=no --child-silent-after-fork=no
+ --trace-children=no --log-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.drain.${PROTOCOL}.memcheck.log
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=drain -b 20 -Q 4096 -M 512
+ -I ${TRACE_FILENAME})
+ add_custom_command (TARGET memcheck-report
+ POST_BUILD
+ COMMAND valgrind --tool=memcheck --leak-check=full --show-reachable=yes
+ --undef-value-errors=yes --track-origins=no --child-silent-after-fork=no
+ --trace-children=no --log-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.stat.${PROTOCOL}.memcheck.log
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=stat -a ${CMAKE_BINARY_DIR}/analyzers/libbreakdown.so
+ -b 20 -Q 4096 -M 512 -I ${TRACE_FILENAME})
+
+ # Memcheck report (XML)
+ add_custom_command (TARGET memcheck-report-xml
+ POST_BUILD
+ COMMAND valgrind --tool=memcheck --leak-check=full --show-reachable=yes
+ --undef-value-errors=yes --track-origins=no --child-silent-after-fork=no
+ --trace-children=no --xml=yes --xml-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.drain.${PROTOCOL}.memcheck.xml
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=drain -b 20 -Q 4096 -M 512
+ -I ${TRACE_FILENAME})
+ add_custom_command (TARGET memcheck-report-xml
+ POST_BUILD
+ COMMAND valgrind --tool=memcheck --leak-check=full --show-reachable=yes
+ --undef-value-errors=yes --track-origins=no --child-silent-after-fork=no
+ --trace-children=no --xml=yes --xml-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.stat.${PROTOCOL}.memcheck.xml
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=stat -a ${CMAKE_BINARY_DIR}/analyzers/libbreakdown.so
+ -b 20 -Q 4096 -M 512 -I ${TRACE_FILENAME})
+
+ # Helgrind report
+ add_custom_command (TARGET helgrind-report
+ POST_BUILD
+ COMMAND valgrind --tool=helgrind --child-silent-after-fork=no --trace-children=no
+ --log-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.drain.${PROTOCOL}.helgrind.log
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=drain -b 20 -Q 4096 -M 512
+ -I ${TRACE_FILENAME})
+ add_custom_command (TARGET helgrind-report
+ POST_BUILD
+ COMMAND valgrind --tool=helgrind --child-silent-after-fork=no --trace-children=no
+ --log-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.stat.${PROTOCOL}.helgrind.log
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=stat -a ${CMAKE_BINARY_DIR}/analyzers/libbreakdown.so
+ -b 20 -Q 4096 -M 512 -I ${TRACE_FILENAME})
+
+ # Helgrind report (XML)
+ add_custom_command (TARGET helgrind-report-xml
+ POST_BUILD
+ COMMAND valgrind --tool=helgrind --child-silent-after-fork=no --trace-children=no
+ --xml=yes --xml-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.drain.${PROTOCOL}.helgrind.xml
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=drain -b 20 -Q 4096 -M 512
+ -I ${TRACE_FILENAME})
+ add_custom_command (TARGET helgrind-report-xml
+ POST_BUILD
+ COMMAND valgrind --tool=helgrind --child-silent-after-fork=no --trace-children=no
+ --xml=yes --xml-file=${CMAKE_BINARY_DIR}/valgrind.nfstrace.%p.stat.${PROTOCOL}.helgrind.xml
+ ${CMAKE_BINARY_DIR}/nfstrace --mode=stat -a ${CMAKE_BINARY_DIR}/analyzers/libbreakdown.so
+ -b 20 -Q 4096 -M 512 -I ${TRACE_FILENAME})
+ endforeach ()
+endif ()
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 0000000..a41ec8f
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,13 @@
+add_custom_target (documentation)
+
+find_program (DOXYGEN_PATH doxygen)
+if (DOXYGEN_PATH)
+ add_custom_target (documentation-doxygen
+ COMMAND ${DOXYGEN_PATH} Doxyfile
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ add_dependencies (documentation documentation-doxygen)
+else ()
+ message (WARNING "Doxygen is not found - source-code documentation is not available")
+endif ()
+
+add_subdirectory (design)
diff --git a/docs/TODO b/docs/TODO
index 82b81c9..c9e177d 100644
--- a/docs/TODO
+++ b/docs/TODO
@@ -12,6 +12,4 @@ The '*'s mean a complexity of implementation.
**** Add batching to Analyzers API. Passing a sequence of RPC Procedures to an analyser
*** Implement drawing graphics in analyzers via gnuplot directly, without external .sh script
**** Implement libpyadapter.so or libjavaadapter.so
-***** Implement CIFS support
-**** Implement NFSv4.1 support
**** Implement WebUI
diff --git a/docs/design/CMakeLists.txt b/docs/design/CMakeLists.txt
new file mode 100644
index 0000000..5196121
--- /dev/null
+++ b/docs/design/CMakeLists.txt
@@ -0,0 +1,34 @@
+find_program (JAVA_PATH java)
+if (JAVA_PATH)
+ add_custom_target (documentation-design)
+ add_dependencies (documentation documentation-design)
+
+ # Processing PlantUML JAR
+ set (PLANTUML_JAR "plantuml.jar")
+ set (PLANTUML_FOUND "FALSE")
+ if (NOT "${PLANTUML_JAR_DIR}" STREQUAL "")
+ # PlantUML directory has been manually set
+ find_file (PLANTUML_JAR_PATH ${PLANTUML_JAR} PATHS ${PLANTUML_JAR_DIR})
+ if ("${PLANTUML_JAR_PATH}" STREQUAL "PLANTUML_JAR_PATH-NOTFOUND")
+ message (FATAL_ERROR "Plantuml JAR file '${PLANTUML_JAR}' not found in '${PLANTUML_JAR_DIR}' directory")
+ else ()
+ message (STATUS "Plantuml JAR file successfully found: '${PLANTUML_JAR_PATH}'")
+ set (PLANTUML_FOUND "TRUE")
+ endif ()
+ endif ()
+ set (DOWNLOAD_PLANTUML_JAR_PROXY_TARGET download-plantuml-jar-proxy)
+ add_custom_target (${DOWNLOAD_PLANTUML_JAR_PROXY_TARGET}) # Special target with optional 'Download PlantUML JAR' dependency
+ if (NOT ${PLANTUML_FOUND})
+ set (DOWNLOAD_PLANTUML_JAR_TARGET download-plantuml-jar)
+ set (PLANTUML_JAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${PLANTUML_JAR}")
+ add_custom_command (OUTPUT ${PLANTUML_JAR_PATH}
+ COMMAND ${CMAKE_COMMAND} -DPLANTUML_JAR_PATH=${PLANTUML_JAR_PATH} -P ${CMAKE_CURRENT_SOURCE_DIR}/download_plantuml.cmake)
+ set_source_files_properties (${PLANTUML_JAR_PATH} PROPERTIES GENERATED 1)
+ add_custom_target (${DOWNLOAD_PLANTUML_JAR_TARGET} SOURCES ${PLANTUML_JAR_PATH})
+ add_dependencies (${DOWNLOAD_PLANTUML_JAR_PROXY_TARGET} ${DOWNLOAD_PLANTUML_JAR_TARGET})
+ endif ()
+
+ add_subdirectory (libwatch)
+else ()
+ message (WARNING "Java is not found - design documentation is not available")
+endif ()
diff --git a/docs/design/download_plantuml.cmake b/docs/design/download_plantuml.cmake
new file mode 100644
index 0000000..0251fa5
--- /dev/null
+++ b/docs/design/download_plantuml.cmake
@@ -0,0 +1,10 @@
+message ("Downloading PlantUML JAR. Use '-DPLANTUML_JAR_DIR=<dir_with_plantuml_jar>' param for CMake to use local PlantUML JAR.")
+file (DOWNLOAD "http://downloads.sourceforge.net/project/plantuml/plantuml.jar"
+ ${PLANTUML_JAR_PATH} SHOW_PROGRESS STATUS DOWNLOAD_STATUS_LIST)
+list (GET DOWNLOAD_STATUS_LIST 0 DOWNLOAD_STATUS)
+if (${DOWNLOAD_STATUS} EQUAL 0)
+ message ("Successfully downloaded PlantUML JAR")
+else ()
+ list (GET DOWNLOAD_STATUS_LIST 1 DOWNLOAD_ERROR)
+ message (FATAL_ERROR "PlantUML JAR download error: ${DOWNLOAD_ERROR}")
+endif ()
diff --git a/docs/design/libwatch/CMakeLists.txt b/docs/design/libwatch/CMakeLists.txt
new file mode 100644
index 0000000..d6b5713
--- /dev/null
+++ b/docs/design/libwatch/CMakeLists.txt
@@ -0,0 +1,15 @@
+file (GLOB DIAGRAM_SOURCE_FILES "*.plantuml")
+foreach (DIAGRAM_SOURCE_FILE ${DIAGRAM_SOURCE_FILES})
+ get_filename_component (DIAGRAM_SOURCE_FILENAME ${DIAGRAM_SOURCE_FILE} NAME)
+ get_filename_component (DIAGRAM_SOURCE_FILENAME_WE ${DIAGRAM_SOURCE_FILE} NAME_WE)
+ set (DIAGRAM_TARGET_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${DIAGRAM_SOURCE_FILENAME_WE}.png")
+ set (DIAGRAM_TARGET documentation-design-libwatch-${DIAGRAM_SOURCE_FILENAME})
+ add_custom_command(OUTPUT ${DIAGRAM_TARGET_FILE}
+ COMMAND ${JAVA_PATH} -jar ${PLANTUML_JAR_PATH} -verbose ${DIAGRAM_SOURCE_FILENAME}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS ${DIAGRAM_SOURCE_FILE})
+ set_source_files_properties (${DIAGRAM_TARGET_FILE} PROPERTIES GENERATED 1)
+ add_custom_target (${DIAGRAM_TARGET} SOURCES ${DIAGRAM_TARGET_FILE})
+ add_dependencies (documentation-design ${DIAGRAM_TARGET})
+ add_dependencies (${DIAGRAM_TARGET} ${DOWNLOAD_PLANTUML_JAR_PROXY_TARGET})
+endforeach ()
diff --git a/docs/design/libwatch/class_diagram.plantuml b/docs/design/libwatch/class_diagram.plantuml
new file mode 100644
index 0000000..600bcfa
--- /dev/null
+++ b/docs/design/libwatch/class_diagram.plantuml
@@ -0,0 +1,111 @@
+@startuml
+skinparam titleFontSize 24
+skinparam defaultFontSize 16
+title NFSTrace: libwatch class diagram
+
+abstract class AbstractProtocol #Aquamarine {
+ + commandsAmount: const std::size_t
+ + name: const std::string
+ + AbstractProtocol(name: const std::string&, commandsAmount: std::size_t)
+ + {abstract} commandName(std::size_t commandId): const char * = 0
+}
+
+class NFSv3Protocol #Aquamarine {
+ + NFSv3Protocol()
+ + {abstract} commandName(std::size_t commandId): const char *
+}
+
+class NFSv4Protocol #Aquamarine {
+ + NFSv4Protocol()
+ + {abstract} commandName(std::size_t commandId): const char *
+}
+
+AbstractProtocol <|-- NFSv3Protocol
+AbstractProtocol <|-- NFSv4Protocol
+
+class CommandsStatistics {
+ + commands: std::vector<std::size_t>
+}
+
+class WatchAnalyzer {
+ - _userGUI: UserGUI
+ - _protocols: std::vector<AbstractProtocol*>
+ + {abstract} onCommand(): void
+ + {abstract} onUnixSignal(): void
+}
+
+class UserGUI << thread >> {
+ - _isRunning: std::atomic<bool>
+ - _shouldRefresh: std::atomic<bool>
+ - _statisticsMutex: std::mutex
+ - _statisticsContainer: std::unordered_map<AbstractProtocol*, CommandsStatistics>
+ - _activeProtocol: AbstractProtocol&
+ - _mainWindow: MainWindow
+ - _headerWindow: HeaderWindow
+ - _statisticsWindow: StatisticsWindow
+ + UserGUI(protocols: std::vector<AbstractProtocol *>&)
+ + incrementCommand(protocol: const AbstractProtocol&, commandId: std::size_t)
+ + refresh()
+ - run()
+ - selectProtocol(protocol: const ActiveProtocol&)
+}
+
+note right of UserGUI
+ <b>_statisticsContainer/_statisticsMutex</b>
+ are used to thread-safely pass statistics from
+ analyzer's thread to GUI's one;
+ <b>run()</b> is a thread-function where GUI is to
+ be created/[re-]drawn/destroyed, keyboard events are to
+ be handled and incoming statistics delta is to be applied;
+ <b>selectProtocol()</b> is to be called internally when
+ a user changes active protocol;
+ <b>incrementCommand()</b> is to be called from analyzer
+ to update statistics on command detection;
+ <b>refresh()</b> is to be called from analyzer
+ to completely redraw GUI (e.g. on SIGCONT) -
+ this method just sets <b>_shouldRefresh</b> to <b>true</b>
+ but actual refresh is made in <b>run()</b>.
+end note
+
+class MainWindow #Khaki {
+ - _handle: WINDOW*
+}
+
+class HeaderWindow #Khaki {
+ - _handle: WINDOW*
+ - _activeProtocol: const AbstractProtocol&
+ + HeaderWindow(protocols: std::vector<AbstractProtocol *>&, activeProtocol: const AbstractProtocol&)
+ + selectProtocol(protocol: const AbstractProtocol&)
+ + refresh()
+}
+
+class StatisticsWindow #Khaki {
+ - _handle: WINDOW*
+ - _activeProtocol: const AbstractProtocol&
+ - _statisticsContainer: const CommandsStatistics&
+ - _scrollOffsets: std::unordered_map<AbstractProtocol*, std::size_t>
+ + StatisticsWindow(activeProtocol: const AbstractProtocol&, statisticsContainer: const CommandsStatistics&)
+ + selectProtocol(protocol: const AbstractProtocol&)
+ + update()
+ + scroll(increment: int)
+ + refresh()
+}
+
+note top of StatisticsWindow
+ <b>selectProtocol()</b> is to be called when a protocol is changed;
+ <b>update()</b> is to be called to update statistics data;
+ <b>scroll()</b> is to be called to scroll statistics data;
+ <b>refresh()</b> is to be called to completely redraw window.
+end note
+
+WatchAnalyzer "1" *-- "1" UserGUI
+WatchAnalyzer "1" *-- "*" AbstractProtocol
+UserGUI "1" *-- "*" AbstractProtocol
+UserGUI "1" *-- "1" MainWindow
+UserGUI "1" *-- "1" HeaderWindow
+UserGUI "1" *-- "1" StatisticsWindow
+UserGUI "1" *-- "*" CommandsStatistics
+HeaderWindow "1" o-- "1" AbstractProtocol
+StatisticsWindow "1" o-- "1" CommandsStatistics
+StatisticsWindow "1" o-- "1" AbstractProtocol
+@enduml
diff --git a/docs/graphics.pdf b/docs/graphics.pdf
index 2a4d244..a1bb237 100644
--- a/docs/graphics.pdf
+++ b/docs/graphics.pdf
Binary files differ
diff --git a/docs/graphics.vsdx b/docs/graphics.vsdx
index cba081f..f07dcea 100644
--- a/docs/graphics.vsdx
+++ b/docs/graphics.vsdx
Binary files differ
diff --git a/docs/logo.png b/docs/logo.png
new file mode 100644
index 0000000..649e644
--- /dev/null
+++ b/docs/logo.png
Binary files differ
diff --git a/docs/logo64.png b/docs/logo64.png
new file mode 100644
index 0000000..87ef62e
--- /dev/null
+++ b/docs/logo64.png
Binary files differ
diff --git a/docs/nfstrace.8.in b/docs/nfstrace.8.in
index 9e224e0..189ba65 100644
--- a/docs/nfstrace.8.in
+++ b/docs/nfstrace.8.in
@@ -22,7 +22,7 @@
.TH nfstrace 8 "@COMPILATION_DATE@" "version @NST_VERSION@"
.\" --------------------- NAME -----------------------------------
.SH NAME
-.B nfstrace \- NFS tracing/monitoring/capturing/analyzing tool
+.B nfstrace \- NFS and CIFS tracing/monitoring/capturing/analyzing tool
.\" --------------------- SYNOPSIS -------------------------------
.SH SYNOPSIS
.B nfstrace
@@ -47,7 +47,11 @@
.B \-b
.I MBytes
]
-.br
+[
+.B \-p
+.I promisc
+]
+.br
[
.B \-d
.I in|out|inout
@@ -68,6 +72,9 @@
] [
.B \-D
.I MBytes
+] [
+.B \-E
+.I interfaces|plugins
]
.br
[
@@ -77,6 +84,9 @@
.B \-Q
.I 1..65535
] [
+.B \-T
+.I true|false
+] [
.B \-Z
.I username
] [
@@ -87,7 +97,7 @@
.SH DESCRIPTION
.B nfstrace
performs live Ethernet 1 Gbps – 10 Gbps packets capturing and helps to
-determine NFS procedures in raw network traffic. Furthermore, it performs
+determine NFS and CIFS procedures in raw network traffic. Furthermore, it performs
filtration, dumping, compression, statistical analysis, visualization and
provides the API for custom pluggable analysis modules.
.PP
@@ -105,7 +115,7 @@ Currently
.B nfstrace
supports the following protocols:
.PP
- Ethernet > IPv4 | IPv6 > UDP | TCP > NFSv3 | NFSv4
+ Ethernet > IPv4 | IPv6 > UDP | TCP > NFSv3 | NFSv4 | NFSv4.1 | CIFSv1 | CIFSv2
.PP
.B nfstrace
can operate in four different modes:
@@ -179,17 +189,17 @@ for specifying custom filters in BPF syntax (see
The default BPF filter in
.B nfstrace
is
-.BR "'port 2049'" ,
+.BR "'port 2049 or port 445'" ,
which means that each packet that is delivered to user-space from the kernel
satisfies the following conditions: it has IPv4 or IPv6 header and it has TCP
and UDP header with source or destination port number equals to 2049 (default
-NFS port).
+NFS port) or 445 (default CIFS port).
.PP
The reality is that this filter is very heavy and support of IPv6 is
experimental, so if you want to reach faster filtration of IPv4-only traffic we
suggest to use the following BPF filter:
.RS 4
-.B 'ip and port 2049'.
+.B 'ip and port 2049 or port 445'.
.RE
.\" --------------------- OPTIONS --------------------------------
.SH OPTIONS
@@ -209,7 +219,7 @@ Listen interface, it is required for live and dump modes
.BI "\-f, \-\-filtration=" filter
Specify the packet filter in BPF syntax; for the expression syntax, see
.BR pcap-filter (7)
-.RB (default:\ "'port 2049'" ).
+.RB (default:\ "'port 2049 or port 445'" ).
.TP
.BI "\-s, \-\-snaplen=" 1..65535
Set the max length of captured raw packet (bigger packets will be truncated).
@@ -263,12 +273,13 @@ Set the size of the dumping file portion,
means no limit
.RB (default:\ 0 ).
.TP
-.BI "\-L, \-\-list"
-List all available network interfaces and exit; please note that this option is
-not supported unless nfstrace was built against the recent version of libpcap
-that supports the
+.BI "\-E, \-\-enum=" interfaces|plugins
+Enumerate all available network interfaces and and/or all available plugins,
+then exit; please note that interfaces can't be listed unless nfstrace was built
+against the recent version of libpcap that supports the
.B pcap_findalldevs()
-function.
+function
+.RB (default:\ none ).
.TP
.BI "\-M, \-\-msg-header=" 1..4000
Truncate RPC messages to this limit (specified in bytes) before passing to a
@@ -298,21 +309,14 @@ option, then exit.
.\" --------------------- ANALYSIS MODULES -----------------------
.SH ANALYSIS MODULES
.SS Operation Breakdown Analyzer
-Operation Breakdown (OB) analyzer calculates average frequency of NFS
-procedures and computes standard deviation of latency using one of two
-algorithms (two-pass or one-pass).
-.PP
-Two-pass algorithm returns correct standard deviation but requires a lot of
-memory during computations. One-pass algorithm is memory-efficient but it
-accumulates computation error in case of a large number of small latencies. It
-is possible to choose one of these algorithms by passing according parameter
-while attaching OB analyzer to
-.BR nfstrace .
+Operation Breakdown (OB) analyzer calculates average frequency of NFS and CIFS
+procedures and computes standard deviation of latency.
+.PP
.RS 4
.PP
.B $ nfstrace -a libbreakdown.so -h
.br
-.B nfstrace 0.3.0 (Release)
+.B nfstrace 0.4.0 (Release)
.br
.B built on Linux-3.16.1-1-generic
.br
@@ -320,23 +324,14 @@ while attaching OB analyzer to
.br
.B Usage: ./nfstrace [OPTIONS]...
.br
-.B ...
-.br
-.B Usage of libbreakdown.so:
-.br
-.B ACC - for accurate evaluation(default), MEM - for memory efficient
-.B evaluation. Options cannot be combined
-.RE
.PP
-So, say, in order to choose two-pass algorithm you have to pass
-.B ACC
-to OB analyzer:
+Usage example:
.RS 4
.PP
-.B nfstrace \-m stat \-a libreakdown.so#ACC
+.B $ nfstrace \-m stat \-a libreakdown.so
.RE
.PP
-OB analyzer produces
+Breakdown analyzer produces
.B .dat
file in the current directory for each detected NFS session that can be
visualized using
@@ -348,7 +343,103 @@ or
(according to NFS version).
.RS 4
.PP
-.B nst.sh \-a breakdown_nfsv4.plt \-d . \-p 'breakdown_10.6.137.47:903*.dat'
+.B $ nst.sh \-a breakdown_nfsv4.plt \-d . \-p 'breakdown_10.6.137.47:903*.dat'
+.RE
+.SS Watch
+Watch plugin mimics old
+.B nfswatch
+utility: it monitors NFS and CIFS traffic and displays it in terminal using ncurses. It
+supports NFSv3, NFSv4, NFSv41, CIFSv1 and CIFSv2.
+.PP
+By default watch plugin will update its screen every second, you can specify
+another timeout in milliseconds:
+.RS 4
+.PP
+.B $ nfstrace -a libwatch.so#2000
+.RE
+.SS JSON Analyzer
+JSON analyzer calculates a total amount of each supported application protocol
+operation. It accepts TCP-connections on particular TCP-endpoint (host:port),
+sends a respective JSON to the TCP-client and closes connection. Suggested to
+be used in
+.B live
+mode.
+.PP
+.B Available options
+.RS 4
+.TP
+.BI "host=" hostname
+Network interface to listen (default is to listen all interfaces)
+.TP
+.BI "port=" port
+IP-port to bind to
+.RB (default:\ 8888 )
+.TP
+.BI "workers=" workers
+Amount of worker threads
+.RB (default:\ 10 )
+.TP
+.BI "duration=" duration
+Max serving duration in milliseconds
+.RB (default:\ 500 )
+.TP
+.BI "backlog=" backlog
+Listen backlog
+.RB (default:\ 15 )
+.RE
+.PP
+.B Example of use
+.RS 4
+.PP
+Start
+.B nfstrace
+in one console:
+.RS 4
+.PP
+.B $ sudo nfstrace -i eth0 -a analyzers/libjson.so#host=localhost
+.br
+\[char46]..
+.RE
+.PP
+Make a TCP-request to
+.B nfstrace
+in another console to fetch current statistics:
+.RS 4
+.PP
+.B $ telnet localhost 8888
+.br
+Trying 127.0.0.1...
+.br
+Connected to localhost.
+.br
+Escape character is '^]'.
+.br
+{
+.br
+.RS 2
+"nfs_v3":{
+.br
+.RS 2
+"null":32,
+.br
+"getattr":4582,
+.br
+\[char46]..
+.RE
+},
+.RE
+.RS 2
+"nfs_v4":{
+.br
+.RS 2
+\[char46]..
+.RE
+},
+.br
+\[char46]..
+.RE
+}Connection closed by foreign host.
+.RE
.RE
.\" --------------------- EXAMPLES -------------------------------
.SH EXAMPLES
@@ -361,7 +452,7 @@ or
options). Note that you can pass more than one module here.
.RS 4
.PP
-.B nfstrace \-\-help \-\-analysis=libbreakdown.so
+.B nfstrace \-\-help \-\-analysis=libjson.so
.RE
.SS Online tracing
The following command will run
@@ -370,7 +461,7 @@ in online analysis mode (specified with
.B \-\-mode
or
.B \-m
-options) without a pluggable analysis module. It will capture NFS traffic
+options) without a pluggable analysis module. It will capture NFS and CIFS traffic
transferred over TCP or UDP with source or destination port number equals to
2049 and will simply print them out to
.B stdout
@@ -391,7 +482,7 @@ Note that capturing from network interface requires superuser privileges.
.SS Online analysis
The following command demonstrates running
.B nfstrace
-in online analysis mode. Just like in the previous example it will capture NFS
+in online analysis mode. Just like in the previous example it will capture NFS and CIFS
traffic transferred over TCP or UDP with source or destination port number
equals to 2049 and then it will perform Operation Breakdown analysis using
pluggable analysis module
@@ -583,6 +674,15 @@ Dzianis Huznou
.PP
Pavel Karneliuk
.B <Pavel_Karneliuk@epam.com>
+.PP
+Andrey Kuznetsov
+.B <Andrey_Kuznetsov@epam.com>
+.PP
+Mikhail Litvinets
+.B <Mikhail_Litvinets@epam.com>
+.PP
+Ilya Storozhilov
+.B <Ilya_Storozhilov@epam.com>
.\" -------------------- SEE ALSO --------------------------------
.SH SEE ALSO
.BR bpf (4),
diff --git a/docs/nfstrace_manual.docx b/docs/nfstrace_manual.docx
new file mode 100755
index 0000000..98fbafb
--- /dev/null
+++ b/docs/nfstrace_manual.docx
Binary files differ
diff --git a/docs/nfstrace_manual.odt b/docs/nfstrace_manual.odt
deleted file mode 100644
index 194ef6d..0000000
--- a/docs/nfstrace_manual.odt
+++ /dev/null
Binary files differ
diff --git a/docs/nfstrace_manual.pdf b/docs/nfstrace_manual.pdf
index c8c6a2f..75672a6 100644
--- a/docs/nfstrace_manual.pdf
+++ b/docs/nfstrace_manual.pdf
Binary files differ
diff --git a/docs/template.cpp b/docs/template.cpp
index 15604fa..18158b2 100644
--- a/docs/template.cpp
+++ b/docs/template.cpp
@@ -39,12 +39,12 @@ SayHello::~SayHello()
{
}
-void SayHello::set_value(unsigned int v)
+void SayHello::set_value(std::uint32_t v)
{
value = v;
}
-unsigned int SayHello::get_value() const
+std::uint32_t SayHello::get_value() const
{
return value;
}
@@ -56,11 +56,25 @@ int main(int argc, char** argv)
hello::SayHello hello;
std::cout << hello.say() << std::endl;
-
hello.set(42);
assert(42 == hello.get());
+ // FizzBuzz
+ for(std::size_t i=1; i<=100; i++)
+ {
+ if((i % 15) == 0)
+ {
+ std::cout << "FizzBuzz\n";
+ }
+ else if(i % 3 == 0) std::cout << "Fizz\n";
+ else if(i % 5 == 0) std::cout << "Buzz\n";
+ else
+ {
+ std::cout << i << '\n';
+ }
+ }
+
return 0;
}
//------------------------------------------------------------------------------
diff --git a/docs/template.h b/docs/template.h
index 8723259..edb2ddc 100644
--- a/docs/template.h
+++ b/docs/template.h
@@ -22,6 +22,7 @@
#ifndef TEMPLATE_H
#define TEMPLATE_H
//------------------------------------------------------------------------------
+#include <cstdint> // include language headers in alphabetical order
#include <string>
//------------------------------------------------------------------------------
#define MY_MIN(a,b) (((a) < (b)) ? (a) : (b)) //!< This is example of preprocessor usage
@@ -37,27 +38,27 @@ public:
SayHello();// May be uncommented
~SayHello();// May be uncommented
- SayHello(const SayHello&); // undefined. May be uncommented
- SayHello& operator=(const SayHello&); // undefined. May be uncommented
+ SayHello(const SayHello&) = delete;
+ SayHello& operator=(const SayHello&) = delete;
/*! small functions may be implemented in-place
* \return hello string
*/
inline const std::string& say() const { return text; }
- /*! Returns value
- * \return value of sth
- */
- unsigned int get() const;
-
/*! Sets some value
* \param v - new value
*/
- void set(unsigned int v);
+ void set_value(std::uint32_t v);
+
+ /*! Returns value
+ * \return value of sth
+ */
+ std::uint32_t get_value() const;
private:
std::string text;//!< Hello phrase
- unsigned int value; //!< just a value for get/set methods
+ std::uint32_t value; //!< just a value for get/set methods
static const unsigned int BAD_COFFEE;//!< Some constant
};
diff --git a/src/analysis/analysis_manager.cpp b/src/analysis/analysis_manager.cpp
index 50754cf..f2ad42c 100644
--- a/src/analysis/analysis_manager.cpp
+++ b/src/analysis/analysis_manager.cpp
@@ -35,7 +35,8 @@ AnalysisManager::AnalysisManager(RunningStatus& status, const Parameters& params
queue.reset(new FilteredDataQueue(params.queue_capacity(), 1));
- parser_thread.reset(new NFSParserThread(*queue, *analysiss, status));
+ Parsers parser(*analysiss);
+ parser_thread.reset(new ParserThread<Parsers>(parser, *queue, status));
}
void AnalysisManager::start()
@@ -46,7 +47,6 @@ void AnalysisManager::start()
void AnalysisManager::stop()
{
parser_thread->stop();
-
analysiss->flush_statistics();
}
diff --git a/src/analysis/analysis_manager.h b/src/analysis/analysis_manager.h
index 91dc7c3..4bdc8fc 100644
--- a/src/analysis/analysis_manager.h
+++ b/src/analysis/analysis_manager.h
@@ -25,10 +25,11 @@
#include <memory>
#include "analysis/analyzers.h"
-#include "analysis/nfs_parser_thread.h"
+#include "analysis/parser_thread.h"
#include "controller/parameters.h"
#include "controller/running_status.h"
#include "utils/filtered_data.h"
+#include "analysis/parsers.h"
//------------------------------------------------------------------------------
namespace NST
{
@@ -51,10 +52,19 @@ public:
void start();
void stop();
+ inline void on_unix_signal(int signo)
+ {
+ analysiss->on_unix_signal(signo);
+ }
+
+ inline bool isSilent()
+ {
+ return analysiss->isSilent();
+ }
private:
std::unique_ptr<Analyzers> analysiss;
std::unique_ptr<FilteredDataQueue> queue;
- std::unique_ptr<NFSParserThread> parser_thread;
+ std::unique_ptr<ParserThread<Parsers>> parser_thread;
};
} // namespace analysis
diff --git a/src/analysis/analyzers.cpp b/src/analysis/analyzers.cpp
index 3a44088..e6232a4 100644
--- a/src/analysis/analyzers.cpp
+++ b/src/analysis/analyzers.cpp
@@ -29,6 +29,7 @@ namespace analysis
{
Analyzers::Analyzers(const controller::Parameters& params)
+: _silent{false}
{
for(const auto& a : params.analysis_modules())
{
@@ -36,8 +37,23 @@ Analyzers::Analyzers(const controller::Parameters& params)
try // try to load plugin
{
message << "Loading module: '" << a.path << "' with args: [" << a.args << "]";
-
std::unique_ptr<PluginInstance> plugin{new PluginInstance{a.path, a.args}};
+ if(plugin->silent())
+ {
+ if(!_silent)
+ {
+ _silent = true;
+ }
+ }
+ else
+ {
+ if(_silent)
+ {
+ TRACE("Error in plugin %s loading. Already load module with silent option.", a.path.c_str());
+ continue;
+ }
+ }
+
modules.emplace_back(plugin->instance());
plugins.emplace_back(std::move(plugin));
}
diff --git a/src/analysis/analyzers.h b/src/analysis/analyzers.h
index fdfa266..f8a1c4a 100644
--- a/src/analysis/analyzers.h
+++ b/src/analysis/analyzers.h
@@ -45,6 +45,7 @@ public:
Analyzers(const Analyzers&) = delete;
Analyzers& operator=(const Analyzers&) = delete;
+ //! This function is used for passing ALL possible procedures to analyzers
template
<
typename Handle,
@@ -58,6 +59,35 @@ public:
}
}
+ //! This function is used for passing args- or res-only NFS4.x operations (ex. NFSv4 ILLEGAL) to analyzers
+ template
+ <
+ typename Handle,
+ typename ArgOrResType
+ >
+ inline void operator()(Handle handle, const RPCProcedure* rpc, ArgOrResType* arg_or_res)
+ {
+ for(const auto a : modules)
+ {
+ (a->*handle)(rpc, arg_or_res);
+ }
+ }
+
+ //! This function is used for passing args + res NFS4.x operations (ex. NFSv4.x ACCESS) to analyzers
+ template
+ <
+ typename Handle,
+ typename ArgopType,
+ typename ResopType
+ >
+ inline void operator()(Handle handle, const RPCProcedure* rpc, ArgopType* arg, ResopType* res)
+ {
+ for(const auto a : modules)
+ {
+ (a->*handle)(rpc, arg, res);
+ }
+ }
+
inline void flush_statistics()
{
for(const auto a : modules)
@@ -66,10 +96,22 @@ public:
}
}
+ inline void on_unix_signal(int signo)
+ {
+ for(const auto a : modules)
+ {
+ a->on_unix_signal(signo);
+ }
+ }
+ inline bool isSilent()
+ {
+ return _silent;
+ }
private:
Storage modules; // pointers to all modules (plugins and builtins)
Plugins plugins;
BuiltIns builtin;
+ bool _silent;
};
} // namespace analysis
diff --git a/src/analysis/cifs_parser.cpp b/src/analysis/cifs_parser.cpp
new file mode 100644
index 0000000..44a5697
--- /dev/null
+++ b/src/analysis/cifs_parser.cpp
@@ -0,0 +1,350 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Parser of filtrated CIFS Procedures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <iostream>
+
+#include "analysis/cifs_parser.h"
+#include "api/cifs_types.h"
+#include "utils/log.h"
+//------------------------------------------------------------------------------
+using namespace NST::protocols;
+using namespace NST::analysis;
+
+CIFSParser::CIFSParser(Analyzers& a) :
+ analyzers(a)
+{
+}
+
+bool CIFSParser::parse_data(FilteredDataQueue::Ptr& data)
+{
+ if (const CIFSv1::MessageHeader* header = CIFSv1::get_header(data->data))
+ {
+ parse_packet(header, std::move(data));
+ return true;
+ }
+ else if (const CIFSv2::MessageHeader* header = CIFSv2::get_header(data->data))
+ {
+ parse_packet(header, std::move(data));
+ return true;
+ }
+ else
+ {
+ LOG("Got non-CIFS message!");
+ }
+ return false;
+}
+
+void CIFSParser::parse_packet(const CIFSv1::MessageHeader* header, NST::utils::FilteredDataQueue::Ptr&& ptr)
+{
+ using namespace NST::API::SMBv1;
+ using namespace NST::protocols::CIFSv1;
+
+ if (header->isFlag(Flags::REPLY))
+ {
+ // It is response
+ if (Session* session = sessions.get_session(ptr->session, ptr->direction, MsgType::REPLY))
+ {
+ FilteredDataQueue::Ptr&& requestData = session->get_call_data(header->sec.sequenceNumber);
+ if (requestData)
+ {
+ if (const MessageHeader* request = get_header(requestData->data))
+ {
+ return analyse_operation(session, request, header, std::move(requestData), std::move(ptr));
+ }
+ LOG("Can't find request for response");
+ }
+ LOG("Can't find request's raw data for response");
+ }
+ }
+ else
+ {
+ // It is request
+ if (Session* session = sessions.get_session(ptr->session, ptr->direction, MsgType::CALL))
+ {
+ return session->save_call_data(header->sec.sequenceNumber, std::move(ptr));
+ }
+ LOG("Can't get right CIFS session");
+ }
+}
+
+void CIFSParser::parse_packet(const CIFSv2::MessageHeader* header, utils::FilteredDataQueue::Ptr&& ptr)
+{
+ using namespace NST::API::SMBv2;
+ using namespace NST::protocols::CIFSv2;
+
+ if (header->isFlag(Flags::SERVER_TO_REDIR))
+ {
+ // It is response
+ if (Session* session = sessions.get_session(ptr->session, ptr->direction, MsgType::REPLY))
+ {
+ //Loosing precision: conversion from int64_t to uint32_t
+ const uint32_t messageId = static_cast<uint32_t>(header->messageId);
+ FilteredDataQueue::Ptr&& requestData = session->get_call_data(messageId);
+ if (requestData)
+ {
+ if (const MessageHeader* request = get_header(requestData->data))
+ {
+ return analyse_operation(session, request, header, std::move(requestData), std::move(ptr));
+ }
+ LOG("Can't find request for response");
+ }
+ LOG("Can't find request's raw data for response");
+ }
+ }
+ else
+ {
+ // It is request
+ if (Session* session = sessions.get_session(ptr->session, ptr->direction, MsgType::CALL))
+ {
+ // It is async request
+ if (header->isFlag(Flags::ASYNC_COMMAND))
+ {
+ return analyse_operation(session, header, nullptr, std::move(ptr), std::move(nullptr));
+ }
+ //Loosing precision: conversion from int64_t to uint32_t
+ const uint32_t messageId = static_cast<uint32_t>(header->messageId);
+ return session->save_call_data(messageId, std::move(ptr));
+ }
+ LOG("Can't get right CIFS session");
+ }
+}
+
+void CIFSParser::analyse_operation(Session* session,
+ const CIFSv1::MessageHeader* request,
+ const CIFSv1::MessageHeader* /*response*/,
+ NST::utils::FilteredDataQueue::Ptr&& requestData,
+ NST::utils::FilteredDataQueue::Ptr&& responseData)
+{
+ using namespace NST::API::SMBv1;
+ using namespace NST::protocols::CIFSv1;
+
+ //FIXME: code smells. Too much code
+ switch (request->cmd_code)
+ {
+ case Commands::CREATE_DIRECTORY:
+ return analyzers(&IAnalyzer::ISMBv1::createDirectorySMBv1, command<CreateDirectoryCommand>(requestData, responseData, session));
+ case Commands::DELETE_DIRECTORY:
+ return analyzers(&IAnalyzer::ISMBv1::deleteDirectorySMBv1, command<DeleteDirectoryCommand>(requestData, responseData, session));
+ case Commands::OPEN:
+ return analyzers(&IAnalyzer::ISMBv1::openSMBv1, command<OpenCommand>(requestData, responseData, session));
+ case Commands::CREATE:
+ return analyzers(&IAnalyzer::ISMBv1::createSMBv1, command<CreateCommand>(requestData, responseData, session));
+ case Commands::CLOSE:
+ return analyzers(&IAnalyzer::ISMBv1::closeSMBv1, command<CloseCommand>(requestData, responseData, session));
+ case Commands::FLUSH:
+ return analyzers(&IAnalyzer::ISMBv1::flushSMBv1, command<FlushCommand>(requestData, responseData, session));
+ case Commands::DELETE:
+ return analyzers(&IAnalyzer::ISMBv1::deleteSMBv1, command<DeleteCommand>(requestData, responseData, session));
+ case Commands::RENAME:
+ return analyzers(&IAnalyzer::ISMBv1::renameSMBv1, command<RenameCommand>(requestData, responseData, session));
+ case Commands::QUERY_INFORMATION:
+ return analyzers(&IAnalyzer::ISMBv1::queryInfoSMBv1, command<QueryInformationCommand>(requestData, responseData, session));
+ case Commands::SET_INFORMATION:
+ return analyzers(&IAnalyzer::ISMBv1::setInfoSMBv1, command<SetInformationCommand>(requestData, responseData, session));
+ case Commands::READ:
+ return analyzers(&IAnalyzer::ISMBv1::readSMBv1, command<ReadCommand>(requestData, responseData, session));
+ case Commands::WRITE:
+ return analyzers(&IAnalyzer::ISMBv1::writeSMBv1, command<WriteCommand>(requestData, responseData, session));
+ case Commands::LOCK_BYTE_RANGE:
+ return analyzers(&IAnalyzer::ISMBv1::lockByteRangeSMBv1, command<LockByteRangeCommand>(requestData, responseData, session));
+ case Commands::UNLOCK_BYTE_RANGE:
+ return analyzers(&IAnalyzer::ISMBv1::unlockByteRangeSMBv1, command<UnlockByteRangeCommand>(requestData, responseData, session));
+ case Commands::CREATE_TEMPORARY:
+ return analyzers(&IAnalyzer::ISMBv1::createTmpSMBv1, command<CreateTemporaryCommand>(requestData, responseData, session));
+ case Commands::CREATE_NEW:
+ return analyzers(&IAnalyzer::ISMBv1::createNewSMBv1, command<CreateNewCommand>(requestData, responseData, session));
+ case Commands::CHECK_DIRECTORY:
+ return analyzers(&IAnalyzer::ISMBv1::checkDirectorySMBv1, command<CheckDirectoryCommand>(requestData, responseData, session));
+ case Commands::PROCESS_EXIT:
+ return analyzers(&IAnalyzer::ISMBv1::processExitSMBv1, command<ProcessExitCommand>(requestData, responseData, session));
+ case Commands::SEEK:
+ return analyzers(&IAnalyzer::ISMBv1::seekSMBv1, command<SeekCommand>(requestData, responseData, session));
+ case Commands::LOCK_AND_READ:
+ return analyzers(&IAnalyzer::ISMBv1::lockAndReadSMBv1, command<LockAndReadCommand>(requestData, responseData, session));
+ case Commands::WRITE_AND_UNLOCK:
+ return analyzers(&IAnalyzer::ISMBv1::writeAndUnlockSMBv1, command<WriteAndUnlockCommand>(requestData, responseData, session));
+ case Commands::READ_RAW:
+ return analyzers(&IAnalyzer::ISMBv1::readRawSMBv1, command<ReadRawCommand>(requestData, responseData, session));
+ case Commands::READ_MPX:
+ return analyzers(&IAnalyzer::ISMBv1::readMpxSMBv1, command<ReadMpxCommand>(requestData, responseData, session));
+ case Commands::READ_MPX_SECONDARY:
+ return analyzers(&IAnalyzer::ISMBv1::readMpxSecondarySMBv1, command<ReadMpxSecondaryCommand>(requestData, responseData, session));
+ case Commands::WRITE_RAW:
+ return analyzers(&IAnalyzer::ISMBv1::writeRawSMBv1, command<WriteRawCommand>(requestData, responseData, session));
+ case Commands::WRITE_MPX:
+ return analyzers(&IAnalyzer::ISMBv1::writeMpxSMBv1, command<WriteMpxCommand>(requestData, responseData, session));
+ case Commands::WRITE_MPX_SECONDARY:
+ return analyzers(&IAnalyzer::ISMBv1::writeMpxSecondarySMBv1, command<WriteMpxSecondaryCommand>(requestData, responseData, session));
+ case Commands::WRITE_COMPLETE:
+ return analyzers(&IAnalyzer::ISMBv1::writeCompleteSMBv1, command<WriteCompleteCommand>(requestData, responseData, session));
+ case Commands::QUERY_SERVER:
+ return analyzers(&IAnalyzer::ISMBv1::queryServerSMBv1, command<QueryServerCommand>(requestData, responseData, session));
+ case Commands::SET_INFORMATION2:
+ return analyzers(&IAnalyzer::ISMBv1::setInfo2SMBv1, command<SetInformation2Command>(requestData, responseData, session));
+ case Commands::QUERY_INFORMATION2:
+ return analyzers(&IAnalyzer::ISMBv1::queryInfo2SMBv1, command<QueryInformation2Command>(requestData, responseData, session));
+ case Commands::LOCKING_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::lockingAndxSMBv1, command<LockingAndxCommand>(requestData, responseData, session));
+ case Commands::TRANSACTION:
+ return analyzers(&IAnalyzer::ISMBv1::transactionSMBv1, command<TransactionCommand>(requestData, responseData, session));
+ case Commands::TRANSACTION_SECONDARY:
+ return analyzers(&IAnalyzer::ISMBv1::transactionSecondarySMBv1, command<TransactionSecondaryCommand>(requestData, responseData, session));
+ case Commands::IOCTL:
+ return analyzers(&IAnalyzer::ISMBv1::ioctlSMBv1, command<IoctlCommand>(requestData, responseData, session));
+ case Commands::IOCTL_SECONDARY:
+ return analyzers(&IAnalyzer::ISMBv1::ioctlSecondarySMBv1, command<IoctlSecondaryCommand>(requestData, responseData, session));
+ case Commands::COPY:
+ return analyzers(&IAnalyzer::ISMBv1::copySMBv1, command<CopyCommand>(requestData, responseData, session));
+ case Commands::MOVE:
+ return analyzers(&IAnalyzer::ISMBv1::moveSMBv1, command<MoveCommand>(requestData, responseData, session));
+ case Commands::ECHO:
+ return analyzers(&IAnalyzer::ISMBv1::echoSMBv1, command<EchoCommand>(requestData, responseData, session));
+ case Commands::WRITE_AND_CLOSE:
+ return analyzers(&IAnalyzer::ISMBv1::writeAndCloseSMBv1, command<WriteAndCloseCommand>(requestData, responseData, session));
+ case Commands::OPEN_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::openAndxSMBv1, command<OpenAndxCommand>(requestData, responseData, session));
+ case Commands::READ_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::readAndxSMBv1, command<ReadAndxCommand>(requestData, responseData, session));
+ case Commands::WRITE_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::writeAndxSMBv1, command<WriteAndxCommand>(requestData, responseData, session));
+ case Commands::NEW_FILE_SIZE:
+ return analyzers(&IAnalyzer::ISMBv1::newFileSizeSMBv1, command<NewFileSizeCommand>(requestData, responseData, session));
+ case Commands::CLOSE_AND_TREE_DISC:
+ return analyzers(&IAnalyzer::ISMBv1::closeAndTreeDiscSMBv1, command<CloseAndTreeDiscCommand>(requestData, responseData, session));
+ case Commands::TRANSACTION2:
+ return analyzers(&IAnalyzer::ISMBv1::transaction2SMBv1, command<Transaction2Command>(requestData, responseData, session));
+ case Commands::TRANSACTION2_SECONDARY:
+ return analyzers(&IAnalyzer::ISMBv1::transaction2SecondarySMBv1, command<Transaction2SecondaryCommand>(requestData, responseData, session));
+ case Commands::FIND_CLOSE2:
+ return analyzers(&IAnalyzer::ISMBv1::findClose2SMBv1, command<FindClose2Command>(requestData, responseData, session));
+ case Commands::FIND_NOTIFY_CLOSE:
+ return analyzers(&IAnalyzer::ISMBv1::findNotifyCloseSMBv1, command<FindNotifyCloseCommand>(requestData, responseData, session));
+ case Commands::TREE_CONNECT:
+ return analyzers(&IAnalyzer::ISMBv1::treeConnectSMBv1, command<TreeConnectCommand>(requestData, responseData, session));
+ case Commands::TREE_DISCONNECT:
+ return analyzers(&IAnalyzer::ISMBv1::treeDisconnectSMBv1, command<TreeDisconnectCommand>(requestData, responseData, session));
+ case Commands::NEGOTIATE:
+ return analyzers(&IAnalyzer::ISMBv1::negotiateSMBv1, command<NegotiateCommand>(requestData, responseData, session));
+ case Commands::SESSION_SETUP_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::sessionSetupAndxSMBv1, command<SessionSetupAndxCommand>(requestData, responseData, session));
+ case Commands::LOGOFF_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::logoffAndxSMBv1, command<LogoffAndxCommand>(requestData, responseData, session));
+ case Commands::TREE_CONNECT_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::treeConnectAndxSMBv1, command<TreeConnectAndxCommand>(requestData, responseData, session));
+ case Commands::SECURITY_PACKAGE_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::securityPackageAndxSMBv1, command<SecurityPackageAndxCommand>(requestData, responseData, session));
+ case Commands::QUERY_INFORMATION_DISK:
+ return analyzers(&IAnalyzer::ISMBv1::queryInformationDiskSMBv1, command<QueryInformationDiskCommand>(requestData, responseData, session));
+ case Commands::SEARCH:
+ return analyzers(&IAnalyzer::ISMBv1::searchSMBv1, command<SearchCommand>(requestData, responseData, session));
+ case Commands::FIND:
+ return analyzers(&IAnalyzer::ISMBv1::findSMBv1, command<FindCommand>(requestData, responseData, session));
+ case Commands::FIND_UNIQUE:
+ return analyzers(&IAnalyzer::ISMBv1::findUniqueSMBv1, command<FindUniqueCommand>(requestData, responseData, session));
+ case Commands::FIND_CLOSE:
+ return analyzers(&IAnalyzer::ISMBv1::findCloseSMBv1, command<FindCloseCommand>(requestData, responseData, session));
+ case Commands::NT_TRANSACT:
+ return analyzers(&IAnalyzer::ISMBv1::ntTransactSMBv1, command<NtTransactCommand>(requestData, responseData, session));
+ case Commands::NT_TRANSACT_SECONDARY:
+ return analyzers(&IAnalyzer::ISMBv1::ntTransactSecondarySMBv1, command<NtTransactSecondaryCommand>(requestData, responseData, session));
+ case Commands::NT_CREATE_ANDX:
+ return analyzers(&IAnalyzer::ISMBv1::ntCreateAndxSMBv1, command<NtCreateAndxCommand>(requestData, responseData, session));
+ case Commands::NT_CANCEL:
+ return analyzers(&IAnalyzer::ISMBv1::ntCancelSMBv1, command<NtCancelCommand>(requestData, responseData, session));
+ case Commands::NT_RENAME:
+ return analyzers(&IAnalyzer::ISMBv1::ntRenameSMBv1, command<NtRenameCommand>(requestData, responseData, session));
+ case Commands::OPEN_PRINT_FILE:
+ return analyzers(&IAnalyzer::ISMBv1::openPrintFileSMBv1, command<OpenPrintFileCommand>(requestData, responseData, session));
+ case Commands::WRITE_PRINT_FILE:
+ return analyzers(&IAnalyzer::ISMBv1::writePrintFileSMBv1, command<WritePrintFileCommand>(requestData, responseData, session));
+ case Commands::CLOSE_PRINT_FILE:
+ return analyzers(&IAnalyzer::ISMBv1::closePrintFileSMBv1, command<ClosePrintFileCommand>(requestData, responseData, session));
+ case Commands::GET_PRINT_QUEUE:
+ return analyzers(&IAnalyzer::ISMBv1::getPrintQueueSMBv1, command<GetPrintQueueCommand>(requestData, responseData, session));
+ case Commands::READ_BULK:
+ return analyzers(&IAnalyzer::ISMBv1::readBulkSMBv1, command<ReadBulkCommand>(requestData, responseData, session));
+ case Commands::WRITE_BULK:
+ return analyzers(&IAnalyzer::ISMBv1::writeBulkSMBv1, command<WriteBulkCommand>(requestData, responseData, session));
+ case Commands::WRITE_BULK_DATA:
+ return analyzers(&IAnalyzer::ISMBv1::writeBulkDataSMBv1, command<WriteBulkDataCommand>(requestData, responseData, session));
+ case Commands::INVALID:
+ return analyzers(&IAnalyzer::ISMBv1::invalidSMBv1, command<InvalidCommand>(requestData, responseData, session));
+ case Commands::NO_ANDX_COMMAND:
+ return analyzers(&IAnalyzer::ISMBv1::noAndxCommandSMBv1, command<NoAndxCommand>(requestData, responseData, session));
+ default:
+ LOG("Usupported command");
+ }
+}
+
+
+void CIFSParser::analyse_operation(Session* session,
+ const CIFSv2::MessageHeader* request,
+ const CIFSv2::MessageHeader* /*response*/,
+ NST::utils::FilteredDataQueue::Ptr&& requestData,
+ NST::utils::FilteredDataQueue::Ptr&& responseData)
+{
+ using namespace NST::API::SMBv2;
+ using namespace NST::protocols::CIFSv2;
+
+ switch (request->cmd_code)
+ {
+ case SMBv2Commands::CLOSE:
+ return analyzers(&IAnalyzer::ISMBv2::closeFileSMBv2, command<CloseFileCommand>(requestData, responseData, session));
+ case SMBv2Commands::NEGOTIATE:
+ return analyzers(&IAnalyzer::ISMBv2::negotiateSMBv2, command<NegotiateCommand>(requestData, responseData, session));
+ case SMBv2Commands::SESSION_SETUP:
+ return analyzers(&IAnalyzer::ISMBv2::sessionSetupSMBv2, command<SessionSetupCommand>(requestData, responseData, session));
+ case SMBv2Commands::LOGOFF:
+ return analyzers(&IAnalyzer::ISMBv2::logOffSMBv2, command<LogOffCommand>(requestData, responseData, session));
+ case SMBv2Commands::TREE_CONNECT:
+ return analyzers(&IAnalyzer::ISMBv2::treeConnectSMBv2, command<TreeConnectCommand>(requestData, responseData, session));
+ case SMBv2Commands::TREE_DISCONNECT:
+ return analyzers(&IAnalyzer::ISMBv2::treeDisconnectSMBv2, command<TreeDisconnectCommand>(requestData, responseData, session));
+ case SMBv2Commands::CREATE:
+ return analyzers(&IAnalyzer::ISMBv2::createSMBv2, command<CreateCommand>(requestData, responseData, session));
+ case SMBv2Commands::FLUSH:
+ return analyzers(&IAnalyzer::ISMBv2::flushSMBv2, command<FlushCommand>(requestData, responseData, session));
+ case SMBv2Commands::READ:
+ return analyzers(&IAnalyzer::ISMBv2::readSMBv2, command<ReadCommand>(requestData, responseData, session));
+ case SMBv2Commands::WRITE:
+ return analyzers(&IAnalyzer::ISMBv2::writeSMBv2, command<WriteCommand>(requestData, responseData, session));
+ case SMBv2Commands::LOCK:
+ return analyzers(&IAnalyzer::ISMBv2::lockSMBv2, command<LockCommand>(requestData, responseData, session));
+ case SMBv2Commands::IOCTL:
+ return analyzers(&IAnalyzer::ISMBv2::ioctlSMBv2, command<IoctlCommand>(requestData, responseData, session));
+ case SMBv2Commands::CANCEL:
+ return analyzers(&IAnalyzer::ISMBv2::cancelSMBv2, command<CancelCommand>(requestData, responseData, session));
+ case SMBv2Commands::ECHO:
+ return analyzers(&IAnalyzer::ISMBv2::echoSMBv2, command<EchoCommand>(requestData, responseData, session));
+ case SMBv2Commands::QUERY_DIRECTORY:
+ return analyzers(&IAnalyzer::ISMBv2::queryDirSMBv2, command<QueryDirCommand>(requestData, responseData, session));
+ case SMBv2Commands::CHANGE_NOTIFY:
+ return analyzers(&IAnalyzer::ISMBv2::changeNotifySMBv2, command<ChangeNotifyCommand>(requestData, responseData, session));
+ case SMBv2Commands::QUERY_INFO:
+ return analyzers(&IAnalyzer::ISMBv2::queryInfoSMBv2, command<QueryInfoCommand>(requestData, responseData, session));
+ case SMBv2Commands::SET_INFO:
+ return analyzers(&IAnalyzer::ISMBv2::setInfoSMBv2, command<SetInfoCommand>(requestData, responseData, session));
+ case SMBv2Commands::OPLOCK_BREAK:
+ return analyzers(&IAnalyzer::ISMBv2::breakOplockSMBv2, command<BreakOpLockCommand>(requestData, responseData, session));
+ default:
+ LOG("Usupported command");
+ }
+}
diff --git a/src/analysis/cifs_parser.h b/src/analysis/cifs_parser.h
new file mode 100644
index 0000000..de81ade
--- /dev/null
+++ b/src/analysis/cifs_parser.h
@@ -0,0 +1,98 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Parser of filtrated CIFS Procedures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFS_PARSER_H
+#define CIFS_PARSER_H
+//------------------------------------------------------------------------------
+#include "analysis/analyzers.h"
+#include "protocols/cifs/cifs.h"
+#include "protocols/cifs2/cifs2.h"
+#include "rpc_sessions.h"
+#include "utils/filtered_data.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace analysis
+{
+
+/*! \class It is class which can parse CIFS messages and it called by ParserThread
+ */
+class CIFSParser
+{
+ using FilteredDataQueue = NST::utils::FilteredDataQueue;//!< Packets queue
+
+ Analyzers& analyzers;//!< Plugins manager
+ Sessions<Session> sessions;//!< Sessions list
+
+ /*! Parses SMBv1 packet
+ * \param header - Message's header
+ * \param ptr - raw packet
+ */
+ inline void parse_packet(const protocols::CIFSv1::MessageHeader* header, FilteredDataQueue::Ptr&& ptr);
+
+ /*! analyses CIFS v1 operation: request and response
+ * \param session - session
+ * \param request - Call's header
+ * \param response - Reply's header
+ * \param requestData - Call's data
+ * \param responseData - Reply's data
+ */
+ inline void analyse_operation(Session* session,
+ const protocols::CIFSv1::MessageHeader* request,
+ const protocols::CIFSv1::MessageHeader* response,
+ FilteredDataQueue::Ptr&& requestData,
+ FilteredDataQueue::Ptr&& responseData);
+
+ /*! Parses SMB v2 packet
+ * \param header - Message's header
+ * \param ptr - raw packet
+ */
+ inline void parse_packet(const protocols::CIFSv2::MessageHeader* header, NST::utils::FilteredDataQueue::Ptr&& ptr);
+
+ /*! analyses CIFS v2 operation: request and response
+ * \param session - session
+ * \param request - Call's header
+ * \param response - Reply's header
+ * \param requestData - Call's data
+ * \param responseData - Reply's data
+ */
+ inline void analyse_operation(Session* session,
+ const protocols::CIFSv2::MessageHeader* request,
+ const protocols::CIFSv2::MessageHeader* response,
+ FilteredDataQueue::Ptr&& requestData,
+ FilteredDataQueue::Ptr&& responseData);
+public:
+
+ CIFSParser(Analyzers& a);
+ CIFSParser(CIFSParser& c) : analyzers(c.analyzers) {}
+
+ /*! Function which will be called by ParserThread class
+ * \param data - raw packet
+ * \return True, if it is CIFS packet and False in other case
+ */
+ bool parse_data(FilteredDataQueue::Ptr& data);
+};
+
+} // analysis
+} // NST
+//------------------------------------------------------------------------------
+#endif//CIFS_PARSER_H
+//------------------------------------------------------------------------------
diff --git a/src/analysis/nfs_parser.cpp b/src/analysis/nfs_parser.cpp
new file mode 100644
index 0000000..9bff62a
--- /dev/null
+++ b/src/analysis/nfs_parser.cpp
@@ -0,0 +1,1015 @@
+//------------------------------------------------------------------------------
+// Author: Dzianis Huznou
+// Description: Parser of filtrated NFSv3 Procedures.
+// Copyright (c) 2013 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include "analysis/nfs_parser.h"
+#include "protocols/nfs/nfs_procedure.h"
+#include "protocols/rpc/rpc_header.h"
+#include "protocols/xdr/xdr_decoder.h"
+#include "utils/log.h"
+//------------------------------------------------------------------------------
+using namespace NST::protocols::xdr;
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace analysis
+{
+
+
+bool NFSParser::parse_data(FilteredDataQueue::Ptr& ptr)
+{
+ using namespace NST::protocols::rpc;
+
+ // TODO: refactor and generalize this code
+ if (ptr->dlen < sizeof(MessageHeader))
+ {
+ return false;
+ }
+ auto msg = reinterpret_cast<const MessageHeader*>(ptr->data);
+ switch (msg->type())
+ {
+ case MsgType::CALL:
+ {
+ if (ptr->dlen < sizeof(CallHeader))
+ {
+ return false;
+ }
+
+ auto call = static_cast<const CallHeader*>(msg);
+
+ if (RPCValidator::check(call) && (protocols::NFS4::Validator::check(call) ||
+ protocols::NFS3::Validator::check(call)))
+ {
+ Session* session = sessions.get_session(ptr->session, ptr->direction, MsgType::CALL);
+ if (session)
+ {
+ session->save_call_data(call->xid(), std::move(ptr));
+ }
+ return true;
+ }
+ }
+ break;
+ case MsgType::REPLY:
+ {
+ if (ptr->dlen < sizeof(ReplyHeader))
+ {
+ return false;
+ }
+ auto reply = static_cast<const ReplyHeader*>(msg);
+
+ if (!RPCValidator::check(reply))
+ {
+ return false;
+ }
+
+ Session* session = sessions.get_session(ptr->session, ptr->direction, MsgType::REPLY);
+ if (session)
+ {
+ FilteredDataQueue::Ptr&& call_data = session->get_call_data(reply->xid());
+ if (call_data)
+ {
+ analyze_nfs_procedure(std::move(call_data), std::move(ptr), session);
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+// ----------------------------------------------------------------------------
+// Forward declarations of internal functions used inside analyze_nfs_procedure
+// They're supposed to be used inside analyze_nfs_procedure only
+// ----------------------------------------------------------------------------
+
+static uint32_t get_nfs4_compound_minor_version(const uint32_t procedure, const std::uint8_t* rpc_nfs4_call);
+
+using NFS40CompoundType = NST::protocols::NFS4::NFSPROC4RPCGEN_COMPOUND;
+using NFS41CompoundType = NST::protocols::NFS41::NFSPROC41RPCGEN_COMPOUND;
+
+template
+<
+typename ArgOpType,
+ typename ResOpType,
+ typename NFS4CompoundType
+ >
+void analyze_nfs4_operations(Analyzers& analyzers, NFS4CompoundType& nfs4_compound_procedure);
+
+inline void analyze_nfs40_operations(Analyzers& analyzers, NFS40CompoundType& nfs40_compound_procedure)
+{
+ analyze_nfs4_operations < NST::API::NFS4::nfs_argop4,
+ NST::API::NFS4::nfs_resop4,
+ NFS40CompoundType > (analyzers, nfs40_compound_procedure);
+}
+
+inline void analyze_nfs41_operations(Analyzers& analyzers, NFS41CompoundType& nfs41_compound_procedure)
+{
+ analyze_nfs4_operations < NST::API::NFS41::nfs_argop4,
+ NST::API::NFS41::nfs_resop4,
+ NFS41CompoundType > (analyzers, nfs41_compound_procedure);
+}
+
+void nfs4_ops_switch(Analyzers& analyzers,
+ const RPCProcedure* rpc_procedure,
+ const NST::API::NFS4::nfs_argop4* arg,
+ const NST::API::NFS4::nfs_resop4* res);
+
+void nfs4_ops_switch(Analyzers& analyzers,
+ const RPCProcedure* rpc_procedure,
+ const NST::API::NFS41::nfs_argop4* arg,
+ const NST::API::NFS41::nfs_resop4* res);
+
+// ----------------------------------------------------------------------------
+
+static inline void analyze_nfsv3_procedure(const uint32_t procedure, XDRDecoder&& c, XDRDecoder&& r, const Session* s, Analyzers& analyzers)
+{
+ using namespace NST::protocols::NFS3;
+ switch (procedure)
+ {
+ case ProcEnumNFS3::NFS_NULL:
+ analyzers(&IAnalyzer::INFSv3rpcgen::null, NFSPROC3RPCGEN_NULL {c, r, s});
+ break;
+ case ProcEnumNFS3::GETATTR:
+ analyzers(&IAnalyzer::INFSv3rpcgen::getattr3, NFSPROC3RPCGEN_GETATTR {c, r, s});
+ break;
+ case ProcEnumNFS3::SETATTR:
+ analyzers(&IAnalyzer::INFSv3rpcgen::setattr3, NFSPROC3RPCGEN_SETATTR {c, r, s});
+ break;
+ case ProcEnumNFS3::LOOKUP:
+ analyzers(&IAnalyzer::INFSv3rpcgen::lookup3, NFSPROC3RPCGEN_LOOKUP {c, r, s});
+ break;
+ case ProcEnumNFS3::ACCESS:
+ analyzers(&IAnalyzer::INFSv3rpcgen::access3, NFSPROC3RPCGEN_ACCESS {c, r, s});
+ break;
+ case ProcEnumNFS3::READLINK:
+ analyzers(&IAnalyzer::INFSv3rpcgen::readlink3, NFSPROC3RPCGEN_READLINK {c, r, s});
+ break;
+ case ProcEnumNFS3::READ:
+ analyzers(&IAnalyzer::INFSv3rpcgen::read3, NFSPROC3RPCGEN_READ {c, r, s});
+ break;
+ case ProcEnumNFS3::WRITE:
+ analyzers(&IAnalyzer::INFSv3rpcgen::write3, NFSPROC3RPCGEN_WRITE {c, r, s});
+ break;
+ case ProcEnumNFS3::CREATE:
+ analyzers(&IAnalyzer::INFSv3rpcgen::create3, NFSPROC3RPCGEN_CREATE {c, r, s});
+ break;
+ case ProcEnumNFS3::MKDIR:
+ analyzers(&IAnalyzer::INFSv3rpcgen::mkdir3, NFSPROC3RPCGEN_MKDIR {c, r, s});
+ break;
+ case ProcEnumNFS3::SYMLINK:
+ analyzers(&IAnalyzer::INFSv3rpcgen::symlink3, NFSPROC3RPCGEN_SYMLINK {c, r, s});
+ break;
+ case ProcEnumNFS3::MKNOD:
+ analyzers(&IAnalyzer::INFSv3rpcgen::mknod3, NFSPROC3RPCGEN_MKNOD {c, r, s});
+ break;
+ case ProcEnumNFS3::REMOVE:
+ analyzers(&IAnalyzer::INFSv3rpcgen::remove3, NFSPROC3RPCGEN_REMOVE {c, r, s});
+ break;
+ case ProcEnumNFS3::RMDIR:
+ analyzers(&IAnalyzer::INFSv3rpcgen::rmdir3, NFSPROC3RPCGEN_RMDIR {c, r, s});
+ break;
+ case ProcEnumNFS3::RENAME:
+ analyzers(&IAnalyzer::INFSv3rpcgen::rename3, NFSPROC3RPCGEN_RENAME {c, r, s});
+ break;
+ case ProcEnumNFS3::LINK:
+ analyzers(&IAnalyzer::INFSv3rpcgen::link3, NFSPROC3RPCGEN_LINK {c, r, s});
+ break;
+ case ProcEnumNFS3::READDIR:
+ analyzers(&IAnalyzer::INFSv3rpcgen::readdir3, NFSPROC3RPCGEN_READDIR {c, r, s});
+ break;
+ case ProcEnumNFS3::READDIRPLUS:
+ analyzers(&IAnalyzer::INFSv3rpcgen::readdirplus3, NFSPROC3RPCGEN_READDIRPLUS {c, r, s});
+ break;
+ case ProcEnumNFS3::FSSTAT:
+ analyzers(&IAnalyzer::INFSv3rpcgen::fsstat3, NFSPROC3RPCGEN_FSSTAT {c, r, s});
+ break;
+ case ProcEnumNFS3::FSINFO:
+ analyzers(&IAnalyzer::INFSv3rpcgen::fsinfo3, NFSPROC3RPCGEN_FSINFO {c, r, s});
+ break;
+ case ProcEnumNFS3::PATHCONF:
+ analyzers(&IAnalyzer::INFSv3rpcgen::pathconf3, NFSPROC3RPCGEN_PATHCONF {c, r, s});
+ break;
+ case ProcEnumNFS3::COMMIT:
+ analyzers(&IAnalyzer::INFSv3rpcgen::commit3, NFSPROC3RPCGEN_COMMIT {c, r, s});
+ break;
+ }
+}
+
+static inline void analyze_nfsv4_procedure(const uint32_t procedure, XDRDecoder&& c, XDRDecoder&& r, const Session* s, Analyzers& analyzers)
+{
+ using namespace NST::protocols::NFS4;
+ using namespace NST::protocols::NFS41;
+
+ switch (get_nfs4_compound_minor_version(procedure, c.data().data))
+ {
+ case NFS_V40:
+ switch (procedure)
+ {
+ case ProcEnumNFS4::NFS_NULL:
+ analyzers(&IAnalyzer::INFSv4rpcgen::null4, NFSPROC4RPCGEN_NULL { c, r, s });
+ break;
+ case ProcEnumNFS4::COMPOUND:
+ NFSPROC4RPCGEN_COMPOUND compound { c, r, s };
+ analyzers(&IAnalyzer::INFSv4rpcgen::compound4, compound);
+ analyze_nfs40_operations(analyzers, compound);
+ break;
+ }
+ break;
+ case NFS_V41:
+ if (ProcEnumNFS41::COMPOUND == procedure)
+ {
+ NFSPROC41RPCGEN_COMPOUND compound { c, r, s };
+ analyzers(&IAnalyzer::INFSv41rpcgen::compound41, compound);
+ analyze_nfs41_operations(analyzers, compound);
+ }
+ break;
+ }
+}
+
+void NFSParser::analyze_nfs_procedure( FilteredDataQueue::Ptr&& call,
+ FilteredDataQueue::Ptr&& reply,
+ Session* session)
+{
+ using namespace NST::protocols::rpc;
+
+ auto header = reinterpret_cast<const CallHeader*>(call->data);
+ const uint32_t major_version {header->vers()};
+ const uint32_t procedure {header->proc()};
+
+ try
+ {
+ const Session* s { session->get_session() };
+
+ switch (major_version)
+ {
+ case NFS_V4:
+ analyze_nfsv4_procedure(procedure, std::move(call), std::move(reply), s, this->analyzers);
+ break;
+ case NFS_V3:
+ analyze_nfsv3_procedure(procedure, std::move(call), std::move(reply), s, this->analyzers);
+ break;
+ }
+ }
+ catch (XDRDecoderError& e)
+ {
+ const char* procedure_name {"Unknown procedure"};
+ switch (major_version)
+ {
+ case NFS_V4:
+ procedure_name = print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(procedure));
+ break;
+ case NFS_V3:
+ procedure_name = print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(procedure));
+ break;
+ }
+ LOG("Some data of NFS operation %s %s(%u) was not parsed: %s", session->str().c_str(), procedure_name, procedure, e.what());
+ }
+}
+
+//! Get NFSv4.x minor version
+/*! This is a fast method. It doesn't call expensive XDR's mechanisms &
+* doesn't create new objects. It simply moves pointer to a proper
+* place.
+*
+* According to NFSv4.0 & 4.1 RFC's it's possible to determine
+* minor version ONLY in call COMPOUND(1) procedure.
+* That's why only call can be passed here.
+*/
+static uint32_t get_nfs4_compound_minor_version(const uint32_t procedure, const std::uint8_t* rpc_nfs4_call)
+{
+ if (ProcEnumNFS4::COMPOUND != procedure)
+ {
+ return 0;
+ }
+ // get initial data
+ auto* it = rpc_nfs4_call;
+
+ // move to rpc's credentials length
+ it += (sizeof(protocols::rpc::CallHeader) + sizeof(uint32_t));
+ size_t rpc_cred_length = ntohl(*(uint32_t*)it);
+
+ // skip credentials & move to rpc's verifier length
+ it += (rpc_cred_length * sizeof(uint8_t) + sizeof(uint32_t));
+ size_t rpc_verf_length = ntohl(*(uint32_t*)it);
+
+ // skip verifier & move to nfsv4's tag length
+ it += (rpc_verf_length * sizeof(uint8_t) + sizeof(uint32_t));
+ size_t rpc_tag_length = ntohl(*(uint32_t*)it);
+
+ // skip tag & move to nfsv4's minor version
+ it += (rpc_tag_length * sizeof(uint8_t) + 2 * sizeof(uint32_t));
+
+ return ntohl(*(uint32_t*)it);
+}
+
+//! Common internal function for parsing NFSv4.x's COMPOUND procedure
+//! It's supposed to be used inside analyze_nfs_procedure only
+template
+<
+typename ArgOpType, // Type of arguments(call part of nfs's procedure)
+ typename ResOpType, // Type of results(reply part of nfs's procedure)
+ typename NFS4CompoundType // Type of NFSv4.x COMPOUND procedure. Can be 4.0 or 4.1
+ >
+void analyze_nfs4_operations(Analyzers& analyzers, NFS4CompoundType& nfs4_compound_procedure)
+{
+ ArgOpType* arg {nullptr};
+ ResOpType* res {nullptr};
+
+ uint32_t arg_ops_count {0}; // Amount of NFS operations (call part)
+ uint32_t res_ops_count {0}; // Amount of NFS operations (reply part)
+ uint32_t total_ops_count {0};
+
+ if (nfs4_compound_procedure.parg) // Checking if COMPOUND procedure has valid arg
+ {
+ arg_ops_count = nfs4_compound_procedure.parg->argarray.argarray_len;
+ arg = nfs4_compound_procedure.parg->argarray.argarray_val;
+ }
+
+ if (nfs4_compound_procedure.pres) // Checking if COMPOUND procedure has valid res
+ {
+ res_ops_count = nfs4_compound_procedure.pres->resarray.resarray_len;
+ res = nfs4_compound_procedure.pres->resarray.resarray_val;
+ }
+
+ // Determing which part of COMPOUND has the biggest amount of operations.
+ total_ops_count = arg_ops_count > res_ops_count ? arg_ops_count : res_ops_count;
+
+ // Traversing through ALL COMPOUND procedure's operations
+ for (uint32_t i {0}; i < total_ops_count; i++)
+ {
+ if ((arg && res) && (arg->argop != res->resop))
+ {
+ // Passing each operation to analyzers using the helper's function
+ nfs4_ops_switch(analyzers, &nfs4_compound_procedure, arg, nullptr);
+ nfs4_ops_switch(analyzers, &nfs4_compound_procedure, nullptr, res);
+ }
+ else
+ {
+ nfs4_ops_switch(analyzers, &nfs4_compound_procedure, arg, res);
+ }
+
+ if (arg && i < (arg_ops_count - 1)) { arg++; }
+ else { arg = nullptr; }
+ if (res && i < (res_ops_count - 1)) { res++; }
+ else { res = nullptr; }
+ }
+}
+
+//! Internal function for proper passing NFSv4.x's arg + res operations to analyzers
+//! It's supposed to be used inside nfs4_ops_switch only
+template
+<
+typename nfs_argop4_t,
+ typename nfs_resop4_t,
+ typename IAnalyzer_func_t,
+ typename nfs_argop_member_t,
+ typename nfs_resop_member_t
+ >
+inline void analyze(Analyzers& analyzers,
+ const RPCProcedure* rpc_procedure,
+ const nfs_argop4_t* arg,
+ const nfs_resop4_t* res,
+ IAnalyzer_func_t&& IAnalyzer_function,
+ nfs_argop_member_t arg_operation,
+ nfs_resop_member_t res_operation)
+{
+ analyzers(IAnalyzer_function, rpc_procedure,
+ arg == nullptr ? nullptr : & (arg->nfs_argop4_u.*arg_operation),
+ res == nullptr ? nullptr : & (res->nfs_resop4_u.*res_operation));
+}
+
+//! Internal function for proper passing NFSv4.x's res-only operations to analyzers
+//! It's supposed to be used inside nfs4_ops_switch only
+template
+<
+typename nfs_resop4_t,
+ typename IAnalyzer_func_t,
+ typename nfs_resop_member_t
+ >
+inline void analyze(Analyzers& analyzers,
+ const RPCProcedure* rpc_procedure,
+ const nfs_resop4_t* res,
+ IAnalyzer_func_t&& IAnalyzer_function,
+ nfs_resop_member_t res_operation)
+{
+ analyzers(IAnalyzer_function, rpc_procedure,
+ res == nullptr ? nullptr : & (res->nfs_resop4_u.*res_operation));
+}
+
+//! Internal function for proper passing NFSv4.0's operations to analyzers
+//! It's supposed to be used inside analyze_nfs4_operations only
+void nfs4_ops_switch(Analyzers& analyzers,
+ const RPCProcedure* rpc_procedure,
+ const NST::API::NFS4::nfs_argop4* arg,
+ const NST::API::NFS4::nfs_resop4* res)
+{
+ using INFSv40 = NST::API::IAnalyzer::INFSv4rpcgen;
+ using arg_t = NST::API::NFS4::nfs_argop4_u_t;
+ using res_t = NST::API::NFS4::nfs_resop4_u_t;
+
+ uint32_t nfs_op_num = arg ? arg->argop : res->resop;
+ switch (nfs_op_num)
+ {
+ case ProcEnumNFS4::ACCESS:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::access40,
+ &arg_t::opaccess,
+ &res_t::opaccess);
+ break;
+ case ProcEnumNFS4::CLOSE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::close40,
+ &arg_t::opclose,
+ &res_t::opclose);
+ break;
+ case ProcEnumNFS4::COMMIT:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::commit40,
+ &arg_t::opcommit,
+ &res_t::opcommit);
+ break;
+ case ProcEnumNFS4::CREATE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::create40,
+ &arg_t::opcreate,
+ &res_t::opcreate);
+ break;
+ case ProcEnumNFS4::DELEGPURGE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::delegpurge40,
+ &arg_t::opdelegpurge,
+ &res_t::opdelegpurge);
+ break;
+ case ProcEnumNFS4::DELEGRETURN:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::delegreturn40,
+ &arg_t::opdelegreturn,
+ &res_t::opdelegreturn);
+ break;
+ case ProcEnumNFS4::GETATTR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::getattr40,
+ &arg_t::opgetattr,
+ &res_t::opgetattr);
+ break;
+ case ProcEnumNFS4::GETFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::getfh40,
+ &res_t::opgetfh);
+ break;
+ case ProcEnumNFS4::LINK:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::link40,
+ &arg_t::oplink,
+ &res_t::oplink);
+ break;
+ case ProcEnumNFS4::LOCK:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::lock40,
+ &arg_t::oplock,
+ &res_t::oplock);
+ break;
+ case ProcEnumNFS4::LOCKT:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::lockt40,
+ &arg_t::oplockt,
+ &res_t::oplockt);
+ break;
+ case ProcEnumNFS4::LOCKU:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::locku40,
+ &arg_t::oplocku,
+ &res_t::oplocku);
+ break;
+ case ProcEnumNFS4::LOOKUP:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::lookup40,
+ &arg_t::oplookup,
+ &res_t::oplookup);
+ break;
+ case ProcEnumNFS4::LOOKUPP:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::lookupp40,
+ &res_t::oplookupp);
+ break;
+ case ProcEnumNFS4::NVERIFY:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::nverify40,
+ &arg_t::opnverify,
+ &res_t::opnverify);
+ break;
+ case ProcEnumNFS4::OPEN:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::open40,
+ &arg_t::opopen,
+ &res_t::opopen);
+ break;
+ case ProcEnumNFS4::OPENATTR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::openattr40,
+ &arg_t::opopenattr,
+ &res_t::opopenattr);
+ break;
+ case ProcEnumNFS4::OPEN_CONFIRM:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::open_confirm40,
+ &arg_t::opopen_confirm,
+ &res_t::opopen_confirm);
+ break;
+ case ProcEnumNFS4::OPEN_DOWNGRADE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::open_downgrade40,
+ &arg_t::opopen_downgrade,
+ &res_t::opopen_downgrade);
+ break;
+ case ProcEnumNFS4::PUTFH:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::putfh40,
+ &arg_t::opputfh,
+ &res_t::opputfh);
+ break;
+ case ProcEnumNFS4::PUTPUBFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::putpubfh40,
+ &res_t::opputpubfh);
+ break;
+ case ProcEnumNFS4::PUTROOTFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::putrootfh40,
+ &res_t::opputrootfh);
+ break;
+ case ProcEnumNFS4::READ:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::read40,
+ &arg_t::opread,
+ &res_t::opread);
+ break;
+ case ProcEnumNFS4::READDIR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::readdir40,
+ &arg_t::opreaddir,
+ &res_t::opreaddir);
+ break;
+ case ProcEnumNFS4::READLINK:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::readlink40,
+ &res_t::opreadlink);
+ break;
+ case ProcEnumNFS4::REMOVE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::remove40,
+ &arg_t::opremove,
+ &res_t::opremove);
+ break;
+ case ProcEnumNFS4::RENAME:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::rename40,
+ &arg_t::oprename,
+ &res_t::oprename);
+ break;
+ case ProcEnumNFS4::RENEW:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::renew40,
+ &arg_t::oprenew,
+ &res_t::oprenew);
+ break;
+ case ProcEnumNFS4::RESTOREFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::restorefh40,
+ &res_t::oprestorefh);
+ break;
+ case ProcEnumNFS4::SAVEFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::savefh40,
+ &res_t::opsavefh);
+ break;
+ case ProcEnumNFS4::SECINFO:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::secinfo40,
+ &arg_t::opsecinfo,
+ &res_t::opsecinfo);
+ break;
+ case ProcEnumNFS4::SETATTR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::setattr40,
+ &arg_t::opsetattr,
+ &res_t::opsetattr);
+ break;
+ case ProcEnumNFS4::SETCLIENTID:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::setclientid40,
+ &arg_t::opsetclientid,
+ &res_t::opsetclientid);
+ break;
+ case ProcEnumNFS4::SETCLIENTID_CONFIRM:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::setclientid_confirm40,
+ &arg_t::opsetclientid_confirm,
+ &res_t::opsetclientid_confirm);
+ break;
+ case ProcEnumNFS4::VERIFY:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::verify40,
+ &arg_t::opverify,
+ &res_t::opverify);
+ break;
+ case ProcEnumNFS4::WRITE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::write40,
+ &arg_t::opwrite,
+ &res_t::opwrite);
+ break;
+ case ProcEnumNFS4::RELEASE_LOCKOWNER:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::release_lockowner40,
+ &arg_t::oprelease_lockowner,
+ &res_t::oprelease_lockowner);
+ break;
+ case ProcEnumNFS4::GET_DIR_DELEGATION:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv40::get_dir_delegation40,
+ &arg_t::opget_dir_delegation,
+ &res_t::opget_dir_delegation);
+ break;
+ case ProcEnumNFS4::ILLEGAL:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv40::illegal40,
+ &res_t::opillegal);
+ break;
+ default:
+ break;
+ }
+}
+
+//! Internal function for proper passing NFSv4.1's operations to analyzers
+//! It's supposed to be used inside analyze_nfs4_operations only
+void nfs4_ops_switch(Analyzers& analyzers,
+ const RPCProcedure* rpc_procedure,
+ const NST::API::NFS41::nfs_argop4* arg,
+ const NST::API::NFS41::nfs_resop4* res)
+{
+ using INFSv41 = NST::API::IAnalyzer::INFSv41rpcgen;
+ using arg_t = NST::API::NFS41::nfs_argop4_u_t;
+ using res_t = NST::API::NFS41::nfs_resop4_u_t;
+
+ uint32_t nfs_op_num = arg ? arg->argop : res->resop;
+ switch (nfs_op_num)
+ {
+ case ProcEnumNFS41::ACCESS:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::access41,
+ &arg_t::opaccess,
+ &res_t::opaccess);
+ break;
+ case ProcEnumNFS41::CLOSE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::close41,
+ &arg_t::opclose,
+ &res_t::opclose);
+ break;
+ case ProcEnumNFS41::COMMIT:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::commit41,
+ &arg_t::opcommit,
+ &res_t::opcommit);
+ break;
+ case ProcEnumNFS41::CREATE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::create41,
+ &arg_t::opcreate,
+ &res_t::opcreate);
+ break;
+ case ProcEnumNFS41::DELEGPURGE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::delegpurge41,
+ &arg_t::opdelegpurge,
+ &res_t::opdelegpurge);
+ break;
+ case ProcEnumNFS41::DELEGRETURN:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::delegreturn41,
+ &arg_t::opdelegreturn,
+ &res_t::opdelegreturn);
+ break;
+ case ProcEnumNFS41::GETATTR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::getattr41,
+ &arg_t::opgetattr,
+ &res_t::opgetattr);
+ break;
+ case ProcEnumNFS41::GETFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::getfh41,
+ &res_t::opgetfh);
+ break;
+ case ProcEnumNFS41::LINK:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::link41,
+ &arg_t::oplink,
+ &res_t::oplink);
+ break;
+ case ProcEnumNFS41::LOCK:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::lock41,
+ &arg_t::oplock,
+ &res_t::oplock);
+ break;
+ case ProcEnumNFS41::LOCKT:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::lockt41,
+ &arg_t::oplockt,
+ &res_t::oplockt);
+ break;
+ case ProcEnumNFS41::LOCKU:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::locku41,
+ &arg_t::oplocku,
+ &res_t::oplocku);
+ break;
+ case ProcEnumNFS41::LOOKUP:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::lookup41,
+ &arg_t::oplookup,
+ &res_t::oplookup);
+ break;
+ case ProcEnumNFS41::LOOKUPP:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::lookupp41,
+ &res_t::oplookupp);
+ break;
+ case ProcEnumNFS41::NVERIFY:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::nverify41,
+ &arg_t::opnverify,
+ &res_t::opnverify);
+ break;
+ case ProcEnumNFS41::OPEN:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::open41,
+ &arg_t::opopen,
+ &res_t::opopen);
+ break;
+ case ProcEnumNFS41::OPENATTR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::openattr41,
+ &arg_t::opopenattr,
+ &res_t::opopenattr);
+ break;
+ case ProcEnumNFS41::OPEN_CONFIRM:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::open_confirm41,
+ &arg_t::opopen_confirm,
+ &res_t::opopen_confirm);
+ break;
+ case ProcEnumNFS41::OPEN_DOWNGRADE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::open_downgrade41,
+ &arg_t::opopen_downgrade,
+ &res_t::opopen_downgrade);
+ break;
+ case ProcEnumNFS41::PUTFH:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::putfh41,
+ &arg_t::opputfh,
+ &res_t::opputfh);
+ break;
+ case ProcEnumNFS41::PUTPUBFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::putpubfh41,
+ &res_t::opputpubfh);
+ break;
+ case ProcEnumNFS41::PUTROOTFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::putrootfh41,
+ &res_t::opputrootfh);
+ break;
+ case ProcEnumNFS41::READ:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::read41,
+ &arg_t::opread,
+ &res_t::opread);
+ break;
+ case ProcEnumNFS41::READDIR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::readdir41,
+ &arg_t::opreaddir,
+ &res_t::opreaddir);
+ break;
+ case ProcEnumNFS41::READLINK:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::readlink41,
+ &res_t::opreadlink);
+ break;
+ case ProcEnumNFS41::REMOVE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::remove41,
+ &arg_t::opremove,
+ &res_t::opremove);
+ break;
+ case ProcEnumNFS41::RENAME:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::rename41,
+ &arg_t::oprename,
+ &res_t::oprename);
+ break;
+ case ProcEnumNFS41::RENEW:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::renew41,
+ &arg_t::oprenew,
+ &res_t::oprenew);
+ break;
+ case ProcEnumNFS41::RESTOREFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::restorefh41,
+ &res_t::oprestorefh);
+ break;
+ case ProcEnumNFS41::SAVEFH:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::savefh41,
+ &res_t::opsavefh);
+ break;
+ case ProcEnumNFS41::SECINFO:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::secinfo41,
+ &arg_t::opsecinfo,
+ &res_t::opsecinfo);
+ break;
+ case ProcEnumNFS41::SETATTR:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::setattr41,
+ &arg_t::opsetattr,
+ &res_t::opsetattr);
+ break;
+ case ProcEnumNFS41::SETCLIENTID:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::setclientid41,
+ &arg_t::opsetclientid,
+ &res_t::opsetclientid);
+ break;
+ case ProcEnumNFS41::SETCLIENTID_CONFIRM:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::setclientid_confirm41,
+ &arg_t::opsetclientid_confirm,
+ &res_t::opsetclientid_confirm);
+ break;
+ case ProcEnumNFS41::VERIFY:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::verify41,
+ &arg_t::opverify,
+ &res_t::opverify);
+ break;
+ case ProcEnumNFS41::WRITE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::write41,
+ &arg_t::opwrite,
+ &res_t::opwrite);
+ break;
+ case ProcEnumNFS41::RELEASE_LOCKOWNER:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::release_lockowner41,
+ &arg_t::oprelease_lockowner,
+ &res_t::oprelease_lockowner);
+ break;
+ case ProcEnumNFS41::BACKCHANNEL_CTL:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::backchannel_ctl41,
+ &arg_t::opbackchannel_ctl,
+ &res_t::opbackchannel_ctl);
+ break;
+ case ProcEnumNFS41::BIND_CONN_TO_SESSION:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::bind_conn_to_session41,
+ &arg_t::opbind_conn_to_session,
+ &res_t::opbind_conn_to_session);
+ break;
+ case ProcEnumNFS41::EXCHANGE_ID:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::exchange_id41,
+ &arg_t::opexchange_id,
+ &res_t::opexchange_id);
+ break;
+ case ProcEnumNFS41::CREATE_SESSION:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::create_session41,
+ &arg_t::opcreate_session,
+ &res_t::opcreate_session);
+ break;
+ case ProcEnumNFS41::DESTROY_SESSION:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::destroy_session41,
+ &arg_t::opdestroy_session,
+ &res_t::opdestroy_session);
+ break;
+ case ProcEnumNFS41::FREE_STATEID:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::free_stateid41,
+ &arg_t::opfree_stateid,
+ &res_t::opfree_stateid);
+ break;
+ case ProcEnumNFS41::GET_DIR_DELEGATION:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::get_dir_delegation41,
+ &arg_t::opget_dir_delegation,
+ &res_t::opget_dir_delegation);
+ case ProcEnumNFS41::GETDEVICEINFO:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::getdeviceinfo41,
+ &arg_t::opgetdeviceinfo,
+ &res_t::opgetdeviceinfo);
+ break;
+ case ProcEnumNFS41::GETDEVICELIST:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::getdevicelist41,
+ &arg_t::opgetdevicelist,
+ &res_t::opgetdevicelist);
+ break;
+ case ProcEnumNFS41::LAYOUTCOMMIT:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::layoutcommit41,
+ &arg_t::oplayoutcommit,
+ &res_t::oplayoutcommit);
+ break;
+ case ProcEnumNFS41::LAYOUTGET:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::layoutget41,
+ &arg_t::oplayoutget,
+ &res_t::oplayoutget);
+ break;
+ case ProcEnumNFS41::LAYOUTRETURN:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::layoutreturn41,
+ &arg_t::oplayoutreturn,
+ &res_t::oplayoutreturn);
+ break;
+ case ProcEnumNFS41::SECINFO_NO_NAME:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::secinfo_no_name41,
+ &arg_t::opsecinfo_no_name,
+ &res_t::opsecinfo_no_name);
+ break;
+ case ProcEnumNFS41::SEQUENCE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::sequence41,
+ &arg_t::opsequence,
+ &res_t::opsequence);
+ break;
+ case ProcEnumNFS41::SET_SSV:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::set_ssv41,
+ &arg_t::opset_ssv,
+ &res_t::opset_ssv);
+ break;
+ case ProcEnumNFS41::TEST_STATEID:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::test_stateid41,
+ &arg_t::optest_stateid,
+ &res_t::optest_stateid);
+ break;
+ case ProcEnumNFS41::WANT_DELEGATION:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::want_delegation41,
+ &arg_t::opwant_delegation,
+ &res_t::opwant_delegation);
+ break;
+ case ProcEnumNFS41::DESTROY_CLIENTID:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::destroy_clientid41,
+ &arg_t::opdestroy_clientid,
+ &res_t::opdestroy_clientid);
+ break;
+ case ProcEnumNFS41::RECLAIM_COMPLETE:
+ analyze(analyzers, rpc_procedure, arg, res,
+ &INFSv41::reclaim_complete41,
+ &arg_t::opreclaim_complete,
+ &res_t::opreclaim_complete);
+ break;
+ case ProcEnumNFS41::ILLEGAL:
+ analyze(analyzers, rpc_procedure, res,
+ &INFSv41::illegal41,
+ &res_t::opillegal);
+ break;
+ default:
+ break;
+ }
+}
+
+} // namespace analysis
+} // namespace NST
+//------------------------------------------------------------------------------
diff --git a/src/analysis/nfs_parser_thread.h b/src/analysis/nfs_parser.h
index 1e8659d..4ef6666 100644
--- a/src/analysis/nfs_parser_thread.h
+++ b/src/analysis/nfs_parser.h
@@ -1,6 +1,6 @@
//------------------------------------------------------------------------------
// Author: Dzianis Huznou
-// Description: Parser of the NFS Data.
+// Description: Parser of filtrated NFSv3 Procedures.
// Copyright (c) 2013 EPAM Systems
//------------------------------------------------------------------------------
/*
@@ -19,15 +19,13 @@
along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
-#ifndef NFS_PARSER_THREAD_H
-#define NFS_PARSER_THREAD_H
+#ifndef NFS_PARSER_H
+#define NFS_PARSER_H
//------------------------------------------------------------------------------
-#include <atomic>
-#include <thread>
-
#include "analysis/analyzers.h"
#include "analysis/rpc_sessions.h"
#include "controller/running_status.h"
+#include "protocols/nfs/nfs_procedure.h"
#include "utils/filtered_data.h"
//------------------------------------------------------------------------------
namespace NST
@@ -35,37 +33,33 @@ namespace NST
namespace analysis
{
-class NFSParserThread
+/*! \class It is class which can parse NFS messages and it called by ParserThread
+ */
+class NFSParser
{
- using RunningStatus = NST::controller::RunningStatus;
using FilteredDataQueue = NST::utils::FilteredDataQueue;
+
+ Analyzers& analyzers;
+ Sessions<Session> sessions;
public:
- NFSParserThread(FilteredDataQueue& q, Analyzers& a, RunningStatus& rs);
- ~NFSParserThread();
- void start();
- void stop();
+ NFSParser(Analyzers& a) : analyzers(a) {}
+ NFSParser(NFSParser& c) : analyzers(c.analyzers) {}
-private:
- inline void thread();
- inline void process_queue();
+ /*! Function which will be called by ParserThread class
+ * \param data - RPC packet
+ * \return True, if it is RPC(NFS) packet and False in other case
+ */
+ bool parse_data(FilteredDataQueue::Ptr& data);
void parse_data(FilteredDataQueue::Ptr&& data);
- void analyze_nfs_operation(FilteredDataQueue::Ptr&& call,
+ void analyze_nfs_procedure(FilteredDataQueue::Ptr&& call,
FilteredDataQueue::Ptr&& reply,
- RPCSession* session);
-
- RunningStatus& status;
- Analyzers& analyzers;
- FilteredDataQueue& queue;
- RPCSessions sessions;
-
- std::thread parsing;
- std::atomic_flag running;
+ Session* session);
};
-} // namespace analysis
-} // namespace NST
+} // analysis
+} // NST
//------------------------------------------------------------------------------
-#endif//NFS_PARSER_THREAD_H
+#endif//NFS_PARSER_H
//------------------------------------------------------------------------------
diff --git a/src/analysis/nfs_parser_thread.cpp b/src/analysis/nfs_parser_thread.cpp
deleted file mode 100644
index ab99b4f..0000000
--- a/src/analysis/nfs_parser_thread.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Parser of filtrated NFSv3 Procedures.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include "analysis/nfs_parser_thread.h"
-#include "protocols/nfs/nfs_procedure.h"
-#include "protocols/rpc/rpc_header.h"
-#include "protocols/xdr/xdr_decoder.h"
-#include "utils/log.h"
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-namespace NST
-{
-namespace analysis
-{
-
-NFSParserThread::NFSParserThread(FilteredDataQueue& q, Analyzers& a, RunningStatus& s)
-: status (s)
-, analyzers(a)
-, queue (q)
-, running {ATOMIC_FLAG_INIT} // false
-{
-}
-
-NFSParserThread::~NFSParserThread()
-{
- if (parsing.joinable()) stop();
-}
-
-void NFSParserThread::start()
-{
- if(running.test_and_set()) return;
- parsing = std::thread(&NFSParserThread::thread, this);
-}
-
-void NFSParserThread::stop()
-{
- running.clear();
- parsing.join();
-}
-
-inline void NFSParserThread::thread()
-{
- try
- {
- while(running.test_and_set())
- {
- // process all available items from queue
- process_queue();
-
- // then sleep this thread
- std::this_thread::sleep_for(std::chrono::milliseconds(10));
- }
- process_queue(); // flush data from queue
- }
- catch(...)
- {
- status.push_current_exception();
- }
-}
-
-inline void NFSParserThread::process_queue()
-{
- while(true)
- {
- // take all items from the queue
- FilteredDataQueue::List list{queue};
- if(!list)
- {
- return; // list from queue is empty, break infinity loop
- }
-
- do
- {
- parse_data(list.get_current());
- }
- while(list);
- }
-}
-
-void NFSParserThread::parse_data(FilteredDataQueue::Ptr&& ptr)
-{
- using namespace NST::protocols::rpc;
-
- // TODO: refactor and generalize this code
- if(ptr->dlen < sizeof(MessageHeader)) return;
- auto msg = reinterpret_cast<const MessageHeader*>(ptr->data);
- switch(msg->type())
- {
- case MsgType::CALL:
- {
- if(ptr->dlen < sizeof(CallHeader)) return;
- auto call = static_cast<const CallHeader*>(msg);
-
- if(RPCValidator::check(call) && (protocols::NFS4::Validator::check(call) ||
- protocols::NFS3::Validator::check(call)))
- {
- RPCSession* session = sessions.get_session(ptr->session, ptr->direction, MsgType::CALL);
- if(session)
- {
- session->save_nfs_call_data(call->xid(), std::move(ptr));
- }
- }
- }
- break;
- case MsgType::REPLY:
- {
- if(ptr->dlen < sizeof(ReplyHeader)) return;
- auto reply = static_cast<const ReplyHeader*>(msg);
-
- if(!RPCValidator::check(reply)) return;
-
- RPCSession* session = sessions.get_session(ptr->session, ptr->direction, MsgType::REPLY);
- if(session)
- {
- FilteredDataQueue::Ptr&& call_data = session->get_nfs_call_data(reply->xid());
- if(call_data)
- {
- analyze_nfs_operation(std::move(call_data), std::move(ptr), session);
- }
- }
- }
- break;
- }
-}
-
-void NFSParserThread::analyze_nfs_operation( FilteredDataQueue::Ptr&& call,
- FilteredDataQueue::Ptr&& reply,
- RPCSession* session)
-{
- using namespace NST::protocols::rpc;
- using namespace NST::protocols::NFS3;
- using namespace NST::protocols::NFS4;
-
- auto header = reinterpret_cast<const CallHeader*>(call->data);
- const uint32_t procedure {header->proc()};
- const uint32_t version {header->vers()};
- try
- {
- XDRDecoder c {std::move(call) };
- XDRDecoder r {std::move(reply)};
- const Session* s {session->get_session()};
-
- switch(version)
- {
- case NFS_V4:
- switch(procedure)
- {
- case ProcEnumNFS4::NFS_NULL: return analyzers(&IAnalyzer::INFSv4rpcgen::null, NFSPROC4RPCGEN_NULL {c,r,s});
- case ProcEnumNFS4::COMPOUND: return analyzers(&IAnalyzer::INFSv4rpcgen::compound4, NFSPROC4RPCGEN_COMPOUND {c,r,s});
- }
- break;
- case NFS_V3:
- switch(procedure)
- {
- case ProcEnumNFS3::NFS_NULL: return analyzers(&IAnalyzer::INFSv3rpcgen::null, NFSPROC3RPCGEN_NULL {c, r, s});
- case ProcEnumNFS3::GETATTR: return analyzers(&IAnalyzer::INFSv3rpcgen::getattr3, NFSPROC3RPCGEN_GETATTR {c, r, s});
- case ProcEnumNFS3::SETATTR: return analyzers(&IAnalyzer::INFSv3rpcgen::setattr3, NFSPROC3RPCGEN_SETATTR {c, r, s});
- case ProcEnumNFS3::LOOKUP: return analyzers(&IAnalyzer::INFSv3rpcgen::lookup3, NFSPROC3RPCGEN_LOOKUP {c, r, s});
- case ProcEnumNFS3::ACCESS: return analyzers(&IAnalyzer::INFSv3rpcgen::access3, NFSPROC3RPCGEN_ACCESS {c, r, s});
- case ProcEnumNFS3::READLINK: return analyzers(&IAnalyzer::INFSv3rpcgen::readlink3, NFSPROC3RPCGEN_READLINK {c, r, s});
- case ProcEnumNFS3::READ: return analyzers(&IAnalyzer::INFSv3rpcgen::read3, NFSPROC3RPCGEN_READ {c, r, s});
- case ProcEnumNFS3::WRITE: return analyzers(&IAnalyzer::INFSv3rpcgen::write3, NFSPROC3RPCGEN_WRITE {c, r, s});
- case ProcEnumNFS3::CREATE: return analyzers(&IAnalyzer::INFSv3rpcgen::create3, NFSPROC3RPCGEN_CREATE {c, r, s});
- case ProcEnumNFS3::MKDIR: return analyzers(&IAnalyzer::INFSv3rpcgen::mkdir3, NFSPROC3RPCGEN_MKDIR {c, r, s});
- case ProcEnumNFS3::SYMLINK: return analyzers(&IAnalyzer::INFSv3rpcgen::symlink3, NFSPROC3RPCGEN_SYMLINK {c, r, s});
- case ProcEnumNFS3::MKNOD: return analyzers(&IAnalyzer::INFSv3rpcgen::mknod3, NFSPROC3RPCGEN_MKNOD {c, r, s});
- case ProcEnumNFS3::REMOVE: return analyzers(&IAnalyzer::INFSv3rpcgen::remove3, NFSPROC3RPCGEN_REMOVE {c, r, s});
- case ProcEnumNFS3::RMDIR: return analyzers(&IAnalyzer::INFSv3rpcgen::rmdir3, NFSPROC3RPCGEN_RMDIR {c, r, s});
- case ProcEnumNFS3::RENAME: return analyzers(&IAnalyzer::INFSv3rpcgen::rename3, NFSPROC3RPCGEN_RENAME {c, r, s});
- case ProcEnumNFS3::LINK: return analyzers(&IAnalyzer::INFSv3rpcgen::link3, NFSPROC3RPCGEN_LINK {c, r, s});
- case ProcEnumNFS3::READDIR: return analyzers(&IAnalyzer::INFSv3rpcgen::readdir3, NFSPROC3RPCGEN_READDIR {c, r, s});
- case ProcEnumNFS3::READDIRPLUS: return analyzers(&IAnalyzer::INFSv3rpcgen::readdirplus3, NFSPROC3RPCGEN_READDIRPLUS{c, r, s});
- case ProcEnumNFS3::FSSTAT: return analyzers(&IAnalyzer::INFSv3rpcgen::fsstat3, NFSPROC3RPCGEN_FSSTAT {c, r, s});
- case ProcEnumNFS3::FSINFO: return analyzers(&IAnalyzer::INFSv3rpcgen::fsinfo3, NFSPROC3RPCGEN_FSINFO {c, r, s});
- case ProcEnumNFS3::PATHCONF: return analyzers(&IAnalyzer::INFSv3rpcgen::pathconf3, NFSPROC3RPCGEN_PATHCONF {c, r, s});
- case ProcEnumNFS3::COMMIT: return analyzers(&IAnalyzer::INFSv3rpcgen::commit3, NFSPROC3RPCGEN_COMMIT {c, r, s});
- }
- break;
- }
- }
- catch(XDRDecoderError& e)
- {
- const char* procedure_name{"Unknown procedure"};
- switch(version)
- {
- case NFS_V4:
- procedure_name = print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(procedure));
- break;
- case NFS_V3:
- procedure_name = print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(procedure));
- break;
- }
- LOG("Some data of NFS operation %s %s(%u) was not parsed: %s", session->str().c_str(), procedure_name, procedure, e.what());
- }
-}
-
-} // namespace analysis
-} // namespace NST
-//------------------------------------------------------------------------------
diff --git a/src/analysis/parser_thread.h b/src/analysis/parser_thread.h
new file mode 100644
index 0000000..66f6ec7
--- /dev/null
+++ b/src/analysis/parser_thread.h
@@ -0,0 +1,123 @@
+//------------------------------------------------------------------------------
+// Author: Dzianis Huznou
+// Description: Parser of the NFS Data.
+// Copyright (c) 2013 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFS_PARSER_THREAD_H
+#define NFS_PARSER_THREAD_H
+//------------------------------------------------------------------------------
+#include <atomic>
+#include <thread>
+
+#include "analysis/analyzers.h"
+#include "controller/running_status.h"
+#include "utils/filtered_data.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace analysis
+{
+
+template <typename Parser>
+class ParserThread
+{
+ using RunningStatus = NST::controller::RunningStatus;
+ using FilteredDataQueue = NST::utils::FilteredDataQueue;
+public:
+ ParserThread(Parser p, FilteredDataQueue& q, RunningStatus& s)
+ : status (s)
+ , queue (q)
+ , running {ATOMIC_FLAG_INIT} // false
+ , parser(p)
+ {
+ }
+
+ ~ParserThread()
+ {
+ if (parsing.joinable()) stop();
+ }
+
+ void start()
+ {
+ if(running.test_and_set()) return;
+ parsing = std::thread(&ParserThread::thread, this);
+ }
+
+ void stop()
+ {
+ running.clear();
+ parsing.join();
+ }
+
+
+private:
+
+ inline void thread()
+ {
+ try
+ {
+ while(running.test_and_set())
+ {
+ // process all available items from queue
+ process_queue();
+
+ // then sleep this thread
+ std::this_thread::sleep_for(std::chrono::milliseconds(10));
+ }
+ process_queue(); // flush data from queue
+ }
+ catch(...)
+ {
+ status.push_current_exception();
+ }
+ }
+
+ inline void process_queue()
+ {
+ while(true)
+ {
+ // take all items from the queue
+ FilteredDataQueue::List list{queue};
+ if(!list)
+ {
+ return; // list from queue is empty, break infinity loop
+ }
+
+ do
+ {
+ FilteredDataQueue::Ptr data = list.get_current();
+ parser.parse_data(data);
+ }
+ while(list);
+ }
+ }
+
+ RunningStatus& status;
+ FilteredDataQueue& queue;
+
+ std::thread parsing;
+ std::atomic_flag running;
+ Parser parser;
+};
+
+} // namespace analysis
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFS_PARSER_THREAD_H
+//------------------------------------------------------------------------------
diff --git a/src/analysis/parsers.h b/src/analysis/parsers.h
new file mode 100644
index 0000000..b60fdbb
--- /dev/null
+++ b/src/analysis/parsers.h
@@ -0,0 +1,74 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Composite parser which parses both CIFS&NFS
+// TODO: THIS CODE MUST BE TOTALLY REFACTORED!
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef PARSERS_H
+#define PARSERS_H
+//------------------------------------------------------------------------------
+#include "cifs_parser.h"
+#include "nfs_parser.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace analysis
+{
+
+/*!
+ * Composite parser which parses both CIFS&NFS
+ */
+class Parsers
+{
+ using FilteredDataQueue = NST::utils::FilteredDataQueue;
+ CIFSParser parser_cifs;//!< CIFS parser
+ NFSParser parser_nfs;//!< NFS parser
+public:
+
+ Parsers(Analyzers& a)
+ : parser_cifs(a)
+ , parser_nfs(a)
+ {}
+
+ Parsers(Parsers& c)
+ : parser_cifs(c.parser_cifs)
+ , parser_nfs(c.parser_nfs)
+ {}
+
+ /*! Function which will be called by ParserThread class
+ * \param data - packet
+ */
+ inline void parse_data(FilteredDataQueue::Ptr& data)
+ {
+ if (!parser_nfs.parse_data(data))
+ {
+ if (!parser_cifs.parse_data(data))
+ {
+ LOG("Unknown packet to analysis");
+ }
+ }
+ }
+
+};
+
+} // analysis
+} // NST
+//------------------------------------------------------------------------------
+#endif // PARSERS_H
+//------------------------------------------------------------------------------
diff --git a/src/analysis/plugin.cpp b/src/analysis/plugin.cpp
index 14b5e10..90adba7 100644
--- a/src/analysis/plugin.cpp
+++ b/src/analysis/plugin.cpp
@@ -28,11 +28,26 @@ namespace NST
namespace analysis
{
+bool Plugin::isSilent()
+{
+ if (requirements != nullptr)
+ {
+ // Processing analyzer requirements
+ const AnalyzerRequirements* r = requirements();
+ if (r != nullptr)
+ {
+ return r->silence;
+ }
+ }
+ return false;
+}
+
Plugin::Plugin(const std::string& path)
: DynamicLoad{path}
, usage {nullptr}
, create {nullptr}
, destroy{nullptr}
+ , requirements{nullptr}
{
plugin_get_entry_points_func nst_get_entry_points{nullptr};
@@ -53,6 +68,7 @@ Plugin::Plugin(const std::string& path)
usage = entry_points->usage;
create = entry_points->create;
destroy = entry_points->destroy;
+ requirements = entry_points->requirements;
}
if(!usage || !create || !destroy)
@@ -68,7 +84,7 @@ const std::string Plugin::usage_of(const std::string& path)
}
PluginInstance::PluginInstance(const std::string& path, const std::string& args)
- : Plugin{path}
+: Plugin{path}
{
analysis = create(args.c_str());
if(!analysis) throw std::runtime_error{path + ": create call returns NULL-pointer"};
diff --git a/src/analysis/plugin.h b/src/analysis/plugin.h
index 262301a..0f259bd 100644
--- a/src/analysis/plugin.h
+++ b/src/analysis/plugin.h
@@ -36,6 +36,7 @@ class Plugin : private NST::utils::DynamicLoad
{
public:
static const std::string usage_of(const std::string& path);
+ bool isSilent();
protected:
explicit Plugin(const std::string& path);
@@ -45,6 +46,7 @@ protected:
plugin_usage_func usage;
plugin_create_func create;
plugin_destroy_func destroy;
+ plugin_requirements_func requirements;
};
class PluginInstance : private Plugin
@@ -56,7 +58,7 @@ public:
~PluginInstance();
inline IAnalyzer* instance() const { return analysis; }
-
+ inline bool silent(){ return isSilent(); }
private:
IAnalyzer* analysis;
};
diff --git a/src/analysis/print_analyzer.cpp b/src/analysis/print_analyzer.cpp
index 674c824..7d8315b 100644
--- a/src/analysis/print_analyzer.cpp
+++ b/src/analysis/print_analyzer.cpp
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// Author: Dzianis Huznou (Alexey Costroma)
// Description: Created for demonstration purpose only.
-// Copyright (c) 2013,2014 EPAM Systems
+// Copyright (c) 2013-2015 EPAM Systems
//------------------------------------------------------------------------------
/*
This file is part of Nfstrace.
@@ -20,183 +20,854 @@
*/
//------------------------------------------------------------------------------
#include <iomanip>
+#include <time.h>
+#include <algorithm>
+#include <utility>
+#include <sstream>
#include "analysis/print_analyzer.h"
+#include "protocols/cifs/cifs.h"
+#include "protocols/cifs2/cifs2.h"
#include "protocols/nfs/nfs_utils.h"
#include "protocols/nfs3/nfs3_utils.h"
#include "protocols/nfs4/nfs4_utils.h"
+#include "protocols/nfs4/nfs41_utils.h"
+#include "protocols/cifs2/cifs2_utils.h"
+#include "utils/sessions.h"
//------------------------------------------------------------------------------
namespace NST
{
namespace analysis
{
-using namespace NST::protocols::NFS; // NFS helpers
-using namespace NST::protocols::NFS3; // NFSv3 helpers
-using namespace NST::protocols::NFS4; // NFSv4 helpers
+using SMBv1Commands = NST::API::SMBv1::SMBv1Commands;
+using SMBv2Commands = NST::API::SMBv2::SMBv2Commands;
+using namespace NST::protocols::CIFSv2;
+using namespace NST::protocols::NFS; // NFS helpers
+using namespace NST::protocols::NFS3; // NFSv3 helpers
+using namespace NST::protocols::NFS4; // NFSv4.0 helpers
+using namespace NST::protocols::NFS41; // NFSv4.1 helpers
+namespace NFS3 = NST::API::NFS3;
+namespace NFS4 = NST::API::NFS4;
+namespace NFS41 = NST::API::NFS41;
namespace
+{
+bool print_procedure(std::ostream& out, const RPCProcedure* proc)
{
-
-bool print_procedure(std::ostream& out, const struct RPCProcedure* proc)
-{
+ using namespace NST::utils;
bool result {false};
- NST::utils::operator<<(out, *(proc->session));
+ out << *(proc->session);
- auto& call = proc->rpc_call;
+ auto& call = proc->call;
const unsigned long nfs_version {call.ru.RM_cmb.cb_vers};
- if(out_all())
+ if (out_all())
{
out << " XID: " << call.rm_xid
<< " RPC version: " << call.ru.RM_cmb.cb_rpcvers
<< " RPC program: " << call.ru.RM_cmb.cb_prog
<< " version: " << nfs_version << ' ';
}
- switch(nfs_version)
+ switch (nfs_version)
{
case NFS_V3:
out << print_nfs3_procedures(static_cast<ProcEnumNFS3::NFSProcedure>(call.ru.RM_cmb.cb_proc));
break;
case NFS_V4:
- out << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(call.ru.RM_cmb.cb_proc));
+ out << print_nfs41_procedures(static_cast<ProcEnumNFS41::NFSProcedure>(call.ru.RM_cmb.cb_proc));
break;
}
// check procedure reply
- auto& reply = proc->rpc_reply;
- if(reply.ru.RM_rmb.rp_stat == reply_stat::MSG_ACCEPTED)
+ auto& reply = proc->reply;
+ if (reply.ru.RM_rmb.rp_stat == reply_stat::MSG_ACCEPTED)
+ {
+ switch (reply.ru.RM_rmb.ru.RP_ar.ar_stat)
+ {
+ case accept_stat::SUCCESS:
+ result = true; // Ok, reply is correct
+ break;
+ case accept_stat::PROG_MISMATCH:
+ out << " Program mismatch: "
+ << " low: " << reply.ru.RM_rmb.ru.RP_ar.ru.AR_versions.low
+ << " high: " << reply.ru.RM_rmb.ru.RP_ar.ru.AR_versions.high;
+ break;
+ case accept_stat::PROG_UNAVAIL:
+ out << " Program unavailable";
+ break;
+ case accept_stat::PROC_UNAVAIL:
+ out << " Procedure unavailable";
+ break;
+ case accept_stat::GARBAGE_ARGS:
+ out << " Garbage arguments";
+ break;
+ case accept_stat::SYSTEM_ERR:
+ out << " System error";
+ break;
+ }
+ }
+ else if (reply.ru.RM_rmb.rp_stat == reply_stat::MSG_DENIED)
{
- switch(reply.ru.RM_rmb.ru.RP_ar.ar_stat)
+ out << " RPC Call rejected: ";
+ switch (reply.ru.RM_rmb.ru.RP_dr.rj_stat)
+ {
+ case reject_stat::RPC_MISMATCH:
+ out << "RPC version number mismatch, "
+ << " low: "
+ << reply.ru.RM_rmb.ru.RP_dr.ru.RJ_versions.low
+ << " high: "
+ << reply.ru.RM_rmb.ru.RP_dr.ru.RJ_versions.high;
+ break;
+ case reject_stat::AUTH_ERROR:
{
- case accept_stat::SUCCESS:
- result = true; // Ok, reply is correct
+ out << " Authentication check: ";
+ switch (reply.ru.RM_rmb.ru.RP_dr.ru.RJ_why)
+ {
+ case auth_stat::AUTH_OK:
+ out << "OK";
break;
- case accept_stat::PROG_MISMATCH:
- out << " Program mismatch: "
- << " low: " << reply.ru.RM_rmb.ru.RP_ar.ru.AR_versions.low
- << " high: " << reply.ru.RM_rmb.ru.RP_ar.ru.AR_versions.high;
+ case auth_stat::AUTH_BADCRED:
+ out << " bogus credentials (seal broken)"
+ << " (failed at remote end)";
break;
- case accept_stat::PROG_UNAVAIL:
- out << " Program unavailable";
+ case auth_stat::AUTH_REJECTEDCRED:
+ out << " rejected credentials (client should begin new session)"
+ << " (failed at remote end)";
break;
- case accept_stat::PROC_UNAVAIL:
- out << " Procedure unavailable";
+ case auth_stat::AUTH_BADVERF:
+ out << " bogus verifier (seal broken)"
+ << " (failed at remote end)";
break;
- case accept_stat::GARBAGE_ARGS:
- out << " Garbage arguments";
+ case auth_stat::AUTH_REJECTEDVERF:
+ out << " verifier expired or was replayed"
+ << " (failed at remote end)";
break;
- case accept_stat::SYSTEM_ERR:
- out << " System error";
+ case auth_stat::AUTH_TOOWEAK:
+ out << " too weak (rejected due to security reasons)"
+ << " (failed at remote end)";
break;
- }
- }
- else if(reply.ru.RM_rmb.rp_stat == reply_stat::MSG_DENIED)
- {
- out << " RPC Call rejected: ";
- switch(reply.ru.RM_rmb.ru.RP_dr.rj_stat)
- {
- case reject_stat::RPC_MISMATCH:
- out << "RPC version number mismatch, "
- << " low: "
- << reply.ru.RM_rmb.ru.RP_dr.ru.RJ_versions.low
- << " high: "
- << reply.ru.RM_rmb.ru.RP_dr.ru.RJ_versions.high;
+ case auth_stat::AUTH_INVALIDRESP:
+ out << " bogus response verifier"
+ << " (failed locally)";
break;
- case reject_stat::AUTH_ERROR:
- {
- out << " Authentication check: ";
- switch(reply.ru.RM_rmb.ru.RP_dr.ru.RJ_why)
- {
- case auth_stat::AUTH_OK:
- out << "OK";
- break;
- case auth_stat::AUTH_BADCRED:
- out << " bogus credentials (seal broken)"
- << " (failed at remote end)";
- break;
- case auth_stat::AUTH_REJECTEDCRED:
- out << " rejected credentials (client should begin new session)"
- << " (failed at remote end)";
- break;
- case auth_stat::AUTH_BADVERF:
- out << " bogus verifier (seal broken)"
- << " (failed at remote end)";
- break;
- case auth_stat::AUTH_REJECTEDVERF:
- out << " verifier expired or was replayed"
- << " (failed at remote end)";
- break;
- case auth_stat::AUTH_TOOWEAK:
- out << " too weak (rejected due to security reasons)"
- << " (failed at remote end)";
- break;
- case auth_stat::AUTH_INVALIDRESP:
- out << " bogus response verifier"
- << " (failed locally)";
- break;
- default:
- out << " some unknown reason"
- << " (failed locally)";
- break;
- }
+ default:
+ out << " some unknown reason"
+ << " (failed locally)";
break;
}
+ break;
+ }
}
}
out << '\n'; // end line of RPC procedure information
return result;
}
+std::ostream& print_time(std::ostream& out, uint64_t time)
+{
+ // TODO: Replace with C++ 11 functions
+ if (time != 0)
+ {
+ const auto EPOCH_DIFF = 0x019DB1DED53E8000LL; /* 116444736000000000 nsecs */
+ const auto RATE_DIFF = 10000000; /* 100 nsecs */
+
+ uint64_t unixTimestamp = (time - EPOCH_DIFF) / RATE_DIFF;
+ time_t t = static_cast<time_t>(unixTimestamp);
+
+ // NOTE: If you ever want to print the year/day/month separately like this:
+ //
+ // struct tm* lt = localtime(&t);
+ //
+ // do not forget adding 1900 to tm_year field, just to get current year
+ // lt->tm_year + 1900
+
+ const char *pTime = ctime(&t);
+ if (pTime != nullptr)
+ {
+ // ctime adds "\n" at the end - remove it.
+ size_t len = std::strlen(pTime);
+ out << std::string(pTime, len - 1);
+ }
+ }
+ else
+ {
+ out << "Create: No time specified (0)";
+ }
+
+ return out;
+}
+
+std::ostream& print_buffer(std::ostream& out, const uint8_t *buffer, uint16_t len)
+{
+ // TODO: Add unicode support
+ const char* char_buffer = reinterpret_cast<const char*>(buffer);
+
+ // smb2 buffer usually contains Unicode 16-bit character
+ // currently we do not support unicode output, so make English only variant
+ for(uint16_t i = 0; i < len; i += 2)
+ {
+ out << char_buffer[i];
+ }
+ return out;
+}
+
+std::ostream& print_buffer_hex(std::ostream& out, const uint8_t *buffer, uint16_t len)
+{
+ for(uint16_t i = 0; i < len; i++)
+ {
+ out << std::hex << std::setfill('0') << std::setw(2)
+ << static_cast<uint16_t>(buffer[i]);
+ }
+
+ out << std::setfill(' ') << std::dec;
+ return out;
+}
+
+void print_guid(std::ostream& out, const uint8_t (&guid)[16])
+{
+ const Guid& refGuid = reinterpret_cast<const Guid&>(guid);
+
+ // print hex value with preceding 0 (zeros) if necessary
+ // ( e.g: 0x01 will be printed as 01 or 0x00 as 00 )
+ auto print_hex = [&out](uint32_t value, uint8_t bitShift)
+ {
+ out << std::hex << std::setfill('0') << std::setw(2)
+ << (static_cast<uint32_t>(value >> bitShift) & 0xFF) << std::dec;
+ };
+
+ print_hex(refGuid.Data1, 24);
+ print_hex(refGuid.Data1, 16);
+ print_hex(refGuid.Data1, 8);
+ print_hex(refGuid.Data1, 0);
+ out << "-";
+ print_hex(refGuid.Data2, 8);
+ print_hex(refGuid.Data2, 0);
+ out << "-";
+ print_hex(refGuid.Data3, 8);
+ print_hex(refGuid.Data3, 0);
+ out << "-";
+ print_hex(refGuid.Data4[0], 0);
+ print_hex(refGuid.Data4[1], 0);
+ out << "-";
+
+ for(uint8_t i = 2; i < 8; i++)
+ {
+ print_hex(refGuid.Data4[i], 0);
+ }
+}
+
+template<typename CommandType>
+std::ostream& print_session(std::ostream& out, CommandType* cmd)
+{
+ using namespace NST::utils;
+ out << "\n";
+ out << *(cmd->session);
+ return out;
+}
+
+template<typename CommandType>
+std::ostream& print_smbv2_common_info(std::ostream& out, SMBv2Commands cmdEnum, CommandType* cmd, const std::string& cmdComment)
+{
+ out << print_cifs2_procedures(cmdEnum)
+ << " "
+ << cmdComment << " (";
+ print_hex16(out, to_integral(cmdEnum));
+ out << ")\n"
+ << " Structure size = ";
+ print_hex16(out, cmd->structureSize);
+ return out;
+}
+
+template<typename CommandType>
+std::ostream& print_smbv2_common_info_req(std::ostream& out, SMBv2Commands cmdEnum, CommandType* cmd)
+{
+ return print_smbv2_common_info(out, cmdEnum, cmd->parg, "request");
+}
+
+template<typename CommandType>
+std::ostream& print_smbv2_common_info_resp(std::ostream& out, SMBv2Commands cmdEnum, CommandType* cmd)
+{
+ return print_smbv2_common_info(out, cmdEnum, cmd->pres, "response");
+}
+
+std::ostream& print_smbv2_header(std::ostream& out, const RawMessageHeader* header)
+{
+ if (header == nullptr)
+ {
+ return out;
+ }
+
+ out << "SMB2 Header\n";
+ uint8_t len = sizeof(header->head.protocol) / sizeof(header->head.protocol[0]);
+ out << " Server Component = ";
+ for(uint8_t i = 0; i < len; i++)
+ {
+ out << header->head.protocol[i];
+ }
+
+ if(header->head.protocol_code == protocols::CIFSv1::ProtocolCodes::SMB1)
+ {
+ out << "1";
+ }
+ else if(header->head.protocol_code == protocols::CIFSv1::ProtocolCodes::SMB2)
+ {
+ out << "2";
+ }
+
+ out << "\n Header Length = " << header->StructureSize << "\n";
+ out << " Credit Charge = " << header->CreditCharge << "\n";
+
+ bool isResponse = header->flags & static_cast<uint32_t>(Flags::SERVER_TO_REDIR);
+ if (isResponse)
+ {
+ SMBv2::NTStatus status = static_cast<SMBv2::NTStatus>(header->status);
+ print_enum(out, "NT Status", status);
+ }
+ else
+ {
+ out << " Channel Sequence = " << header->status;
+ }
+
+ out << "\n";
+ print_enum(out, "Command", header->cmd_code) << "\n";
+
+ if (isResponse)
+ {
+ out << " Credits granted = " << header->Credit << "\n";
+ }
+ else
+ {
+ out << " Credits requested = " << header->Credit << "\n";
+ }
+
+ print_enum(out, "Flags", static_cast<Flags>(header->flags)) << "\n";
+ out << " Chain Offset = ";
+ print_hex32(out, header->nextCommand);
+ out << "\n";
+ out << " Command Sequence Number = " << header->messageId << "\n";
+ out << " Process Id = ";
+ print_hex32(out, header->_);
+ out << "\n";
+ out << " Tree Id = ";
+ print_hex32(out, header->TreeId);
+ out << "\n";
+ out << " Session Id = ";
+ print_hex64(out, header->SessionId);
+ out << "\n";
+ out << " Signature = ";
+ print_buffer_hex(out, header->Signature, sizeof(header->Signature) / sizeof(header->Signature[0]));
+
+ return out;
+}
+
} // unnamed namespace
+void PrintAnalyzer::closeFileSMBv2(const SMBv2::CloseFileCommand* cmd,
+ const SMBv2::CloseRequest*,
+ const SMBv2::CloseResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::CLOSE;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+
+ print_enum(out, "Close Flags", cmd->parg->Flags) << "\n";
+
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+
+ print_enum(out, "Close Flags", res->Flags) << "\n";
+
+ out << " Create = ";
+ print_time(out, res->CreationTime) << "\n";
+
+ out << " Last Access = ";
+ print_time(out, res->LastAccessTime) << "\n";
+
+ out << " Last Write = ";
+ print_time(out, res->LastWriteTime) << "\n";
+
+ out << " Last Change = ";
+ print_time(out, res->ChangeTime) << "\n";
+
+ out << " Allocation Size = "
+ << res->AllocationSize
+ << "\n";
+
+ out << " End of File = "
+ << res->EndOfFile
+ << "\n";
+
+ out << " File Attributes = "
+ << res->Attributes;
+}
+
+void PrintAnalyzer::negotiateSMBv2(const SMBv2::NegotiateCommand* cmd,
+ const SMBv2::NegotiateRequest*,
+ const SMBv2::NegotiateResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::NEGOTIATE;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+
+ out << " Dialect count = "
+ << cmd->parg->dialectCount
+ << "\n";
+
+ print_enum(out, "Security mode", cmd->parg->securityMode) << "\n";
+ print_enum(out, "Capabilities", cmd->parg->capabilities) << "\n";
+
+ out << " Client Guid = ";
+ print_guid(out, cmd->parg->clientGUID);
+ out << "\n";
+
+ out << " Boot Time = ";
+ print_time(out, cmd->parg->clientStartTime) << "\n";
+
+ for(int i = 0; i < cmd->parg->dialectCount; i++)
+ {
+ out << " Dialect = ";
+ print_hex16(out, to_integral(cmd->parg->dialects[i]));
+ out << "\n";
+ }
+
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+
+ print_enum(out, "Security mode", res->securityMode) << "\n";
+
+ out << " Dialect = ";
+ print_hex16(out, res->dialectRevision);
+ out << "\n";
+
+ out << " Server Guid = ";
+ print_guid(out, res->serverGUID);
+ out << "\n";
+
+ print_enum(out, "Capabilities", res->capabilities);
+
+ out << "\n Max Transaction Size = "
+ << res->maxTransactSize
+ << "\n";
+
+ out << " Max Read Size = "
+ << res->maxReadSize
+ << "\n";
+
+ out << " Max Write Size = "
+ << res->maxWriteSize
+ << "\n";
+
+ out << " Current Time = ";
+ print_time(out, res->systemTime);
+
+ out << "\n Boot Time = ";
+ print_time(out, res->serverStartTime);
+
+}
+
+void PrintAnalyzer::sessionSetupSMBv2(const SMBv2::SessionSetupCommand* cmd,
+ const SMBv2::SessionSetupRequest*,
+ const SMBv2::SessionSetupResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::SESSION_SETUP;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Flags", cmd->parg->VcNumber) << "\n";
+ print_enum(out, "Security mode", cmd->parg->securityMode) << "\n";
+ print_enum(out, "Capabilities", cmd->parg->capabilities) << "\n";
+ out << " Channel = " << cmd->parg->Channel << "\n"
+ << " Previous session id = " << cmd->parg->PreviousSessionId << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Session flags", res->sessionFlags);
+}
+
+void PrintAnalyzer::logOffSMBv2(const SMBv2::LogOffCommand* cmd,
+ const SMBv2::LogOffRequest*,
+ const SMBv2::LogOffResponse*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::LOGOFF;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd);
+ out << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd);
+}
+
+void PrintAnalyzer::treeConnectSMBv2(const SMBv2::TreeConnectCommand* cmd,
+ const SMBv2::TreeConnectRequest*,
+ const SMBv2::TreeConnectResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::TREE_CONNECT;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ if(cmd->parg->PathLength > 0)
+ {
+ out << " Tree =";
+ print_buffer(out,cmd->parg->Buffer, cmd->parg->PathLength) << "\n";
+ }
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Share types", res->ShareType) << "\n";
+ print_enum(out, "Capabilities", res->capabilities) << "\n";
+ print_enum(out, "Share flags", res->shareFlags) << "\n";
+ print_enum(out, "Access mask", static_cast<SMBv2::AccessMask>(res->MaximalAccess));
+}
+
+void PrintAnalyzer::treeDisconnectSMBv2(const SMBv2::TreeDisconnectCommand* cmd,
+ const SMBv2::TreeDisconnectRequest*,
+ const SMBv2::TreeDisconnectResponse*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::TREE_DISCONNECT;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd);
+}
+void PrintAnalyzer::createSMBv2(const SMBv2::CreateCommand* cmd,
+ const SMBv2::CreateRequest*,
+ const SMBv2::CreateResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::CREATE;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Oplock", cmd->parg->RequestedOplockLevel) << "\n";
+ print_enum(out, "Impersonation", cmd->parg->ImpersonationLevel) << "\n";
+ out << " Create Flags = ";
+ print_hex64(out, cmd->parg->SmbCreateFlags);
+ out << "\n";
+ print_enum(out, "Access Mask", cmd->parg->desiredAccess) << "\n";
+ print_enum(out, "File Attributes", cmd->parg->attributes) << "\n";
+ print_enum(out, "Share Access", cmd->parg->shareAccess) << "\n";
+ print_enum(out, "Disposition", cmd->parg->createDisposition) << "\n";
+ print_enum(out, "Create Options", cmd->parg->createOptions) << "\n";
+
+ if(cmd->parg->NameLength > 0)
+ {
+ out << " File name = ";
+ print_buffer(out, cmd->parg->Buffer, cmd->parg->NameLength) << "\n";
+ out << " File length = " << cmd->parg->NameLength << "\n";
+ }
+
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+
+ print_enum(out, "Oplock", res->oplockLevel) << "\n";
+ out << " Response Flags = ";
+ print_hex8(out, res->flag);
+ out << "\n";
+ print_enum(out, "Create Action", res->CreateAction) << "\n";
+
+ if (cmd->res_header && cmd->res_header->status == to_integral(SMBv2::NTStatus::STATUS_SUCCESS))
+ {
+ out << " Create = ";
+ print_time(out, res->CreationTime);
+
+ out << "\n Last Access = ";
+ print_time(out, res->LastAccessTime);
+
+ out << "\n Last Write = ";
+ print_time(out, res->LastWriteTime);
+
+ out << "\n Last Change = ";
+ print_time(out, res->ChangeTime);
+
+ out << "\n Allocation Size = ";
+ out << res->AllocationSize;
+
+ out << "\n End Of File = ";
+ out << res->EndofFile << "\n";
+
+ print_enum(out, "File Attributes", res->attributes);
+ }
+}
+
+void PrintAnalyzer::flushSMBv2(const SMBv2::FlushCommand* cmd,
+ const SMBv2::FlushRequest*,
+ const SMBv2::FlushResponse*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::FLUSH;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd);
+}
+void PrintAnalyzer::readSMBv2(const SMBv2::ReadCommand* cmd,
+ const SMBv2::ReadRequest*,
+ const SMBv2::ReadResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::READ;
+
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+
+ out << " Read length = " << cmd->parg->length << "\n"
+ << " File offset = " << cmd->parg->offset << "\n"
+ << " Min count = " << cmd->parg->minimumCount << "\n"
+ << " Channel = " << to_integral(cmd->parg->channel) << "\n"
+ << " Remaining bytes = " << cmd->parg->RemainingBytes << "\n"
+ << " Channel Info Offset = " << cmd->parg->ReadChannelInfoOffset << "\n"
+ << " Channel Info Length = " << cmd->parg->ReadChannelInfoLength << "\n";
+
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+
+ out << " Data offset = ";
+ print_hex16(out, res->DataOffset);
+ out << "\n"
+ << " Read length = " << res->DataLength << "\n"
+ << " Read remaining = " << res->DataRemaining;
+}
+
+void PrintAnalyzer::writeSMBv2(const SMBv2::WriteCommand* cmd,
+ const SMBv2::WriteRequest*,
+ const SMBv2::WriteResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::WRITE;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+
+ out << " Data offset = ";
+ print_hex16(out, cmd->parg->dataOffset);
+
+ out << "\n"
+ << " Write Length = " << cmd->parg->Length << "\n"
+ << " File Offset = " << cmd->parg->Offset << "\n"
+ << " Channel = " << to_integral(cmd->parg->Channel) << "\n"
+ << " Remaining Bytes = " << cmd->parg->RemainingBytes << "\n"
+ << " Channel Info Offset = " << cmd->parg->WriteChannelInfoOffset << "\n"
+ << " Channel Info Length = " << cmd->parg->WriteChannelInfoLength << "\n";
+ print_enum(out, "Write Flags", cmd->parg->Flags) << "\n";
+
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+
+ out << " Write Count = " << res->Count << "\n"
+ << " Write Remaining = " << res->Remaining << "\n"
+ << " Channel Info Offset = " << res->WriteChannelInfoOffset << "\n"
+ << " Channel Info Length = " << res->WriteChannelInfoLength;
+}
+
+void PrintAnalyzer::lockSMBv2(const SMBv2::LockCommand* cmd,
+ const SMBv2::LockRequest*,
+ const SMBv2::LockResponse*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::LOCK;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ out << " Lock Count = " << static_cast<uint32_t>(cmd->parg->LockCount) << "\n"
+ << " Lock Sequence = " << static_cast<uint32_t>(cmd->parg->LockSequence) << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd);
+}
+
+void PrintAnalyzer::ioctlSMBv2(const SMBv2::IoctlCommand* cmd,
+ const SMBv2::IoCtlRequest*,
+ const SMBv2::IoCtlResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::IOCTL;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Control Code", cmd->parg->CtlCode) << "\n";
+ out << " Input offset = " << cmd->parg->InputOffset << "\n"
+ << " Input count = " << cmd->parg->InputCount << "\n"
+ << " Max input response = " << cmd->parg->MaxInputResponse << "\n"
+ << " Output offset = " << cmd->parg->OutputOffset << "\n"
+ << " Output count = " << cmd->parg->OutputCount << "\n"
+ << " Max output response = " << cmd->parg->MaxOutputResponse << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Control Code", res->CtlCode) << "\n";
+ out << " Input offset = " << res->InputOffset << "\n"
+ << " Input count = " << res->InputCount << "\n"
+ << " Output offset = " << res->OutputOffset << "\n"
+ << " Output count = " << res->OutputCount;
+}
+void PrintAnalyzer::cancelSMBv2(const SMBv2::CancelCommand* cmd,
+ const SMBv2::CancelRequest*,
+ const SMBv2::CancelResponce*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::CANCEL;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd);
+ print_smbv2_header(out, cmd->res_header) << "\n";
+}
+void PrintAnalyzer::echoSMBv2(const SMBv2::EchoCommand* cmd,
+ const SMBv2::EchoRequest*,
+ const SMBv2::EchoResponse*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::ECHO;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd);
+}
+void PrintAnalyzer::queryDirSMBv2(const SMBv2::QueryDirCommand* cmd,
+ const SMBv2::QueryDirRequest*,
+ const SMBv2::QueryDirResponse*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::QUERY_DIRECTORY;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Info level", cmd->parg->infoType) << "\n";
+ out << " File index = " << cmd->parg->FileIndex << "\n"
+ << " Output buffer length = " << cmd->parg->OutputBufferLength << "\n"
+ << " Search pattern =";
+ print_buffer(out, cmd->parg->Buffer, cmd->parg->FileNameLength) << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd);
+}
+void PrintAnalyzer::changeNotifySMBv2(const SMBv2::ChangeNotifyCommand* cmd,
+ const SMBv2::ChangeNotifyRequest*,
+ const SMBv2::ChangeNotifyResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::CHANGE_NOTIFY;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ out << " Length = ";
+ print_hex32(out, cmd->parg->OutputBufferLength);
+ out << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+ out << " Offset = ";
+ print_hex32(out, res->OutputBufferOffset);
+ out << "\n";
+ out << " Length = ";
+ print_hex32(out, res->OutputBufferLength);
+}
+void PrintAnalyzer::queryInfoSMBv2(const SMBv2::QueryInfoCommand* cmd,
+ const SMBv2::QueryInfoRequest*,
+ const SMBv2::QueryInfoResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::QUERY_INFO;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Class", cmd->parg->infoType) << "\n";
+ print_info_levels(out, cmd->parg->infoType, cmd->parg->FileInfoClass) << "\n";
+ //TODO: Print GUID handle file
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+ out << " Offset = ";
+ print_hex32(out, res->OutputBufferOffset);
+ out << "\n Length = ";
+ print_hex32(out, res->OutputBufferLength);
+}
+void PrintAnalyzer::setInfoSMBv2(const SMBv2::SetInfoCommand* cmd,
+ const SMBv2::SetInfoRequest*,
+ const SMBv2::SetInfoResponse*)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::SET_INFO;
+ print_session(out, cmd) << "\n";
+ print_smbv2_header(out, cmd->req_header) << "\n";
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Class", cmd->parg->infoType) << "\n";
+ print_info_levels(out, cmd->parg->infoType, cmd->parg->FileInfoClass) << "\n";
+ out << " Setinfo Size = ";
+ print_hex32(out, cmd->parg->BufferLength);
+ out << "\n Setinfo Offset = ";
+ print_hex16(out, cmd->parg->BufferOffset);
+ out << "\n";
+ print_smbv2_header(out, cmd->res_header) << "\n";
+ print_smbv2_common_info_resp(out, cmdEnum, cmd);
+}
+
+void PrintAnalyzer::breakOplockSMBv2(const SMBv2::BreakOpLockCommand* cmd,
+ const SMBv2::OplockAcknowledgment*,
+ const SMBv2::OplockResponse* res)
+{
+ SMBv2Commands cmdEnum = SMBv2Commands::OPLOCK_BREAK;
+
+ print_smbv2_common_info_req(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Oplock", cmd->parg->LockCount) << "\n";
+ out << " File Id = ";
+ print_guid(out, cmd->parg->fileId);
+ out << "\n";
+
+ print_smbv2_common_info_resp(out, cmdEnum, cmd) << "\n";
+ print_enum(out, "Oplock", res->LockCount) << "\n";
+ out << " File Id = ";
+ print_guid(out, res->fileId);
+}
+
// Print NFSv3 procedures (rpcgen)
// 1st line - PRC information: src and dst hosts, status of RPC procedure
// 2nd line - <tabulation>related RPC procedure-specific arguments
// 3rd line - <tabulation>related RPC procedure-specific results
-void PrintAnalyzer::null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL3args*,
- const struct rpcgen::NULL3res*)
+void PrintAnalyzer::null(const RPCProcedure* proc,
+ const struct NFS3::NULL3args*,
+ const struct NFS3::NULL3res*)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
out << "\tCALL []\n\tREPLY []\n";
}
-void PrintAnalyzer::getattr3(const struct RPCProcedure* proc,
- const struct rpcgen::GETATTR3args* args,
- const struct rpcgen::GETATTR3res* res)
+void PrintAnalyzer::getattr3(const RPCProcedure* proc,
+ const struct NFS3::GETATTR3args* args,
+ const struct NFS3::GETATTR3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args) out << "\tCALL ["
- << " object: " << args->object
- << " ]\n";
- if(res)
+ if (args)
+ {
+ out << "\tCALL ["
+ << " object: " << args->object
+ << " ]\n";
+ }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (out_all() && res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj attributes: "
<< res->GETATTR3res_u.resok.obj_attributes;
out << " ]\n";
}
}
-void PrintAnalyzer::setattr3(const struct RPCProcedure* proc,
- const struct rpcgen::SETATTR3args* args,
- const struct rpcgen::SETATTR3res* res)
+void PrintAnalyzer::setattr3(const RPCProcedure* proc,
+ const struct NFS3::SETATTR3args* args,
+ const struct NFS3::SETATTR3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args) out << "\tCALL [ object: " << args->object
- << " new attributes: " << args->new_attributes
- << " guard: " << args->guard
- << " ]\n";
- if(res)
+ if (args)
+ {
+ out << "\tCALL [ object: " << args->object
+ << " new attributes: " << args->new_attributes
+ << " guard: " << args->guard
+ << " ]\n";
+ }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj_wcc: "
<< res->SETATTR3res_u.resok.obj_wcc;
else
@@ -207,19 +878,19 @@ void PrintAnalyzer::setattr3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::lookup3(const struct RPCProcedure* proc,
- const struct rpcgen::LOOKUP3args* args,
- const struct rpcgen::LOOKUP3res* res)
+void PrintAnalyzer::lookup3(const RPCProcedure* proc,
+ const struct NFS3::LOOKUP3args* args,
+ const struct NFS3::LOOKUP3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args) out << "\tCALL [ what: " << args->what << " ]\n";
- if(res)
+ if (args) { out << "\tCALL [ what: " << args->what << " ]\n"; }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " object: "
<< res->LOOKUP3res_u.resok.object
<< " object attributes: "
@@ -234,13 +905,13 @@ void PrintAnalyzer::lookup3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::access3(const struct RPCProcedure* proc,
- const struct rpcgen::ACCESS3args* args,
- const struct rpcgen::ACCESS3res* res)
+void PrintAnalyzer::access3(const RPCProcedure* proc,
+ const struct NFS3::ACCESS3args* args,
+ const struct NFS3::ACCESS3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
{
out << "\tCALL [ object: ";
print_nfs_fh(out,
@@ -251,12 +922,12 @@ void PrintAnalyzer::access3(const struct RPCProcedure* proc,
out << " ]\n";
}
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
{
out << " object attributes: "
<< res->ACCESS3res_u.resok.obj_attributes
@@ -273,19 +944,19 @@ void PrintAnalyzer::access3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::readlink3(const struct RPCProcedure* proc,
- const struct rpcgen::READLINK3args* args,
- const struct rpcgen::READLINK3res* res)
+void PrintAnalyzer::readlink3(const RPCProcedure* proc,
+ const struct NFS3::READLINK3args* args,
+ const struct NFS3::READLINK3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args) out << "\tCALL [ symlink: " << args->symlink << " ]\n";
- if(res)
+ if (args) { out << "\tCALL [ symlink: " << args->symlink << " ]\n"; }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " symlink attributes: "
<< res->READLINK3res_u.resok.symlink_attributes
<< " data: "
@@ -298,22 +969,25 @@ void PrintAnalyzer::readlink3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::read3(const struct RPCProcedure* proc,
- const struct rpcgen::READ3args* args,
- const struct rpcgen::READ3res* res)
+void PrintAnalyzer::read3(const RPCProcedure* proc,
+ const struct NFS3::READ3args* args,
+ const struct NFS3::READ3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args) out << "\tCALL [ file: " << args->file
- << " offset: " << args->offset
- << " count: " << args->count
- << " ]\n";
- if(res)
+ if (args)
+ {
+ out << "\tCALL [ file: " << args->file
+ << " offset: " << args->offset
+ << " count: " << args->count
+ << " ]\n";
+ }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
{
out << " file attributes: "
<< res->READ3res_u.resok.file_attributes
@@ -332,13 +1006,13 @@ void PrintAnalyzer::read3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::write3(const struct RPCProcedure* proc,
- const struct rpcgen::WRITE3args* args,
- const struct rpcgen::WRITE3res* res)
+void PrintAnalyzer::write3(const RPCProcedure* proc,
+ const struct NFS3::WRITE3args* args,
+ const struct NFS3::WRITE3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
{
out << "\tCALL [ file: " << args->file
<< " offset: " << args->offset
@@ -346,12 +1020,12 @@ void PrintAnalyzer::write3(const struct RPCProcedure* proc,
<< " stable: " << args->stable
<< " ]\n";
}
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
{
out << " file_wcc: "
<< res->WRITE3res_u.resok.file_wcc
@@ -362,7 +1036,7 @@ void PrintAnalyzer::write3(const struct RPCProcedure* proc,
<< " verf: ";
print_hex(out,
res->WRITE3res_u.resok.verf,
- rpcgen::NFS3_WRITEVERFSIZE);
+ NFS3::NFS3_WRITEVERFSIZE);
}
else
{
@@ -374,22 +1048,22 @@ void PrintAnalyzer::write3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::create3(const struct RPCProcedure* proc,
- const struct rpcgen::CREATE3args* args,
- const struct rpcgen::CREATE3res* res)
+void PrintAnalyzer::create3(const RPCProcedure* proc,
+ const struct NFS3::CREATE3args* args,
+ const struct NFS3::CREATE3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
out << "\tCALL [ where: " << args->where
<< " how: " << args->how
<< " ]\n";
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj: "
<< res->CREATE3res_u.resok.obj
<< " obj attributes: "
@@ -404,22 +1078,22 @@ void PrintAnalyzer::create3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::mkdir3(const struct RPCProcedure* proc,
- const struct rpcgen::MKDIR3args* args,
- const struct rpcgen::MKDIR3res* res)
+void PrintAnalyzer::mkdir3(const RPCProcedure* proc,
+ const struct NFS3::MKDIR3args* args,
+ const struct NFS3::MKDIR3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
out << "\tCALL [ where: " << args->where
<< " attributes: " << args->attributes
<< " ]\n";
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj: "
<< res->MKDIR3res_u.resok.obj
<< " obj attributes: "
@@ -434,22 +1108,22 @@ void PrintAnalyzer::mkdir3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::symlink3(const struct RPCProcedure* proc,
- const struct rpcgen::SYMLINK3args* args,
- const struct rpcgen::SYMLINK3res* res)
+void PrintAnalyzer::symlink3(const RPCProcedure* proc,
+ const struct NFS3::SYMLINK3args* args,
+ const struct NFS3::SYMLINK3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
out << "\tCALL [ where: " << args->where
<< " symlink: " << args->symlink
<< " ]\n";
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj: "
<< res->SYMLINK3res_u.resok.obj
<< " obj attributes: "
@@ -464,24 +1138,24 @@ void PrintAnalyzer::symlink3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::mknod3(const struct RPCProcedure* proc,
- const struct rpcgen::MKNOD3args* args,
- const struct rpcgen::MKNOD3res* res)
+void PrintAnalyzer::mknod3(const RPCProcedure* proc,
+ const struct NFS3::MKNOD3args* args,
+ const struct NFS3::MKNOD3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
{
out << "\tCALL [ where: " << args->where
<< " what: " << args->what
<< " ]\n";
}
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj: "
<< res->MKNOD3res_u.resok.obj
<< " obj attributes: "
@@ -496,20 +1170,22 @@ void PrintAnalyzer::mknod3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::remove3(const struct RPCProcedure* proc,
- const struct rpcgen::REMOVE3args* args,
- const struct rpcgen::REMOVE3res* res)
+void PrintAnalyzer::remove3(const RPCProcedure* proc,
+ const struct NFS3::REMOVE3args* args,
+ const struct NFS3::REMOVE3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
+ {
out << "\tCALL [ object: " << args->object << " ]\n";
- if(res)
+ }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " dir_wcc: "
<< res->REMOVE3res_u.resok.dir_wcc;
else
@@ -520,22 +1196,22 @@ void PrintAnalyzer::remove3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::rmdir3(const struct RPCProcedure* proc,
- const struct rpcgen::RMDIR3args* args,
- const struct rpcgen::RMDIR3res* res)
+void PrintAnalyzer::rmdir3(const RPCProcedure* proc,
+ const struct NFS3::RMDIR3args* args,
+ const struct NFS3::RMDIR3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
{
out << "\tCALL [ object: " << args->object << " ]\n";
}
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " dir_wcc: "
<< res->RMDIR3res_u.resok.dir_wcc;
else
@@ -546,22 +1222,22 @@ void PrintAnalyzer::rmdir3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::rename3(const struct RPCProcedure* proc,
- const struct rpcgen::RENAME3args* args,
- const struct rpcgen::RENAME3res* res)
+void PrintAnalyzer::rename3(const RPCProcedure* proc,
+ const struct NFS3::RENAME3args* args,
+ const struct NFS3::RENAME3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
out << "\tCALL [ from: " << args->from
<< " to: " << args->to
<< " ]\n";
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " from dir_wcc: "
<< res->RENAME3res_u.resok.fromdir_wcc
<< " to dir_wcc: "
@@ -576,22 +1252,22 @@ void PrintAnalyzer::rename3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::link3(const struct RPCProcedure* proc,
- const struct rpcgen::LINK3args* args,
- const struct rpcgen::LINK3res* res)
+void PrintAnalyzer::link3(const RPCProcedure* proc,
+ const struct NFS3::LINK3args* args,
+ const struct NFS3::LINK3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
out << "\tCALL [ file: " << args->file
<< " link: " << args->link
<< " ]\n";
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " file attributes: "
<< res->LINK3res_u.resok.file_attributes
<< " link dir_wcc: "
@@ -606,36 +1282,36 @@ void PrintAnalyzer::link3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::readdir3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIR3args* args,
- const struct rpcgen::READDIR3res* res)
+void PrintAnalyzer::readdir3(const RPCProcedure* proc,
+ const struct NFS3::READDIR3args* args,
+ const struct NFS3::READDIR3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
{
out << "\tCALL [ dir: " << args->dir
<< " cookie: " << args->cookie
<< " cookieverf: ";
print_hex(out,
args->cookieverf,
- rpcgen::NFS3_COOKIEVERFSIZE);
+ NFS3::NFS3_COOKIEVERFSIZE);
out << " count: " << args->count
<< " ]\n";
}
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
{
out << " dir attributes: "
<< res->READDIR3res_u.resok.dir_attributes
<< " cookieverf: ";
print_hex(out,
res->READDIR3res_u.resok.cookieverf,
- rpcgen::NFS3_COOKIEVERFSIZE);
+ NFS3::NFS3_COOKIEVERFSIZE);
out << " reply: "
<< res->READDIR3res_u.resok.reply;
}
@@ -649,37 +1325,37 @@ void PrintAnalyzer::readdir3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::readdirplus3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIRPLUS3args* args,
- const struct rpcgen::READDIRPLUS3res* res)
+void PrintAnalyzer::readdirplus3(const RPCProcedure* proc,
+ const struct NFS3::READDIRPLUS3args* args,
+ const struct NFS3::READDIRPLUS3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
{
out << "\tCALL [ dir: " << args->dir
<< " cookie: " << args->cookie
<< " cookieverf: ";
print_hex(out,
args->cookieverf,
- rpcgen::NFS3_COOKIEVERFSIZE);
+ NFS3::NFS3_COOKIEVERFSIZE);
out << " dir count: " << args->dircount
<< " max count: " << args->maxcount
<< " ]\n";
}
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
{
out << " dir attributes: "
<< res->READDIRPLUS3res_u.resok.dir_attributes
<< " cookieverf: ";
print_hex(out,
res->READDIRPLUS3res_u.resok.cookieverf,
- rpcgen::NFS3_COOKIEVERFSIZE);
+ NFS3::NFS3_COOKIEVERFSIZE);
out << " reply: "
<< res->READDIRPLUS3res_u.resok.reply;
}
@@ -693,20 +1369,22 @@ void PrintAnalyzer::readdirplus3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::fsstat3(const struct RPCProcedure* proc,
- const struct rpcgen::FSSTAT3args* args,
- const struct rpcgen::FSSTAT3res* res)
+void PrintAnalyzer::fsstat3(const RPCProcedure* proc,
+ const struct NFS3::FSSTAT3args* args,
+ const struct NFS3::FSSTAT3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
+ {
out << "\tCALL [ fsroot: " << args->fsroot << " ]\n";
- if(res)
+ }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj attributes: "
<< res->FSSTAT3res_u.resok.obj_attributes
<< " tbytes: "
@@ -731,20 +1409,22 @@ void PrintAnalyzer::fsstat3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::fsinfo3(const struct RPCProcedure* proc,
- const struct rpcgen::FSINFO3args* args,
- const struct rpcgen::FSINFO3res* res)
+void PrintAnalyzer::fsinfo3(const RPCProcedure* proc,
+ const struct NFS3::FSINFO3args* args,
+ const struct NFS3::FSINFO3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
+ {
out << "\tCALL [ fsroot: " << args->fsroot << " ]\n";
- if(res)
+ }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj attributes: "
<< res->FSINFO3res_u.resok.obj_attributes
<< " rtmax: "
@@ -769,16 +1449,16 @@ void PrintAnalyzer::fsinfo3(const struct RPCProcedure* proc,
<< res->FSINFO3res_u.resok.properties
<< " LINK (filesystem supports hard links): "
<< static_cast<bool>(res->FSINFO3res_u.resok.properties &
- rpcgen::FSF3_LINK)
+ NFS3::FSF3_LINK)
<< " SYMLINK (file system supports symbolic links): "
<< static_cast<bool>(res->FSINFO3res_u.resok.properties &
- rpcgen::FSF3_SYMLINK)
+ NFS3::FSF3_SYMLINK)
<< " HOMOGENEOUS (PATHCONF: is valid for all files): "
<< static_cast<bool>(res->FSINFO3res_u.resok.properties &
- rpcgen::FSF3_HOMOGENEOUS)
+ NFS3::FSF3_HOMOGENEOUS)
<< " CANSETTIME (SETATTR can set time on server): "
<< static_cast<bool>(res->FSINFO3res_u.resok.properties &
- rpcgen::FSF3_CANSETTIME);
+ NFS3::FSF3_CANSETTIME);
else
out << " obj attributes: "
<< res->FSINFO3res_u.resfail.obj_attributes;
@@ -787,20 +1467,22 @@ void PrintAnalyzer::fsinfo3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::pathconf3(const struct RPCProcedure* proc,
- const struct rpcgen::PATHCONF3args* args,
- const struct rpcgen::PATHCONF3res* res)
+void PrintAnalyzer::pathconf3(const RPCProcedure* proc,
+ const struct NFS3::PATHCONF3args* args,
+ const struct NFS3::PATHCONF3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
+ {
out << "\tCALL [ object: " << args->object << " ]\n";
- if(res)
+ }
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
out << " obj attributes: "
<< res->PATHCONF3res_u.resok.obj_attributes
<< " link max: "
@@ -823,30 +1505,30 @@ void PrintAnalyzer::pathconf3(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::commit3(const struct RPCProcedure* proc,
- const struct rpcgen::COMMIT3args* args,
- const struct rpcgen::COMMIT3res* res)
+void PrintAnalyzer::commit3(const RPCProcedure* proc,
+ const struct NFS3::COMMIT3args* args,
+ const struct NFS3::COMMIT3res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
- if(args)
+ if (args)
out << "\tCALL [ file: " << args->file
<< " offset: " << args->offset
<< " count: " << args->count
<< " ]\n";
- if(res)
+ if (res)
{
out << "\tREPLY [ status: " << res->status;
- if(out_all())
+ if (out_all())
{
- if(res->status == rpcgen::nfsstat3::NFS3_OK)
+ if (res->status == NFS3::nfsstat3::NFS3_OK)
{
out << " file_wcc: "
<< res->COMMIT3res_u.resok.file_wcc
<< " verf: ";
print_hex(out,
res->COMMIT3res_u.resok.verf,
- rpcgen::NFS3_WRITEVERFSIZE);
+ NFS3::NFS3_WRITEVERFSIZE);
}
else
{
@@ -866,48 +1548,48 @@ void PrintAnalyzer::commit3(const struct RPCProcedure* proc,
// 4th line - <tabulation>related RPC procedure-specific results
// 5rd line - <tabulation>related NFSv4-operations
-void PrintAnalyzer::null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL4args*,
- const struct rpcgen::NULL4res*)
+void PrintAnalyzer::null4(const RPCProcedure* proc,
+ const struct NFS4::NULL4args*,
+ const struct NFS4::NULL4res*)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
out << "\tCALL []\n\tREPLY []\n";
}
-void PrintAnalyzer::compound4(const struct RPCProcedure* proc,
- const struct rpcgen::COMPOUND4args* args,
- const struct rpcgen::COMPOUND4res* res)
+void PrintAnalyzer::compound4(const RPCProcedure* proc,
+ const struct NFS4::COMPOUND4args* args,
+ const struct NFS4::COMPOUND4res* res)
{
- if(!print_procedure(out, proc)) return;
+ if (!print_procedure(out, proc)) { return; }
const u_int* array_len {};
- if(args)
+ if (args)
{
array_len = &args->argarray.argarray_len;
out << "\tCALL [ operations: " << *array_len
<< " tag: " << args->tag
<< " minor version: " << args->minorversion;
- if(*array_len)
+ if (*array_len)
{
- rpcgen::nfs_argop4* current_el {args->argarray.argarray_val};
- for(u_int i=0; i<*array_len; i++, current_el++)
+ NFS4::nfs_argop4* current_el {args->argarray.argarray_val};
+ for (u_int i = 0; i < *array_len; i++, current_el++)
{
out << "\n\t\t[ ";
nfs4_operation(current_el);
out << " ] ";
}
out << " ]\n";
- }
+ }
}
- if(res)
+ if (res)
{
array_len = &res->resarray.resarray_len;
out << "\tREPLY [ operations: " << *array_len;
- if(*array_len)
+ if (*array_len)
{
- rpcgen::nfs_resop4* current_el {res->resarray.resarray_val};
- for(u_int i=0; i<*array_len; i++, current_el++)
+ NFS4::nfs_resop4* current_el {res->resarray.resarray_val};
+ for (u_int i = 0; i < *array_len; i++, current_el++)
{
out << "\n\t\t[ ";
nfs4_operation(current_el);
@@ -918,391 +1600,437 @@ void PrintAnalyzer::compound4(const struct RPCProcedure* proc,
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::nfs_argop4* op)
-{
- if(op)
- {
- out << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(op->argop))
- << '(' << op->argop << ") [ ";
- switch(op->argop)
- {
- case rpcgen::OP_ACCESS:
- return nfs4_operation(&op->nfs_argop4_u.opaccess);
- case rpcgen::OP_CLOSE:
- return nfs4_operation(&op->nfs_argop4_u.opclose);
- case rpcgen::OP_COMMIT:
- return nfs4_operation(&op->nfs_argop4_u.opcommit);
- case rpcgen::OP_CREATE:
- return nfs4_operation(&op->nfs_argop4_u.opcreate);
- case rpcgen::OP_DELEGPURGE:
- return nfs4_operation(&op->nfs_argop4_u.opdelegpurge);
- case rpcgen::OP_DELEGRETURN:
- return nfs4_operation(&op->nfs_argop4_u.opdelegreturn);
- case rpcgen::OP_GETATTR:
- return nfs4_operation(&op->nfs_argop4_u.opgetattr);
- case rpcgen::OP_GETFH:
- break; /* no such operation in call procedure */
- case rpcgen::OP_LINK:
- return nfs4_operation(&op->nfs_argop4_u.oplink);
- case rpcgen::OP_LOCK:
- return nfs4_operation(&op->nfs_argop4_u.oplock);
- case rpcgen::OP_LOCKT:
- return nfs4_operation(&op->nfs_argop4_u.oplockt);
- case rpcgen::OP_LOCKU:
- return nfs4_operation(&op->nfs_argop4_u.oplocku);
- case rpcgen::OP_LOOKUP:
- return nfs4_operation(&op->nfs_argop4_u.oplookup);
- case rpcgen::OP_LOOKUPP:
- break; /* no such operation in call procedure */
- case rpcgen::OP_NVERIFY:
- return nfs4_operation(&op->nfs_argop4_u.opnverify);
- case rpcgen::OP_OPEN:
- return nfs4_operation(&op->nfs_argop4_u.opopen);
- case rpcgen::OP_OPENATTR:
- return nfs4_operation(&op->nfs_argop4_u.opopenattr);
- case rpcgen::OP_OPEN_CONFIRM:
- return nfs4_operation(&op->nfs_argop4_u.opopen_confirm);
- case rpcgen::OP_OPEN_DOWNGRADE:
- return nfs4_operation(&op->nfs_argop4_u.opopen_downgrade);
- case rpcgen::OP_PUTFH:
- return nfs4_operation(&op->nfs_argop4_u.opputfh);
- case rpcgen::OP_PUTPUBFH:
- break; /* no such operation in call procedure */
- case rpcgen::OP_PUTROOTFH:
- break; /* no such operation in call procedure */
- case rpcgen::OP_READ:
- return nfs4_operation(&op->nfs_argop4_u.opread);
- case rpcgen::OP_READDIR:
- return nfs4_operation(&op->nfs_argop4_u.opreaddir);
- case rpcgen::OP_READLINK:
- break; /* no such operation in call procedure */
- case rpcgen::OP_REMOVE:
- return nfs4_operation(&op->nfs_argop4_u.opremove);
- case rpcgen::OP_RENAME:
- return nfs4_operation(&op->nfs_argop4_u.oprename);
- case rpcgen::OP_RENEW:
- return nfs4_operation(&op->nfs_argop4_u.oprenew);
- case rpcgen::OP_RESTOREFH:
- break; /* no such operation in call procedure */
- case rpcgen::OP_SAVEFH:
- break; /* no such operation in call procedure */
- case rpcgen::OP_SECINFO:
- return nfs4_operation(&op->nfs_argop4_u.opsecinfo);
- case rpcgen::OP_SETATTR:
- return nfs4_operation(&op->nfs_argop4_u.opsetattr);
- case rpcgen::OP_SETCLIENTID:
- return nfs4_operation(&op->nfs_argop4_u.opsetclientid);
- case rpcgen::OP_SETCLIENTID_CONFIRM:
- return nfs4_operation(&op->nfs_argop4_u.opsetclientid_confirm);
- case rpcgen::OP_VERIFY:
- return nfs4_operation(&op->nfs_argop4_u.opverify);
- case rpcgen::OP_WRITE:
- return nfs4_operation(&op->nfs_argop4_u.opwrite);
- case rpcgen::OP_RELEASE_LOCKOWNER:
- return nfs4_operation(&op->nfs_argop4_u.oprelease_lockowner);
- case rpcgen::OP_GET_DIR_DELEGATION:
- return nfs4_operation(&op->nfs_argop4_u.opget_dir_delegation);
- case rpcgen::OP_ILLEGAL:
- break; /* no such operation in call procedure */
- }
- out << " ]";
- }
-}
-
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::nfs_resop4* op)
-{
- if(op)
- {
- out << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(op->resop))
- << '(' << op->resop << ") [ ";
- switch(op->resop)
- {
- case rpcgen::OP_ACCESS:
- return nfs4_operation(&op->nfs_resop4_u.opaccess);
- case rpcgen::OP_CLOSE:
- return nfs4_operation(&op->nfs_resop4_u.opclose);
- case rpcgen::OP_COMMIT:
- return nfs4_operation(&op->nfs_resop4_u.opcommit);
- case rpcgen::OP_CREATE:
- return nfs4_operation(&op->nfs_resop4_u.opcreate);
- case rpcgen::OP_DELEGPURGE:
- return nfs4_operation(&op->nfs_resop4_u.opdelegpurge);
- case rpcgen::OP_DELEGRETURN:
- return nfs4_operation(&op->nfs_resop4_u.opdelegreturn);
- case rpcgen::OP_GETATTR:
- return nfs4_operation(&op->nfs_resop4_u.opgetattr);
- case rpcgen::OP_GETFH:
- return nfs4_operation(&op->nfs_resop4_u.opgetfh);
- case rpcgen::OP_LINK:
- return nfs4_operation(&op->nfs_resop4_u.oplink);
- case rpcgen::OP_LOCK:
- return nfs4_operation(&op->nfs_resop4_u.oplock);
- case rpcgen::OP_LOCKT:
- return nfs4_operation(&op->nfs_resop4_u.oplockt);
- case rpcgen::OP_LOCKU:
- return nfs4_operation(&op->nfs_resop4_u.oplocku);
- case rpcgen::OP_LOOKUP:
- return nfs4_operation(&op->nfs_resop4_u.oplookup);
- case rpcgen::OP_LOOKUPP:
- return nfs4_operation(&op->nfs_resop4_u.oplookupp);
- case rpcgen::OP_NVERIFY:
- return nfs4_operation(&op->nfs_resop4_u.opnverify);
- case rpcgen::OP_OPEN:
- return nfs4_operation(&op->nfs_resop4_u.opopen);
- case rpcgen::OP_OPENATTR:
- return nfs4_operation(&op->nfs_resop4_u.opopenattr);
- case rpcgen::OP_OPEN_CONFIRM:
- return nfs4_operation(&op->nfs_resop4_u.opopen_confirm);
- case rpcgen::OP_OPEN_DOWNGRADE:
- return nfs4_operation(&op->nfs_resop4_u.opopen_downgrade);
- case rpcgen::OP_PUTFH:
- return nfs4_operation(&op->nfs_resop4_u.opputfh);
- case rpcgen::OP_PUTPUBFH:
- return nfs4_operation(&op->nfs_resop4_u.opputpubfh);
- case rpcgen::OP_PUTROOTFH:
- return nfs4_operation(&op->nfs_resop4_u.opputrootfh);
- case rpcgen::OP_READ:
- return nfs4_operation(&op->nfs_resop4_u.opread);
- case rpcgen::OP_READDIR:
- return nfs4_operation(&op->nfs_resop4_u.opreaddir);
- case rpcgen::OP_READLINK:
- return nfs4_operation(&op->nfs_resop4_u.opreadlink);
- case rpcgen::OP_REMOVE:
- return nfs4_operation(&op->nfs_resop4_u.opremove);
- case rpcgen::OP_RENAME:
- return nfs4_operation(&op->nfs_resop4_u.oprename);
- case rpcgen::OP_RENEW:
- return nfs4_operation(&op->nfs_resop4_u.oprenew);
- case rpcgen::OP_RESTOREFH:
- return nfs4_operation(&op->nfs_resop4_u.oprestorefh);
- case rpcgen::OP_SAVEFH:
- return nfs4_operation(&op->nfs_resop4_u.opsavefh);
- case rpcgen::OP_SECINFO:
- return nfs4_operation(&op->nfs_resop4_u.opsecinfo);
- case rpcgen::OP_SETATTR:
- return nfs4_operation(&op->nfs_resop4_u.opsetattr);
- case rpcgen::OP_SETCLIENTID:
- return nfs4_operation(&op->nfs_resop4_u.opsetclientid);
- case rpcgen::OP_SETCLIENTID_CONFIRM:
- return nfs4_operation(&op->nfs_resop4_u.opsetclientid_confirm);
- case rpcgen::OP_VERIFY:
- return nfs4_operation(&op->nfs_resop4_u.opverify);
- case rpcgen::OP_WRITE:
- return nfs4_operation(&op->nfs_resop4_u.opwrite);
- case rpcgen::OP_RELEASE_LOCKOWNER:
- return nfs4_operation(&op->nfs_resop4_u.oprelease_lockowner);
- case rpcgen::OP_GET_DIR_DELEGATION:
- return nfs4_operation(&op->nfs_resop4_u.opget_dir_delegation);
- case rpcgen::OP_ILLEGAL:
- return nfs4_operation(&op->nfs_resop4_u.opillegal);
- }
- out << " ]";
- }
-}
-
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::ACCESS4args* args)
-{
- if(args)
- {
- if ((args->access) & ACCESS4_READ) out << "READ ";
- if ((args->access) & ACCESS4_LOOKUP) out << "LOOKUP ";
- if ((args->access) & ACCESS4_MODIFY) out << "MODIFY ";
- if ((args->access) & ACCESS4_EXTEND) out << "EXTEND ";
- if ((args->access) & ACCESS4_DELETE) out << "DELETE ";
- if ((args->access) & ACCESS4_EXECUTE) out << "EXECUTE ";
- }
-}
-
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::ACCESS4res* res)
-{
- if(res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::nfs_argop4* op)
+{
+ if (op)
+ {
+ out << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(op->argop))
+ << '(' << op->argop << ") [ ";
+ switch (op->argop)
+ {
+ case NFS4::OP_ACCESS:
+ return nfs4_operation(&op->nfs_argop4_u.opaccess);
+ case NFS4::OP_CLOSE:
+ return nfs4_operation(&op->nfs_argop4_u.opclose);
+ case NFS4::OP_COMMIT:
+ return nfs4_operation(&op->nfs_argop4_u.opcommit);
+ case NFS4::OP_CREATE:
+ return nfs4_operation(&op->nfs_argop4_u.opcreate);
+ case NFS4::OP_DELEGPURGE:
+ return nfs4_operation(&op->nfs_argop4_u.opdelegpurge);
+ case NFS4::OP_DELEGRETURN:
+ return nfs4_operation(&op->nfs_argop4_u.opdelegreturn);
+ case NFS4::OP_GETATTR:
+ return nfs4_operation(&op->nfs_argop4_u.opgetattr);
+ case NFS4::OP_GETFH:
+ break; /* no such operation in call procedure */
+ case NFS4::OP_LINK:
+ return nfs4_operation(&op->nfs_argop4_u.oplink);
+ case NFS4::OP_LOCK:
+ return nfs4_operation(&op->nfs_argop4_u.oplock);
+ case NFS4::OP_LOCKT:
+ return nfs4_operation(&op->nfs_argop4_u.oplockt);
+ case NFS4::OP_LOCKU:
+ return nfs4_operation(&op->nfs_argop4_u.oplocku);
+ case NFS4::OP_LOOKUP:
+ return nfs4_operation(&op->nfs_argop4_u.oplookup);
+ case NFS4::OP_LOOKUPP:
+ break; /* no such operation in call procedure */
+ case NFS4::OP_NVERIFY:
+ return nfs4_operation(&op->nfs_argop4_u.opnverify);
+ case NFS4::OP_OPEN:
+ return nfs4_operation(&op->nfs_argop4_u.opopen);
+ case NFS4::OP_OPENATTR:
+ return nfs4_operation(&op->nfs_argop4_u.opopenattr);
+ case NFS4::OP_OPEN_CONFIRM:
+ return nfs4_operation(&op->nfs_argop4_u.opopen_confirm);
+ case NFS4::OP_OPEN_DOWNGRADE:
+ return nfs4_operation(&op->nfs_argop4_u.opopen_downgrade);
+ case NFS4::OP_PUTFH:
+ return nfs4_operation(&op->nfs_argop4_u.opputfh);
+ case NFS4::OP_PUTPUBFH:
+ break; /* no such operation in call procedure */
+ case NFS4::OP_PUTROOTFH:
+ break; /* no such operation in call procedure */
+ case NFS4::OP_READ:
+ return nfs4_operation(&op->nfs_argop4_u.opread);
+ case NFS4::OP_READDIR:
+ return nfs4_operation(&op->nfs_argop4_u.opreaddir);
+ case NFS4::OP_READLINK:
+ break; /* no such operation in call procedure */
+ case NFS4::OP_REMOVE:
+ return nfs4_operation(&op->nfs_argop4_u.opremove);
+ case NFS4::OP_RENAME:
+ return nfs4_operation(&op->nfs_argop4_u.oprename);
+ case NFS4::OP_RENEW:
+ return nfs4_operation(&op->nfs_argop4_u.oprenew);
+ case NFS4::OP_RESTOREFH:
+ break; /* no such operation in call procedure */
+ case NFS4::OP_SAVEFH:
+ break; /* no such operation in call procedure */
+ case NFS4::OP_SECINFO:
+ return nfs4_operation(&op->nfs_argop4_u.opsecinfo);
+ case NFS4::OP_SETATTR:
+ return nfs4_operation(&op->nfs_argop4_u.opsetattr);
+ case NFS4::OP_SETCLIENTID:
+ return nfs4_operation(&op->nfs_argop4_u.opsetclientid);
+ case NFS4::OP_SETCLIENTID_CONFIRM:
+ return nfs4_operation(&op->nfs_argop4_u.opsetclientid_confirm);
+ case NFS4::OP_VERIFY:
+ return nfs4_operation(&op->nfs_argop4_u.opverify);
+ case NFS4::OP_WRITE:
+ return nfs4_operation(&op->nfs_argop4_u.opwrite);
+ case NFS4::OP_RELEASE_LOCKOWNER:
+ return nfs4_operation(&op->nfs_argop4_u.oprelease_lockowner);
+ case NFS4::OP_GET_DIR_DELEGATION:
+ return nfs4_operation(&op->nfs_argop4_u.opget_dir_delegation);
+ case NFS4::OP_ILLEGAL:
+ break; /* no such operation in call procedure */
+ }
+ out << " ]";
+ }
+}
+
+void PrintAnalyzer::nfs4_operation(const struct NFS4::nfs_resop4* op)
+{
+ if (op)
+ {
+ out << print_nfs4_procedures(static_cast<ProcEnumNFS4::NFSProcedure>(op->resop))
+ << '(' << op->resop << ") [ ";
+ switch (op->resop)
+ {
+ case NFS4::OP_ACCESS:
+ return nfs4_operation(&op->nfs_resop4_u.opaccess);
+ case NFS4::OP_CLOSE:
+ return nfs4_operation(&op->nfs_resop4_u.opclose);
+ case NFS4::OP_COMMIT:
+ return nfs4_operation(&op->nfs_resop4_u.opcommit);
+ case NFS4::OP_CREATE:
+ return nfs4_operation(&op->nfs_resop4_u.opcreate);
+ case NFS4::OP_DELEGPURGE:
+ return nfs4_operation(&op->nfs_resop4_u.opdelegpurge);
+ case NFS4::OP_DELEGRETURN:
+ return nfs4_operation(&op->nfs_resop4_u.opdelegreturn);
+ case NFS4::OP_GETATTR:
+ return nfs4_operation(&op->nfs_resop4_u.opgetattr);
+ case NFS4::OP_GETFH:
+ return nfs4_operation(&op->nfs_resop4_u.opgetfh);
+ case NFS4::OP_LINK:
+ return nfs4_operation(&op->nfs_resop4_u.oplink);
+ case NFS4::OP_LOCK:
+ return nfs4_operation(&op->nfs_resop4_u.oplock);
+ case NFS4::OP_LOCKT:
+ return nfs4_operation(&op->nfs_resop4_u.oplockt);
+ case NFS4::OP_LOCKU:
+ return nfs4_operation(&op->nfs_resop4_u.oplocku);
+ case NFS4::OP_LOOKUP:
+ return nfs4_operation(&op->nfs_resop4_u.oplookup);
+ case NFS4::OP_LOOKUPP:
+ return nfs4_operation(&op->nfs_resop4_u.oplookupp);
+ case NFS4::OP_NVERIFY:
+ return nfs4_operation(&op->nfs_resop4_u.opnverify);
+ case NFS4::OP_OPEN:
+ return nfs4_operation(&op->nfs_resop4_u.opopen);
+ case NFS4::OP_OPENATTR:
+ return nfs4_operation(&op->nfs_resop4_u.opopenattr);
+ case NFS4::OP_OPEN_CONFIRM:
+ return nfs4_operation(&op->nfs_resop4_u.opopen_confirm);
+ case NFS4::OP_OPEN_DOWNGRADE:
+ return nfs4_operation(&op->nfs_resop4_u.opopen_downgrade);
+ case NFS4::OP_PUTFH:
+ return nfs4_operation(&op->nfs_resop4_u.opputfh);
+ case NFS4::OP_PUTPUBFH:
+ return nfs4_operation(&op->nfs_resop4_u.opputpubfh);
+ case NFS4::OP_PUTROOTFH:
+ return nfs4_operation(&op->nfs_resop4_u.opputrootfh);
+ case NFS4::OP_READ:
+ return nfs4_operation(&op->nfs_resop4_u.opread);
+ case NFS4::OP_READDIR:
+ return nfs4_operation(&op->nfs_resop4_u.opreaddir);
+ case NFS4::OP_READLINK:
+ return nfs4_operation(&op->nfs_resop4_u.opreadlink);
+ case NFS4::OP_REMOVE:
+ return nfs4_operation(&op->nfs_resop4_u.opremove);
+ case NFS4::OP_RENAME:
+ return nfs4_operation(&op->nfs_resop4_u.oprename);
+ case NFS4::OP_RENEW:
+ return nfs4_operation(&op->nfs_resop4_u.oprenew);
+ case NFS4::OP_RESTOREFH:
+ return nfs4_operation(&op->nfs_resop4_u.oprestorefh);
+ case NFS4::OP_SAVEFH:
+ return nfs4_operation(&op->nfs_resop4_u.opsavefh);
+ case NFS4::OP_SECINFO:
+ return nfs4_operation(&op->nfs_resop4_u.opsecinfo);
+ case NFS4::OP_SETATTR:
+ return nfs4_operation(&op->nfs_resop4_u.opsetattr);
+ case NFS4::OP_SETCLIENTID:
+ return nfs4_operation(&op->nfs_resop4_u.opsetclientid);
+ case NFS4::OP_SETCLIENTID_CONFIRM:
+ return nfs4_operation(&op->nfs_resop4_u.opsetclientid_confirm);
+ case NFS4::OP_VERIFY:
+ return nfs4_operation(&op->nfs_resop4_u.opverify);
+ case NFS4::OP_WRITE:
+ return nfs4_operation(&op->nfs_resop4_u.opwrite);
+ case NFS4::OP_RELEASE_LOCKOWNER:
+ return nfs4_operation(&op->nfs_resop4_u.oprelease_lockowner);
+ case NFS4::OP_GET_DIR_DELEGATION:
+ return nfs4_operation(&op->nfs_resop4_u.opget_dir_delegation);
+ case NFS4::OP_ILLEGAL:
+ return nfs4_operation(&op->nfs_resop4_u.opillegal);
+ }
+ out << " ]";
+ }
+}
+
+void PrintAnalyzer::nfs4_operation(const struct NFS4::ACCESS4args* args)
+{
+ if (args)
+ {
+ if ((args->access) & NFS4::ACCESS4_READ) { out << "READ "; }
+ if ((args->access) & NFS4::ACCESS4_LOOKUP) { out << "LOOKUP "; }
+ if ((args->access) & NFS4::ACCESS4_MODIFY) { out << "MODIFY "; }
+ if ((args->access) & NFS4::ACCESS4_EXTEND) { out << "EXTEND "; }
+ if ((args->access) & NFS4::ACCESS4_DELETE) { out << "DELETE "; }
+ if ((args->access) & NFS4::ACCESS4_EXECUTE) { out << "EXECUTE "; }
+ }
+}
+
+void PrintAnalyzer::nfs4_operation(const struct NFS4::ACCESS4res* res)
+{
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
{
out << " supported: ";
- if ((res->ACCESS4res_u.resok4.supported) & ACCESS4_READ)
+ if ((res->ACCESS4res_u.resok4.supported) & NFS4::ACCESS4_READ)
+ {
out << "READ ";
- if ((res->ACCESS4res_u.resok4.supported) & ACCESS4_LOOKUP)
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS4::ACCESS4_LOOKUP)
+ {
out << "LOOKUP ";
- if ((res->ACCESS4res_u.resok4.supported) & ACCESS4_MODIFY)
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS4::ACCESS4_MODIFY)
+ {
out << "MODIFY ";
- if ((res->ACCESS4res_u.resok4.supported) & ACCESS4_EXTEND)
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS4::ACCESS4_EXTEND)
+ {
out << "EXTEND ";
- if ((res->ACCESS4res_u.resok4.supported) & ACCESS4_DELETE)
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS4::ACCESS4_DELETE)
+ {
out << "DELETE ";
- if ((res->ACCESS4res_u.resok4.supported) & ACCESS4_EXECUTE)
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS4::ACCESS4_EXECUTE)
+ {
out << "EXECUTE ";
+ }
out << " access: ";
- if ((res->ACCESS4res_u.resok4.access) & ACCESS4_READ)
+ if ((res->ACCESS4res_u.resok4.access) & NFS4::ACCESS4_READ)
+ {
out << "READ ";
- if ((res->ACCESS4res_u.resok4.access) & ACCESS4_LOOKUP)
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS4::ACCESS4_LOOKUP)
+ {
out << "LOOKUP ";
- if ((res->ACCESS4res_u.resok4.access) & ACCESS4_MODIFY)
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS4::ACCESS4_MODIFY)
+ {
out << "MODIFY ";
- if ((res->ACCESS4res_u.resok4.access) & ACCESS4_EXTEND)
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS4::ACCESS4_EXTEND)
+ {
out << "EXTEND ";
- if ((res->ACCESS4res_u.resok4.access) & ACCESS4_DELETE)
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS4::ACCESS4_DELETE)
+ {
out << "DELETE ";
- if ((res->ACCESS4res_u.resok4.access) & ACCESS4_EXECUTE)
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS4::ACCESS4_EXECUTE)
+ {
out << "EXECUTE ";
+ }
}
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::CLOSE4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::CLOSE4args* args)
{
- if(args) out << "seqid: " << std::hex << args->seqid << std::dec
- << " open state id:" << args->open_stateid;
+ if (args)
+ {
+ out << "seqid: " << std::hex << args->seqid << std::dec
+ << " open state id:" << args->open_stateid;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::CLOSE4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::CLOSE4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << " open state id:" << res->CLOSE4res_u.open_stateid;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::COMMIT4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::COMMIT4args* args)
{
- if(args) out << "offset: " << args->offset
- << " count: " << args->count;
+ if (args)
+ {
+ out << "offset: " << args->offset
+ << " count: " << args->count;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::COMMIT4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::COMMIT4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
{
out << " write verifier: ";
print_hex(out,
res->COMMIT4res_u.resok4.writeverf,
- rpcgen::NFS4_VERIFIER_SIZE);
+ NFS4::NFS4_VERIFIER_SIZE);
}
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::CREATE4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::CREATE4args* args)
{
- if(args) out << "object type: " << args->objtype
- << " object name: " << args->objname
- << " create attributes: " << args->createattrs;
+ if (args)
+ {
+ out << "object type: " << args->objtype
+ << " object name: " << args->objname
+ << " create attributes: " << args->createattrs;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::CREATE4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::CREATE4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
out << res->CREATE4res_u.resok4.cinfo << ' '
<< res->CREATE4res_u.resok4.attrset;
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::DELEGPURGE4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::DELEGPURGE4args* args)
{
- if(args) out << "client id: " << std::hex << args->clientid << std::dec;
+ if (args) { out << "client id: " << std::hex << args->clientid << std::dec; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::DELEGPURGE4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::DELEGPURGE4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::DELEGRETURN4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::DELEGRETURN4args* args)
{
- if(args) out << args->deleg_stateid;
+ if (args) { out << args->deleg_stateid; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::DELEGRETURN4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::DELEGRETURN4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::GETATTR4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::GETATTR4args* args)
{
- if(args) out << args->attr_request;
+ if (args) { out << args->attr_request; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::GETATTR4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::GETATTR4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << ' ' << res->GETATTR4res_u.resok4.obj_attributes;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LINK4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LINK4args* args)
{
- if(args) out << "new name: " << args->newname;
+ if (args) { out << "new name: " << args->newname; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LINK4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LINK4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << ' ' << res->LINK4res_u.resok4.cinfo;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOCK4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOCK4args* args)
{
- if(args) out << "lock type: " << args->locktype
- << " reclaim: " << args->reclaim
- << " offset: " << args->offset
- << " length: " << args->length
- << " locker: " << args->locker;
+ if (args)
+ {
+ out << "lock type: " << args->locktype
+ << " reclaim: " << args->reclaim
+ << " offset: " << args->offset
+ << " length: " << args->length
+ << " locker: " << args->locker;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOCK4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOCK4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all())
+ if (out_all())
{
- switch(res->status)
+ switch (res->status)
{
- case rpcgen::nfsstat4::NFS4_OK:
+ case NFS4::nfsstat4::NFS4_OK:
out << " lock stat id: "
<< res->LOCK4res_u.resok4.lock_stateid;
break;
- case rpcgen::nfsstat4::NFS4ERR_DENIED:
+ case NFS4::nfsstat4::NFS4ERR_DENIED:
out << " offset: " << res->LOCK4res_u.denied.offset
<< " length: " << res->LOCK4res_u.denied.length
<< " lock type: " << res->LOCK4res_u.denied.locktype
<< " owner: " << res->LOCK4res_u.denied.owner;
break;
- default: break;
+ default:
+ break;
}
}
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOCKT4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOCKT4args* args)
{
- if(args) out << "lock type: " << args->locktype
- << " offset: " << args->offset
- << " length: " << args->length
- << " owner: " << args->owner;
+ if (args)
+ {
+ out << "lock type: " << args->locktype
+ << " offset: " << args->offset
+ << " length: " << args->length
+ << " owner: " << args->owner;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOCKT4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOCKT4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4ERR_DENIED)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4ERR_DENIED)
out << " offset: " << res->LOCKT4res_u.denied.offset
<< " length: " << res->LOCKT4res_u.denied.length
<< " lock type: " << res->LOCKT4res_u.denied.locktype
@@ -1310,64 +2038,72 @@ void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOCKT4res* res)
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOCKU4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOCKU4args* args)
{
- if(args) out << "lock type: " << args->locktype
- << " seqid: " << std::hex << args->seqid << std::dec
- << " lock state id: " << args->lock_stateid
- << " offset: " << args->offset
- << " length: " << args->length;
+ if (args)
+ {
+ out << "lock type: " << args->locktype
+ << " seqid: " << std::hex << args->seqid << std::dec
+ << " lock state id: " << args->lock_stateid
+ << " offset: " << args->offset
+ << " length: " << args->length;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOCKU4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOCKU4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << " lock state id: " << res->LOCKU4res_u.lock_stateid;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOOKUP4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOOKUP4args* args)
{
- if(args) out << "object name: " << args->objname;
+ if (args) { out << "object name: " << args->objname; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOOKUP4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOOKUP4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::NVERIFY4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::NVERIFY4args* args)
{
- if(args) out << "object attributes: " << args->obj_attributes;
+ if (args) { out << "object attributes: " << args->obj_attributes; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::NVERIFY4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::NVERIFY4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPEN4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPEN4args* args)
{
- static const char* const open4_share_access[4] = {"", "READ","WRITE","BOTH"};
- static const char* const open4_share_deny[4] = {"NONE","READ","WRITE","BOTH"};
+ static const char* const open4_share_access[4] = {"", "READ", "WRITE", "BOTH"};
+ static const char* const open4_share_deny[4] = {"NONE", "READ", "WRITE", "BOTH"};
- if(args) out << "seqid: " << std::hex << args->seqid << std::dec
- << " share access: " << open4_share_access[args->share_access]
- << " share deny: " << open4_share_deny[args->share_deny]
- << ' ' << args->owner
- << ' ' << args->openhow
- << ' ' << args->claim;
+ if (args)
+ {
+ out << "seqid: " << std::hex << args->seqid << std::dec
+ << " share access: " << open4_share_access[args->share_access]
+ << " share deny: " << open4_share_deny[args->share_deny]
+ << ' ' << args->owner
+ << ' ' << args->openhow
+ << ' ' << args->claim;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPEN4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPEN4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
out << res->OPEN4res_u.resok4.stateid
<< res->OPEN4res_u.resok4.cinfo
<< " results flags: "
@@ -1377,132 +2113,155 @@ void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPEN4res* res)
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPENATTR4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPENATTR4args* args)
{
- if(args) out << "create directory: " << args->createdir;
+ if (args) { out << "create directory: " << args->createdir; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPENATTR4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPENATTR4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPEN_CONFIRM4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPEN_CONFIRM4args* args)
{
- if(args) out << "open state id:" << args->open_stateid
- << " seqid: " << std::hex << args->seqid << std::dec;
+ if (args)
+ {
+ out << "open state id:" << args->open_stateid
+ << " seqid: " << std::hex << args->seqid << std::dec;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPEN_CONFIRM4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPEN_CONFIRM4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << " open state id:" << res->OPEN_CONFIRM4res_u.resok4.open_stateid;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPEN_DOWNGRADE4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPEN_DOWNGRADE4args* args)
{
- if(args) out << " open state id: " << args->open_stateid
- << " seqid: " << std::hex << args->seqid << std::dec
- << " share access: " << args->share_access
- << " share deny: " << args->share_deny;
+ if (args)
+ {
+ out << " open state id: " << args->open_stateid
+ << " seqid: " << std::hex << args->seqid << std::dec
+ << " share access: " << args->share_access
+ << " share deny: " << args->share_deny;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::OPEN_DOWNGRADE4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::OPEN_DOWNGRADE4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << ' ' << res->OPEN_DOWNGRADE4res_u.resok4.open_stateid;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::PUTFH4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::PUTFH4args* args)
{
- if(args)
+ if (args)
{
out << "object: ";
print_nfs_fh(out, args->object.nfs_fh4_val, args->object.nfs_fh4_len);
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::PUTFH4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::PUTFH4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::READ4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::READ4args* args)
{
- if(args) out << args->stateid
- << " offset: " << args->offset
- << " count: " << args->count;
+ if (args)
+ {
+ out << args->stateid
+ << " offset: " << args->offset
+ << " count: " << args->count;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::READ4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::READ4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
{
out << " eof: " << res->READ4res_u.resok4.eof;
- if(res->READ4res_u.resok4.data.data_len)
+ if (res->READ4res_u.resok4.data.data_len)
+ {
out << " data : " << *res->READ4res_u.resok4.data.data_val;
+ }
}
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::READDIR4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::READDIR4args* args)
{
- if(args) out << "cookie: " << args->cookie
- << " cookieverf: " << args->cookieverf
- << " dir count: " << args->dircount
- << " max count: " << args->maxcount
- << " attributes request: " << args->attr_request;
+ if (args)
+ {
+ out << "cookie: " << args->cookie
+ << " cookieverf: " << args->cookieverf
+ << " dir count: " << args->dircount
+ << " max count: " << args->maxcount
+ << " attributes request: " << args->attr_request;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::READDIR4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::READDIR4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
out << " cookie verifier: " << res->READDIR4res_u.resok4.cookieverf
<< " reply: " << res->READDIR4res_u.resok4.reply;
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::REMOVE4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::REMOVE4args* args)
{
- if(args) out << "target: " << args->target;
+ if (args) { out << "target: " << args->target; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::REMOVE4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::REMOVE4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << ' ' << res->REMOVE4res_u.resok4.cinfo;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::RENAME4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::RENAME4args* args)
{
- if(args) out << "old name: " << args->oldname
- << " new name: " << args->newname;
+ if (args)
+ {
+ out << "old name: " << args->oldname
+ << " new name: " << args->newname;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::RENAME4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::RENAME4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
out << " source: "
<< res->RENAME4res_u.resok4.source_cinfo
<< " target: "
@@ -1510,114 +2269,124 @@ void PrintAnalyzer::nfs4_operation(const struct rpcgen::RENAME4res* res)
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::RENEW4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::RENEW4args* args)
{
- if(args) out << "client id: "
- << std::hex << args->clientid << std::dec;
+ if (args)
+ {
+ out << "client id: "
+ << std::hex << args->clientid << std::dec;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::RENEW4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::RENEW4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SECINFO4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SECINFO4args* args)
{
- if(args) out << "name: " << args->name;
+ if (args) { out << "name: " << args->name; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SECINFO4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SECINFO4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
{
- if(res->SECINFO4res_u.resok4.SECINFO4resok_len)
+ if (res->SECINFO4res_u.resok4.SECINFO4resok_len)
out << " data : "
<< *res->SECINFO4res_u.resok4.SECINFO4resok_val;
}
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SETATTR4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SETATTR4args* args)
{
- if(args) out << "state id:" << args->stateid
- << ' ' << args->obj_attributes;
+ if (args)
+ {
+ out << "state id:" << args->stateid
+ << ' ' << args->obj_attributes;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SETATTR4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SETATTR4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all()) out << ' ' << res->attrsset;
+ if (out_all()) { out << ' ' << res->attrsset; }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SETCLIENTID4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SETCLIENTID4args* args)
{
- if(args) out << args->client
- << " callback: "
- << args->callback
- << " callback ident: "
- << std::hex << args->callback_ident << std::dec;
+ if (args)
+ {
+ out << args->client
+ << " callback: "
+ << args->callback
+ << " callback ident: "
+ << std::hex << args->callback_ident << std::dec;
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SETCLIENTID4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SETCLIENTID4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all())
+ if (out_all())
{
- switch(res->status)
+ switch (res->status)
{
- case rpcgen::nfsstat4::NFS4_OK:
+ case NFS4::nfsstat4::NFS4_OK:
out << " client id: "
<< std::hex << res->SETCLIENTID4res_u.resok4.clientid << std::dec
<< " verifier: ";
print_hex(out,
res->SETCLIENTID4res_u.resok4.setclientid_confirm,
- rpcgen::NFS4_VERIFIER_SIZE);
+ NFS4::NFS4_VERIFIER_SIZE);
break;
- case rpcgen::nfsstat4::NFS4ERR_CLID_INUSE:
+ case NFS4::nfsstat4::NFS4ERR_CLID_INUSE:
out << " client using: " << res->SETCLIENTID4res_u.client_using;
break;
- default: break;
+ default:
+ break;
}
}
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SETCLIENTID_CONFIRM4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SETCLIENTID_CONFIRM4args* args)
{
- if(args)
+ if (args)
{
out << " client id: " << std::hex << args->clientid << std::dec
<< " verifier: ";
- print_hex(out, args->setclientid_confirm, rpcgen::NFS4_VERIFIER_SIZE);
+ print_hex(out, args->setclientid_confirm, NFS4::NFS4_VERIFIER_SIZE);
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SETCLIENTID_CONFIRM4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SETCLIENTID_CONFIRM4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::VERIFY4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::VERIFY4args* args)
{
- if(args) out << "object attributes: " << args->obj_attributes;
+ if (args) { out << "object attributes: " << args->obj_attributes; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::VERIFY4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::VERIFY4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::WRITE4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::WRITE4args* args)
{
- if(args)
+ if (args)
{
out << args->stateid
<< " offset: " << args->offset
@@ -1626,48 +2395,48 @@ void PrintAnalyzer::nfs4_operation(const struct rpcgen::WRITE4args* args)
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::WRITE4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::WRITE4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
{
out << " count: " << res->WRITE4res_u.resok4.count
<< " committed: " << res->WRITE4res_u.resok4.committed
<< " write verifier: ";
print_hex(out,
res->WRITE4res_u.resok4.writeverf,
- rpcgen::NFS4_VERIFIER_SIZE);
+ NFS4::NFS4_VERIFIER_SIZE);
}
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::RELEASE_LOCKOWNER4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::RELEASE_LOCKOWNER4args* args)
{
- if(args) out << "lock owner: " << args->lock_owner;
+ if (args) { out << "lock owner: " << args->lock_owner; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::RELEASE_LOCKOWNER4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::RELEASE_LOCKOWNER4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::GET_DIR_DELEGATION4args* args)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::GET_DIR_DELEGATION4args* args)
{
- if(args)
+ if (args)
out << "client id: " << args->clientid
<< " notification types: " << args->notif_types
<< " dir notification delay: " << args->dir_notif_delay
<< " dir entry notification delay: " << args->dir_entry_notif_delay;
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::GET_DIR_DELEGATION4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::GET_DIR_DELEGATION4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
out << ' ' << res->GET_DIR_DELEGATION4res_u.resok4.stateid
<< " status: "
<< res->GET_DIR_DELEGATION4res_u.resok4.status
@@ -1680,56 +2449,1585 @@ void PrintAnalyzer::nfs4_operation(const struct rpcgen::GET_DIR_DELEGATION4res*
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::GETFH4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::GETFH4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << " object: " << res->GETFH4res_u.resok4.object;
+ }
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::LOOKUPP4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::LOOKUPP4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::PUTPUBFH4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::PUTPUBFH4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::PUTROOTFH4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::PUTROOTFH4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res) { out << "status: " << res->status; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::READLINK4res* res)
+void PrintAnalyzer::nfs4_operation(const struct NFS4::READLINK4res* res)
{
- if(res)
+ if (res)
{
out << "status: " << res->status;
- if(out_all() && res->status == rpcgen::nfsstat4::NFS4_OK)
+ if (out_all() && res->status == NFS4::nfsstat4::NFS4_OK)
+ {
out << " link: " << res->READLINK4res_u.resok4.link;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs4_operation(const struct NFS4::RESTOREFH4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs4_operation(const struct NFS4::SAVEFH4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs4_operation(const struct NFS4::ILLEGAL4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+// Print NFSv4.1 procedures
+// 1st line - PRC information: src and dst hosts, status of RPC procedure
+// 2nd line - <tabulation>related RPC procedure-specific arguments
+// 3rd line - <tabulation>related NFSv4-operations
+// 4th line - <tabulation>related RPC procedure-specific results
+// 5rd line - <tabulation>related NFSv4-operations
+
+
+void PrintAnalyzer::compound41(const RPCProcedure* proc,
+ const struct NFS41::COMPOUND4args* args,
+ const struct NFS41::COMPOUND4res* res)
+{
+ if (!print_procedure(out, proc)) { return; }
+
+ const u_int* array_len {};
+ if (args)
+ {
+ array_len = &args->argarray.argarray_len;
+ out << "\tCALL [ operations: " << *array_len
+ << " tag: " << args->tag
+ << " minor version: " << args->minorversion;
+
+ if (*array_len)
+ {
+ NFS41::nfs_argop4* current_el {args->argarray.argarray_val};
+ for (u_int i {0}; i < *array_len; i++, current_el++)
+ {
+ out << "\n\t\t[ ";
+ nfs41_operation(current_el);
+ out << " ] ";
+ }
+ out << " ]\n";
+ }
+ }
+ if (res)
+ {
+ array_len = &res->resarray.resarray_len;
+ out << "\tREPLY [ operations: " << *array_len
+ << " status: " << res->status
+ << " tag: " << res->tag;
+ if (*array_len)
+ {
+ NFS41::nfs_resop4* current_el {res->resarray.resarray_val};
+ for (u_int i {0}; i < *array_len; i++, current_el++)
+ {
+ out << "\n\t\t[ ";
+ nfs41_operation(current_el);
+ out << " ] ";
+ }
+ out << " ]\n";
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::nfs_argop4* op)
+{
+ if (op)
+ {
+ out << print_nfs41_procedures(static_cast<ProcEnumNFS41::NFSProcedure>(op->argop))
+ << '(' << op->argop << ") [ ";
+ switch (op->argop)
+ {
+ case NFS41::OP_ACCESS:
+ return nfs41_operation(&op->nfs_argop4_u.opaccess);
+ case NFS41::OP_CLOSE:
+ return nfs41_operation(&op->nfs_argop4_u.opclose);
+ case NFS41::OP_COMMIT:
+ return nfs41_operation(&op->nfs_argop4_u.opcommit);
+ case NFS41::OP_CREATE:
+ return nfs41_operation(&op->nfs_argop4_u.opcreate);
+ case NFS41::OP_DELEGPURGE:
+ return nfs41_operation(&op->nfs_argop4_u.opdelegpurge);
+ case NFS41::OP_DELEGRETURN:
+ return nfs41_operation(&op->nfs_argop4_u.opdelegreturn);
+ case NFS41::OP_GETATTR:
+ return nfs41_operation(&op->nfs_argop4_u.opgetattr);
+ case NFS41::OP_GETFH:
+ break;
+ case NFS41::OP_LINK:
+ return nfs41_operation(&op->nfs_argop4_u.oplink);
+ case NFS41::OP_LOCK:
+ return nfs41_operation(&op->nfs_argop4_u.oplock);
+ case NFS41::OP_LOCKT:
+ return nfs41_operation(&op->nfs_argop4_u.oplockt);
+ case NFS41::OP_LOCKU:
+ return nfs41_operation(&op->nfs_argop4_u.oplocku);
+ case NFS41::OP_LOOKUP:
+ return nfs41_operation(&op->nfs_argop4_u.oplookup);
+ case NFS41::OP_LOOKUPP:
+ break;
+ case NFS41::OP_NVERIFY:
+ return nfs41_operation(&op->nfs_argop4_u.opnverify);
+ case NFS41::OP_OPEN:
+ return nfs41_operation(&op->nfs_argop4_u.opopen);
+ case NFS41::OP_OPENATTR:
+ return nfs41_operation(&op->nfs_argop4_u.opopenattr);
+ case NFS41::OP_OPEN_CONFIRM:
+ return nfs41_operation(&op->nfs_argop4_u.opopen_confirm);
+ case NFS41::OP_OPEN_DOWNGRADE:
+ return nfs41_operation(&op->nfs_argop4_u.opopen_downgrade);
+ case NFS41::OP_PUTFH:
+ return nfs41_operation(&op->nfs_argop4_u.opputfh);
+ case NFS41::OP_PUTPUBFH:
+ break;
+ case NFS41::OP_PUTROOTFH:
+ break;
+ case NFS41::OP_READ:
+ return nfs41_operation(&op->nfs_argop4_u.opread);
+ case NFS41::OP_READDIR:
+ return nfs41_operation(&op->nfs_argop4_u.opreaddir);
+ case NFS41::OP_READLINK:
+ break;
+ case NFS41::OP_REMOVE:
+ return nfs41_operation(&op->nfs_argop4_u.opremove);
+ case NFS41::OP_RENAME:
+ return nfs41_operation(&op->nfs_argop4_u.oprename);
+ case NFS41::OP_RENEW:
+ return nfs41_operation(&op->nfs_argop4_u.oprenew);
+ case NFS41::OP_RESTOREFH:
+ break;
+ case NFS41::OP_SAVEFH:
+ break;
+ case NFS41::OP_SECINFO:
+ return nfs41_operation(&op->nfs_argop4_u.opsecinfo);
+ case NFS41::OP_SETATTR:
+ return nfs41_operation(&op->nfs_argop4_u.opsetattr);
+ case NFS41::OP_SETCLIENTID:
+ return nfs41_operation(&op->nfs_argop4_u.opsetclientid);
+ case NFS41::OP_SETCLIENTID_CONFIRM:
+ return nfs41_operation(&op->nfs_argop4_u.opsetclientid_confirm);
+ case NFS41::OP_VERIFY:
+ return nfs41_operation(&op->nfs_argop4_u.opverify);
+ case NFS41::OP_WRITE:
+ return nfs41_operation(&op->nfs_argop4_u.opwrite);
+ case NFS41::OP_RELEASE_LOCKOWNER:
+ return nfs41_operation(&op->nfs_argop4_u.oprelease_lockowner);
+ case NFS41::OP_BACKCHANNEL_CTL:
+ return nfs41_operation(&op->nfs_argop4_u.opbackchannel_ctl);
+ case NFS41::OP_BIND_CONN_TO_SESSION:
+ return nfs41_operation(&op->nfs_argop4_u.opbind_conn_to_session);
+ case NFS41::OP_EXCHANGE_ID:
+ return nfs41_operation(&op->nfs_argop4_u.opexchange_id);
+ case NFS41::OP_CREATE_SESSION:
+ return nfs41_operation(&op->nfs_argop4_u.opcreate_session);
+ case NFS41::OP_DESTROY_SESSION:
+ return nfs41_operation(&op->nfs_argop4_u.opdestroy_session);
+ case NFS41::OP_FREE_STATEID:
+ return nfs41_operation(&op->nfs_argop4_u.opfree_stateid);
+ case NFS41::OP_GET_DIR_DELEGATION:
+ return nfs41_operation(&op->nfs_argop4_u.opget_dir_delegation);
+ case NFS41::OP_GETDEVICEINFO:
+ return nfs41_operation(&op->nfs_argop4_u.opgetdeviceinfo);
+ case NFS41::OP_GETDEVICELIST:
+ return nfs41_operation(&op->nfs_argop4_u.opgetdevicelist);
+ case NFS41::OP_LAYOUTCOMMIT:
+ return nfs41_operation(&op->nfs_argop4_u.oplayoutcommit);
+ case NFS41::OP_LAYOUTGET:
+ return nfs41_operation(&op->nfs_argop4_u.oplayoutget);
+ case NFS41::OP_LAYOUTRETURN:
+ return nfs41_operation(&op->nfs_argop4_u.oplayoutreturn);
+ case NFS41::OP_SECINFO_NO_NAME:
+ return nfs41_operation(&op->nfs_argop4_u.opsecinfo_no_name);
+ case NFS41::OP_SEQUENCE:
+ return nfs41_operation(&op->nfs_argop4_u.opsequence);
+ case NFS41::OP_SET_SSV:
+ return nfs41_operation(&op->nfs_argop4_u.opset_ssv);
+ case NFS41::OP_TEST_STATEID:
+ return nfs41_operation(&op->nfs_argop4_u.optest_stateid);
+ case NFS41::OP_WANT_DELEGATION:
+ return nfs41_operation(&op->nfs_argop4_u.opwant_delegation);
+ case NFS41::OP_DESTROY_CLIENTID:
+ return nfs41_operation(&op->nfs_argop4_u.opdestroy_clientid);
+ case NFS41::OP_RECLAIM_COMPLETE:
+ return nfs41_operation(&op->nfs_argop4_u.opreclaim_complete);
+ case NFS41::OP_ILLEGAL:
+ break;
+ default:
+ break;
+ }
+ out << " ]";
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::nfs_resop4* op)
+{
+ if (op)
+ {
+ out << print_nfs41_procedures(static_cast<ProcEnumNFS41::NFSProcedure>(op->resop))
+ << '(' << op->resop << ") [ ";
+ switch (op->resop)
+ {
+ case NFS41::OP_ACCESS:
+ return nfs41_operation(&op->nfs_resop4_u.opaccess);
+ case NFS41::OP_CLOSE:
+ return nfs41_operation(&op->nfs_resop4_u.opclose);
+ case NFS41::OP_COMMIT:
+ return nfs41_operation(&op->nfs_resop4_u.opcommit);
+ case NFS41::OP_CREATE:
+ return nfs41_operation(&op->nfs_resop4_u.opcreate);
+ case NFS41::OP_DELEGPURGE:
+ return nfs41_operation(&op->nfs_resop4_u.opdelegpurge);
+ case NFS41::OP_DELEGRETURN:
+ return nfs41_operation(&op->nfs_resop4_u.opdelegreturn);
+ case NFS41::OP_GETATTR:
+ return nfs41_operation(&op->nfs_resop4_u.opgetattr);
+ case NFS41::OP_GETFH:
+ return nfs41_operation(&op->nfs_resop4_u.opgetfh);
+ case NFS41::OP_LINK:
+ return nfs41_operation(&op->nfs_resop4_u.oplink);
+ case NFS41::OP_LOCK:
+ return nfs41_operation(&op->nfs_resop4_u.oplock);
+ case NFS41::OP_LOCKT:
+ return nfs41_operation(&op->nfs_resop4_u.oplockt);
+ case NFS41::OP_LOCKU:
+ return nfs41_operation(&op->nfs_resop4_u.oplocku);
+ case NFS41::OP_LOOKUP:
+ return nfs41_operation(&op->nfs_resop4_u.oplookup);
+ case NFS41::OP_LOOKUPP:
+ return nfs41_operation(&op->nfs_resop4_u.oplookupp);
+ case NFS41::OP_NVERIFY:
+ return nfs41_operation(&op->nfs_resop4_u.opnverify);
+ case NFS41::OP_OPEN:
+ return nfs41_operation(&op->nfs_resop4_u.opopen);
+ case NFS41::OP_OPENATTR:
+ return nfs41_operation(&op->nfs_resop4_u.opopenattr);
+ case NFS41::OP_OPEN_CONFIRM:
+ return nfs41_operation(&op->nfs_resop4_u.opopen_confirm);
+ case NFS41::OP_OPEN_DOWNGRADE:
+ return nfs41_operation(&op->nfs_resop4_u.opopen_downgrade);
+ case NFS41::OP_PUTFH:
+ return nfs41_operation(&op->nfs_resop4_u.opputfh);
+ case NFS41::OP_PUTPUBFH:
+ return nfs41_operation(&op->nfs_resop4_u.opputpubfh);
+ case NFS41::OP_PUTROOTFH:
+ return nfs41_operation(&op->nfs_resop4_u.opputrootfh);
+ case NFS41::OP_READ:
+ return nfs41_operation(&op->nfs_resop4_u.opread);
+ case NFS41::OP_READDIR:
+ return nfs41_operation(&op->nfs_resop4_u.opreaddir);
+ case NFS41::OP_READLINK:
+ return nfs41_operation(&op->nfs_resop4_u.opreadlink);
+ case NFS41::OP_REMOVE:
+ return nfs41_operation(&op->nfs_resop4_u.opremove);
+ case NFS41::OP_RENAME:
+ return nfs41_operation(&op->nfs_resop4_u.oprename);
+ case NFS41::OP_RENEW:
+ return nfs41_operation(&op->nfs_resop4_u.oprenew);
+ case NFS41::OP_RESTOREFH:
+ return nfs41_operation(&op->nfs_resop4_u.oprestorefh);
+ case NFS41::OP_SAVEFH:
+ return nfs41_operation(&op->nfs_resop4_u.opsavefh);
+ case NFS41::OP_SECINFO:
+ return nfs41_operation(&op->nfs_resop4_u.opsecinfo);
+ case NFS41::OP_SETATTR:
+ return nfs41_operation(&op->nfs_resop4_u.opsetattr);
+ case NFS41::OP_SETCLIENTID:
+ return nfs41_operation(&op->nfs_resop4_u.opsetclientid);
+ case NFS41::OP_SETCLIENTID_CONFIRM:
+ return nfs41_operation(&op->nfs_resop4_u.opsetclientid_confirm);
+ case NFS41::OP_VERIFY:
+ return nfs41_operation(&op->nfs_resop4_u.opverify);
+ case NFS41::OP_WRITE:
+ return nfs41_operation(&op->nfs_resop4_u.opwrite);
+ case NFS41::OP_RELEASE_LOCKOWNER:
+ return nfs41_operation(&op->nfs_resop4_u.oprelease_lockowner);
+ case NFS41::OP_BACKCHANNEL_CTL:
+ return nfs41_operation(&op->nfs_resop4_u.opbackchannel_ctl);
+ case NFS41::OP_BIND_CONN_TO_SESSION:
+ return nfs41_operation(&op->nfs_resop4_u.opbind_conn_to_session);
+ case NFS41::OP_EXCHANGE_ID:
+ return nfs41_operation(&op->nfs_resop4_u.opexchange_id);
+ case NFS41::OP_CREATE_SESSION:
+ return nfs41_operation(&op->nfs_resop4_u.opcreate_session);
+ case NFS41::OP_DESTROY_SESSION:
+ return nfs41_operation(&op->nfs_resop4_u.opdestroy_session);
+ case NFS41::OP_FREE_STATEID:
+ return nfs41_operation(&op->nfs_resop4_u.opfree_stateid);
+ case NFS41::OP_GET_DIR_DELEGATION:
+ return nfs41_operation(&op->nfs_resop4_u.opget_dir_delegation);
+ case NFS41::OP_GETDEVICEINFO:
+ return nfs41_operation(&op->nfs_resop4_u.opgetdeviceinfo);
+ case NFS41::OP_GETDEVICELIST:
+ return nfs41_operation(&op->nfs_resop4_u.opgetdevicelist);
+ case NFS41::OP_LAYOUTCOMMIT:
+ return nfs41_operation(&op->nfs_resop4_u.oplayoutcommit);
+ case NFS41::OP_LAYOUTGET:
+ return nfs41_operation(&op->nfs_resop4_u.oplayoutget);
+ case NFS41::OP_LAYOUTRETURN:
+ return nfs41_operation(&op->nfs_resop4_u.oplayoutreturn);
+ case NFS41::OP_SECINFO_NO_NAME:
+ return nfs41_operation(&op->nfs_resop4_u.opsecinfo_no_name);
+ case NFS41::OP_SEQUENCE:
+ return nfs41_operation(&op->nfs_resop4_u.opsequence);
+ case NFS41::OP_SET_SSV:
+ return nfs41_operation(&op->nfs_resop4_u.opset_ssv);
+ case NFS41::OP_TEST_STATEID:
+ return nfs41_operation(&op->nfs_resop4_u.optest_stateid);
+ case NFS41::OP_WANT_DELEGATION:
+ return nfs41_operation(&op->nfs_resop4_u.opwant_delegation);
+ case NFS41::OP_DESTROY_CLIENTID:
+ return nfs41_operation(&op->nfs_resop4_u.opdestroy_clientid);
+ case NFS41::OP_RECLAIM_COMPLETE:
+ return nfs41_operation(&op->nfs_resop4_u.opreclaim_complete);
+ case NFS41::OP_ILLEGAL:
+ return nfs41_operation(&op->nfs_resop4_u.opillegal);
+ default:
+ break;
+ }
+ out << " ]";
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::ACCESS4args* args)
+{
+ if (args)
+ {
+ if ((args->access) & NFS41::ACCESS4_READ) { out << "READ "; }
+ if ((args->access) & NFS41::ACCESS4_LOOKUP) { out << "LOOKUP "; }
+ if ((args->access) & NFS41::ACCESS4_MODIFY) { out << "MODIFY "; }
+ if ((args->access) & NFS41::ACCESS4_EXTEND) { out << "EXTEND "; }
+ if ((args->access) & NFS41::ACCESS4_DELETE) { out << "DELETE "; }
+ if ((args->access) & NFS41::ACCESS4_EXECUTE) { out << "EXECUTE "; }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::ACCESS4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " supported: ";
+ if ((res->ACCESS4res_u.resok4.supported) & NFS41::ACCESS4_READ)
+ {
+ out << "READ ";
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS41::ACCESS4_LOOKUP)
+ {
+ out << "LOOKUP ";
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS41::ACCESS4_MODIFY)
+ {
+ out << "MODIFY ";
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS41::ACCESS4_EXTEND)
+ {
+ out << "EXTEND ";
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS41::ACCESS4_DELETE)
+ {
+ out << "DELETE ";
+ }
+ if ((res->ACCESS4res_u.resok4.supported) & NFS41::ACCESS4_EXECUTE)
+ {
+ out << "EXECUTE ";
+ }
+ out << " access: ";
+ if ((res->ACCESS4res_u.resok4.access) & NFS41::ACCESS4_READ)
+ {
+ out << "READ ";
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS41::ACCESS4_LOOKUP)
+ {
+ out << "LOOKUP ";
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS41::ACCESS4_MODIFY)
+ {
+ out << "MODIFY ";
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS41::ACCESS4_EXTEND)
+ {
+ out << "EXTEND ";
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS41::ACCESS4_DELETE)
+ {
+ out << "DELETE ";
+ }
+ if ((res->ACCESS4res_u.resok4.access) & NFS41::ACCESS4_EXECUTE)
+ {
+ out << "EXECUTE ";
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::CLOSE4args* args)
+{
+ if (args)
+ {
+ out << "seqid: " << std::hex << args->seqid << std::dec
+ << " open state id:" << args->open_stateid;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::CLOSE4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " open state id:" << res->CLOSE4res_u.open_stateid;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::COMMIT4args* args)
+{
+ if (args)
+ {
+ out << "offset: " << args->offset
+ << " count: " << args->count;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::COMMIT4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " write verifier: ";
+ print_hex(out,
+ res->COMMIT4res_u.resok4.writeverf,
+ NFS41::NFS4_VERIFIER_SIZE);
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::CREATE4args* args)
+{
+ if (args)
+ {
+ out << "object type: " << args->objtype
+ << " object name: " << args->objname
+ << " create attributes: " << args->createattrs;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::CREATE4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ out << res->CREATE4res_u.resok4.cinfo << ' '
+ << res->CREATE4res_u.resok4.attrset;
}
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::RESTOREFH4res* res)
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DELEGPURGE4args* args)
+{
+ if (args) { out << "client id: " << std::hex << args->clientid << std::dec; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DELEGPURGE4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DELEGRETURN4args* args)
+{
+ if (args) { out << args->deleg_stateid; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DELEGRETURN4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GETATTR4args* args)
{
- if(res) out << "status: " << res->status;
+ if (args) { out << args->attr_request; }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::SAVEFH4res* res)
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GETATTR4res* res)
{
- if(res) out << "status: " << res->status;
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << ' ' << res->GETATTR4res_u.resok4.obj_attributes;
+ }
+ }
}
-void PrintAnalyzer::nfs4_operation(const struct rpcgen::ILLEGAL4res* res)
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LINK4args* args)
{
- if(res) out << "status: " << res->status;
+ if (args) { out << "new name: " << args->newname; }
}
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LINK4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << ' ' << res->LINK4res_u.resok4.cinfo;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOCK4args* args)
+{
+ if (args)
+ {
+ out << "lock type: " << args->locktype
+ << " reclaim: " << args->reclaim
+ << " offset: " << args->offset
+ << " length: " << args->length
+ << " locker: " << args->locker;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOCK4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all())
+ {
+ switch (res->status)
+ {
+ case NFS41::nfsstat4::NFS4_OK:
+ out << " lock stat id: "
+ << res->LOCK4res_u.resok4.lock_stateid;
+ break;
+ case NFS41::nfsstat4::NFS4ERR_DENIED:
+ out << " offset: " << res->LOCK4res_u.denied.offset
+ << " length: " << res->LOCK4res_u.denied.length
+ << " lock type: " << res->LOCK4res_u.denied.locktype
+ << " owner: " << res->LOCK4res_u.denied.owner;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOCKT4args* args)
+{
+ if (args)
+ {
+ out << "lock type: " << args->locktype
+ << " offset: " << args->offset
+ << " length: " << args->length
+ << " owner: " << args->owner;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOCKT4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4ERR_DENIED)
+ out << " offset: " << res->LOCKT4res_u.denied.offset
+ << " length: " << res->LOCKT4res_u.denied.length
+ << " lock type: " << res->LOCKT4res_u.denied.locktype
+ << " owner: " << res->LOCKT4res_u.denied.owner;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOCKU4args* args)
+{
+ if (args)
+ {
+ out << "lock type: " << args->locktype
+ << " seqid: " << std::hex << args->seqid << std::dec
+ << " lock state id: " << args->lock_stateid
+ << " offset: " << args->offset
+ << " length: " << args->length;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOCKU4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " lock state id: " << res->LOCKU4res_u.lock_stateid;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOOKUP4args* args)
+{
+ if (args) { out << "object name: " << args->objname; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOOKUP4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::NVERIFY4args* args)
+{
+ if (args) { out << "object attributes: " << args->obj_attributes; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::NVERIFY4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPEN4args* args)
+{
+ static const char* const open4_share_access[4] = {"", "READ", "WRITE", "BOTH"};
+ static const char* const open4_share_deny[4] = {"NONE", "READ", "WRITE", "BOTH"};
+
+ if (args)
+ {
+ out << "seqid: " << std::hex << args->seqid << std::dec
+ << " share access: " << open4_share_access[args->share_access]
+ << " share deny: " << open4_share_deny[args->share_deny]
+ << ' ' << args->owner
+ << ' ' << args->openhow
+ << ' ' << args->claim;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPEN4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ out << res->OPEN4res_u.resok4.stateid
+ << res->OPEN4res_u.resok4.cinfo
+ << " results flags: "
+ << std::hex << res->OPEN4res_u.resok4.rflags << std::dec
+ << ' ' << res->OPEN4res_u.resok4.attrset
+ << ' ' << res->OPEN4res_u.resok4.delegation;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPENATTR4args* args)
+{
+ if (args) { out << "create directory: " << args->createdir; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPENATTR4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPEN_CONFIRM4args* args)
+{
+ if (args)
+ {
+ out << "open state id:" << args->open_stateid
+ << " seqid: " << std::hex << args->seqid << std::dec;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPEN_CONFIRM4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " open state id:" << res->OPEN_CONFIRM4res_u.resok4.open_stateid;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPEN_DOWNGRADE4args* args)
+{
+ if (args)
+ {
+ out << " open state id: " << args->open_stateid
+ << " seqid: " << std::hex << args->seqid << std::dec
+ << " share access: " << args->share_access
+ << " share deny: " << args->share_deny;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::OPEN_DOWNGRADE4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << ' ' << res->OPEN_DOWNGRADE4res_u.resok4.open_stateid;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::PUTFH4args* args)
+{
+ if (args)
+ {
+ out << "object: ";
+ print_nfs_fh(out, args->object.nfs_fh4_val, args->object.nfs_fh4_len);
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::PUTFH4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::READ4args* args)
+{
+ if (args)
+ {
+ out << args->stateid
+ << " offset: " << args->offset
+ << " count: " << args->count;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::READ4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " eof: " << res->READ4res_u.resok4.eof;
+ if (res->READ4res_u.resok4.data.data_len)
+ {
+ out << " data: " << *res->READ4res_u.resok4.data.data_val;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::READDIR4args* args)
+{
+ if (args)
+ {
+ out << "cookie: " << args->cookie
+ << " cookieverf: " << args->cookieverf
+ << " dir count: " << args->dircount
+ << " max count: " << args->maxcount
+ << " attributes request: " << args->attr_request;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::READDIR4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ out << " cookie verifier: " << res->READDIR4res_u.resok4.cookieverf
+ << " reply: " << res->READDIR4res_u.resok4.reply;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::REMOVE4args* args)
+{
+ if (args) { out << "target: " << args->target; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::REMOVE4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << ' ' << res->REMOVE4res_u.resok4.cinfo;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RENAME4args* args)
+{
+ if (args)
+ {
+ out << "old name: " << args->oldname
+ << " new name: " << args->newname;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RENAME4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ out << " source: "
+ << res->RENAME4res_u.resok4.source_cinfo
+ << " target: "
+ << res->RENAME4res_u.resok4.target_cinfo;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RENEW4args* args)
+{
+ if (args)
+ {
+ out << "client id: "
+ << std::hex << args->clientid << std::dec;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RENEW4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SECINFO4args* args)
+{
+ if (args) { out << "name: " << args->name; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SECINFO4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ if (res->SECINFO4res_u.resok4.SECINFO4resok_len)
+ {
+ out << *res->SECINFO4res_u.resok4.SECINFO4resok_val;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SETATTR4args* args)
+{
+ if (args)
+ {
+ out << "state id:" << args->stateid
+ << ' ' << args->obj_attributes;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SETATTR4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all()) { out << ' ' << res->attrsset; }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SETCLIENTID4args* args)
+{
+ if (args)
+ {
+ out << args->client
+ << " callback: "
+ << args->callback
+ << " callback ident: "
+ << std::hex << args->callback_ident << std::dec;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SETCLIENTID4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all())
+ {
+ switch (res->status)
+ {
+ case NFS41::nfsstat4::NFS4_OK:
+ out << " client id: "
+ << std::hex << res->SETCLIENTID4res_u.resok4.clientid << std::dec
+ << " verifier: ";
+ print_hex(out,
+ res->SETCLIENTID4res_u.resok4.setclientid_confirm,
+ NFS41::NFS4_VERIFIER_SIZE);
+ break;
+ case NFS41::nfsstat4::NFS4ERR_CLID_INUSE:
+ out << " client using: " << res->SETCLIENTID4res_u.client_using;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SETCLIENTID_CONFIRM4args* args)
+{
+ if (args)
+ {
+ out << " client id: " << std::hex << args->clientid << std::dec
+ << " verifier: ";
+ print_hex(out, args->setclientid_confirm, NFS41::NFS4_VERIFIER_SIZE);
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SETCLIENTID_CONFIRM4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::VERIFY4args* args)
+{
+ if (args) { out << "object attributes: " << args->obj_attributes; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::VERIFY4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::WRITE4args* args)
+{
+ if (args)
+ {
+ out << args->stateid
+ << " offset: " << args->offset
+ << " stable: " << args->stable
+ << " data length: " << args->data.data_len;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::WRITE4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " count: " << res->WRITE4res_u.resok4.count
+ << " committed: " << res->WRITE4res_u.resok4.committed
+ << " write verifier: ";
+ print_hex(out,
+ res->WRITE4res_u.resok4.writeverf,
+ NFS41::NFS4_VERIFIER_SIZE);
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RELEASE_LOCKOWNER4args* args)
+{
+ if (args) { out << "lock owner: " << args->lock_owner; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RELEASE_LOCKOWNER4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GETFH4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " object: " << res->GETFH4res_u.resok4.object;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LOOKUPP4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::PUTPUBFH4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::PUTROOTFH4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::READLINK4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->status;
+ if (out_all() && res->status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " link: " << res->READLINK4res_u.resok4.link;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RESTOREFH4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SAVEFH4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GET_DIR_DELEGATION4args* args)
+{
+ if (args)
+ out << "signal delegation available: " << args->gdda_signal_deleg_avail
+ << " notification types: " << args->gdda_notification_types
+ << " child attr delay: " << args->gdda_child_attr_delay
+ << " dir attr delay: " << args->gdda_dir_attr_delay
+ << " child child attributes: " << args->gdda_child_attributes
+ << " child dir attributes: " << args->gdda_dir_attributes;
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GET_DIR_DELEGATION4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->gddr_status;
+ if (out_all() && res->gddr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " status: " << res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.gddrnf_status;
+ if (out_all() && res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.gddrnf_status == NFS41::gddrnf4_status::GDD4_OK)
+ {
+ out << " cookieverf: ";
+ print_hex(out,
+ res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_resok4.gddr_cookieverf,
+ NFS41::NFS4_VERIFIER_SIZE);
+ out << " stateid: "
+ << res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_resok4.gddr_stateid
+ << " notification: "
+ << res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_resok4.gddr_notification
+ << " child attributes: "
+ << res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_resok4.gddr_child_attributes
+ << " dir attributes: "
+ << res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_resok4.gddr_dir_attributes;
+ }
+ else
+ {
+ out << " will signal deleg avail: "
+ << res->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4.GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_will_signal_deleg_avail;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::BACKCHANNEL_CTL4args* args)
+{
+ if (args)
+ {
+ out << "program: " << args->bca_cb_program
+ << " sec parms: ";
+ NFS41::callback_sec_parms4* current_el {args->bca_sec_parms.bca_sec_parms_val};
+ for (u_int i {0}; i < args->bca_sec_parms.bca_sec_parms_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::BACKCHANNEL_CTL4res* res)
+{
+ if (res) { out << "status: " << res->bcr_status; }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::BIND_CONN_TO_SESSION4args* args)
+{
+ if (args)
+ {
+ out << "sessid: ";
+ print_hex(out,
+ args->bctsa_sessid,
+ NFS41::NFS4_SESSIONID_SIZE);
+ out << " dir: " << args->bctsa_dir
+ << " use conn in rdma mode: " << args->bctsa_use_conn_in_rdma_mode;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::BIND_CONN_TO_SESSION4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->bctsr_status;
+ if (out_all() && res->bctsr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " sessid: ";
+ print_hex(out,
+ res->BIND_CONN_TO_SESSION4res_u.bctsr_resok4.bctsr_sessid,
+ NFS41::NFS4_SESSIONID_SIZE);
+ out << " dir: "
+ << res->BIND_CONN_TO_SESSION4res_u.bctsr_resok4.bctsr_dir
+ << " use conn in rdma mode: "
+ << res->BIND_CONN_TO_SESSION4res_u.bctsr_resok4.bctsr_use_conn_in_rdma_mode;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::EXCHANGE_ID4args* args)
+{
+ if (args)
+ {
+ out << "client owner: " << args->eia_clientowner
+ << " flags: " << args->eia_flags
+ << " state protect: " << args->eia_state_protect
+ << " client impl id: ";
+ NFS41::nfs_impl_id4* current_el {args->eia_client_impl_id.eia_client_impl_id_val};
+ for (u_int i {0}; i < args->eia_client_impl_id.eia_client_impl_id_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::EXCHANGE_ID4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->eir_status;
+ if (out_all() && res->eir_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " clientid: " << res->EXCHANGE_ID4res_u.eir_resok4.eir_clientid
+ << " sequenceid: 0x" << std::hex << res->EXCHANGE_ID4res_u.eir_resok4.eir_sequenceid << std::dec
+ << " flags: " << res->EXCHANGE_ID4res_u.eir_resok4.eir_flags
+ << " state protect: " << res->EXCHANGE_ID4res_u.eir_resok4.eir_state_protect
+ << " server owner: " << res->EXCHANGE_ID4res_u.eir_resok4.eir_server_owner
+ << " server scope: ";
+ print_hex(out,
+ res->EXCHANGE_ID4res_u.eir_resok4.eir_server_scope.eir_server_scope_val,
+ res->EXCHANGE_ID4res_u.eir_resok4.eir_server_scope.eir_server_scope_len);
+ out << " server impl id:";
+ NFS41::nfs_impl_id4* current_el {res->EXCHANGE_ID4res_u.eir_resok4.eir_server_impl_id.eir_server_impl_id_val};
+ for (u_int i {0}; i < res->EXCHANGE_ID4res_u.eir_resok4.eir_server_impl_id.eir_server_impl_id_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::CREATE_SESSION4args* args)
+{
+ if (args)
+ {
+ out << "clientid: 0x" << std::hex << args->csa_clientid
+ << "; seqid: 0x" << std::hex << args->csa_sequence << std::dec
+ << "; flags: " << args->csa_flags
+ << "; fore chan attrs: [ " << args->csa_fore_chan_attrs << " ] "
+ << "; fore back attrs: [ " << args->csa_back_chan_attrs << " ] "
+ << "; cb program: 0x" << std::hex << args->csa_cb_program << std::dec
+ << "; callback sec parms:";
+ NFS41::callback_sec_parms4* current_el {args->csa_sec_parms.csa_sec_parms_val};
+ for (u_int i {0}; i < args->csa_sec_parms.csa_sec_parms_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::CREATE_SESSION4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->csr_status;
+ if (out_all() && res->csr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " session id: ";
+ print_hex(out,
+ res->CREATE_SESSION4res_u.csr_resok4.csr_sessionid,
+ NFS41::NFS4_SESSIONID_SIZE);
+ out << " sequenceid: 0x" << std::hex << res->CREATE_SESSION4res_u.csr_resok4.csr_sequence << std::dec
+ << " flags: " << res->CREATE_SESSION4res_u.csr_resok4.csr_flags
+ << " fore chan attrs: " << res->CREATE_SESSION4res_u.csr_resok4.csr_fore_chan_attrs
+ << " fore back attrs: " << res->CREATE_SESSION4res_u.csr_resok4.csr_back_chan_attrs;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DESTROY_SESSION4args* args)
+{
+ if (args)
+ {
+ out << "session id: ";
+ print_hex(out,
+ args->dsa_sessionid,
+ NFS41::NFS4_SESSIONID_SIZE);
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DESTROY_SESSION4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->dsr_status;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::FREE_STATEID4args* args)
+{
+ if (args)
+ {
+ out << "stateid: " << args->fsa_stateid;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::FREE_STATEID4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->fsr_status;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GETDEVICEINFO4args* args)
+{
+ if (args)
+ {
+ out << "device id: " << args->gdia_device_id
+ << " layout type: " << args->gdia_layout_type
+ << " maxcount: " << args->gdia_maxcount
+ << " notify types: " << args->gdia_notify_types;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GETDEVICEINFO4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->gdir_status;
+ if (out_all())
+ {
+ if (res->gdir_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " device addr: " << res->GETDEVICEINFO4res_u.gdir_resok4.gdir_device_addr
+ << " notification: " << res->GETDEVICEINFO4res_u.gdir_resok4.gdir_notification;
+ }
+ if (res->gdir_status == NFS41::nfsstat4::NFS4ERR_TOOSMALL)
+ {
+ out << " min count: " << res->GETDEVICEINFO4res_u.gdir_mincount;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GETDEVICELIST4args* args)
+{
+ if (args)
+ {
+ out << "layout type: " << args->gdla_layout_type
+ << " max devices: " << args->gdla_maxdevices
+ << " cookie: " << args->gdla_cookie
+ << " cookieverf: " << args->gdla_cookieverf;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::GETDEVICELIST4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->gdlr_status;
+ if (out_all() && res->gdlr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " cookie: " << res->GETDEVICELIST4res_u.gdlr_resok4.gdlr_cookie
+ << " cookieverf: " << res->GETDEVICELIST4res_u.gdlr_resok4.gdlr_cookieverf
+ << " device id list: ";
+ NFS41::deviceid4* current_el {res->GETDEVICELIST4res_u.gdlr_resok4.gdlr_deviceid_list.gdlr_deviceid_list_val};
+ for (u_int i {0}; i < res->GETDEVICELIST4res_u.gdlr_resok4.gdlr_deviceid_list.gdlr_deviceid_list_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ out << " eof: " << res->GETDEVICELIST4res_u.gdlr_resok4.gdlr_eof;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LAYOUTCOMMIT4args* args)
+{
+ if (args)
+ {
+ out << "offset: " << args->loca_offset
+ << " length: " << args->loca_length
+ << " reclaim: " << args->loca_reclaim
+ << " stateid: " << args->loca_stateid
+ << " last write offset: " << args->loca_last_write_offset
+ << " time modify: " << args->loca_time_modify
+ << " tayout update: " << args->loca_layoutupdate;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LAYOUTCOMMIT4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->locr_status;
+ if (out_all() && res->locr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " new size: " << res->LAYOUTCOMMIT4res_u.locr_resok4.locr_newsize;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LAYOUTGET4args* args)
+{
+ if (args)
+ {
+ out << "signal layout avail: " << args->loga_signal_layout_avail
+ << " layout type: " << args->loga_layout_type
+ << " iomode: " << args->loga_iomode
+ << " offset: " << args->loga_offset
+ << " length: " << args->loga_length
+ << " minlength: " << args->loga_minlength
+ << " stateid: " << args->loga_stateid
+ << " maxcount: " << args->loga_maxcount;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LAYOUTGET4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->logr_status;
+ if (out_all())
+ {
+ if (res->logr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " return on close: "
+ << res->LAYOUTGET4res_u.logr_resok4.logr_return_on_close
+ << " stateid: "
+ << res->LAYOUTGET4res_u.logr_resok4.logr_stateid
+ << " layout:x ";
+ NFS41::layout4* current_el = res->LAYOUTGET4res_u.logr_resok4.logr_layout.logr_layout_val;
+ for (u_int i {0}; i < res->LAYOUTGET4res_u.logr_resok4.logr_layout.logr_layout_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+ }
+ if (res->logr_status == NFS41::nfsstat4::NFS4ERR_LAYOUTTRYLATER)
+ {
+ out << "will signal layout avail: "
+ << res->LAYOUTGET4res_u.logr_will_signal_layout_avail;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LAYOUTRETURN4args* args)
+{
+ if (args)
+ {
+ out << "reclaim: " << args->lora_reclaim
+ << " layout type: " << args->lora_layout_type
+ << " iomode: " << args->lora_iomode
+ << " layout return: " << args->lora_layoutreturn;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::LAYOUTRETURN4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->lorr_status;
+ if (out_all() && res->lorr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " stateid: " << res->LAYOUTRETURN4res_u.lorr_stateid;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SEQUENCE4args* args)
+{
+ if (args)
+ {
+ out << "sessionid: ";
+ print_hex(out,
+ args->sa_sessionid,
+ NFS41::NFS4_SESSIONID_SIZE);
+ out << " sequenceid: 0x" << std::hex << args->sa_sequenceid << std::dec
+ << " slotid: " << args->sa_slotid
+ << " cache this: " << args->sa_cachethis;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SEQUENCE4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->sr_status;
+ if (out_all() && res->sr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " session: ";
+ print_hex(out,
+ res->SEQUENCE4res_u.sr_resok4.sr_sessionid,
+ NFS41::NFS4_SESSIONID_SIZE);
+ out << " sequenceid: 0x" << std::hex << res->SEQUENCE4res_u.sr_resok4.sr_sequenceid << std::dec
+ << " slotid: " << res->SEQUENCE4res_u.sr_resok4.sr_slotid
+ << " highest slotid: " << res->SEQUENCE4res_u.sr_resok4.sr_highest_slotid
+ << " target highest slotid: " << res->SEQUENCE4res_u.sr_resok4.sr_target_highest_slotid
+ << " status flags: " << res->SEQUENCE4res_u.sr_resok4.sr_status_flags;
+ }
+ }
+}
+
+//SECINFO_NO_NAME4args
+void PrintAnalyzer::nfs41_operation(const enum NFS41::secinfo_style4* args)
+{
+ if (args)
+ {
+ out << ' ' << *args;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SET_SSV4args* args)
+{
+ if (args)
+ {
+ out << "ssv: ";
+ out.write(args->ssa_ssv.ssa_ssv_val,
+ args->ssa_ssv.ssa_ssv_len);
+ out << " digest: ";
+ out.write(args->ssa_digest.ssa_digest_val,
+ args->ssa_digest.ssa_digest_len);
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::SET_SSV4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->ssr_status;
+ if (out_all() && res->ssr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " digest: ";
+ out.write(res->SET_SSV4res_u.ssr_resok4.ssr_digest.ssr_digest_val,
+ res->SET_SSV4res_u.ssr_resok4.ssr_digest.ssr_digest_len);
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::TEST_STATEID4args* args)
+{
+ if (args)
+ {
+ out << "stateids:";
+ NFS41::stateid4* current_el = args->ts_stateids.ts_stateids_val;
+ for (u_int i {0}; i < args->ts_stateids.ts_stateids_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::TEST_STATEID4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->tsr_status;
+ if (out_all() && res->tsr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << " status codes: ";
+ NFS41::nfsstat4* current_el = res->TEST_STATEID4res_u.tsr_resok4.tsr_status_codes.tsr_status_codes_val;
+ for (u_int i {0}; i < res->TEST_STATEID4res_u.tsr_resok4.tsr_status_codes.tsr_status_codes_len; i++, current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::WANT_DELEGATION4args* args)
+{
+ if (args)
+ {
+ out << "want: " << args->wda_want
+ << " claim: " << args->wda_claim;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::WANT_DELEGATION4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->wdr_status;
+ if (out_all() && res->wdr_status == NFS41::nfsstat4::NFS4_OK)
+ {
+ out << res->WANT_DELEGATION4res_u.wdr_resok4;
+ }
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DESTROY_CLIENTID4args* args)
+{
+ if (args)
+ {
+ out << "clientid: " << args->dca_clientid;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::DESTROY_CLIENTID4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->dcr_status;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RECLAIM_COMPLETE4args* args)
+{
+ if (args)
+ {
+ out << "one fs: " << args->rca_one_fs;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::RECLAIM_COMPLETE4res* res)
+{
+ if (res)
+ {
+ out << "status: " << res->rcr_status;
+ }
+}
+
+void PrintAnalyzer::nfs41_operation(const struct NFS41::ILLEGAL4res* res)
+{
+ if (res) { out << "status: " << res->status; }
+}
+
+
void PrintAnalyzer::flush_statistics()
{
// flush is in each handler
diff --git a/src/analysis/print_analyzer.h b/src/analysis/print_analyzer.h
index 6eac483..ba7e613 100644
--- a/src/analysis/print_analyzer.h
+++ b/src/analysis/print_analyzer.h
@@ -31,6 +31,10 @@ namespace NST
namespace analysis
{
+namespace NFS3 = NST::API::NFS3;
+namespace NFS4 = NST::API::NFS4;
+namespace NFS41 = NST::API::NFS41;
+
class PrintAnalyzer : public IAnalyzer
{
public:
@@ -41,191 +45,417 @@ public:
{
}
- void null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL3args*,
- const struct rpcgen::NULL3res*) override final;
- void getattr3(const struct RPCProcedure* proc,
- const struct rpcgen::GETATTR3args* args,
- const struct rpcgen::GETATTR3res* res) override final;
- void setattr3(const struct RPCProcedure* proc,
- const struct rpcgen::SETATTR3args* args,
- const struct rpcgen::SETATTR3res* res) override final;
- void lookup3(const struct RPCProcedure* proc,
- const struct rpcgen::LOOKUP3args* args,
- const struct rpcgen::LOOKUP3res* res) override final;
- void access3(const struct RPCProcedure* proc,
- const struct rpcgen::ACCESS3args* args,
- const struct rpcgen::ACCESS3res* res) override final;
- void readlink3(const struct RPCProcedure* proc,
- const struct rpcgen::READLINK3args* args,
- const struct rpcgen::READLINK3res* res) override final;
- void read3(const struct RPCProcedure* proc,
- const struct rpcgen::READ3args* args,
- const struct rpcgen::READ3res* res) override final;
- void write3(const struct RPCProcedure* proc,
- const struct rpcgen::WRITE3args* args,
- const struct rpcgen::WRITE3res* res) override final;
- void create3(const struct RPCProcedure* proc,
- const struct rpcgen::CREATE3args* args,
- const struct rpcgen::CREATE3res* res) override final;
- void mkdir3(const struct RPCProcedure* proc,
- const struct rpcgen::MKDIR3args* args,
- const struct rpcgen::MKDIR3res* res) override final;
- void symlink3(const struct RPCProcedure* proc,
- const struct rpcgen::SYMLINK3args* args,
- const struct rpcgen::SYMLINK3res* res) override final;
- void mknod3(const struct RPCProcedure* proc,
- const struct rpcgen::MKNOD3args* args,
- const struct rpcgen::MKNOD3res* res) override final;
- void remove3(const struct RPCProcedure* proc,
- const struct rpcgen::REMOVE3args* args,
- const struct rpcgen::REMOVE3res* res) override final;
- void rmdir3(const struct RPCProcedure* proc,
- const struct rpcgen::RMDIR3args* args,
- const struct rpcgen::RMDIR3res* res) override final;
- void rename3(const struct RPCProcedure* proc,
- const struct rpcgen::RENAME3args* args,
- const struct rpcgen::RENAME3res* res) override final;
- void link3(const struct RPCProcedure* proc,
- const struct rpcgen::LINK3args* args,
- const struct rpcgen::LINK3res* res) override final;
- void readdir3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIR3args* args,
- const struct rpcgen::READDIR3res* res) override final;
- void readdirplus3(const struct RPCProcedure* proc,
- const struct rpcgen::READDIRPLUS3args* args,
- const struct rpcgen::READDIRPLUS3res* res) override final;
- void fsstat3(const struct RPCProcedure* proc,
- const struct rpcgen::FSSTAT3args* args,
- const struct rpcgen::FSSTAT3res* res) override final;
- void fsinfo3(const struct RPCProcedure* proc,
- const struct rpcgen::FSINFO3args* args,
- const struct rpcgen::FSINFO3res* res) override final;
- void pathconf3(const struct RPCProcedure* proc,
- const struct rpcgen::PATHCONF3args* args,
- const struct rpcgen::PATHCONF3res* res) override final;
- void commit3(const struct RPCProcedure* proc,
- const struct rpcgen::COMMIT3args* args,
- const struct rpcgen::COMMIT3res* res) override final;
-
- void null(const struct RPCProcedure* proc,
- const struct rpcgen::NULL4args* args,
- const struct rpcgen::NULL4res* res) override final;
- void compound4(const struct RPCProcedure* proc,
- const struct rpcgen::COMPOUND4args* args,
- const struct rpcgen::COMPOUND4res* res) override final;
-
- void nfs4_operation(const struct rpcgen::nfs_argop4* op);
- void nfs4_operation(const struct rpcgen::nfs_resop4* op);
-
- void nfs4_operation(const struct rpcgen::ACCESS4args* args);
- void nfs4_operation(const struct rpcgen::ACCESS4res* res );
-
- void nfs4_operation(const struct rpcgen::CLOSE4args* args);
- void nfs4_operation(const struct rpcgen::CLOSE4res* res );
-
- void nfs4_operation(const struct rpcgen::COMMIT4args* args);
- void nfs4_operation(const struct rpcgen::COMMIT4res* res );
-
- void nfs4_operation(const struct rpcgen::CREATE4args* args);
- void nfs4_operation(const struct rpcgen::CREATE4res* res );
-
- void nfs4_operation(const struct rpcgen::DELEGPURGE4args* args);
- void nfs4_operation(const struct rpcgen::DELEGPURGE4res* res );
-
- void nfs4_operation(const struct rpcgen::DELEGRETURN4args* args);
- void nfs4_operation(const struct rpcgen::DELEGRETURN4res* res );
-
- void nfs4_operation(const struct rpcgen::GETATTR4args* args);
- void nfs4_operation(const struct rpcgen::GETATTR4res* res );
-
- void nfs4_operation(const struct rpcgen::LINK4args* args);
- void nfs4_operation(const struct rpcgen::LINK4res* res );
-
- void nfs4_operation(const struct rpcgen::LOCK4args* args);
- void nfs4_operation(const struct rpcgen::LOCK4res* res );
-
- void nfs4_operation(const struct rpcgen::LOCKT4args* args);
- void nfs4_operation(const struct rpcgen::LOCKT4res* res );
-
- void nfs4_operation(const struct rpcgen::LOCKU4args* args);
- void nfs4_operation(const struct rpcgen::LOCKU4res* res );
-
- void nfs4_operation(const struct rpcgen::LOOKUP4args* args);
- void nfs4_operation(const struct rpcgen::LOOKUP4res* res );
-
- void nfs4_operation(const struct rpcgen::NVERIFY4args* args);
- void nfs4_operation(const struct rpcgen::NVERIFY4res* res );
-
- void nfs4_operation(const struct rpcgen::OPEN4args* args);
- void nfs4_operation(const struct rpcgen::OPEN4res* res );
+ void closeFileSMBv2(const SMBv2::CloseFileCommand*,
+ const SMBv2::CloseRequest*,
+ const SMBv2::CloseResponse*) override final;
+ void negotiateSMBv2(const SMBv2::NegotiateCommand*,
+ const SMBv2::NegotiateRequest*,
+ const SMBv2::NegotiateResponse*) override final;
+ void sessionSetupSMBv2(const SMBv2::SessionSetupCommand*,
+ const SMBv2::SessionSetupRequest*,
+ const SMBv2::SessionSetupResponse*) override final;
+ void logOffSMBv2(const SMBv2::LogOffCommand*,
+ const SMBv2::LogOffRequest*,
+ const SMBv2::LogOffResponse*) override final;
+ void treeConnectSMBv2(const SMBv2::TreeConnectCommand*,
+ const SMBv2::TreeConnectRequest*,
+ const SMBv2::TreeConnectResponse*) override final;
+ void treeDisconnectSMBv2(const SMBv2::TreeDisconnectCommand*,
+ const SMBv2::TreeDisconnectRequest*,
+ const SMBv2::TreeDisconnectResponse*) override final;
+ void createSMBv2(const SMBv2::CreateCommand*,
+ const SMBv2::CreateRequest*,
+ const SMBv2::CreateResponse*) override final;
+ void flushSMBv2(const SMBv2::FlushCommand*,
+ const SMBv2::FlushRequest*,
+ const SMBv2::FlushResponse*) override final;
+ void readSMBv2(const SMBv2::ReadCommand*,
+ const SMBv2::ReadRequest*,
+ const SMBv2::ReadResponse*) override final;
+ void writeSMBv2(const SMBv2::WriteCommand*,
+ const SMBv2::WriteRequest*,
+ const SMBv2::WriteResponse*) override final;
+ void lockSMBv2(const SMBv2::LockCommand*,
+ const SMBv2::LockRequest*,
+ const SMBv2::LockResponse*) override final;
+ void ioctlSMBv2(const SMBv2::IoctlCommand*,
+ const SMBv2::IoCtlRequest*,
+ const SMBv2::IoCtlResponse*) override final;
+ void cancelSMBv2(const SMBv2::CancelCommand*,
+ const SMBv2::CancelRequest*,
+ const SMBv2::CancelResponce*) override final;
+ void echoSMBv2(const SMBv2::EchoCommand*,
+ const SMBv2::EchoRequest*,
+ const SMBv2::EchoResponse*) override final;
+ void queryDirSMBv2(const SMBv2::QueryDirCommand*,
+ const SMBv2::QueryDirRequest*,
+ const SMBv2::QueryDirResponse*) override final;
+ void changeNotifySMBv2(const SMBv2::ChangeNotifyCommand*,
+ const SMBv2::ChangeNotifyRequest*,
+ const SMBv2::ChangeNotifyResponse*) override final;
+ void queryInfoSMBv2(const SMBv2::QueryInfoCommand*,
+ const SMBv2::QueryInfoRequest*,
+ const SMBv2::QueryInfoResponse*) override final;
+ void setInfoSMBv2(const SMBv2::SetInfoCommand*,
+ const SMBv2::SetInfoRequest*,
+ const SMBv2::SetInfoResponse*) override final;
+ void breakOplockSMBv2(const SMBv2::BreakOpLockCommand*,
+ const SMBv2::OplockAcknowledgment*,
+ const SMBv2::OplockResponse*) override final;
+ void null(const RPCProcedure* proc,
+ const struct NFS3::NULL3args*,
+ const struct NFS3::NULL3res*) override final;
+ void getattr3(const RPCProcedure* proc,
+ const struct NFS3::GETATTR3args* args,
+ const struct NFS3::GETATTR3res* res) override final;
+ void setattr3(const RPCProcedure* proc,
+ const struct NFS3::SETATTR3args* args,
+ const struct NFS3::SETATTR3res* res) override final;
+ void lookup3(const RPCProcedure* proc,
+ const struct NFS3::LOOKUP3args* args,
+ const struct NFS3::LOOKUP3res* res) override final;
+ void access3(const RPCProcedure* proc,
+ const struct NFS3::ACCESS3args* args,
+ const struct NFS3::ACCESS3res* res) override final;
+ void readlink3(const RPCProcedure* proc,
+ const struct NFS3::READLINK3args* args,
+ const struct NFS3::READLINK3res* res) override final;
+ void read3(const RPCProcedure* proc,
+ const struct NFS3::READ3args* args,
+ const struct NFS3::READ3res* res) override final;
+ void write3(const RPCProcedure* proc,
+ const struct NFS3::WRITE3args* args,
+ const struct NFS3::WRITE3res* res) override final;
+ void create3(const RPCProcedure* proc,
+ const struct NFS3::CREATE3args* args,
+ const struct NFS3::CREATE3res* res) override final;
+ void mkdir3(const RPCProcedure* proc,
+ const struct NFS3::MKDIR3args* args,
+ const struct NFS3::MKDIR3res* res) override final;
+ void symlink3(const RPCProcedure* proc,
+ const struct NFS3::SYMLINK3args* args,
+ const struct NFS3::SYMLINK3res* res) override final;
+ void mknod3(const RPCProcedure* proc,
+ const struct NFS3::MKNOD3args* args,
+ const struct NFS3::MKNOD3res* res) override final;
+ void remove3(const RPCProcedure* proc,
+ const struct NFS3::REMOVE3args* args,
+ const struct NFS3::REMOVE3res* res) override final;
+ void rmdir3(const RPCProcedure* proc,
+ const struct NFS3::RMDIR3args* args,
+ const struct NFS3::RMDIR3res* res) override final;
+ void rename3(const RPCProcedure* proc,
+ const struct NFS3::RENAME3args* args,
+ const struct NFS3::RENAME3res* res) override final;
+ void link3(const RPCProcedure* proc,
+ const struct NFS3::LINK3args* args,
+ const struct NFS3::LINK3res* res) override final;
+ void readdir3(const RPCProcedure* proc,
+ const struct NFS3::READDIR3args* args,
+ const struct NFS3::READDIR3res* res) override final;
+ void readdirplus3(const RPCProcedure* proc,
+ const struct NFS3::READDIRPLUS3args* args,
+ const struct NFS3::READDIRPLUS3res* res) override final;
+ void fsstat3(const RPCProcedure* proc,
+ const struct NFS3::FSSTAT3args* args,
+ const struct NFS3::FSSTAT3res* res) override final;
+ void fsinfo3(const RPCProcedure* proc,
+ const struct NFS3::FSINFO3args* args,
+ const struct NFS3::FSINFO3res* res) override final;
+ void pathconf3(const RPCProcedure* proc,
+ const struct NFS3::PATHCONF3args* args,
+ const struct NFS3::PATHCONF3res* res) override final;
+ void commit3(const RPCProcedure* proc,
+ const struct NFS3::COMMIT3args* args,
+ const struct NFS3::COMMIT3res* res) override final;
+
+ void null4(const RPCProcedure* proc,
+ const struct NFS4::NULL4args* args,
+ const struct NFS4::NULL4res* res) override final;
+ void compound4(const RPCProcedure* proc,
+ const struct NFS4::COMPOUND4args* args,
+ const struct NFS4::COMPOUND4res* res) override final;
+
+ void nfs4_operation(const struct NFS4::nfs_argop4* op);
+ void nfs4_operation(const struct NFS4::nfs_resop4* op);
+
+ void nfs4_operation(const struct NFS4::ACCESS4args* args);
+ void nfs4_operation(const struct NFS4::ACCESS4res* res );
+
+ void nfs4_operation(const struct NFS4::CLOSE4args* args);
+ void nfs4_operation(const struct NFS4::CLOSE4res* res );
+
+ void nfs4_operation(const struct NFS4::COMMIT4args* args);
+ void nfs4_operation(const struct NFS4::COMMIT4res* res );
+
+ void nfs4_operation(const struct NFS4::CREATE4args* args);
+ void nfs4_operation(const struct NFS4::CREATE4res* res );
+
+ void nfs4_operation(const struct NFS4::DELEGPURGE4args* args);
+ void nfs4_operation(const struct NFS4::DELEGPURGE4res* res );
+
+ void nfs4_operation(const struct NFS4::DELEGRETURN4args* args);
+ void nfs4_operation(const struct NFS4::DELEGRETURN4res* res );
+
+ void nfs4_operation(const struct NFS4::GETATTR4args* args);
+ void nfs4_operation(const struct NFS4::GETATTR4res* res );
+
+ void nfs4_operation(const struct NFS4::LINK4args* args);
+ void nfs4_operation(const struct NFS4::LINK4res* res );
+
+ void nfs4_operation(const struct NFS4::LOCK4args* args);
+ void nfs4_operation(const struct NFS4::LOCK4res* res );
+
+ void nfs4_operation(const struct NFS4::LOCKT4args* args);
+ void nfs4_operation(const struct NFS4::LOCKT4res* res );
+
+ void nfs4_operation(const struct NFS4::LOCKU4args* args);
+ void nfs4_operation(const struct NFS4::LOCKU4res* res );
+
+ void nfs4_operation(const struct NFS4::LOOKUP4args* args);
+ void nfs4_operation(const struct NFS4::LOOKUP4res* res );
+
+ void nfs4_operation(const struct NFS4::NVERIFY4args* args);
+ void nfs4_operation(const struct NFS4::NVERIFY4res* res );
+
+ void nfs4_operation(const struct NFS4::OPEN4args* args);
+ void nfs4_operation(const struct NFS4::OPEN4res* res );
+
+ void nfs4_operation(const struct NFS4::OPENATTR4args* args);
+ void nfs4_operation(const struct NFS4::OPENATTR4res* res );
+
+ void nfs4_operation(const struct NFS4::OPEN_CONFIRM4args* args);
+ void nfs4_operation(const struct NFS4::OPEN_CONFIRM4res* res );
+
+ void nfs4_operation(const struct NFS4::OPEN_DOWNGRADE4args* args);
+ void nfs4_operation(const struct NFS4::OPEN_DOWNGRADE4res* res );
+
+ void nfs4_operation(const struct NFS4::PUTFH4args* args);
+ void nfs4_operation(const struct NFS4::PUTFH4res* res );
+
+ void nfs4_operation(const struct NFS4::READ4args* args);
+ void nfs4_operation(const struct NFS4::READ4res* res );
+
+ void nfs4_operation(const struct NFS4::READDIR4args* args);
+ void nfs4_operation(const struct NFS4::READDIR4res* res );
+
+ void nfs4_operation(const struct NFS4::REMOVE4args* args);
+ void nfs4_operation(const struct NFS4::REMOVE4res* res );
+
+ void nfs4_operation(const struct NFS4::RENAME4args* args);
+ void nfs4_operation(const struct NFS4::RENAME4res* res );
+
+ void nfs4_operation(const struct NFS4::RENEW4args* args);
+ void nfs4_operation(const struct NFS4::RENEW4res* res );
+
+ void nfs4_operation(const struct NFS4::SECINFO4args* args);
+ void nfs4_operation(const struct NFS4::SECINFO4res* res );
+
+ void nfs4_operation(const struct NFS4::SETATTR4args* args);
+ void nfs4_operation(const struct NFS4::SETATTR4res* res );
+
+ void nfs4_operation(const struct NFS4::SETCLIENTID4args* args);
+ void nfs4_operation(const struct NFS4::SETCLIENTID4res* res );
+
+ void nfs4_operation(const struct NFS4::SETCLIENTID_CONFIRM4args* args);
+ void nfs4_operation(const struct NFS4::SETCLIENTID_CONFIRM4res* res );
+
+ void nfs4_operation(const struct NFS4::VERIFY4args* args);
+ void nfs4_operation(const struct NFS4::VERIFY4res* res );
+
+ void nfs4_operation(const struct NFS4::WRITE4args* args);
+ void nfs4_operation(const struct NFS4::WRITE4res* res );
+
+ void nfs4_operation(const struct NFS4::RELEASE_LOCKOWNER4args* args);
+ void nfs4_operation(const struct NFS4::RELEASE_LOCKOWNER4res* res );
+
+ void nfs4_operation(const struct NFS4::GET_DIR_DELEGATION4args* args);
+ void nfs4_operation(const struct NFS4::GET_DIR_DELEGATION4res* res );
+
+ void nfs4_operation(const struct NFS4::GETFH4res* res);
+
+ void nfs4_operation(const struct NFS4::LOOKUPP4res* res);
+
+ void nfs4_operation(const struct NFS4::PUTPUBFH4res* res);
+
+ void nfs4_operation(const struct NFS4::PUTROOTFH4res* res);
+
+ void nfs4_operation(const struct NFS4::READLINK4res* res);
+
+ void nfs4_operation(const struct NFS4::RESTOREFH4res* res);
+
+ void nfs4_operation(const struct NFS4::SAVEFH4res* res);
+
+ void nfs4_operation(const struct NFS4::ILLEGAL4res* res);
+
+ void compound41(const RPCProcedure* proc,
+ const struct NFS41::COMPOUND4args* args,
+ const struct NFS41::COMPOUND4res* res) override final;
+
+ void nfs41_operation(const struct NFS41::nfs_argop4* op);
+ void nfs41_operation(const struct NFS41::nfs_resop4* op);
+
+ void nfs41_operation(const struct NFS41::ACCESS4args* args);
+ void nfs41_operation(const struct NFS41::ACCESS4res* res );
+
+ void nfs41_operation(const struct NFS41::CLOSE4args* args);
+ void nfs41_operation(const struct NFS41::CLOSE4res* res );
+
+ void nfs41_operation(const struct NFS41::COMMIT4args* args);
+ void nfs41_operation(const struct NFS41::COMMIT4res* res );
+
+ void nfs41_operation(const struct NFS41::CREATE4args* args);
+ void nfs41_operation(const struct NFS41::CREATE4res* res );
+
+ void nfs41_operation(const struct NFS41::DELEGPURGE4args* args);
+ void nfs41_operation(const struct NFS41::DELEGPURGE4res* res );
+
+ void nfs41_operation(const struct NFS41::DELEGRETURN4args* args);
+ void nfs41_operation(const struct NFS41::DELEGRETURN4res* res );
+
+ void nfs41_operation(const struct NFS41::GETATTR4args* args);
+ void nfs41_operation(const struct NFS41::GETATTR4res* res );
+
+ void nfs41_operation(const struct NFS41::LINK4args* args);
+ void nfs41_operation(const struct NFS41::LINK4res* res );
+
+ void nfs41_operation(const struct NFS41::LOCK4args* args);
+ void nfs41_operation(const struct NFS41::LOCK4res* res );
+
+ void nfs41_operation(const struct NFS41::LOCKT4args* args);
+ void nfs41_operation(const struct NFS41::LOCKT4res* res );
+
+ void nfs41_operation(const struct NFS41::LOCKU4args* args);
+ void nfs41_operation(const struct NFS41::LOCKU4res* res );
+
+ void nfs41_operation(const struct NFS41::LOOKUP4args* args);
+ void nfs41_operation(const struct NFS41::LOOKUP4res* res );
+
+ void nfs41_operation(const struct NFS41::NVERIFY4args* args);
+ void nfs41_operation(const struct NFS41::NVERIFY4res* res );
+
+ void nfs41_operation(const struct NFS41::OPEN4args* args);
+ void nfs41_operation(const struct NFS41::OPEN4res* res );
+
+ void nfs41_operation(const struct NFS41::OPENATTR4args* args);
+ void nfs41_operation(const struct NFS41::OPENATTR4res* res );
+
+ void nfs41_operation(const struct NFS41::OPEN_CONFIRM4args* args);
+ void nfs41_operation(const struct NFS41::OPEN_CONFIRM4res* res );
+
+ void nfs41_operation(const struct NFS41::OPEN_DOWNGRADE4args* args);
+ void nfs41_operation(const struct NFS41::OPEN_DOWNGRADE4res* res );
+
+ void nfs41_operation(const struct NFS41::PUTFH4args* args);
+ void nfs41_operation(const struct NFS41::PUTFH4res* res );
+
+ void nfs41_operation(const struct NFS41::READ4args* args);
+ void nfs41_operation(const struct NFS41::READ4res* res );
+
+ void nfs41_operation(const struct NFS41::READDIR4args* args);
+ void nfs41_operation(const struct NFS41::READDIR4res* res );
+
+ void nfs41_operation(const struct NFS41::REMOVE4args* args);
+ void nfs41_operation(const struct NFS41::REMOVE4res* res );
+
+ void nfs41_operation(const struct NFS41::RENAME4args* args);
+ void nfs41_operation(const struct NFS41::RENAME4res* res );
+
+ void nfs41_operation(const struct NFS41::RENEW4args* args);
+ void nfs41_operation(const struct NFS41::RENEW4res* res );
+
+ void nfs41_operation(const struct NFS41::SECINFO4args* args);
+ void nfs41_operation(const struct NFS41::SECINFO4res* res );
+
+ void nfs41_operation(const struct NFS41::SETATTR4args* args);
+ void nfs41_operation(const struct NFS41::SETATTR4res* res );
+
+ void nfs41_operation(const struct NFS41::SETCLIENTID4args* args);
+ void nfs41_operation(const struct NFS41::SETCLIENTID4res* res );
+
+ void nfs41_operation(const struct NFS41::SETCLIENTID_CONFIRM4args* args);
+ void nfs41_operation(const struct NFS41::SETCLIENTID_CONFIRM4res* res );
+
+ void nfs41_operation(const struct NFS41::VERIFY4args* args);
+ void nfs41_operation(const struct NFS41::VERIFY4res* res );
+
+ void nfs41_operation(const struct NFS41::WRITE4args* args);
+ void nfs41_operation(const struct NFS41::WRITE4res* res );
+
+ void nfs41_operation(const struct NFS41::RELEASE_LOCKOWNER4args* args);
+ void nfs41_operation(const struct NFS41::RELEASE_LOCKOWNER4res* res );
+
+ void nfs41_operation(const struct NFS41::BACKCHANNEL_CTL4args* args);
+ void nfs41_operation(const struct NFS41::BACKCHANNEL_CTL4res* res );
+
+ void nfs41_operation(const struct NFS41::BIND_CONN_TO_SESSION4args* args);
+ void nfs41_operation(const struct NFS41::BIND_CONN_TO_SESSION4res* res );
- void nfs4_operation(const struct rpcgen::OPENATTR4args* args);
- void nfs4_operation(const struct rpcgen::OPENATTR4res* res );
+ void nfs41_operation(const struct NFS41::EXCHANGE_ID4args* args);
+ void nfs41_operation(const struct NFS41::EXCHANGE_ID4res* res );
- void nfs4_operation(const struct rpcgen::OPEN_CONFIRM4args* args);
- void nfs4_operation(const struct rpcgen::OPEN_CONFIRM4res* res );
+ void nfs41_operation(const struct NFS41::CREATE_SESSION4args* args);
+ void nfs41_operation(const struct NFS41::CREATE_SESSION4res* res );
- void nfs4_operation(const struct rpcgen::OPEN_DOWNGRADE4args* args);
- void nfs4_operation(const struct rpcgen::OPEN_DOWNGRADE4res* res );
+ void nfs41_operation(const struct NFS41::DESTROY_SESSION4args* args);
+ void nfs41_operation(const struct NFS41::DESTROY_SESSION4res* res );
- void nfs4_operation(const struct rpcgen::PUTFH4args* args);
- void nfs4_operation(const struct rpcgen::PUTFH4res* res );
+ void nfs41_operation(const struct NFS41::FREE_STATEID4args* args);
+ void nfs41_operation(const struct NFS41::FREE_STATEID4res* res );
- void nfs4_operation(const struct rpcgen::READ4args* args);
- void nfs4_operation(const struct rpcgen::READ4res* res );
+ void nfs41_operation(const struct NFS41::GET_DIR_DELEGATION4args* args);
+ void nfs41_operation(const struct NFS41::GET_DIR_DELEGATION4res* res );
- void nfs4_operation(const struct rpcgen::READDIR4args* args);
- void nfs4_operation(const struct rpcgen::READDIR4res* res );
+ void nfs41_operation(const struct NFS41::GETDEVICEINFO4args* args);
+ void nfs41_operation(const struct NFS41::GETDEVICEINFO4res* res );
- void nfs4_operation(const struct rpcgen::REMOVE4args* args);
- void nfs4_operation(const struct rpcgen::REMOVE4res* res );
+ void nfs41_operation(const struct NFS41::GETDEVICELIST4args* args);
+ void nfs41_operation(const struct NFS41::GETDEVICELIST4res* res );
- void nfs4_operation(const struct rpcgen::RENAME4args* args);
- void nfs4_operation(const struct rpcgen::RENAME4res* res );
+ void nfs41_operation(const struct NFS41::LAYOUTCOMMIT4args* args);
+ void nfs41_operation(const struct NFS41::LAYOUTCOMMIT4res* res );
- void nfs4_operation(const struct rpcgen::RENEW4args* args);
- void nfs4_operation(const struct rpcgen::RENEW4res* res );
+ void nfs41_operation(const struct NFS41::LAYOUTGET4args* args);
+ void nfs41_operation(const struct NFS41::LAYOUTGET4res* res );
- void nfs4_operation(const struct rpcgen::SECINFO4args* args);
- void nfs4_operation(const struct rpcgen::SECINFO4res* res );
+ void nfs41_operation(const struct NFS41::LAYOUTRETURN4args* args);
+ void nfs41_operation(const struct NFS41::LAYOUTRETURN4res* res );
- void nfs4_operation(const struct rpcgen::SETATTR4args* args);
- void nfs4_operation(const struct rpcgen::SETATTR4res* res );
+ void nfs41_operation(const enum NFS41::secinfo_style4* args);
- void nfs4_operation(const struct rpcgen::SETCLIENTID4args* args);
- void nfs4_operation(const struct rpcgen::SETCLIENTID4res* res );
+ void nfs41_operation(const struct NFS41::SEQUENCE4args* args);
+ void nfs41_operation(const struct NFS41::SEQUENCE4res* res );
- void nfs4_operation(const struct rpcgen::SETCLIENTID_CONFIRM4args* args);
- void nfs4_operation(const struct rpcgen::SETCLIENTID_CONFIRM4res* res );
+ void nfs41_operation(const struct NFS41::SET_SSV4args* args);
+ void nfs41_operation(const struct NFS41::SET_SSV4res* res );
- void nfs4_operation(const struct rpcgen::VERIFY4args* args);
- void nfs4_operation(const struct rpcgen::VERIFY4res* res );
+ void nfs41_operation(const struct NFS41::TEST_STATEID4args* args);
+ void nfs41_operation(const struct NFS41::TEST_STATEID4res* res );
- void nfs4_operation(const struct rpcgen::WRITE4args* args);
- void nfs4_operation(const struct rpcgen::WRITE4res* res );
+ void nfs41_operation(const struct NFS41::WANT_DELEGATION4args* args);
+ void nfs41_operation(const struct NFS41::WANT_DELEGATION4res* res );
- void nfs4_operation(const struct rpcgen::RELEASE_LOCKOWNER4args* args);
- void nfs4_operation(const struct rpcgen::RELEASE_LOCKOWNER4res* res );
+ void nfs41_operation(const struct NFS41::DESTROY_CLIENTID4args* args);
+ void nfs41_operation(const struct NFS41::DESTROY_CLIENTID4res* res );
- void nfs4_operation(const struct rpcgen::GET_DIR_DELEGATION4args* args);
- void nfs4_operation(const struct rpcgen::GET_DIR_DELEGATION4res* res );
+ void nfs41_operation(const struct NFS41::RECLAIM_COMPLETE4args* args);
+ void nfs41_operation(const struct NFS41::RECLAIM_COMPLETE4res* res );
- void nfs4_operation(const struct rpcgen::GETFH4res* res);
+ void nfs41_operation(const struct NFS41::GETFH4res* res);
- void nfs4_operation(const struct rpcgen::LOOKUPP4res* res);
+ void nfs41_operation(const struct NFS41::LOOKUPP4res* res);
- void nfs4_operation(const struct rpcgen::PUTPUBFH4res* res);
+ void nfs41_operation(const struct NFS41::PUTPUBFH4res* res);
- void nfs4_operation(const struct rpcgen::PUTROOTFH4res* res);
+ void nfs41_operation(const struct NFS41::PUTROOTFH4res* res);
- void nfs4_operation(const struct rpcgen::READLINK4res* res);
+ void nfs41_operation(const struct NFS41::READLINK4res* res);
- void nfs4_operation(const struct rpcgen::RESTOREFH4res* res);
+ void nfs41_operation(const struct NFS41::RESTOREFH4res* res);
- void nfs4_operation(const struct rpcgen::SAVEFH4res* res);
+ void nfs41_operation(const struct NFS41::SAVEFH4res* res);
- void nfs4_operation(const struct rpcgen::ILLEGAL4res* res);
+ void nfs41_operation(const struct NFS41::ILLEGAL4res* res);
void flush_statistics() override final;
diff --git a/src/analysis/rpc_sessions.h b/src/analysis/rpc_sessions.h
index ef8e11e..91f0ff1 100644
--- a/src/analysis/rpc_sessions.h
+++ b/src/analysis/rpc_sessions.h
@@ -34,28 +34,27 @@
#include "utils/out.h"
#include "utils/sessions.h"
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
namespace NST
{
namespace analysis
{
-class RPCSession : public utils::ApplicationSession
+class Session : public utils::ApplicationSession
{
using FilteredDataQueue = NST::utils::FilteredDataQueue;
public:
- RPCSession(const utils::NetworkSession& s, utils::Session::Direction call_direction)
+ Session(const utils::NetworkSession& s, utils::Session::Direction call_direction)
: utils::ApplicationSession{s, call_direction}
{
utils::Out message;
message << "Detect session " << str();
}
- ~RPCSession() = default;
- RPCSession(const RPCSession&) = delete;
- RPCSession& operator=(const RPCSession&) = delete;
+ ~Session() = default;
+ Session(const Session&) = delete;
+ Session& operator=(const Session&) = delete;
- void save_nfs_call_data(const uint32_t xid, FilteredDataQueue::Ptr&& data)
+ void save_call_data(const uint32_t xid, FilteredDataQueue::Ptr&& data)
{
FilteredDataQueue::Ptr& e = operations[xid];
if(e) // xid call already exists
@@ -65,7 +64,7 @@ public:
e = std::move(data); // replace existing or set new
}
- inline FilteredDataQueue::Ptr get_nfs_call_data(const uint32_t xid)
+ inline FilteredDataQueue::Ptr get_call_data(const uint32_t xid)
{
auto i = operations.find(xid);
if(i != operations.end())
@@ -90,34 +89,35 @@ private:
std::unordered_map<uint32_t, FilteredDataQueue::Ptr> operations;
};
-class RPCSessions
+template <typename Session>
+class Sessions
{
public:
using MsgType = NST::protocols::rpc::MsgType;
- RPCSessions() = default;
- ~RPCSessions()= default;
- RPCSessions(const RPCSessions&) = delete;
- RPCSessions& operator=(const RPCSessions&) = delete;
+ Sessions() = default;
+ ~Sessions()= default;
+ Sessions(const Sessions&) = delete;
+ Sessions& operator=(const Sessions&) = delete;
- RPCSession* get_session(utils::NetworkSession* app, NST::utils::Session::Direction dir, MsgType type)
+ Session* get_session(utils::NetworkSession* app, NST::utils::Session::Direction dir, MsgType type)
{
if(app->application == nullptr)
{
if(type == MsgType::CALL) // add new session only for Call
{
- std::unique_ptr<RPCSession> ptr{ new RPCSession{*app, dir} };
+ std::unique_ptr<Session> ptr{ new Session{*app, dir} };
sessions.emplace_back(std::move(ptr));
app->application = sessions.back().get(); // set reference
}
}
- return reinterpret_cast<RPCSession*>(app->application);
+ return reinterpret_cast<Session*>(app->application);
}
private:
- std::vector< std::unique_ptr<RPCSession> > sessions;
+ std::vector< std::unique_ptr<Session> > sessions;
};
} // namespace analysis
diff --git a/src/api/cifs2_commands.h b/src/api/cifs2_commands.h
new file mode 100644
index 0000000..c5ca14c
--- /dev/null
+++ b/src/api/cifs2_commands.h
@@ -0,0 +1,1259 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Definition of CIFSv2 commands
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef API_CIFS2_COMMANDS_H
+#define API_CIFS2_COMMANDS_H
+//------------------------------------------------------------------------------
+#include <api/cifs_pc_to_net.h>
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace API
+{
+/*! SMB 2 version
+ */
+namespace SMBv2
+{
+
+/*! CIFS v2 commands
+ */
+enum class SMBv2Commands : uint16_t
+{
+ NEGOTIATE = API::SMBv2::pc_to_net<uint16_t>(0x0000),
+ SESSION_SETUP = API::SMBv2::pc_to_net<uint16_t>(0x0001),
+ LOGOFF = API::SMBv2::pc_to_net<uint16_t>(0x0002),
+ TREE_CONNECT = API::SMBv2::pc_to_net<uint16_t>(0x0003),
+ TREE_DISCONNECT = API::SMBv2::pc_to_net<uint16_t>(0x0004),
+ CREATE = API::SMBv2::pc_to_net<uint16_t>(0x0005),
+ CLOSE = API::SMBv2::pc_to_net<uint16_t>(0x0006),
+ FLUSH = API::SMBv2::pc_to_net<uint16_t>(0x0007),
+ READ = API::SMBv2::pc_to_net<uint16_t>(0x0008),
+ WRITE = API::SMBv2::pc_to_net<uint16_t>(0x0009),
+ LOCK = API::SMBv2::pc_to_net<uint16_t>(0x000A),
+ IOCTL = API::SMBv2::pc_to_net<uint16_t>(0x000B),
+ CANCEL = API::SMBv2::pc_to_net<uint16_t>(0x000C),
+ ECHO = API::SMBv2::pc_to_net<uint16_t>(0x000D),
+ QUERY_DIRECTORY = API::SMBv2::pc_to_net<uint16_t>(0x000E),
+ CHANGE_NOTIFY = API::SMBv2::pc_to_net<uint16_t>(0x000F),
+ QUERY_INFO = API::SMBv2::pc_to_net<uint16_t>(0x0010),
+ SET_INFO = API::SMBv2::pc_to_net<uint16_t>(0x0011),
+ OPLOCK_BREAK = API::SMBv2::pc_to_net<uint16_t>(0x0012),
+ CMD_COUNT
+};
+/*!
+ * \brief The errResponse struct
+ * The SMB2 ERROR Response packet is sent by the server
+ * to respond to a request that has failed or encountered an error.
+ */
+struct ErrResponse
+{
+ uint16_t structureSize;
+ uint16_t reserved; //!< 0
+ uint32_t byteCount; //!< even if zero, at least one byte follows
+ uint8_t errorData[1]; //!< Error message. Variable length
+} __attribute__ ((__packed__));
+
+/*!
+ * security modes. The security mode field specifies whether
+ * SMB signing is enabled or required at the client.
+ */
+enum class SecurityMode : uint16_t
+{
+ SIGNING_ENABLED = 0x0001, //!< When set, indicates that security signatures are enabled on the client.
+ SIGNING_REQUIRED = 0x0002 //!< When set, indicates that security signatures are required by the client.
+};
+
+/*!
+ * security modes. The security mode field specifies whether
+ * SMB signing is enabled or required at the client.
+ */
+enum class SecurityModeShort : uint8_t
+{
+ SIGNING_ENABLED = 0x01, //!< When set, indicates that security signatures are enabled on the client.
+ SIGNING_REQUIRED = 0x02 //!< When set, indicates that security signatures are required by the client.
+};
+
+/*!
+ * Capabilities flags
+ * If the client implements the SMB 3.x dialect family,
+ * the Capabilities field MUST be constructed using the following values.
+ * Otherwise, this field MUST be set to 0.
+ */
+enum class Capabilities : uint32_t
+{
+ DFS = 0x00000001, //!< When set, indicates that the client supports the Distributed File System (DFS).
+ LEASING = 0x00000002, //!< When set, indicates that the client supports leasing.
+ LARGE_MTU = 0x00000004, //!< When set, indicates that the client supports multi-credit operations.
+ MULTI_CHANNEL = 0x00000008, //!< When set, indicates that the client supports establishing multiple channels for a single session.
+ PERSISTENT_HANDLES = 0x00000010, //!< When set, indicates that the client supports persistent handles.
+ DIRECTORY_LEASING = 0x00000020, //!< When set, indicates that the client supports directory leasing.
+ ENCRYPTION = 0x00000040 //!< When set, indicates that the client supports encryption.
+};
+
+enum class ShareCapabilities : uint32_t
+{
+ DFS = 0x00000008,
+ CONTINUOUS_AVAILABILITY = 0x00000010,
+ SCALEOUT = 0x00000020,
+ CLUSTER = 0x00000040,
+ ASYMMETRIC = 0x00000080
+};
+
+/*!
+ * Supported dialect revision numbers
+ */
+enum class Dialects : uint16_t
+{
+ SMB_2_002 = 0x0202, //!< SMB 2.002 dialect revision number.
+ SMB_2_1 = 0x0210, //!< SMB 2.1 dialect revision number.
+ SMB_3_0 = 0x0300, //!< SMB 3.0 dialect revision number.
+ SMB_3_02 = 0x0302 //!< SMB 3.02 dialect revision number.
+};
+
+/*!
+ * \brief The negotiateRequest struct
+ * The SMB2 NEGOTIATE Request packet is used by the client to notify
+ * the server what dialects of the SMB 2 Protocol the client understands.
+ * This request is composed of an SMB2 header,
+ * followed by this request structure.
+ */
+struct NegotiateRequest
+{
+ uint16_t structureSize; //!< Must be 36
+ uint16_t dialectCount; //!< The number of dialects that are contained in the Dialects[] array
+ SecurityMode securityMode; //!< The security mode field specifies whether SMB signing is enabled or required at the client.
+ uint16_t _; //!< Reserved
+ Capabilities capabilities; //!< Client's capabilities
+ uint8_t clientGUID[16]; //!< Must be 0
+ uint64_t clientStartTime; //!< Must be 0
+ Dialects dialects[1]; //!< An array of one or more 16-bit integers specifying the supported dialect revision numbers. The array MUST contain at least one of the following values. Variable length
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The negotiateResponse struct
+ * The SMB2 NEGOTIATE Response packet is sent by the server to notify
+ * the client of the preferred common dialect.
+ * This response is composed of an SMB2 header,
+ * followed by this response structure.
+ */
+struct NegotiateResponse
+{
+ uint16_t structureSize; //!< Must be 65
+ SecurityMode securityMode; //!< The security mode field specifies whether SMB signing is enabled, required at the server, or both.
+ uint16_t dialectRevision; //!< The preferred common SMB 2 Protocol dialect number from the Dialects array that is sent in the SMB2 NEGOTIATE Request or the SMB2 wildcard revision number
+ uint16_t reserved; //!< Must be 0
+ uint8_t serverGUID[16]; //!< A globally unique identifier that is generated by the server to uniquely identify this server.
+ Capabilities capabilities; //!< The Capabilities field specifies protocol capabilities for the server.
+ uint32_t maxTransactSize; //!< The maximum size, in bytes, of the buffer that can be used for QUERY_INFO, QUERY_DIRECTORY, SET_INFO and CHANGE_NOTIFY operations.
+ uint32_t maxReadSize; //!< The maximum size, in bytes, of the Length in an SMB2 READ Request (section 2.2.19) that the server will accept.
+ uint32_t maxWriteSize; //!< The maximum size, in bytes, of the Length in an SMB2 WRITE Request (section 2.2.21) that the server will accept.
+ uint64_t systemTime; //!< The system time of the SMB2 server when the SMB2 NEGOTIATE Request was processed
+ uint64_t serverStartTime; //!< The SMB2 server start time, in FILETIME format
+ uint16_t securityBufferOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the security buffer.
+ uint16_t securityBufferLength; //!< The length, in bytes, of the security buffer.
+ uint32_t reserved2; //!< This field MUST NOT be used and MUST be reserved. The server may set this to any value, and the client MUST ignore it on receipt.
+ uint8_t buffer[1]; //!< The variable-length buffer that contains the security buffer for the response
+} __attribute__ ((__packed__));
+
+/*! Session binding to connections flags
+ * Is used if the client implements the SMB 3.x dialect family.
+ * Otherwise, it MUST be set to NONE.
+ */
+enum class SessionFlagsBinding : uint8_t
+{
+ NONE = 0x00, //!< Default
+ BINDING = 0x01 //!< When set, indicates that the request is to bind an existing session to a new connection.
+};
+
+/*!
+ * \brief The SMB2 SESSION_SETUP Request packet is sent by the client to
+ * request a new authenticated session within a new or existing SMB 2 Protocol
+ * transport connection to the server. This request is composed of an SMB2
+ * header as specified in section 2.2.1 followed by this request structure.
+ */
+struct SessionSetupRequest
+{
+ uint16_t structureSize; //!< Must be 25
+ SessionFlagsBinding VcNumber; //!< If the client implements the SMB 3.x dialect family, this field MUST be set to combination of zero or more of the following values. Otherwise, it MUST be set to 0.
+ SecurityModeShort securityMode; //!< The security mode field specifies whether SMB signing is enabled or required at the client. This field MUST be constructed using the following values.
+ Capabilities capabilities; //!< Specifies protocol capabilities for the client. This field MUST be constructed using the following values.
+ uint32_t Channel; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ uint16_t SecurityBufferOffset; //!< The offset, in bytes, from the beginning of the SMB 2 Protocol header to the security buffer.
+ uint16_t SecurityBufferLength; //!< The length, in bytes, of the security buffer.
+ uint64_t PreviousSessionId; //!< A previously established session identifier. The server uses this value to identify the client session that was disconnected due to a network error.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the security buffer for the request, as specified by SecurityBufferOffset and SecurityBufferLength
+} __attribute__ ((__packed__));
+
+/*! Currently defined SessionFlags
+ */
+enum class SessionFlags : uint16_t
+{
+ NONE = 0x0000, //!< Default
+ IS_GUEST = 0x0001, //!< If set, the client has been authenticated as a guest user.
+ IS_NULL = 0x0002, //!< If set, the client has been authenticated as an anonymous user.
+ IS_ENCRYPT_DATA = 0x0004 //!< If set, the server requires encryption of messages on this session. This flag is only valid for the SMB 3.x dialect family.
+};
+
+/*!
+ * \brief The sess_setupResponse struct
+ * The SMB2 SESSION_SETUP Response packet is sent by the server in response to
+ * an SMB2 SESSION_SETUP Request packet. This response is composed of an SMB2
+ * header, that is followed by this response structure.
+ */
+struct SessionSetupResponse
+{
+ uint16_t structureSize; //!< Must be 9
+ SessionFlags sessionFlags; //!< A flags field that indicates additional information about the session.
+ uint16_t SecurityBufferOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the security buffer.
+ uint16_t SecurityBufferLength; //!< The length, in bytes, of the security buffer.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the security buffer for the response, as specified by SecurityBufferOffset and SecurityBufferLength.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The LogoffRequest struct.
+ * The SMB2 LOGOFF Request packet is sent by the client to request termination
+ * of a particular session
+ */
+struct LogOffRequest
+{
+ uint16_t structureSize; //!< Must be 4
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The LogoffResponse struct
+ * The SMB2 LOGOFF Response packet is sent by the server to confirm that an
+ * SMB2 LOGOFF Request was completed successfully
+ */
+struct LogOffResponse
+{
+ uint16_t structureSize; //!< Must be 4
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The TreeConnectRequest struct
+ * The SMB2 TREE_CONNECT Request packet is sent by a client to request
+ * access to a particular share on the server
+ */
+struct TreeConnectRequest
+{
+ uint16_t structureSize; //!< The client MUST set this field to 9, indicating the size of the request structure, not including the header. The client MUST set it to this value regardless of how long Buffer[] actually is in the request being sent.
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ uint16_t PathOffset; //!< The offset, in bytes, of the full share path name from the beginning of the packet header.
+ uint16_t PathLength; //!< The length, in bytes, of the path name.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the path name of the share in Unicode in the form "\\server\share" for the request, as described by PathOffset and PathLength
+} __attribute__ ((__packed__));
+
+/*!
+ * Possible ShareType values
+ */
+enum class ShareTypes : uint8_t
+{
+ DISK = 0x01, //!< Physical disk share.
+ PIPE = 0x02, //!< Named pipe share.
+ PRINT = 0x03 //!< Printer share.
+};
+
+/*!
+ * Possible shareFlags - exactly one and only one of the first 4 caching flags
+ * must be set (any of the remaining, SHI1005, flags may be set individually
+ * or in combination.)
+ */
+enum class ShareFlags : uint32_t
+{
+ MANUAL_CACHING = 0x00000000, //!< The client may cache files that are explicitly selected by the user for offline use.
+ AUTO_CACHING = 0x00000010, //!< The client may automatically cache files that are used by the user for offline access.
+ VDO_CACHING = 0x00000020, //!< The client may automatically cache files that are used by the user for offline access and may use those files in an offline mode even if the share is available.
+ NO_CACHING = 0x00000030, //!< Offline caching MUST NOT occur.
+ DFS = 0x00000001, //!< The specified share is present in a Distributed File System (DFS) tree structure.
+ DFS_ROOT = 0x00000002, //!< The specified share is present in a DFS tree structure.
+ RESTRICT_EXCLUSIVE_OPENS = 0x00000100, //!< The specified share disallows exclusive file opens that deny reads to an open file.
+ FORCE_SHARED_DELETE = 0x00000200, //!< The specified share disallows clients from opening files on the share in an exclusive mode that prevents the file from being deleted until the client closes the file.
+ ALLOW_NAMESPACE_CACHING = 0x00000400, //!< The client MUST ignore this flag.
+ ACCESS_BASED_DIRECTORY_ENUM = 0x00000800, //!< The server will filter directory entries based on the access permissions of the client.
+ FORCE_LEVELII_OPLOCK = 0x00001000, //!< The server will not issue exclusive caching rights on this share.
+ ENABLE_HASH = 0x00002000, //!< The share supports hash generation for branch cache retrieval of data. For more information, see section 2.2.31.2. This flag is not valid for the SMB 2.002 dialect.
+ ENABLE_HASH_2 = 0x00004000, //!< The share supports v2 hash generation for branch cache retrieval of data. For more information, see section 2.2.31.2. This flag is not valid for the SMB 2.002 and SMB 2.1 dialects.
+ ENABLE_ENCRYPT_DATA = 0x00008000 //!< The server requires encryption of remote file access messages on this share, per the conditions specified in section 3.3.5.2.11. This flag is only valid for the SMB 3.x dialect family.
+};
+
+/*!
+ * \brief The TreeConnectResponse struct
+ * The SMB2 TREE_CONNECT Response packet is sent by the server when an SMB2
+ * TREE_CONNECT request is processed successfully by the server.
+ */
+struct TreeConnectResponse
+{
+ uint16_t structureSize; //!< Must be 16
+ ShareTypes ShareType; //!< The type of share being accessed.
+ uint8_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+ ShareFlags shareFlags; //!< This field contains properties for this share.
+ ShareCapabilities capabilities; //!< Indicates various capabilities for this share
+ uint32_t MaximalAccess; //!< Contains the maximal access for the user that establishes the tree connect on the share based on the share's permissions
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The tree_disconnectRequest struct
+ * The SMB2 TREE_DISCONNECT Request packet is sent by the client
+ * to request that the tree connect that is specified in the TreeId within
+ * the SMB2 header be disconnected.
+ */
+struct TreeDisconnectRequest
+{
+ uint16_t structureSize; //!< The client MUST set this field to 4, indicating the size of the request structure, not including the header.
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The TreeDisconnectResponse struct
+ * The SMB2 TREE_DISCONNECT Response packet is sent by the server to confirm
+ * that an SMB2 TREE_DISCONNECT Request was successfully processed.
+ */
+struct TreeDisconnectResponse
+{
+ uint16_t structureSize; //!< The client MUST set this field to 4, indicating the size of the request structure, not including the header.
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*! File Attrubutes
+ */
+enum class FileAttributes : uint32_t
+{
+ READONLY = 0x00000001,
+ HIDDEN = 0x00000002,
+ SYSTEM = 0x00000004,
+ DIRECTORY = 0x00000010,
+ ARCHIVE = 0x00000020,
+ NORMAL = 0x00000080,
+ TEMPORARY = 0x00000100,
+ SPARSE_FILE = 0x00000200,
+ REPARSE_POINT = 0x00000400,
+ COMPRESSED = 0x00000800,
+ OFFLINE = 0x00001000,
+ NOT_CONTENT_INDEXED = 0x00002000,
+ ENCRYPTED = 0x00004000
+};
+
+/*!
+ * Oplock levels
+ */
+enum class OplockLevels : uint8_t
+{
+ NONE = 0x00, //!< No oplock is requested.
+ II = 0x01, //!< A level II oplock is requested.
+ EXCLUSIVE = 0x08, //!< An exclusive oplock is requested.
+ BATCH = 0x09, //!< A batch oplock is requested.
+ LEASE = 0xFF //!< A lease is requested. If set, the request packet MUST contain an SMB2_CREATE_REQUEST_LEASE create context. This value is not valid for the SMB 2.002 dialect.
+};
+
+/*! Desired Access Flags
+ */
+enum class DesiredAccessFlags : uint32_t
+{
+ READ_DATA_LE = (0x00000001),
+ WRITE_DATA_LE = (0x00000002),
+ APPEND_DATA_LE = (0x00000004),
+ READ_EA_LE = (0x00000008),
+ WRITE_EA_LE = (0x00000010),
+ EXECUTE_LE = (0x00000020),
+ READ_ATTRIBUTES_LE = (0x00000080),
+ WRITE_ATTRIBUTES_LE = (0x00000100),
+ DELETE_LE = (0x00010000),
+ READ_CONTROL_LE = (0x00020000),
+ WRITE_DAC_LE = (0x00040000),
+ WRITE_OWNER_LE = (0x00080000),
+ SYNCHRONIZE_LE = (0x00100000),
+ ACCESS_SYSTEM_SECURITY_LE = (0x01000000),
+ MAXIMAL_ACCESS_LE = (0x02000000),
+ GENERIC_ALL_LE = (0x10000000),
+ GENERIC_EXECUTE_LE = (0x20000000),
+ GENERIC_WRITE_LE = (0x40000000),
+ GENERIC_READ_LE = (0x80000000)
+};
+
+/*!
+ * Share Access Flags
+ */
+/*
+enum ShareAccessFlags : uint32_t
+{
+ READ_LE = (0x00000001), //!< When set, indicates that other opens are allowed to read this file while this open is present.
+ WRITE_LE = (0x00000002), //!< When set, indicates that other opens are allowed to write this file while this open is present
+ DELETE_LE = (0x00000004), //!< When set, indicates that other opens are allowed to delete or rename this file while this open is present
+ ALL_LE = (0x00000007) //!< Combine
+};*/
+
+enum ShareAccessFlags : uint32_t
+{
+ SHARE_READ_LE = (0x00000001), //!< When set, indicates that other opens are allowed to read this file while this open is present.
+ SHARE_WRITE_LE = (0x00000002), //!< When set, indicates that other opens are allowed to write this file while this open is present.
+ SHARE_DELETE_LE = (0x00000004) //!< When set, indicates that other opens are allowed to delete or rename this file while this open is present.
+};
+
+/*!
+ * CreateDisposition Flags
+ */
+enum class CreateDisposition : uint32_t
+{
+ SUPERSEDE = (0x00000000), //!< If the file already exists, supersede it. Otherwise, create the file.
+ OPEN = (0x00000001), //!< If the file already exists, return success; otherwise, fail the operation.
+ CREATE = (0x00000002), //!< If the file already exists, fail the operation; otherwise, create the file.
+ OPEN_IF = (0x00000003), //!< Open the file if it already exists; otherwise, create the file.
+ OVERWRITE = (0x00000004), //!< Overwrite the file if it already exists; otherwise, fail the operation.
+ OVERWRITE_IF = (0x00000005) //!< Overwrite the file if it already exists; otherwise, create the file.
+};
+
+/*!
+ * Create options Flags
+ */
+enum CreateOptionsFlags : uint32_t
+{
+ DIRECTORY_FILE_LE = (0x00000001), //!< The file being created or opened is a directory file.
+ WRITE_THROUGH_LE = (0x00000002), //!< The server MUST propagate writes to this open to persistent storage before returning success to the client on write operations.
+ SEQUENTIAL_ONLY_LE = (0x00000004), //!< This indicates that the application intends to read or write at sequential offsets using this handle, so the server SHOULD optimize for sequential access
+ NO_INTERMEDIATE_BUFFERRING_LE = (0x00000008), //!< The server or underlying object store SHOULD NOT cache data at intermediate layers and SHOULD allow it to flow through to persistent storage.
+ SYNCHRONOUS_IO_ALERT_LE = (0x00000010), //!< This bit SHOULD be set to 0 and MUST be ignored by the server.<34>
+ SYNCHRONOUS_IO_NON_ALERT_LE = (0x00000020), //!< This bit SHOULD be set to 0 and MUST be ignored by the server.<35>
+ NON_DIRECTORY_FILE_LE = (0x00000040), //!< If the name of the file being created or opened matches with an existing directory file, the server MUST fail the request with STATUS_FILE_IS_A_DIRECTORY.
+ COMPLETE_IF_OPLOCKED_LE = (0x00000100), //!< This bit SHOULD be set to 0 and MUST be ignored by the server
+ NO_EA_KNOWLEDGE_LE = (0x00000200), //!< The caller does not understand how to handle extended attributes.
+ RANDOM_ACCESS_LE = (0x00000800), //!< This indicates that the application intends to read or write at random offsets using this handle, so the server SHOULD optimize for random access.
+ DELETE_ON_CLOSE_LE = (0x00001000), //!< The file MUST be automatically deleted when the last open request on this file is closed.
+ OPEN_BY_FILE_ID_LE = (0x00002000), //!< This bit SHOULD be set to 0 and the server MUST fail the request with a STATUS_NOT_SUPPORTED error if this bit is set.<37>
+ OPEN_FOR_BACKUP_INTENT_LE = (0x00004000), //!< The file is being opened for backup intent. That is, it is being opened or created for the purposes of either a backup or a restore operation
+ NO_COMPRESSION_LE = (0x00008000), //!< The file cannot be compressed.
+ RESERVE_OPFILTER_LE = (0x00100000), //!< This bit SHOULD be set to 0 and the server MUST fail the request with a STATUS_NOT_SUPPORTED error if this bit is set.<38>
+ OPEN_REPARSE_POINT_LE = (0x00200000), //!< If the file or directory being opened is a reparse point, open the reparse point itself rather than the target that the reparse point references.
+ OPEN_NO_RECALL_LE = (0x00400000), //!< In an HSM (Hierarchical Storage Management) environment, this flag means the file SHOULD NOT be recalled from tertiary storage such as tape. The recall can take several minutes. The caller can specify this flag to avoid those delays.
+ OPEN_FOR_FREE_SPACE_QUERY_LE = (0x00800000) //!< Open file to query for free space. The client SHOULD set this to 0 and the server MUST ignore it.<39>
+};
+
+/*!
+ * CreateDisposition Flags
+ */
+enum class CreateActions : uint32_t
+{
+ SUPERSEDED = (0x00000000), //!< An existing file was deleted and a new file was created in its place.
+ OPENED = (0x00000001), //!< An existing file was opened.
+ CREATED = (0x00000002), //!< A new file was created.
+ FILE_OVERWRITTEN = (0x00000003), //!< An existing file was overwritten.
+};
+
+/*!
+ * Impersonation Levels
+ */
+enum class ImpersonationLevels : uint32_t
+{
+ ANONYMOUS = (0x00000000), //!< The application-requested impersonation level is Anonymous.
+ IDENTIFICATION = (0x00000001), //!< The application-requested impersonation level is Identification.
+ IMPERSONATION = (0x00000002), //!< The application-requested impersonation level is Impersonation.
+ DELEGATE = (0x00000003) //!< The application-requested impersonation level is Delegate.
+};
+
+/*!
+ * \brief The createRequest struct
+ * The SMB2 CREATE Request packet is sent by a client to request either
+ * creation of or access to a file. In case of a named pipe or printer,
+ * the server MUST create a new file.
+ */
+struct CreateRequest
+{
+ uint16_t structureSize; //!< The client MUST set this field to 57, indicating the size of the request structure, not including the header. The client MUST set it to this value regardless of how long Buffer[] actually is in the request being sent.
+ uint8_t SecurityFlags; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it.
+ OplockLevels RequestedOplockLevel; //!< The requested oplock level.
+ ImpersonationLevels ImpersonationLevel; //!< This field specifies the impersonation level requested by the application that is issuing the create request
+ uint64_t SmbCreateFlags; //!< This field MUST NOT be used and MUST be reserved. The client SHOULD set this field to zero, and the server MUST ignore it on receipt.
+ uint64_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client sets this to any value, and the server MUST ignore it on receipt.
+ DesiredAccessFlags desiredAccess; //!< The level of access that is required
+ FileAttributes attributes; //!< This field MUST be a combination of the values
+ ShareAccessFlags shareAccess; //!< Specifies the sharing mode for the open
+ CreateDisposition createDisposition; //!< Defines the action the server MUST take if the file that is specified in the name field already exists.
+ CreateOptionsFlags createOptions; //!< Specifies the options to be applied when creating or opening the file. Combinations of the bit positions are valid, unless otherwise noted.
+ uint16_t NameOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the 8-byte aligned file name
+ uint16_t NameLength; //!< The length of the file name, in bytes.
+ uint32_t CreateContextsOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the first 8-byte aligned SMB2_CREATE_CONTEXT structure in the request
+ uint32_t CreateContextsLength; //!< The length, in bytes, of the list of SMB2_CREATE_CONTEXT structures sent in this request.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the Unicode file name and create context list, as defined by NameOffset, NameLength, CreateContextsOffset, and CreateContextsLength.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The CreateResponse struct
+ * The SMB2 CREATE Response packet is sent by the server to notify
+ * the client of the status of its SMB2 CREATE Request.
+ */
+struct CreateResponse
+{
+ uint16_t structureSize; //!< Must be 89
+ OplockLevels oplockLevel; //!< The oplock level that is granted to the client for this open.
+ uint8_t flag; //!< If the server implements the SMB 3.x dialect family, this field MUST be constructed using the 0x01 value. Otherwise, this field MUST NOT be used and MUST be reserved.
+ CreateActions CreateAction; //!< The action taken in establishing the open
+ uint64_t CreationTime; //!< The time when the file was created
+ uint64_t LastAccessTime; //!< The time the file was last accessed
+ uint64_t LastWriteTime; //!< The time when data was last written to the file
+ uint64_t ChangeTime; //!< The time when the file was last modified
+ uint64_t AllocationSize; //!< The size, in bytes, of the data that is allocated to the file.
+ uint64_t EndofFile; //!< The size, in bytes, of the file.
+ FileAttributes attributes; //!< The attributes of the file
+ uint32_t Reserved2; //!< This field MUST NOT be used and MUST be reserved. The server SHOULD set this to 0, and the client MUST ignore it on receipt.<51>
+ uint64_t PersistentFileId; //!< The identifier of the open to a file or pipe that was established. Opaque endianness
+ uint64_t VolatileFileId; //!<
+ uint32_t CreateContextsOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the first 8-byte aligned SMB2_CREATE_CONTEXT response that is contained in this response.
+ uint32_t CreateContextsLength; //!< The length, in bytes, of the list of SMB2_CREATE_CONTEXT response structures that are contained in this response.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the list of create contexts that are contained in this response, as described by CreateContextsOffset and CreateContextsLength.
+} __attribute__ ((__packed__));
+
+/*!
+ * A Flags field indicates how to process the operation.
+ * This field MUST be constructed using the following value
+ */
+enum class CloseFlags : uint16_t
+{
+ POSTQUERY_ATTRIB = (0x0001)
+};
+
+/*!
+ * \brief The closeRequest struct. The SMB2 CLOSE Request packet is used
+ * by the client to close an instance of a file that was opened previously
+ * with a successful SMB2 CREATE Request. This request is composed of an
+ * SMB2 header.
+ */
+struct CloseRequest
+{
+ uint16_t structureSize; //!< The client MUST set this field to 24, indicating the size of the request structure, not including the header.
+ CloseFlags Flags; //!< If set, the server MUST set the attribute fields in the response to valid values. If not set, the client MUST NOT use the values that are returned in the response.
+ uint32_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ uint64_t PersistentFileId; //!< The identifier of the open to a file or named pipe that is being close
+ uint64_t VolatileFileId; //!< The identifier of the open to a file or named pipe that is being close
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The closeResponse struct. The SMB2 CLOSE Response packet is sent
+ * by the server to indicate that an SMB2 CLOSE Request was processed
+ * successfully. This response is composed of an SMB2 header
+ */
+struct CloseResponse
+{
+ uint16_t structureSize; //!< The server MUST set this field to 60, indicating the size of the response structure, not including the header.
+ CloseFlags Flags; //!< A Flags field indicates how to process the operation
+ uint32_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+ uint64_t CreationTime; //!< The time when the file was created
+ uint64_t LastAccessTime; //!< The time when the file was last accessed
+ uint64_t LastWriteTime; //!< The time when data was last written to the file
+ uint64_t ChangeTime; //!< The time when the file was last modified
+ uint64_t AllocationSize; //!< The size, in bytes, of the data that is allocated to the file
+ uint64_t EndOfFile; //!< The size, in bytes, of the file
+ uint32_t Attributes; //!< The attributes of the file.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The echoRequest struct. The SMB2 ECHO Request packet is sent
+ * by a client to determine whether a server is processing requests.
+ */
+struct EchoRequest
+{
+ uint16_t structureSize; //!< The client MUST set this to 4, indicating the size of the request structure, not including the header.
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The echoResponse struct.The SMB2 ECHO Response packet is sent
+ * by the server to confirm that an SMB2 ECHO Request was successfully processed
+ */
+struct EchoResponse
+{
+ uint16_t structureSize; //!< The server MUST set this to 4, indicating the size of the response structure, not including the header.
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*! Possible InfoType values
+ */
+enum class InfoTypes : uint8_t
+{
+ FILE = 0x01, //!< The file information is requested.
+ FILESYSTEM = 0x02, //!< The underlying object store information is requested.
+ SECURITY = 0x03, //!< The security information is requested.
+ QUOTA = 0x04 //!< The underlying object store quota information is requested.
+};
+
+enum class FsInfoLevels : uint8_t {
+ SMB2_FS_INFO_01 = 1,
+ SMB2_FS_INFO_02 = 2,
+ SMB2_FS_INFO_03 = 3,
+ SMB2_FS_INFO_04 = 4,
+ SMB2_FS_INFO_05 = 5,
+ SMB2_FS_INFO_06 = 6,
+ SMB2_FS_INFO_07 = 7
+};
+
+/*!
+ * PDU infolevel structure definitions
+ * BB consider moving to a different header
+ * partial list of QUERY INFO levels
+ */
+enum class QueryInfoLevels : uint8_t
+{
+ DIRECTORY_INFORMATION = 1,
+ FULL_DIRECTORY_INFORMATION = 2,
+ BOTH_DIRECTORY_INFORMATION = 3,
+ BASIC_INFORMATION = 4,
+ STANDARD_INFORMATION = 5,
+ INTERNAL_INFORMATION = 6,
+ EA_INFORMATION = 7,
+ ACCESS_INFORMATION = 8,
+ NAME_INFORMATION = 9,
+ RENAME_INFORMATION = 10,
+ LINK_INFORMATION = 11,
+ NAMES_INFORMATION = 12,
+ DISPOSITION_INFORMATION = 13,
+ POSITION_INFORMATION = 14,
+ FULL_EA_INFORMATION = 15,
+ MODE_INFORMATION = 16,
+ ALIGNMENT_INFORMATION = 17,
+ ALL_INFORMATION = 18,
+ ALLOCATION_INFORMATION = 19,
+ END_OF_FILE_INFORMATION = 20,
+ ALTERNATE_NAME_INFORMATION = 21,
+ STREAM_INFORMATION = 22,
+ PIPE_INFORMATION = 23,
+ PIPE_LOCAL_INFORMATION = 24,
+ PIPE_REMOTE_INFORMATION = 25,
+ MAILSLOT_QUERY_INFORMATION = 26,
+ MAILSLOT_SET_INFORMATION = 27,
+ COMPRESSION_INFORMATION = 28,
+ OBJECT_ID_INFORMATION = 29,
+ /* Number 30 not defined in documents */
+ MOVE_CLUSTER_INFORMATION = 31,
+ QUOTA_INFORMATION = 32,
+ REPARSE_POINT_INFORMATION = 33,
+ NETWORK_OPEN_INFORMATION = 34,
+ ATTRIBUTE_TAG_INFORMATION = 35,
+ TRACKING_INFORMATION = 36,
+ ID_BOTH_DIRECTORY_INFORMATION = 37,
+ ID_FULL_DIRECTORY_INFORMATION = 38,
+ VALID_DATA_LENGTH_INFORMATION = 39,
+ SHORT_NAME_INFORMATION = 40,
+ SFIO_RESERVE_INFORMATION = 44,
+ SFIO_VOLUME_INFORMATION = 45,
+ HARD_LINK_INFORMATION = 46,
+ NORMALIZED_NAME_INFORMATION = 48,
+ ID_GLOBAL_TX_DIRECTORY_INFORMATION = 50,
+ STANDARD_LINK_INFORMATION = 54
+};
+
+/*!
+ * Provides additional information to the server.
+ * If security information is being queried, this value contains a 4-byte bit
+ * field of flags indicating what security attributes MUST be returned.
+ */
+enum class AdditionInfo : uint32_t
+{
+ OWNER_SECURITY_INFORMATION = 0x00000001, //!< The client is querying the owner from the security descriptor of the file or named pipe.
+ GROUP_SECURITY_INFORMATION = 0x00000002, //!< The client is querying the group from the security descriptor of the file or named pipe.
+ DACL_SECURITY_INFORMATION = 0x00000004, //!< The client is querying the discretionary access control list from the security descriptor of the file or named pipe.
+ SACL_SECURITY_INFORMATION = 0x00000008, //!< The client is querying the system access control list from the security descriptor of the file or named pipe.
+ LABEL_SECURITY_INFORMATION = 0x00000010, //!< The client is querying the integrity label from the security descriptor of the file or named pipe.
+ ATTRIBUTE_SECURITY_INFORMATION = 0x00000020, //!< The client is querying the resource attribute from the security descriptor of the file or named pipe.
+ SCOPE_SECURITY_INFORMATION = 0x00000040, //!< The client is querying the central access policy of the resource from the security descriptor of the file or named pipe.
+ BACKUP_SECURITY_INFORMATION = 0x00010000 //!< The client is querying the security descriptor information used for backup operation.
+};
+
+/*!
+ * The flags MUST be set to a combination of zero or more of these bit values
+ * for a FileFullEaInformation query.
+ */
+enum FileFullEaInformation : uint32_t
+{
+ SL_RESTART_SCAN = 0x00000001, //!< Restart the scan for EAs from the beginning.
+ SL_RETURN_SINGLE_ENTRY = 0x00000002, //!< Return a single EA entry in the response buffer.
+ SL_INDEX_SPECIFIED = 0x00000004 //!< The caller has specified an EA index.
+};
+
+/*!
+ * \brief The QueryInfoRequest struct
+ * The SMB2 QUERY_INFO Request (section 2.2.37) packet is sent by a client
+ * to request information on a file, named pipe, or underlying volume.
+ */
+struct QueryInfoRequest
+{
+ uint16_t structureSize; //!< Must be 41
+ InfoTypes infoType; //!< The type of information queried
+ uint8_t FileInfoClass; //!< Class of info
+ uint32_t OutputBufferLength; //!< The maximum number of bytes of information the server can send in the response.
+ uint16_t InputBufferOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the input buffer.
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved.
+ uint32_t InputBufferLength; //!< The length of the input buffer
+ AdditionInfo AdditionalInformation; //!< Provides additional information to the server.
+ FileFullEaInformation Flags; //!< The flags MUST be set to a combination of zero or more of these bit values for a FileFullEaInformation query.
+ uint64_t PersistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t VolatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint8_t Buffer[1]; //!< A variable-length buffer containing the input buffer for the request, as described by the InputBufferOffset and InputBufferLength fields.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The query_infoResponse struct
+ * The SMB2 QUERY_INFO Response packet is sent by the server
+ * in response to an SMB2 QUERY_INFO Request packet.
+ */
+struct QueryInfoResponse
+{
+ uint16_t structureSize; //!< Must be 9
+ uint16_t OutputBufferOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the information being returned.
+ uint32_t OutputBufferLength; //!< The length, in bytes, of the information being returned.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the information that is returned in the response, as described by the OutputBufferOffset and OutputBufferLength fields
+} __attribute__ ((__packed__));
+
+/*!
+ */
+enum class OpFlags : uint8_t
+{
+ SMB2_RESTART_SCANS = 0x01, //!< The server MUST restart the enumeration from the beginning, but the search pattern is not changed.
+ SMB2_RETURN_SINGLE_ENTRY = 0x02, //!< The server MUST only return the first entry of the search results.
+ SMB2_INDEX_SPECIFIED = 0x04, //!< The server SHOULD<64> return entries beginning at the byte number specified by FileIndex.
+ SMB2_REOPEN = 0x10 //!< The server MUST restart the enumeration from the beginning, and the search pattern MUST be changed to the provided value. This often involves silently closing and reopening the directory on the server side.
+};
+
+/*!
+ * \brief The QueryDirRequest struct
+ * The SMB2 QUERY_DIRECTORY Request packet is sent by the client
+ * to obtain a directory enumeration on a directory open.
+ */
+struct QueryDirRequest
+{
+ uint16_t structureSize; //!< Must be 33
+ QueryInfoLevels infoType; //!< The file information class describing the format that data MUST be returned in.
+ OpFlags flags; //!< Flags indicating how the query directory operation MUST be processed
+ uint32_t FileIndex; //!< The byte offset within the directory, indicating the position at which to resume the enumeration
+ uint64_t PersistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t VolatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint16_t FileNameOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the search pattern to be used for the enumeration
+ uint16_t FileNameLength; //!< The length, in bytes, of the search pattern. This field MUST be 0 if no search pattern is provided
+ uint32_t OutputBufferLength; //!< The maximum number of bytes the server is allowed to return in the SMB2 QUERY_DIRECTORY Response.
+ uint8_t Buffer[1]; //!< A variable-length buffer containing the Unicode search pattern for the request, as described by the FileNameOffset and FileNameLength fields
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The QueryDirResponse struct
+ * The SMB2 QUERY_DIRECTORY Response packet is sent by a server in
+ * response to an SMB2 QUERY_DIRECTORY Reques
+ */
+struct QueryDirResponse
+{
+ uint16_t structureSize; //!< Must be 9
+ uint16_t OutputBufferOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the directory enumeration data being returned.
+ uint32_t OutputBufferLength; //!< The length, in bytes, of the directory enumeration being returned.
+ uint8_t Buffer[1]; //!< A variable-length buffer containing the directory enumeration being returned in the response, as described by the OutputBufferOffset and OutputBufferLength
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The FlushRequest struct
+ * The SMB2 FLUSH Request packet is sent by a client to
+ * request that a server flush all cached file information
+ * for a specified open of a file to the persistent store that backs the file
+ */
+struct FlushRequest
+{
+ uint16_t structureSize; //!< Must be 24
+ uint16_t reserved1; //!< This field MUST NOT be used and MUST be reserved. The client may set this to 0, and the server MUST ignore it on receipt.
+ uint32_t reserved2; //!< This field MUST NOT be used and MUST be reserved. The client may set this to 0, and the server MUST ignore it on receipt.
+ uint64_t PersistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t VolatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The FlushResponse struct
+ * The SMB2 FLUSH Request packet is sent by a client to
+ * request that a server flush all cached file information
+ * for a specified open of a file to the persistent store that backs the file
+ */
+struct FlushResponse
+{
+ uint16_t structureSize; //!< Must be 4
+ uint16_t reserved1; //!< This field MUST NOT be used and MUST be reserved. The server may set this to 0, and the client MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * For the SMB 2.002, 2.1 and 3.0 dialects,
+ * this field MUST NOT be used and MUST be reserved.
+ * The client MUST set this field to 0, and the server MUST
+ * ignore it on receipt. Used by the SMB 3.02 dialect.
+ */
+enum class BufferingFlags : uint8_t
+{
+ NONE = 0x00, //!< Default for SMB 2.002, 2.1 and 3.0 dialects
+ SMB2_READFLAG_READ_UNBUFFERED = 0x01, //!< The server or underlying object store SHOULD NOT cache the read data at intermediate layers.
+};
+
+/*!
+ * For SMB 2.002 and 2.1 dialects, this field MUST NOT be used and MUST be reserved.
+ * The client MUST set this field to 0, and the server MUST ignore it on receipt.
+ */
+enum class Channels : uint32_t
+{
+ SMB2_CHANNEL_NONE = 0x00000000,//!< No channel information is present in the request. The ReadChannelInfoOffset and ReadChannelInfoLength fields MUST be set to 0 by the client and MUST be ignored by the server.
+ SMB2_CHANNEL_RDMA_V1 = 0x00000001,//!< One or more SMB_DIRECT_BUFFER_DESCRIPTOR_V1 structures as specified in [MS-SMBD] section 2.2.3.1 are present in the channel information specified by ReadChannelInfoOffset and ReadChannelInfoLength fields.
+ SMB2_CHANNEL_RDMA_V1_INVALIDATE = 0x00000002,//!< This value is valid only for the SMB 3.02 dialect. One or more SMB_DIRECT_BUFFER_DESCRIPTOR_V1 structures, as specified in [MS-SMBD] section 2.2.3.1, are present in the channel information specified by the ReadChannelInfoOffset and ReadChannelInfoLength fields. The server is requested to perform remote invalidation when responding to the request as specified in [MS-SMBD] section 3.1.4.2.
+};
+
+/*!
+ * \brief The ReadRequest structure
+ * The SMB2 READ Request packet is sent by the client
+ * to request a read operation on the file that is specified by the FileId
+ */
+struct ReadRequest
+{
+ uint16_t structureSize; //!< Must be 49
+ uint8_t padding; //!< The requested offset from the start of the SMB2 header, in bytes, at which to place the data read in the SMB2 READ Response
+ BufferingFlags flags; //!< For the SMB 2.002, 2.1 and 3.0 dialects, this field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt. Used by SMB 3.02 dialect
+ uint32_t length; //!< The length, in bytes, of the data to read from the specified file or pipe. The length of the data being read may be zero bytes.
+ uint64_t offset; //!< The offset, in bytes, into the file from which the data MUST be read
+ uint64_t persistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t volatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint32_t minimumCount; //!< The minimum number of bytes to be read for this operation to be successful
+ Channels channel; //!< For SMB 2.002 and 2.1 dialects, this field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt.
+ uint32_t RemainingBytes; //!< The number of subsequent bytes that the client intends to read from the file after this operation completes. This value is provided to facilitate read-ahead caching, and is not binding on the server.
+ uint16_t ReadChannelInfoOffset; //!< For the SMB 2.002 and 2.1 dialects, this field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt. For the SMB 3.x dialect family, it contains the offset, in bytes, from the beginning of the SMB2 header to the channel data as specified by the Channel field of the request.
+ uint16_t ReadChannelInfoLength; //!< For the SMB 2.002 and 2.1 dialects, this field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt. For the SMB 3.x dialect family, it contains the length, in bytes, of the channel data as specified by the Channel field of the request.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the read channel information, as described by ReadChannelInfoOffset and ReadChannelInfoLength. Unused at present. The client MUST set one byte of this field to 0, and the server MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The ReadResponse structure
+ * The SMB2 READ Response packet is sent in response
+ * to an SMB2 READ Request packet
+ */
+struct ReadResponse
+{
+ uint16_t structureSize; //!< Must be 17
+ uint8_t DataOffset; //!< The offset, in bytes, from the beginning of the header to the data read being returned in this response
+ uint8_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+ uint32_t DataLength; //!< The length, in bytes, of the data read being returned in this response.
+ uint32_t DataRemaining; //!< The length, in bytes, of the data being sent on the Channel specified in the request
+ uint32_t Reserved2; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the data read for the response, as described by DataOffset and DataLength. The minimum length is 1 byte. If 0 bytes are returned from the underlying object store, the server MUST send a failure response with status equal to STATUS_END_OF_FILE.
+} __attribute__ ((__packed__));
+
+/*!
+ * A Flags field indicates how to process the operation.
+ * This field MUST be constructed using zero or more of possible values
+ */
+enum class WriteFlags : uint32_t
+{
+ SMB2_WRITEFLAG_WRITE_THROUGH = 0x00000001,//!< The write data should be written to persistent storage before the response is sent regardless of how the file was opened. This value is not valid for the SMB 2.002 dialect.
+ SMB2_WRITEFLAG_WRITE_UNBUFFERED = 0x00000002,//!< The server or underlying object store SHOULD NOT cache the write data at intermediate layers and SHOULD allow it to flow through to persistent storage. This bit is only valid for the SMB 3.02 dialect.
+};
+
+/*!
+ * \brief The WriteRequest structure
+ * The SMB2 WRITE Request packet is sent by the client
+ * to write data to the file or named pipe on the server.
+ */
+struct WriteRequest
+{
+ uint16_t structureSize; //!< The client MUST set this field to 49, indicating the size of the request structure, not including the header. The client MUST set it to this value regardless of how long Buffer[] actually is in the request being sent.
+ uint16_t dataOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the data being written.
+ uint32_t Length; //!< The length of the data being written, in bytes. The length of the data being written may be zero bytes.
+ uint64_t Offset; //!< he offset, in bytes, of where to write the data in the destination file. If the write is being executed on a pipe, the Offset MUST be set to 0 by the client and MUST be ignored by the server.
+ uint64_t persistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t volatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ Channels Channel; //!< For the SMB 2.002 and 2.1 dialects, this field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt. For the SMB 3.x dialect family, this field MUST contain exactly one of possible values
+ uint32_t RemainingBytes; //!< The number of subsequent bytes the client intends to write to the file after this operation completes. This value is provided to facilitate write caching and is not binding on the server
+ uint16_t WriteChannelInfoOffset; //!< For the SMB 2.002 and 2.1 dialects, this field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt. For the SMB 3.x dialect family, it contains the offset, in bytes, from the beginning of the SMB2 header to the channel data as described by the Channel field of the request.
+ uint16_t WriteChannelInfoLength; //!< For the SMB 2.002 and SMB 2.1 dialects, this field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt. For the SMB 3.x dialect family, it contains the offset, in bytes, from the beginning of the SMB2 header to the channel data as described by the Channel field of the request.
+ WriteFlags Flags; //!< A Flags field indicates how to process the operation. This field MUST be constructed using zero or more of possible values
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the data to write and the write channel information, as described by DataOffset, Length, WriteChannelInfoOffset, and WriteChannelInfoLength.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The WriteResponse structure
+ * The SMB2 WRITE Response packet is sent in response to an
+ * SMB2 WRITE Request packet
+ */
+struct WriteResponse
+{
+//FIXME: size must be 17, but actual structure size = 16. Why?
+ uint16_t structureSize; //!< The server MUST set this field to 17, the actual size of the response structure notwithstanding.
+ uint16_t reserved1; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+ uint32_t Count; //!< The number of bytes written.
+ uint32_t Remaining; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+ uint16_t WriteChannelInfoOffset; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+ uint16_t WriteChannelInfoLength; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * The description of how the range is being locked or
+ * unlocked and how to process the operation
+ */
+enum class LockFlags : uint32_t
+{
+ SMB2_LOCKFLAG_SHARED_LOCK = 0x00000001, //!< The range MUST be locked shared, allowing other opens to read from or take a shared lock on the range. All opens MUST NOT be allowed to write within the range. Other locks can be requested and taken on this range.
+ SMB2_LOCKFLAG_EXCLUSIVE_LOCK = 0x00000002, //!< The range MUST be locked exclusive, not allowing other opens to read, write, or lock within the range.
+ SMB2_LOCKFLAG_UNLOCK = 0x00000004, //!< The range MUST be unlocked from a previous lock taken on this range. The unlock range MUST be identical to the lock range. Sub-ranges cannot be unlocked.
+ SMB2_LOCKFLAG_FAIL_IMMEDIATELY = 0x00000010, //!< The lock operation MUST fail immediately if it conflicts with an existing lock, instead of waiting for the range to become available.
+};
+
+/*!
+ * \brief The Lock structure
+ * The SMB2_LOCK_ELEMENT Structure packet is used by the SMB2 LOCK
+ * Request packet to indicate segments of files that
+ * should be locked or unlocked.
+ */
+struct Lock
+{
+ uint64_t Offset; //!< The starting offset, in bytes, in the destination file from where the range being locked or unlocked starts.
+ uint64_t Length; //!< The length, in bytes, of the range being locked or unlocked.
+ LockFlags Flags; //!< The description of how the range is being locked or unlocked and how to process the operation
+ uint32_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The LockRequest structure
+ * he SMB2 LOCK Request packet is sent by the client to either lock
+ * or unlock portions of a file.
+ * Several different segments of the file can be affected with a
+ * single SMB2 LOCK Request packet, but they all MUST be
+ * within the same file.
+ */
+struct LockRequest
+{
+ uint16_t structureSize; //!< The client MUST set this to 48
+ uint16_t LockCount; //!< TMUST be set to the number of SMB2_LOCK_ELEMENT structures that are contained in the Locks[] array. The lock count MUST be greater than or equal to 1.
+ uint32_t LockSequence; //!< The client MUST set this to 48, indicating the size of an SMB2 LOCK Request with a single SMB2_LOCK_ELEMENT structure. This value is set regardless of the number of locks that are sent.
+ uint64_t persistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t volatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ Lock locks[1]; //!< An array of LockCount (SMB2_LOCK_ELEMENT) structures that define the ranges to be locked or unlocked.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The LockResponse structure
+ * The SMB2 LOCK Response packet is sent by a server
+ * in response to an SMB2 LOCK Request packet
+ */
+struct LockResponse
+{
+ uint16_t structureSize; //!< The server MUST set this to 4
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The CancelRequest structure
+ * The SMB2 CANCEL Request packet is sent by the client to
+ * cancel a previously sent message on the same SMB2 transport
+ * connection. The MessageId of the request to be canceled MUST
+ * be set in the SMB2 header of the request
+ */
+struct CancelRequest
+{
+ uint16_t structureSize; //!< The server MUST set this to 4
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+struct CancelResponce {} __attribute__ ((__packed__)); //!< Cancel command's results
+
+/*!
+ * Flags indicating how the operation MUST be processed
+ */
+enum class ChangeFlags : uint16_t
+{
+ NONE = 0x0000,
+ SMB2_WATCH_TREE = 0x0001 //!< The request MUST monitor changes on any file or directory contained beneath the directory specified by FileId.
+};
+
+/*!
+ * Specifies the types of changes to monitor. It is valid to choose multiple trigger conditions
+ */
+enum class Events : uint32_t
+{
+ FILE_NOTIFY_CHANGE_FILE_NAME = 0x00000001,//!< The client is notified if a file-name changes.
+ FILE_NOTIFY_CHANGE_DIR_NAME = 0x00000002,//!< The client is notified if a directory name changes.
+ FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x00000004,//!< The client is notified if a file's attributes change. Possible file attribute values are specified in [MS-FSCC] section 2.6.
+ FILE_NOTIFY_CHANGE_SIZE = 0x00000008,//!< The client is notified if a file's size changes.
+ FILE_NOTIFY_CHANGE_LAST_WRITE = 0x00000010,//!< The client is notified if the last write time of a file changes.
+ FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x00000020,//!< The client is notified if the last access time of a file changes.
+ FILE_NOTIFY_CHANGE_CREATION = 0x00000040,//!< The client is notified if the creation time of a file changes.
+ FILE_NOTIFY_CHANGE_EA = 0x00000080,//!< The client is notified if a file's extended attributes (EAs) change.
+ FILE_NOTIFY_CHANGE_SECURITY = 0x00000100,//!< The client is notified of a file's access control list (ACL) settings change.
+ FILE_NOTIFY_CHANGE_STREAM_NAME = 0x00000200,//!< The client is notified if a named stream is added to a file.
+ FILE_NOTIFY_CHANGE_STREAM_SIZE = 0x00000400,//!< The client is notified if the size of a named stream is changed.
+ FILE_NOTIFY_CHANGE_STREAM_WRITE = 0x00000800,//!< The client is notified if a named stream is modified.
+};
+
+/*!
+ * \brief The LockRequest structure
+ * The SMB2 CHANGE_NOTIFY Request packet is sent by the client to
+ * request change notifications on a directory
+ */
+struct ChangeNotifyRequest
+{
+ uint16_t structureSize; //!< The client MUST set this to 32
+ ChangeFlags flags; //!< Flags indicating how the operation MUST be processed
+ uint32_t OutputBufferLength; //!< The maximum number of bytes the server is allowed to return in the SMB2 CHANGE_NOTIFY Response
+ uint64_t persistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t volatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ Events CompletionFilter; //!< Specifies the types of changes to monitor. It is valid to choose multiple trigger conditions
+ uint32_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt.
+} __attribute__ ((__packed__));
+
+/*!
+ * The changes that occurred on the file
+ */
+enum class FileAction : uint32_t
+{
+ ADDED = 0x00000001, //!< The file was added to the directory.
+ REMOVED = 0x00000002, //!< The file was removed from the directory.
+ MODIFIED = 0x00000003, //!< The file was modified. This may be a change to the data or attributes of the file.
+ RENAMED_OLD_NAME = 0x00000004, //!< The file was renamed, and this is the old name. If the new name resides within the directory being monitored, the client will also receive the FILE_ACTION_RENAMED_NEW_NAME bit value as described in the next list item. If the new name resides outside of the directory being monitored, the client will not receive the FILE_ACTION_RENAMED_NEW_NAME bit value.
+ RENAMED_NEW_NAME = 0x00000005, //!< The file was renamed, and this is the new name. If the old name resides within the directory being monitored, the client will also receive the FILE_ACTION_RENAME_OLD_NAME bit value. If the old name resides outside of the directory being monitored, the client will not receive the FILE_ACTION_RENAME_OLD_NAME bit value.
+ ADDED_STREAM = 0x00000006, //!< The file was added to a named stream.
+ REMOVED_STREAM = 0x00000007, //!< The file was removed from the named stream.
+ MODIFIED_STREAM = 0x00000008, //!< The file was modified. This may be a change to the data or attributes of the file.
+ REMOVED_BY_DELETE = 0x00000009, //!< The file was removed by delete.
+};
+
+/*!
+ * The FILE_NOTIFY_INFORMATION structure contains the changes
+ * that the client is being notified of
+ */
+struct FileNotifyInformation
+{
+ uint32_t NextEntryOffset; //!< The offset, in bytes, from the beginning of this structure to the subsequent FILE_NOTIFY_INFORMATION structure. If there are no subsequent structures, the NextEntryOffset field MUST be 0. NextEntryOffset MUST always be an integral multiple of 4. The FileName array MUST be padded to the next 4-byte boundary counted from the beginning of the structure.
+ FileAction action; //!< The changes that occurred on the file. This field MUST contain one of the following values.
+ uint32_t FileNameLength; //!< The length, in bytes, of the file name in the FileName field.
+ uint32_t FileName[1]; //!< A Unicode string with the name of the file that changed.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The LockResponse structure
+ * The SMB2 CHANGE_NOTIFY Response packet is sent by the
+ * server to transmit the results of a client's SMB2 CHANGE_NOTIFY Request
+ */
+struct ChangeNotifyResponse
+{
+ uint16_t structureSize; //!< The server MUST set this to 9
+ uint16_t OutputBufferOffset; //!< he offset, in bytes, from the beginning of the SMB2 header to the change information being returned.
+ uint32_t OutputBufferLength; //!< The length, in bytes, of the change information being returned.
+ FileNotifyInformation Buffer[1]; //!< A variable-length buffer containing the change information being returned in the response, as described by the OutputBufferOffset and OutputBufferLength fields. This field is an array of FileNotifyInformation structures
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The OplockAcknowledgment structure
+ * The Oplock Break Acknowledgment packet is sent by the client in response
+ * to an SMB2 Oplock Break Notification packet sent by the server.
+ * The server responds to an oplock break acknowledgment with an SMB2
+ * Oplock Break response. The client MUST NOT send an oplock break
+ * acknowledgment for an oplock break from level II to none.
+ * A break from level II MUST transition to none.
+ * Thus, the client does not send a request to the server because there
+ * is no question how the transition was made.
+ */
+struct OplockAcknowledgment
+{
+ uint16_t structureSize; //!< The client MUST set this to 24
+ OplockLevels LockCount; //!< The client will set this field to the lowered oplock level that the client accepts for this file
+ uint8_t Reserved1; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ uint32_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ uint8_t fileId[16]; //!< SMB2_FILEID structure
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The OplockResponse structure
+ * The Oplock Break Response packet is sent by the server in response
+ * to an Oplock Break Acknowledgment from the client.
+ */
+struct OplockResponse
+{
+ uint16_t structureSize; //!< The client MUST set this to 24
+ OplockLevels LockCount; //!< The client will set this field to the lowered oplock level that the client accepts for this file
+ uint8_t Reserved1; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ uint32_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ uint8_t fileId[16]; //!< SMB2_FILEID structure
+} __attribute__ ((__packed__));
+
+/*!
+ * The control code of the FSCTL/IOCTL method.
+ * The values are listed in subsequent sections
+ */
+enum class CtlCodes : uint32_t
+{
+ SCTL_DFS_GET_REFERRALS = 0x00060194,
+ FSCTL_PIPE_PEEK = 0x0011400C,
+ FSCTL_PIPE_WAIT = 0x00110018,
+ FSCTL_PIPE_TRANSCEIVE = 0x0011C017,
+ FSCTL_SRV_COPYCHUNK = 0x001440F2,
+ FSCTL_SRV_ENUMERATE_SNAPSHOTS = 0x00144064,
+ FSCTL_SRV_REQUEST_RESUME_KEY = 0x00140078,
+ FSCTL_SRV_READ_HASH = 0x001441bb,
+ FSCTL_SRV_COPYCHUNK_WRITE = 0x001480F2,
+ FSCTL_LMR_REQUEST_RESILIENCY = 0x001401D4,
+ FSCTL_QUERY_NETWORK_INTERFACE_INFO = 0x001401FC,
+ FSCTL_SET_REPARSE_POINT = 0x000900A4,
+ FSCTL_DFS_GET_REFERRALS_EX = 0x000601B0,
+ FSCTL_FILE_LEVEL_TRIM = 0x00098208,
+ FSCTL_VALIDATE_NEGOTIATE_INFO = 0x00140204,
+};
+
+/*!
+ * A Flags field indicating how to process the operation
+ */
+enum class IoCtlOpFlags : uint32_t
+{
+ NONE = 0x00000000, //!< If Flags is set to this value
+ IOCTL_IS_FSCTL = 0x00000001, //!< If Flags is set to this value
+};
+
+/*!
+ * NT error codes.
+ */
+enum class NTStatus: uint32_t
+{
+ STATUS_SUCCESS = 0x00000000,
+ STATUS_NO_MORE_FILES = 0x80000006,
+ STATUS_INVALID_HANDLE = 0xC0000008,
+ STATUS_INVALID_PARAMETER = 0xC000000D,
+ STATUS_NO_SUCH_FILE = 0xC000000F,
+ STATUS_MORE_PROCESSING_REQUIRED = 0xC0000016,
+ STATUS_INVALID_SYSTEM_SERVICE = 0xC000001C,
+ STATUS_ACCESS_DENIED = 0xC0000022,
+ STATUS_OBJECT_NAME_INVALID = 0xC0000033,
+ STATUS_OBJECT_NAME_NOT_FOUND = 0xC0000034,
+ STATUS_OBJECT_NAME_COLLISION = 0xC0000035,
+ STATUS_OBJECT_PATH_NOT_FOUND = 0xC000003A,
+ STATUS_OBJECT_PATH_SYNTAX_BAD = 0xC000003B,
+ STATUS_SHARING_VIOLATION = 0xC0000043,
+ STATUS_EA_TOO_LARGE = 0xC0000050,
+ STATUS_FILE_LOCK_CONFLICT = 0xC0000054,
+ STATUS_LOCK_NOT_GRANTED = 0xC0000055,
+ STATUS_LOGON_FAILURE = 0xC000006D,
+ STATUS_RANGE_NOT_LOCKED = 0xC000007E,
+ STATUS_FILE_IS_A_DIRECTORY = 0xC00000BA,
+ STATUS_NOT_SUPPORTED = 0xC00000BB,
+ STATUS_BAD_DEVICE_TYPE = 0xC00000CB,
+ STATUS_REQUEST_NOT_ACCEPTED = 0xC00000D0,
+ STATUS_DIRECTORY_NOT_EMPTY = 0xC0000101,
+ STATUS_NOT_A_DIRECTORY = 0xC0000103,
+ STATUS_CANCELLED = 0xC0000120
+};
+
+enum class AccessMask: uint32_t
+{
+ FILE_READ_DATA = 0x00000001,
+ FILE_WRITE_DATA = 0x00000002,
+ FILE_APPEND_DATA = 0x00000004,
+ FILE_READ_EA = 0x00000008,
+ FILE_WRITE_EA = 0x00000010,
+ FILE_EXECUTE = 0x00000020,
+ FILE_DELETE_CHILD = 0x00000040,
+ FILE_READ_ATTRIBUTES = 0x00000080,
+ FILE_WRITE_ATTRIBUTES = 0x00000100,
+ DELETE = 0x00010000,
+ READ_CONTROL = 0x00020000,
+ WRITE_DAC = 0x00040000,
+ WRITE_OWNER = 0x00080000,
+ SYNCHRONIZE = 0x00100000,
+ ACCESS_SYSTEM_SECURITY = 0x01000000,
+ MAXIMUM_ALLOWED = 0x02000000,
+ GENERIC_ALL = 0x10000000,
+ GENERIC_EXECUTE = 0x20000000,
+ GENERIC_WRITE = 0x40000000,
+ GENERIC_READ = 0x80000000
+};
+
+/*!
+ * \brief The IoCtlRequest structure
+ * The SMB2 IOCTL Request packet is sent by a client
+ * to issue an implementation-specific file system
+ * control or device control (FSCTL/IOCTL) command across the network
+ */
+struct IoCtlRequest
+{
+ uint16_t structureSize; //!< The server MUST set this to 57
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ CtlCodes CtlCode; //!< The control code of the FSCTL/IOCTL method
+ uint64_t persistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t volatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint32_t InputOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the input data buffer. If no input data is required for the FSCTL/IOCTL command being issued, the client SHOULD set this value to 0.<56>
+ uint32_t InputCount; //!< The size, in bytes, of the input data.
+ uint32_t MaxInputResponse; //!< The maximum number of bytes that the server can return for the input data in the SMB2 IOCTL Response.
+ uint32_t OutputOffset; //!< The client SHOULD set this to 0.<57>
+ uint32_t OutputCount; //!< The client MUST set this to 0.
+ uint32_t MaxOutputResponse; //!< The maximum number of bytes that the server can return for the output data in the SMB2 IOCTL Response.
+ IoCtlOpFlags flags; //!< A Flags field indicating how to process the operation
+ uint32_t Reserved2; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the input and output data buffer for the request, as described by the InputOffset, InputCount, OutputOffset, and OutputCount. There is no minimum size restriction for this field as there can be FSCTLs with no input or output buffers. For FSCTL_SRV_COPYCHUNK or FSCTL_SRV_COPYCHUNK_WRITE, the format of this buffer is specified in SRV_COPYCHUNK_COPY. The Buffer format for FSCTL_DFS_GET_REFERRALS is specified in [MS-DFSC] section 2.2.2. The format of this buffer for all other FSCTLs is specified in the reference topic for the FSCTL being called.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The IoCtlResponse structure
+ * The SMB2 IOCTL Response packet is sent by the server
+ * to transmit the results of a client SMB2 IOCTL Request.
+ */
+struct IoCtlResponse
+{
+ uint16_t structureSize; //!< The server MUST set this to 49
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
+ CtlCodes CtlCode; //!< The control code of the FSCTL/IOCTL method
+ uint64_t persistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t volatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint32_t InputOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the input data buffer. If no input data is required for the FSCTL/IOCTL command being issued, the client SHOULD set this value to 0.<56>
+ uint32_t InputCount; //!< The size, in bytes, of the input data.
+ uint32_t OutputOffset; //!< The client SHOULD set this to 0.<57>
+ uint32_t OutputCount; //!< The client MUST set this to 0.
+ IoCtlOpFlags flags; //!< A Flags field indicating how to process the operation
+ uint32_t Reserved2; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt.
+ uint8_t Buffer[1]; //!< A variable-length buffer that contains the input and output data buffer for the request, as described by the InputOffset, InputCount, OutputOffset, and OutputCount. There is no minimum size restriction for this field as there can be FSCTLs with no input or output buffers. For FSCTL_SRV_COPYCHUNK or FSCTL_SRV_COPYCHUNK_WRITE, the format of this buffer is specified in SRV_COPYCHUNK_COPY. The Buffer format for FSCTL_DFS_GET_REFERRALS is specified in [MS-DFSC] section 2.2.2. The format of this buffer for all other FSCTLs is specified in the reference topic for the FSCTL being called.
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The SetInfoRequest structure
+ * The SMB2 SET_INFO Request packet is sent by a client
+ * to set information on a file or underlying object store
+ */
+struct SetInfoRequest
+{
+ uint16_t structureSize; //!< The server MUST set this to 33
+ InfoTypes infoType; //!< The type of information being set
+ uint8_t FileInfoClass; //!< For setting file information, this field MUST contain one of the FILE_INFORMATION_CLASS values
+ uint32_t BufferLength; //!< The length, in bytes, of the information to be set.
+ uint16_t BufferOffset; //!< The offset, in bytes, from the beginning of the SMB2 header to the information to be set.
+ uint16_t Reserved; //!< This field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt.
+ AdditionInfo AdditionalInformation; //!< Provides additional information to the server.
+ uint64_t persistentFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint64_t volatileFileId; //!< An SMB2_FILEID identifier of the file or named pipe on which to perform the query.
+ uint8_t Buffer[1];
+} __attribute__ ((__packed__));
+
+/*!
+ * \brief The SetInfoResponse structure
+ * The SMB2 SET_INFO Response packet is sent by the server
+ * in response to an SMB2 SET_INFO Request to notify the
+ * client that its request has been successfully processed
+ */
+struct SetInfoResponse
+{
+ uint16_t structureSize; //!< The server MUST set this to 2
+} __attribute__ ((__packed__));
+
+} // namespace SMBv2
+} // namespace API
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//API_CIFS2_COMMANDS_H
+//------------------------------------------------------------------------------
diff --git a/src/api/cifs_commands.h b/src/api/cifs_commands.h
new file mode 100644
index 0000000..c11e1f7
--- /dev/null
+++ b/src/api/cifs_commands.h
@@ -0,0 +1,352 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Definition of CIFSv1 commands
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef API_CIFS_COMMANDS_H
+#define API_CIFS_COMMANDS_H
+//------------------------------------------------------------------------------
+#include <cstdint>
+
+#include "cifs_pc_to_net.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace API
+{
+/*! SMB 1 version
+ */
+namespace SMBv1
+{
+
+/*! CIFS v1 commands list
+ */
+enum class SMBv1Commands
+{
+ SMB_COM_CREATE_DIRECTORY, //!< Create a new directory.
+ SMB_COM_DELETE_DIRECTORY, //!< Delete an empty directory.
+ SMB_COM_OPEN, //!< Open a file.
+ SMB_COM_CREATE, //!< Create or open a file.
+ SMB_COM_CLOSE, //!< Close a file.
+ SMB_COM_FLUSH, //!< Flush data for a file
+ SMB_COM_DELETE, //!< Delete a file.
+ SMB_COM_RENAME, //!< Rename a file or set of files.
+ SMB_COM_QUERY_INFORMATION, //!< Get file attributes.
+ SMB_COM_SET_INFORMATION, //!< Set file attributes.
+ SMB_COM_READ, //!< Read from a file.
+ SMB_COM_WRITE, //!< Write to a file.
+ SMB_COM_LOCK_BYTE_RANGE, //!< Request a byte-range lock on a file.
+ SMB_COM_UNLOCK_BYTE_RANGE, //!< Release a byte-range lock on a file.
+ SMB_COM_CREATE_TEMPORARY, //!< Create a temporary file.
+ SMB_COM_CREATE_NEW, //!< Create and open a new file.
+ SMB_COM_CHECK_DIRECTORY, //!< Verify that the specified pathname resolves to a directory.Listed as SMBchkpath in some documentation.
+ SMB_COM_PROCESS_EXIT, //!< Indicate process exit.
+ SMB_COM_SEEK, //!< Set the current file pointer within a file.
+ SMB_COM_LOCK_AND_READ, //!< Lock and read a byte-range within a file.
+ SMB_COM_WRITE_AND_UNLOCK, //!< Write and unlock a byte-range within a file.
+ SMB_COM_READ_RAW, //!< Read a block in raw mode.
+ SMB_COM_READ_MPX, //!< Multiplexed block read. Listed as SMBreadmpx in some documentation.
+ SMB_COM_READ_MPX_SECONDARY, //!< Multiplexed block read
+ SMB_COM_WRITE_RAW, //!< Write a block in raw mode.
+ SMB_COM_WRITE_MPX, //!< Multiplexed block write.
+ SMB_COM_WRITE_MPX_SECONDARY, //!< Multiplexed block write
+ SMB_COM_WRITE_COMPLETE, //!< Raw block write
+ SMB_COM_QUERY_SERVER, //!< Reserved
+ SMB_COM_SET_INFORMATION2, //!< Set an extended set of file attributes.
+ SMB_COM_QUERY_INFORMATION2, //!< Get an extended set of file attributes.
+ SMB_COM_LOCKING_ANDX, //!< Lock multiple byte ranges; AndX chaining.
+ SMB_COM_TRANSACTION, //!< Transaction.
+ SMB_COM_TRANSACTION_SECONDARY, //!< Transaction secondary request.
+ SMB_COM_IOCTL, //!< Pass an I/O Control function request to the server.
+ SMB_COM_IOCTL_SECONDARY, //!< IOCTL secondary request.
+ SMB_COM_COPY, //!< Copy a file or directory.
+ SMB_COM_MOVE, //!< Move a file or directory.
+ SMB_COM_ECHO, //!< Echo request (ping).
+ SMB_COM_WRITE_AND_CLOSE, //!< Write to and close a file.
+ SMB_COM_OPEN_ANDX, //!< Extended file open with AndX chaining.
+ SMB_COM_READ_ANDX, //!< Extended file read with AndX chaining.
+ SMB_COM_WRITE_ANDX, //!< Extended file write with AndX chaining.
+ SMB_COM_NEW_FILE_SIZE, //!< Reserved
+ SMB_COM_CLOSE_AND_TREE_DISC, //!< Close an open file and tree disconnect.
+ SMB_COM_TRANSACTION2, //!< Transaction 2 format request/response.
+ SMB_COM_TRANSACTION2_SECONDARY, //!< Transaction 2 secondary request.
+ SMB_COM_FIND_CLOSE2, //!< Close an active search.
+ SMB_COM_FIND_NOTIFY_CLOSE, //!< Notification of the closure of an active search.
+ SMB_COM_TREE_CONNECT, //!< Tree connect.
+ SMB_COM_TREE_DISCONNECT, //!< Tree disconnect.
+ SMB_COM_NEGOTIATE, //!< Negotiate protocol dialect.
+ SMB_COM_SESSION_SETUP_ANDX, //!< Session Setup with AndX chaining.
+ SMB_COM_LOGOFF_ANDX, //!< User logoff with AndX chaining.
+ SMB_COM_TREE_CONNECT_ANDX, //!< Tree connect with AndX chaining.
+ SMB_COM_SECURITY_PACKAGE_ANDX, //!< Negotiate security packages with AndX chaining.
+ SMB_COM_QUERY_INFORMATION_DISK, //!< Retrieve file system information from the server.
+ SMB_COM_SEARCH, //!< Directory wildcard search.
+ SMB_COM_FIND, //!< Start or continue an extended wildcard directory search.
+ SMB_COM_FIND_UNIQUE, //!< Perform a one-time extended wildcard directory search.
+ SMB_COM_FIND_CLOSE, //!< End an extended wildcard directory search.
+ SMB_COM_NT_TRANSACT, //!< NT format transaction request/response.
+ SMB_COM_NT_TRANSACT_SECONDARY, //!< NT format transaction secondary request.
+ SMB_COM_NT_CREATE_ANDX, //!< Create or open a file or a directory.
+ SMB_COM_NT_CANCEL, //!< Cancel a request currently pending at the server.
+ SMB_COM_NT_RENAME, //!< File rename with extended semantics.
+ SMB_COM_OPEN_PRINT_FILE, //!< Create a print queue spool file.
+ SMB_COM_WRITE_PRINT_FILE, //!< Write to a print queue spool file.
+ SMB_COM_CLOSE_PRINT_FILE, //!< Close a print queue spool file.
+ SMB_COM_GET_PRINT_QUEUE, //!< Request print queue information.
+ SMB_COM_READ_BULK, //!< Reserved
+ SMB_COM_WRITE_BULK, //!< Reserved
+ SMB_COM_WRITE_BULK_DATA, //!< Reserved
+ SMB_COM_INVALID, //!< As the name suggests
+ SMB_COM_NO_ANDX_COMMAND, //!< Also known as the NIL command. It identifies the end of an AndX Chain
+ CMD_COUNT
+};
+
+static const int commandsCount = 255;
+
+struct CreateDirectoryArgumentType{} __attribute__ ((__packed__)); //!< CreateDirectory arguments
+struct CreateDirectoryResultType{} __attribute__ ((__packed__)); //!< CreateDirectory results
+
+struct DeleteDirectoryArgumentType{} __attribute__ ((__packed__)); //!< DeleteDirectory arguments
+struct DeleteDirectoryResultType{} __attribute__ ((__packed__)); //!< DeleteDirectory results
+
+struct OpenArgumentType{} __attribute__ ((__packed__)); //!< Open arguments
+struct OpenResultType{} __attribute__ ((__packed__)); //!< Open results
+
+struct CreateArgumentType{} __attribute__ ((__packed__)); //!< Create arguments
+struct CreateResultType{} __attribute__ ((__packed__)); //!< Create results
+
+struct CloseArgumentType{} __attribute__ ((__packed__)); //!< Close arguments
+struct CloseResultType{} __attribute__ ((__packed__)); //!< Close results
+
+struct FlushArgumentType{} __attribute__ ((__packed__)); //!< Flush arguments
+struct FlushResultType{} __attribute__ ((__packed__)); //!< Flush results
+
+struct DeleteArgumentType{} __attribute__ ((__packed__)); //!< Delete arguments
+struct DeleteResultType{} __attribute__ ((__packed__)); //!< Delete results
+
+struct RenameArgumentType{} __attribute__ ((__packed__)); //!< Rename arguments
+struct RenameResultType{} __attribute__ ((__packed__)); //!< Rename results
+
+struct QueryInformationArgumentType{} __attribute__ ((__packed__)); //!< QueryInformation arguments
+struct QueryInformationResultType{} __attribute__ ((__packed__)); //!< QueryInformation results
+
+struct SetInformationArgumentType{} __attribute__ ((__packed__)); //!< Set Information arguments
+struct SetInformationResultType{} __attribute__ ((__packed__)); //!< Set Information results
+
+struct ReadArgumentType{} __attribute__ ((__packed__)); //!< Read arguments
+struct ReadResultType{} __attribute__ ((__packed__)); //!< Read results
+
+struct WriteArgumentType{} __attribute__ ((__packed__)); //!< Write arguments
+struct WriteResultType{} __attribute__ ((__packed__)); //!< Write results
+
+struct LockByteRangeArgumentType{} __attribute__ ((__packed__)); //!< Lock Byte Range arguments
+struct LockByteRangeResultType{} __attribute__ ((__packed__)); //!< Lock Byte Range results
+
+struct UnlockByteRangeArgumentType{} __attribute__ ((__packed__)); //!< UnLock Byte Range arguments
+struct UnlockByteRangeResultType{} __attribute__ ((__packed__)); //!< UnLock Byte Range results
+
+struct CreateTemporaryArgumentType{} __attribute__ ((__packed__)); //!< Create Temporary file arguments
+struct CreateTemporaryResultType{} __attribute__ ((__packed__)); //!< Create Temporary file results
+
+struct CreateNewArgumentType{} __attribute__ ((__packed__)); //!< Create a new file arguments
+struct CreateNewResultType{} __attribute__ ((__packed__)); //!< Create a new file results
+
+struct CheckDirectoryArgumentType{} __attribute__ ((__packed__)); //!< CheckDirectory arguments
+struct CheckDirectoryResultType{} __attribute__ ((__packed__)); //!< CheckDirectory results
+
+struct ProcessExitArgumentType{} __attribute__ ((__packed__)); //!< Process Exit arguments
+struct ProcessExitResultType{} __attribute__ ((__packed__)); //!< Process Exit results
+
+struct SeekArgumentType{} __attribute__ ((__packed__)); //!< Seek arguments
+struct SeekResultType{} __attribute__ ((__packed__)); //!< Seek results
+
+struct LockAndReadArgumentType{} __attribute__ ((__packed__)); //!< Lock And Read arguments
+struct LockAndReadResultType{} __attribute__ ((__packed__)); //!< Lock And Read results
+
+struct WriteAndUnlockArgumentType{} __attribute__ ((__packed__)); //!< Write And Unlock arguments
+struct WriteAndUnlockResultType{} __attribute__ ((__packed__)); //!< Write And Unlock results
+
+struct ReadRawArgumentType{} __attribute__ ((__packed__)); //!< Read raw command's arguments
+struct ReadRawResultType{} __attribute__ ((__packed__)); //!< Read raw command's results
+
+struct ReadMpxArgumentType{} __attribute__ ((__packed__)); //!< Read Mpx command's arguments
+struct ReadMpxResultType{} __attribute__ ((__packed__)); //!< Read Mpx command's results
+
+struct ReadMpxSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Read Read Mpx Secondary command's arguments
+struct ReadMpxSecondaryResultType{} __attribute__ ((__packed__)); //!< Read Read Mpx Secondary command's results
+
+struct WriteRawArgumentType{} __attribute__ ((__packed__)); //!< Write Raw command's arguments
+struct WriteRawResultType{} __attribute__ ((__packed__)); //!< Write Raw command's results
+
+struct WriteMpxArgumentType{} __attribute__ ((__packed__)); //!< Write Mpx command's arguments
+struct WriteMpxResultType{} __attribute__ ((__packed__)); //!< Write Mpx command's results
+
+struct WriteMpxSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Write Mpx 2 command's arguments
+struct WriteMpxSecondaryResultType{} __attribute__ ((__packed__)); //!< Write Mpx 2 command's results
+
+struct WriteCompleteArgumentType{} __attribute__ ((__packed__)); //!< Write Complete command's arguments
+struct WriteCompleteResultType{} __attribute__ ((__packed__)); //!< Write Complete command's results
+
+struct QueryServerArgumentType{} __attribute__ ((__packed__)); //!< Query Server (reserved) command's arguments
+struct QueryServerResultType{} __attribute__ ((__packed__)); //!< Query Server (reserved) command's results
+
+struct SetInformation2ArgumentType{} __attribute__ ((__packed__)); //!< Set Information 2 command's arguments
+struct SetInformation2ResultType{} __attribute__ ((__packed__)); //!< Set Information 2 command's results
+
+struct QueryInformation2ArgumentType{} __attribute__ ((__packed__)); //!< Query Information 2 command's arguments
+struct QueryInformation2ResultType{} __attribute__ ((__packed__)); //!< Query Information 2 command's results
+
+struct LockingAndxArgumentType{} __attribute__ ((__packed__)); //!< Lock some bytes of the file command's arguments
+struct LockingAndxResultType{} __attribute__ ((__packed__)); //!< Lock some bytes of the file command's results
+
+struct TransactionArgumentType{} __attribute__ ((__packed__)); //!< Transaction command's arguments
+struct TransactionResultType{} __attribute__ ((__packed__)); //!< Transaction command's results
+
+struct TransactionSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Transaction 2 command's arguments
+struct TransactionSecondaryResultType{} __attribute__ ((__packed__)); //!< Transaction 2 command's results
+
+struct IoctlArgumentType{} __attribute__ ((__packed__)); //!< Ioctl command's arguments
+struct IoctlResultType{} __attribute__ ((__packed__)); //!< Ioctl command's results
+
+struct IoctlSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Ioctl 2 command's arguments
+struct IoctlSecondaryResultType{} __attribute__ ((__packed__)); //!< Ioctl 2 command's results
+
+struct CopyArgumentType{} __attribute__ ((__packed__)); //!< Copy command's arguments
+struct CopyResultType{} __attribute__ ((__packed__)); //!< Copy command's results
+
+struct MoveArgumentType{} __attribute__ ((__packed__)); //!< Move command's arguments
+struct MoveResultType{} __attribute__ ((__packed__)); //!< Move command's results
+
+struct EchoArgumentType{} __attribute__ ((__packed__)); //!< Echo command's arguments
+struct EchoResultType{} __attribute__ ((__packed__)); //!< Echo command's results
+
+struct WriteAndCloseArgumentType{} __attribute__ ((__packed__)); //!< Write And Close command's arguments
+struct WriteAndCloseResultType{} __attribute__ ((__packed__)); //!< Write And Close command's results
+
+struct OpenAndxArgumentType{} __attribute__ ((__packed__)); //!< Open 2 command's arguments
+struct OpenAndxResultType{} __attribute__ ((__packed__)); //!< Open 2 command's results
+
+struct ReadAndxArgumentType{} __attribute__ ((__packed__)); //!< Read 2 command's arguments
+struct ReadAndxResultType{} __attribute__ ((__packed__)); //!< Read 2 command's results
+
+struct WriteAndxArgumentType{} __attribute__ ((__packed__)); //!< Write 2 command's arguments
+struct WriteAndxResultType{} __attribute__ ((__packed__)); //!< Write 2 command's results
+
+struct NewFileSizeArgumentType{} __attribute__ ((__packed__)); //!< New File Size command's arguments
+struct NewFileSizeResultType{} __attribute__ ((__packed__)); //!< New File Size command's results
+
+struct CloseAndTreeDiscArgumentType{} __attribute__ ((__packed__)); //!< Reserved command's arguments
+struct CloseAndTreeDiscResultType{} __attribute__ ((__packed__)); //!< Reserved command's results
+
+struct Transaction2ArgumentType{} __attribute__ ((__packed__)); //!< Transaction 2 command's arguments
+struct Transaction2ResultType{} __attribute__ ((__packed__)); //!< Transaction 2 command's results
+
+struct Transaction2SecondaryArgumentType{} __attribute__ ((__packed__)); //!< Transaction 3 command's arguments
+struct Transaction2SecondaryResultType{} __attribute__ ((__packed__)); //!< Transaction 3 command's results
+
+struct FindClose2ArgumentType{} __attribute__ ((__packed__)); //!< Search handle close command's arguments
+struct FindClose2ResultType{} __attribute__ ((__packed__)); //!< Search handle close command's results
+
+struct FindNotifyCloseArgumentType{} __attribute__ ((__packed__)); //!< Search handle close command's arguments
+struct FindNotifyCloseResultType{} __attribute__ ((__packed__)); //!< Search handle close command's results
+
+struct TreeConnectArgumentType{} __attribute__ ((__packed__)); //!< establish a client connection to a server share command's arguments
+struct TreeConnectResultType{} __attribute__ ((__packed__)); //!< establish a client connection to a server share command's results
+
+struct TreeDisconnectArgumentType{} __attribute__ ((__packed__)); //!< Disconnect command's arguments
+struct TreeDisconnectResultType{} __attribute__ ((__packed__)); //!< Disconnect command's results
+
+struct NegotiateArgumentType{} __attribute__ ((__packed__)); //!< Negotiate command's arguments
+struct NegotiateResultType{} __attribute__ ((__packed__)); //!< Negotiate command's results
+
+struct SessionSetupAndxArgumentType{} __attribute__ ((__packed__)); //!< Session setup command's arguments
+struct SessionSetupAndxResultType{} __attribute__ ((__packed__)); //!< Session setup command's results
+
+struct LogoffAndxArgumentType{} __attribute__ ((__packed__)); //!< Log off command's arguments
+struct LogoffAndxResultType{} __attribute__ ((__packed__)); //!< Log off command's results
+
+struct TreeConnectAndxArgumentType{} __attribute__ ((__packed__)); //!< Tree Connect command's arguments
+struct TreeConnectAndxResultType{} __attribute__ ((__packed__)); //!< Tree Connect command's results
+
+struct SecurityPackageAndxArgumentType{} __attribute__ ((__packed__)); //!< Security Package command's arguments
+struct SecurityPackageAndxResultType{} __attribute__ ((__packed__)); //!< Security Package command's results
+
+struct QueryInformationDiskArgumentType{} __attribute__ ((__packed__)); //!< Query Disk Information command's arguments
+struct QueryInformationDiskResultType{} __attribute__ ((__packed__)); //!< Query Disk Information command's results
+
+struct SearchArgumentType{} __attribute__ ((__packed__)); //!< Search command's arguments
+struct SearchResultType{} __attribute__ ((__packed__)); //!< Search command's results
+
+struct FindArgumentType{} __attribute__ ((__packed__)); //!< Find command's arguments
+struct FindResultType{} __attribute__ ((__packed__)); //!< Find command's results
+
+struct FindUniqueArgumentType{} __attribute__ ((__packed__)); //!< Find unique command's arguments
+struct FindUniqueResultType{} __attribute__ ((__packed__)); //!< Find unique command's results
+
+struct FindCloseArgumentType{} __attribute__ ((__packed__)); //!< Find close command's arguments
+struct FindCloseResultType{} __attribute__ ((__packed__)); //!< Find close command's results
+
+struct NtTransactArgumentType{} __attribute__ ((__packed__)); //!< Transact command's arguments
+struct NtTransactResultType{} __attribute__ ((__packed__)); //!< Transact command's results
+
+struct NtTransactSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Transact 2 command's arguments
+struct NtTransactSecondaryResultType{} __attribute__ ((__packed__)); //!< Transact 2 command's results
+
+struct NtCreateAndxArgumentType{} __attribute__ ((__packed__)); //!< Create command's arguments
+struct NtCreateAndxResultType{} __attribute__ ((__packed__)); //!< Create command's results
+
+struct NtCancelArgumentType{} __attribute__ ((__packed__)); //!< Cancel command's arguments
+struct NtCancelResultType{} __attribute__ ((__packed__)); //!< Cancel command's results
+
+struct NtRenameArgumentType{} __attribute__ ((__packed__)); //!< Rename command's arguments
+struct NtRenameResultType{} __attribute__ ((__packed__)); //!< Rename command's results
+
+struct OpenPrintFileArgumentType{} __attribute__ ((__packed__)); //!< Open Print File command's arguments
+struct OpenPrintFileResultType{} __attribute__ ((__packed__)); //!< Open Print File command's results
+
+struct WritePrintFileArgumentType{} __attribute__ ((__packed__)); //!< Write Print File command's arguments
+struct WritePrintFileResultType{} __attribute__ ((__packed__)); //!< Write Print File command's results
+
+struct ClosePrintFileArgumentType{} __attribute__ ((__packed__)); //!< Close Print File command's arguments
+struct ClosePrintFileResultType{} __attribute__ ((__packed__)); //!< Close Print File command's results
+
+struct GetPrintQueueArgumentType{} __attribute__ ((__packed__)); //!< Get Print Queue command's arguments
+struct GetPrintQueueResultType{} __attribute__ ((__packed__)); //!< Get Print Queue command's results
+
+struct ReadBulkArgumentType{} __attribute__ ((__packed__)); //!< Read Bulk command's arguments
+struct ReadBulkResultType{} __attribute__ ((__packed__)); //!< Read Bulk command's results
+
+struct WriteBulkArgumentType{} __attribute__ ((__packed__)); //!< Write Bulk command's arguments
+struct WriteBulkResultType{} __attribute__ ((__packed__)); //!< Write Bulk command's results
+
+struct WriteBulkDataArgumentType{} __attribute__ ((__packed__)); //!< Write Bulk command's arguments
+struct WriteBulkDataResultType{} __attribute__ ((__packed__)); //!< Write Bulk command's results
+
+struct InvalidArgumentType{} __attribute__ ((__packed__)); //!< Invalid command's arguments
+struct InvalidResultType{} __attribute__ ((__packed__)); //!< Invalid command's results
+
+struct NoAndxCmdArgumentType{} __attribute__ ((__packed__)); //!< No command's arguments
+struct NoAndxCmdResultType{} __attribute__ ((__packed__)); //!< No command's results
+
+} // namespace SMBv1
+} // namespace API
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//API_CIFS_COMMANDS_H
+//------------------------------------------------------------------------------
diff --git a/src/api/cifs_pc_to_net.h b/src/api/cifs_pc_to_net.h
new file mode 100644
index 0000000..bf03af4
--- /dev/null
+++ b/src/api/cifs_pc_to_net.h
@@ -0,0 +1,115 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Converters to LE for CIFS v2 constants.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef PC_TO_NET_H
+#define PC_TO_NET_H
+//------------------------------------------------------------------------------
+#include <cstdint>
+//------------------------------------------------------------------------------
+#ifdef __linux__
+#include <endian.h>
+#define NFSTRACE_BYTE_ORDER __BYTE_ORDER
+#define NFSTRACE_BIG_ENDIAN __BIG_ENDIAN
+#define NFSTRACE_LITTLE_ENDIAN __LITTLE_ENDIAN
+#else
+#include <sys/param.h>
+#include <machine/endian.h>
+#define NFSTRACE_BYTE_ORDER BYTE_ORDER
+#define NFSTRACE_BIG_ENDIAN BIG_ENDIAN
+#define NFSTRACE_LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace API
+{
+namespace SMBv2
+{
+
+# if NFSTRACE_BYTE_ORDER == NFSTRACE_BIG_ENDIAN
+
+/*!
+ * Converter. Not very fast,
+ * try to not use
+ */
+template<class T>
+constexpr T pc_to_net(T t)
+{
+ static_assert(t == 0, "try to not use pc_to_net w/o specialization");
+ return t;
+}
+
+/*!
+ * gets only 1 byte
+ * Internal function
+ * \param number - number of byte
+ * \param t - source number
+ * \return 1 byte in right place of whole number
+ */
+template<int number, class T>
+constexpr T switch_1_byte(T t)
+{
+ return ((t & (static_cast<T>(0xff) << number*8)) << ((sizeof(T) - 1 - number)*8));
+}
+
+/*!
+ * Compile-time converter BE to LE for 32 bit numbers
+ * \param t - source number
+ * \return converted number
+ */
+template<>
+constexpr uint32_t pc_to_net(uint32_t t)
+{
+ return switch_1_byte<0>(t) | switch_1_byte<1>(t) | switch_1_byte<2>(t) | switch_1_byte<3>(t);
+}
+
+/*!
+ * Compile-time converter BE to LE for 16 bit numbers
+ * \param t - source number
+ * \return converted number
+ */
+template<>
+constexpr uint16_t pc_to_net(uint16_t t)
+{
+ return switch_1_byte<0>(t) | switch_1_byte<1>(t);
+}
+
+# else
+# if NFSTRACE_BYTE_ORDER == NFSTRACE_LITTLE_ENDIAN
+
+/*!
+ * Does nothing for Intel
+ */
+template<class T>
+constexpr T pc_to_net(T t)
+{
+ return t;
+}
+
+# endif
+#endif
+
+} // SMBv2
+} // API
+} // NST
+//------------------------------------------------------------------------------
+#endif//PC_TO_NET_H
+//------------------------------------------------------------------------------
diff --git a/src/api/cifs_types.h b/src/api/cifs_types.h
new file mode 100644
index 0000000..88691ae
--- /dev/null
+++ b/src/api/cifs_types.h
@@ -0,0 +1,181 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Definition of CIFS types and commands
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFS_TYPES_H
+#define CIFS_TYPES_H
+//------------------------------------------------------------------------------
+#include <sys/time.h>
+
+#include "cifs_commands.h"
+#include "cifs2_commands.h"
+#include "procedure.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace CIFSv1
+{
+ struct RawMessageHeader;
+}
+namespace CIFSv2
+{
+ struct RawMessageHeader;
+}
+} // namespace protocols
+namespace API
+{
+
+/*! SMB 1 version
+ */
+namespace SMBv1
+{
+
+using Session = u_int16_t;//!< Session IDentifier
+
+/*! Represents one SMB command
+ */
+template <
+ typename Header,
+ typename Request,
+ typename Response
+ >
+class Command : public Procedure<int>
+{
+public:
+ using RequestType = Request;
+ using ResponseType = Response;
+ using HeaderType = Header;
+ const HeaderType* req_header = nullptr;
+ const HeaderType* res_header = nullptr;
+ const RequestType* parg = nullptr;//!< Arguments of specified command
+ const ResponseType* pres = nullptr;//!< Results of specified command
+};
+
+using CreateDirectoryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CreateDirectoryArgumentType, CreateDirectoryResultType>; //!< CreateDirectory command
+using DeleteDirectoryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, DeleteDirectoryArgumentType, DeleteDirectoryResultType>; //!< DeleteDirectory command
+using OpenCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, OpenArgumentType, OpenResultType>; //!< Open command
+using CreateCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CreateArgumentType, CreateResultType>; //!< Create command
+using CloseCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CloseArgumentType, CloseResultType>; //!< Close command
+using FlushCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, FlushArgumentType, FlushResultType>; //!< Flush command
+using DeleteCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, DeleteArgumentType, DeleteResultType>; //!< Delete command
+using RenameCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, RenameArgumentType, RenameResultType>; //!< Rename command
+using QueryInformationCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, QueryInformationArgumentType, QueryInformationResultType>; //!< QueryInformation command. This transaction is used to get information about a specific file or directory. There are several information levels that can be queried.
+using SetInformationCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, SetInformationArgumentType, SetInformationResultType>; //!< Set Information command. This transaction is used to set the standard and extended attribute information of a specific file or directory on the server.
+using ReadCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ReadArgumentType, ReadResultType>; //!< Read command
+using WriteCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteArgumentType, WriteResultType>; //!< Write command
+using LockByteRangeCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, LockByteRangeArgumentType, LockByteRangeResultType>; //!< Lock Byte Range command. This command is used to explicitly lock a contiguous range of bytes in an open regular file.
+using UnlockByteRangeCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, UnlockByteRangeArgumentType, UnlockByteRangeResultType>; //!< UnLock Byte Range command
+using CreateTemporaryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CreateTemporaryArgumentType, CreateTemporaryResultType>; //!< Create Temporary file command. This command is used to create a file for temporary use by the client.
+using CreateNewCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CreateNewArgumentType, CreateNewResultType>; //!< Create a new file command. This command is used to create a new file. It MUST NOT truncate or overwrite an existing file.
+using CheckDirectoryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CheckDirectoryArgumentType, CheckDirectoryResultType>; //!< CheckDirectory command. This command is used to verify that a specified path resolves to a valid directory on the server.
+using ProcessExitCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ProcessExitArgumentType, ProcessExitResultType>; //!< Process Exit command.An SMB_COM_PROCESS_EXIT request is sent by the client to indicate the catastrophic failure of a client process.
+using SeekCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, SeekArgumentType, SeekResultType>; //!< Seek command
+using LockAndReadCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, LockAndReadArgumentType, LockAndReadResultType>; //!< Lock And Read command
+using WriteAndUnlockCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteAndUnlockArgumentType, WriteAndUnlockResultType>; //!< Write And Unlock command
+using ReadRawCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ReadRawArgumentType, ReadRawResultType>; //!< Read raw command
+using ReadMpxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ReadMpxArgumentType, ReadMpxResultType>; //!< Read Mpx command. This is a specialized read command intended to maximize the performance of reading large blocks of data from a regular file while allowing for other operations to take place between the client and the server.
+using ReadMpxSecondaryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ReadMpxSecondaryArgumentType, ReadMpxSecondaryResultType>; //!< Read Read Mpx Secondary command
+using WriteRawCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteRawArgumentType, WriteRawResultType>; //!< Write Raw command. The command permits a client to send a large unformatted data (raw byte) message over the SMB transport without requiring the usual SMB request format
+using WriteMpxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteMpxArgumentType, WriteMpxResultType>; //!< Write Mpx command
+using WriteMpxSecondaryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteMpxSecondaryArgumentType, WriteMpxSecondaryResultType>; //!< Write Mpx 2 command
+using WriteCompleteCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteCompleteArgumentType, WriteCompleteResultType>; //!< Write Complete command
+using QueryServerCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, QueryServerArgumentType, QueryServerResultType>; //!< Query Server (reserved) command
+using SetInformation2Command = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, SetInformation2ArgumentType, SetInformation2ResultType>; //!< Set Information 2 command
+using QueryInformation2Command = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, QueryInformation2ArgumentType, QueryInformation2ResultType>; //!< Query Information 2 command
+using LockingAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, LockingAndxArgumentType, LockingAndxResultType>; //!< Lock some bytes of the file command
+using TransactionCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, TransactionArgumentType, TransactionResultType>; //!< Transaction command.These commands operate on mailslots and named pipes, which are interprocess communication endpoints within the CIFS file system
+using TransactionSecondaryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, TransactionSecondaryArgumentType, TransactionSecondaryResultType>; //!< Transaction 2 command
+using IoctlCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, IoctlArgumentType, IoctlResultType>; //!< Ioctl command
+using IoctlSecondaryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, IoctlSecondaryArgumentType, IoctlSecondaryResultType>; //!< Ioctl 2 command
+using CopyCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CopyArgumentType, CopyResultType>; //!< Copy command
+using MoveCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, MoveArgumentType, MoveResultType>; //!< Move command
+using EchoCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, EchoArgumentType, EchoResultType>; //!< Echo command
+using WriteAndCloseCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteAndCloseArgumentType, WriteAndCloseResultType>; //!< Write And Close command
+using OpenAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, OpenAndxArgumentType, OpenAndxResultType>; //!< Open 2 command
+using ReadAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ReadAndxArgumentType, ReadAndxResultType>; //!< Read 2 command
+using WriteAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteAndxArgumentType, WriteAndxResultType>; //!< Write 2 command
+using NewFileSizeCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NewFileSizeArgumentType, NewFileSizeResultType>; //!< New File Size command. Reserved but not implemented
+using CloseAndTreeDiscCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, CloseAndTreeDiscArgumentType, CloseAndTreeDiscResultType>; //!< Reserved command
+using Transaction2Command = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, Transaction2ArgumentType, Transaction2ResultType>; //!< Transaction 2 command
+using Transaction2SecondaryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, Transaction2SecondaryArgumentType, Transaction2SecondaryResultType>; //!< Transaction 3 command
+using FindClose2Command = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, FindClose2ArgumentType, FindClose2ResultType>; //!< Search handle close command
+using FindNotifyCloseCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, FindNotifyCloseArgumentType, FindNotifyCloseResultType>; //!< Search handle close command
+using TreeConnectCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, TreeConnectArgumentType, TreeConnectResultType>; //!< establish a client connection to a server share command
+using TreeDisconnectCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, TreeDisconnectArgumentType, TreeDisconnectResultType>; //!< Disconnect command
+using NegotiateCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NegotiateArgumentType, NegotiateResultType>; //!< Negotiate command
+using SessionSetupAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, SessionSetupAndxArgumentType, SessionSetupAndxResultType>; //!< Session setup command
+using LogoffAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, LogoffAndxArgumentType, LogoffAndxResultType>; //!< Log off command
+using TreeConnectAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, TreeConnectAndxArgumentType, TreeConnectAndxResultType>; //!< Tree Connect command
+using SecurityPackageAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, SecurityPackageAndxArgumentType, SecurityPackageAndxResultType>; //!< Security Package command
+using QueryInformationDiskCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, QueryInformationDiskArgumentType, QueryInformationDiskResultType>; //!< Query Disk Information command
+using SearchCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, SearchArgumentType, SearchResultType>; //!< Search command
+using FindCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, FindArgumentType, FindResultType>; //!< Find command
+using FindUniqueCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, FindUniqueArgumentType, FindUniqueResultType>; //!< Find unique command
+using FindCloseCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, FindCloseArgumentType, FindCloseResultType>; //!< Find close command
+using NtTransactCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NtTransactArgumentType, NtTransactResultType>; //!< Transact command
+using NtTransactSecondaryCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NtTransactSecondaryArgumentType, NtTransactSecondaryResultType>; //!< Transact 2 command
+using NtCreateAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NtCreateAndxArgumentType, NtCreateAndxResultType>; //!< Create command
+using NtCancelCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NtCancelArgumentType, NtCancelResultType>; //!< Cancel command
+using NtRenameCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NtRenameArgumentType, NtRenameResultType>; //!< Rename command
+using OpenPrintFileCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, OpenPrintFileArgumentType, OpenPrintFileResultType>; //!< Open Print File command
+using WritePrintFileCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WritePrintFileArgumentType, WritePrintFileResultType>; //!< Write Print File command
+using ClosePrintFileCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ClosePrintFileArgumentType, ClosePrintFileResultType>; //!< Close Print File command
+using GetPrintQueueCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, GetPrintQueueArgumentType, GetPrintQueueResultType>; //!< Get Print Queue command
+using ReadBulkCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, ReadBulkArgumentType, ReadBulkResultType>; //!< Read Bulk command
+using WriteBulkCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteBulkArgumentType, WriteBulkResultType>; //!< Write Bulk command
+using WriteBulkDataCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, WriteBulkDataArgumentType, WriteBulkDataResultType>; //!< Write Bulk command
+using InvalidCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, InvalidArgumentType, InvalidResultType>; //!< Invalid command
+using NoAndxCommand = SMBv1::Command< NST::protocols::CIFSv1::RawMessageHeader, NoAndxCmdArgumentType, NoAndxCmdResultType>; //!< No command
+
+}//SMBv1
+
+/*! SMB 2 version
+ */
+namespace SMBv2
+{
+
+using CloseFileCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, CloseRequest, CloseResponse>; //!< Close file command
+using NegotiateCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, NegotiateRequest, NegotiateResponse>; //!< Negotiate command
+using SessionSetupCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, SessionSetupRequest, SessionSetupResponse>; //!< Session setup command
+using EchoCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, EchoRequest, EchoResponse>; //!< Echo command
+using LogOffCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, LogOffRequest, LogOffResponse>; //!< Log off command
+using TreeConnectCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, TreeConnectRequest, TreeConnectResponse>; //!< Tree connect command
+using TreeDisconnectCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, TreeDisconnectRequest, TreeDisconnectResponse>; //!< Tree disconnect command
+using CreateCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, CreateRequest, CreateResponse>; //!< Create command
+using QueryInfoCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, QueryInfoRequest, QueryInfoResponse>; //!< Query Info command
+using QueryDirCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, QueryDirRequest, QueryDirResponse>; //!< Query directory command
+using FlushCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, FlushRequest, FlushResponse>; //!< Flush command
+using ReadCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, ReadRequest, ReadResponse>; //!< Read command
+using WriteCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, WriteRequest, WriteResponse>; //!< Write command
+using LockCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, LockRequest, LockResponse>; //!< Lock command
+using CancelCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, CancelRequest, CancelResponce>; //!< Cancel command
+using ChangeNotifyCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, ChangeNotifyRequest, ChangeNotifyResponse>; //!< Change Notify command
+using BreakOpLockCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, OplockAcknowledgment, OplockResponse>; //!< Break opportunistic lock command
+using IoctlCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, IoCtlRequest, IoCtlResponse>; //!< Ioctl command
+using SetInfoCommand = SMBv1::Command<NST::protocols::CIFSv2::RawMessageHeader, SetInfoRequest, SetInfoResponse>; //!< Set Info command
+
+} // namespace SMBv2
+} // namespace API
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFS_TYPES_H
+//------------------------------------------------------------------------------
diff --git a/src/api/ianalyzer.h b/src/api/ianalyzer.h
new file mode 100644
index 0000000..b9d7f06
--- /dev/null
+++ b/src/api/ianalyzer.h
@@ -0,0 +1,1811 @@
+//------------------------------------------------------------------------------
+// Author: Dzianis Huznou
+// Description: IAnalyzer describe interface of analysiss expected by application.
+// The interface define set of NFS Procedure handlers with empty dummy implementation
+// and pure virtual function for flushing analysis statistics.
+// Copyright (c) 2013 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef IANALYZER_TYPE_H
+#define IANALYZER_TYPE_H
+//------------------------------------------------------------------------------
+#include "cifs_types.h"
+#include "nfs_types.h"
+#include "nfs3_types_rpcgen.h"
+#include "nfs4_types_rpcgen.h"
+#include "nfs41_types_rpcgen.h"
+#include "rpc_types.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace API
+{
+
+/*! Abstract interface for plugins that collect NFS3 statistics
+ */
+class INFSv3rpcgen
+{
+public:
+ virtual ~INFSv3rpcgen() {}
+
+ /*! NFSv3 "NULL" procedure
+ * \param RPCProcedure - Specified procedure
+ * \param NULL3args - procedure arguments
+ * \param NULL3res - procedure results
+ */
+ virtual void null(const RPCProcedure*,
+ const struct NFS3::NULL3args*,
+ const struct NFS3::NULL3res*) {}
+
+ /*! NFSv3 "GETATTR" procedure (Get file attributes)
+ * \param RPCProcedure - Specified procedure
+ * \param GETATTR3args - procedure arguments
+ * \param GETATTR3res - procedure results
+ */
+ virtual void getattr3(const RPCProcedure*,
+ const struct NFS3::GETATTR3args*,
+ const struct NFS3::GETATTR3res*) {}
+
+ /*! NFSv3 "SETATTR" procedure (Set file attributes)
+ * \param RPCProcedure - Specified procedure
+ * \param SETATTR3args - procedure arguments
+ * \param SETATTR3res - procedure results
+ */
+ virtual void setattr3(const RPCProcedure*,
+ const struct NFS3::SETATTR3args*,
+ const struct NFS3::SETATTR3res*) {}
+
+ /*! NFSv3 "LOOKUP" procedure (Lookup filename)
+ * \param RPCProcedure - Specified procedure
+ * \param LOOKUP3args - procedure arguments
+ * \param LOOKUP3res - procedure results
+ */
+ virtual void lookup3(const RPCProcedure*,
+ const struct NFS3::LOOKUP3args*,
+ const struct NFS3::LOOKUP3res*) {}
+
+ /*! NFSv3 "ACCESS" procedure (Check Access Permission)
+ * \param RPCProcedure - Specified procedure
+ * \param ACCESS3args - procedure arguments
+ * \param ACCESS3res - procedure results
+ */
+ virtual void access3(const RPCProcedure*,
+ const struct NFS3::ACCESS3args*,
+ const struct NFS3::ACCESS3res*) {}
+
+ /*! NFSv3 "READLINK" procedure (Read from symbolic link)
+ * \param RPCProcedure - Specified procedure
+ * \param READLINK3args - procedure arguments
+ * \param READLINK3res - procedure results
+ */
+ virtual void readlink3(const RPCProcedure*,
+ const struct NFS3::READLINK3args*,
+ const struct NFS3::READLINK3res*) {}
+
+ /*! NFSv3 "READ" procedure (Read from file)
+ * \param RPCProcedure - Specified procedure
+ * \param READ3args - procedure arguments
+ * \param READ3res - procedure results
+ */
+ virtual void read3(const RPCProcedure*,
+ const struct NFS3::READ3args*,
+ const struct NFS3::READ3res*) {}
+
+ /*! NFSv3 "WRITE" procedure (Write to file)
+ * \param RPCProcedure - Specified procedure
+ * \param WRITE3args - procedure arguments
+ * \param WRITE3res - procedure results
+ */
+ virtual void write3(const RPCProcedure*,
+ const struct NFS3::WRITE3args*,
+ const struct NFS3::WRITE3res*) {}
+
+ /*! NFSv3 "CREATE" procedure (Create a file)
+ * \param RPCProcedure - Specified procedure
+ * \param CREATE3args - procedure arguments
+ * \param CREATE3res - procedure results
+ */
+ virtual void create3(const RPCProcedure*,
+ const struct NFS3::CREATE3args*,
+ const struct NFS3::CREATE3res*) {}
+
+ /*! NFSv3 "MKDIR" procedure (Create a directory)
+ * \param RPCProcedure - Specified procedure
+ * \param MKDIR3args - procedure arguments
+ * \param MKDIR3res - procedure results
+ */
+ virtual void mkdir3(const RPCProcedure*,
+ const struct NFS3::MKDIR3args*,
+ const struct NFS3::MKDIR3res*) {}
+
+ /*! NFSv3 "SYMLINK" procedure (Create a symbolic link)
+ * \param RPCProcedure - Specified procedure
+ * \param SYMLINK3args - procedure arguments
+ * \param SYMLINK3res - procedure results
+ */
+ virtual void symlink3(const RPCProcedure*,
+ const struct NFS3::SYMLINK3args*,
+ const struct NFS3::SYMLINK3res*) {}
+
+ /*! NFSv3 "MKNOD" procedure (Create a special device)
+ * \param RPCProcedure - Specified procedure
+ * \param MKNOD3args - procedure arguments
+ * \param MKNOD3res - procedure results
+ */
+ virtual void mknod3(const RPCProcedure*,
+ const struct NFS3::MKNOD3args*,
+ const struct NFS3::MKNOD3res*) {}
+
+ /*! NFSv3 "REMOVE" procedure (Remove a file)
+ * \param RPCProcedure - Specified procedure
+ * \param REMOVE3args - procedure arguments
+ * \param REMOVE3res - procedure results
+ */
+ virtual void remove3(const RPCProcedure*,
+ const struct NFS3::REMOVE3args*,
+ const struct NFS3::REMOVE3res*) {}
+
+ /*! NFSv3 "RMDIR" procedure (Remove a directory)
+ * \param RPCProcedure - Specified procedure
+ * \param RMDIR3args - procedure arguments
+ * \param RMDIR3res - procedure results
+ */
+ virtual void rmdir3(const RPCProcedure*,
+ const struct NFS3::RMDIR3args*,
+ const struct NFS3::RMDIR3res*) {}
+
+ /*! NFSv3 "RENAME" procedure (Rename a file or directory)
+ * \param RPCProcedure - Specified procedure
+ * \param RENAME3args - procedure arguments
+ * \param RENAME3res - procedure results
+ */
+ virtual void rename3(const RPCProcedure*,
+ const struct NFS3::RENAME3args*,
+ const struct NFS3::RENAME3res*) {}
+
+ /*! NFSv3 "LINK" procedure (Create link to an object)
+ * \param RPCProcedure - Specified procedure
+ * \param LINK3args - procedure arguments
+ * \param LINK3res - procedure results
+ */
+ virtual void link3(const RPCProcedure*,
+ const struct NFS3::LINK3args*,
+ const struct NFS3::LINK3res*) {}
+
+ /*! NFSv3 "READDIR" procedure (Read From directory)
+ * \param RPCProcedure - Specified procedure
+ * \param READDIR3args - procedure arguments
+ * \param READDIR3res - procedure results
+ */
+ virtual void readdir3(const RPCProcedure*,
+ const struct NFS3::READDIR3args*,
+ const struct NFS3::READDIR3res*) {}
+
+ /*! NFSv3 "READDIRPLUS" procedure (Extended read from directory)
+ * \param RPCProcedure - Specified procedure
+ * \param READDIRPLUS3args - procedure arguments
+ * \param READDIRPLUS3res - procedure results
+ */
+ virtual void readdirplus3(const RPCProcedure*,
+ const struct NFS3::READDIRPLUS3args*,
+ const struct NFS3::READDIRPLUS3res*) {}
+
+ /*! NFSv3 "FSSTAT" procedure (Get dynamic file system information)
+ * \param RPCProcedure - Specified procedure
+ * \param FSSTAT3args - procedure arguments
+ * \param FSSTAT3res - procedure results
+ */
+ virtual void fsstat3(const RPCProcedure*,
+ const struct NFS3::FSSTAT3args*,
+ const struct NFS3::FSSTAT3res*) {}
+
+ /*! NFSv3 "FSINFO" procedure (Get static file system information)
+ * \param RPCProcedure - Specified procedure
+ * \param FSINFO3args - procedure arguments
+ * \param FSINFO3res - procedure results
+ */
+ virtual void fsinfo3(const RPCProcedure*,
+ const struct NFS3::FSINFO3args*,
+ const struct NFS3::FSINFO3res*) {}
+
+ /*! NFSv3 "PATHINFO" procedure (Retrieve POSIX information)
+ * \param RPCProcedure - Specified procedure
+ * \param PATHINFO3args - procedure arguments
+ * \param PATHINFO3res - procedure results
+ */
+ virtual void pathconf3(const RPCProcedure*,
+ const struct NFS3::PATHCONF3args*,
+ const struct NFS3::PATHCONF3res*) {}
+
+ /*! NFSv3 "COMMIT" procedure (Commit cached data on a server to stable storage)
+ * \param RPCProcedure - Specified procedure
+ * \param COMMIT3args - procedure arguments
+ * \param COMMIT3res - procedure results
+ */
+ virtual void commit3(const RPCProcedure*,
+ const struct NFS3::COMMIT3args*,
+ const struct NFS3::COMMIT3res*) {}
+};
+
+/*! Abstract interface for plugins that collect NFS4 statistics
+ */
+class INFSv4rpcgen
+{
+public:
+ virtual ~INFSv4rpcgen() {}
+ /*! NFSv4 "NULL" procedure (No Operation)
+ * \param RPCProcedure - Specified procedure
+ * \param NULL4args - procedure arguments
+ * \param NULL4res - procedure results
+ */
+ virtual void null4(const RPCProcedure*,
+ const struct NFS4::NULL4args*,
+ const struct NFS4::NULL4res*) {}
+
+ /*! NFSv4 "COMPOUND" procedure (Compound Operations)
+ * \param RPCProcedure - Specified procedure
+ * \param COMPOUND4args - procedure arguments
+ * \param COMPOUND4res - procedure results
+ */
+ virtual void compound4(const RPCProcedure*,
+ const struct NFS4::COMPOUND4args*,
+ const struct NFS4::COMPOUND4res*) {}
+
+ /*! NFSv4 "ACCESS" operation (Check Access Rights)
+ * \param RPCProcedure - Specified operation
+ * \param ACCESS4args - operation arguments
+ * \param ACCESS4res - operation results
+ */
+ virtual void access40(const RPCProcedure*,
+ const struct NFS4::ACCESS4args*,
+ const struct NFS4::ACCESS4res*) {}
+
+ /*! NFSv4 "CLOSE" operation (Close File)
+ * \param RPCProcedure - Specified operation
+ * \param CLOSE4args - operation arguments
+ * \param CLOSE4res - operation results
+ */
+ virtual void close40(const RPCProcedure*,
+ const struct NFS4::CLOSE4args*,
+ const struct NFS4::CLOSE4res*) {}
+
+ /*! NFSv4 "COMMIT" operation (Commit Cached Data)
+ * \param RPCProcedure - Specified operation
+ * \param COMMIT4args - operation arguments
+ * \param COMMIT4res - operation results
+ */
+ virtual void commit40(const RPCProcedure*,
+ const struct NFS4::COMMIT4args*,
+ const struct NFS4::COMMIT4res*) {}
+
+ /*! NFSv4 "CREATE" operation (Create a Non-Regular File Object)
+ * \param RPCProcedure - Specified operation
+ * \param CREATE4args - operation arguments
+ * \param CREATE4res - operation results
+ */
+ virtual void create40(const RPCProcedure*,
+ const struct NFS4::CREATE4args*,
+ const struct NFS4::CREATE4res*) {}
+
+ /*! NFSv4 "DELEGPURGE" operation (Purge Delegations Awaiting Recovery)
+ * \param RPCProcedure - Specified operation
+ * \param DELEGPURGE4args - operation arguments
+ * \param DELEGPURGE4res - operation results
+ */
+ virtual void delegpurge40(const RPCProcedure*,
+ const struct NFS4::DELEGPURGE4args*,
+ const struct NFS4::DELEGPURGE4res*) {}
+
+ /*! NFSv4 "DELEGRETURN" operation (Return Delegation)
+ * \param RPCProcedure - Specified operation
+ * \param DELEGRETURN4args - operation arguments
+ * \param DELEGRETUR4res - operation results
+ */
+ virtual void delegreturn40(const RPCProcedure*,
+ const struct NFS4::DELEGRETURN4args*,
+ const struct NFS4::DELEGRETURN4res*) {}
+
+ /*! NFSv4 "GETATTR" operation (Get Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param GETATTR4args - operation arguments
+ * \param GETATTR4res - operation results
+ */
+ virtual void getattr40(const RPCProcedure*,
+ const struct NFS4::GETATTR4args*,
+ const struct NFS4::GETATTR4res*) {}
+
+ /*! NFSv4 "GETFH" operation (Get Current Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param GETFH4res - operation results
+ */
+ virtual void getfh40(const RPCProcedure*,
+ const struct NFS4::GETFH4res*) {}
+
+ /*! NFSv4 "LINK" operation (Create Link to a File)
+ * \param RPCProcedure - Specified operation
+ * \param LINK4args - operation arguments
+ * \param LINK4res - operation results
+ */
+ virtual void link40(const RPCProcedure*,
+ const struct NFS4::LINK4args*,
+ const struct NFS4::LINK4res*) {}
+
+ /*! NFSv4 "LOCK" operation (Create Lock)
+ * \param RPCProcedure - Specified operation
+ * \param LOCK4args - operation arguments
+ * \param LOCK4res - operation results
+ */
+ virtual void lock40(const RPCProcedure*,
+ const struct NFS4::LOCK4args*,
+ const struct NFS4::LOCK4res*) {}
+
+ /*! NFSv4 "LOCKT" operation (Test For Lock)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKT4args - operation arguments
+ * \param LOCKT4res - operation results
+ */
+ virtual void lockt40(const RPCProcedure*,
+ const struct NFS4::LOCKT4args*,
+ const struct NFS4::LOCKT4res*) {}
+
+ /*! NFSv4 "LOCKU" operation (Unlock File)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKUargs - operation arguments
+ * \param LOCKUres - operation results
+ */
+ virtual void locku40(const RPCProcedure*,
+ const struct NFS4::LOCKU4args*,
+ const struct NFS4::LOCKU4res*) {}
+
+ /*! NFSv4 "LOCKUP" operation (Lookup Filename)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKUP4args - operation arguments
+ * \param LOCKUP4res - operation results
+ */
+ virtual void lookup40(const RPCProcedure*,
+ const struct NFS4::LOOKUP4args*,
+ const struct NFS4::LOOKUP4res*) {}
+
+ /*! NFSv4 "LOCKUPP" operation (Lookup Parent Directory)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKUPP4res - operation results
+ */
+ virtual void lookupp40(const RPCProcedure*,
+ const struct NFS4::LOOKUPP4res*) {}
+
+ /*! NFSv4 "NVERIFY" operation (Verify Difference in Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param NVERIFY4args - operation arguments
+ * \param NVERIFY4res - operation results
+ */
+ virtual void nverify40(const RPCProcedure*,
+ const struct NFS4::NVERIFY4args*,
+ const struct NFS4::NVERIFY4res*) {}
+
+ /*! NFSv4 "OPEN" operation (Open a Regular File)
+ * \param RPCProcedure - Specified operation
+ * \param OPEN4args - operation arguments
+ * \param OPEN4res - operation results
+ */
+ virtual void open40(const RPCProcedure*,
+ const struct NFS4::OPEN4args*,
+ const struct NFS4::OPEN4res*) {}
+
+ /*! NFSv4 "OPENATTR" operation (Open Named Attribute Directory)
+ * \param RPCProcedure - Specified operation
+ * \param OPENATTR4args - operation arguments
+ * \param OPENATTR4res - operation results
+ */
+ virtual void openattr40(const RPCProcedure*,
+ const struct NFS4::OPENATTR4args*,
+ const struct NFS4::OPENATTR4res*) {}
+
+ /*! NFSv4 "OPEN_CONFIRM" operation (Confirm Open)
+ * \param RPCProcedure - Specified operation
+ * \param OPEN_CONFIRM4args - operation arguments
+ * \param OPEN_CONFIRM4NULL3res - operation results
+ */
+ virtual void open_confirm40(const RPCProcedure*,
+ const struct NFS4::OPEN_CONFIRM4args*,
+ const struct NFS4::OPEN_CONFIRM4res*) {}
+
+ /*! NFSv4 "OPEN_DOWNGRADE" operation (Reduce Open File Access)
+ * \param RPCProcedure - Specified operation
+ * \param OPEN_DOWNGRADE4args - operation arguments
+ * \param OPEN_DOWNGRADE4res - operation results
+ */
+ virtual void open_downgrade40(const RPCProcedure*,
+ const struct NFS4::OPEN_DOWNGRADE4args*,
+ const struct NFS4::OPEN_DOWNGRADE4res*) {}
+
+ /*! NFSv4 "PUTFH" operation (Set Current Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param PUTFH4args - operation arguments
+ * \param PUTFH4res - operation results
+ */
+ virtual void putfh40(const RPCProcedure*,
+ const struct NFS4::PUTFH4args*,
+ const struct NFS4::PUTFH4res*) {}
+
+ /*! NFSv4 "PUTPUBFH" operation (Set Public Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param PUTPUBFH4res - operation results
+ */
+ virtual void putpubfh40(const RPCProcedure*,
+ const struct NFS4::PUTPUBFH4res*) {}
+
+ /*! NFSv4 "PUTROOTFH" operation (Set Root Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param PUTROOTFHargs - operation arguments
+ * \param PUTROOTFHres - operation results
+ */
+ virtual void putrootfh40(const RPCProcedure*,
+ const struct NFS4::PUTROOTFH4res*) {}
+
+ /*! NFSv4 "READ" operation (Read from File)
+ * \param RPCProcedure - Specified operation
+ * \param READ4args - operation arguments
+ * \param READ4res - operation results
+ */
+ virtual void read40(const RPCProcedure*,
+ const struct NFS4::READ4args*,
+ const struct NFS4::READ4res*) {}
+
+ /*! NFSv4 "READDIR" operation (Read Directory)
+ * \param RPCProcedure - Specified operation
+ * \param READDIR4args - operation arguments
+ * \param READDIR4res - operation results
+ */
+ virtual void readdir40(const RPCProcedure*,
+ const struct NFS4::READDIR4args*,
+ const struct NFS4::READDIR4res*) {}
+
+ /*! NFSv4 "READLINK" operation (Read Symbolic Link)
+ * \param RPCProcedure - Specified operation
+ * \param READLINK4res - operation results
+ */
+ virtual void readlink40(const RPCProcedure*,
+ const struct NFS4::READLINK4res*) {}
+
+ /*! NFSv4 "REMOVE" operation (Remove Filesystem Object)
+ * \param RPCProcedure - Specified operation
+ * \param REMOVE4args - operation arguments
+ * \param REMOVE4res - operation results
+ */
+ virtual void remove40(const RPCProcedure*,
+ const struct NFS4::REMOVE4args*,
+ const struct NFS4::REMOVE4res*) {}
+
+ /*! NFSv4 "RENAME" operation (Rename Directory Entry)
+ * \param RPCProcedure - Specified operation
+ * \param RENAME4args - operation arguments
+ * \param RENAME4res - operation results
+ */
+ virtual void rename40(const RPCProcedure*,
+ const struct NFS4::RENAME4args*,
+ const struct NFS4::RENAME4res*) {}
+
+ /*! NFSv4 "RENEW" operation (Renew a Lease)
+ * \param RPCProcedure - Specified operation
+ * \param RENEW4args - operation arguments
+ * \param RENEW4res - operation results
+ */
+ virtual void renew40(const RPCProcedure*,
+ const struct NFS4::RENEW4args*,
+ const struct NFS4::RENEW4res*) {}
+
+ /*! NFSv4 "RESTOREFH" operation (Restore Saved Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param RESTOREFH4res - operation results
+ */
+ virtual void restorefh40(const RPCProcedure*,
+ const struct NFS4::RESTOREFH4res*) {}
+
+ /*! NFSv4 "SAVEFH" operation (Save Current Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param SAVEFH4res - operation results
+ */
+ virtual void savefh40(const RPCProcedure*,
+ const struct NFS4::SAVEFH4res*) {}
+
+ /*! NFSv4 "SECINFO" operation (Obtain Available Security)
+ * \param RPCProcedure - Specified operation
+ * \param SECINFO4args - operation arguments
+ * \param SECINFO4res - operation results
+ */
+ virtual void secinfo40(const RPCProcedure*,
+ const struct NFS4::SECINFO4args*,
+ const struct NFS4::SECINFO4res*) {}
+
+ /*! NFSv4 "SETATTR" operation (Set Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param SETATTR4args - operation arguments
+ * \param SETATTR4res - operation results
+ */
+ virtual void setattr40(const RPCProcedure*,
+ const struct NFS4::SETATTR4args*,
+ const struct NFS4::SETATTR4res*) {}
+
+ /*! NFSv4 "SETCLIENTID" operation (Negotiate Clientid)
+ * \param RPCProcedure - Specified operation
+ * \param SETCLIENTID4args - operation arguments
+ * \param SETCLIENTID4res - operation results
+ */
+ virtual void setclientid40(const RPCProcedure*,
+ const struct NFS4::SETCLIENTID4args*,
+ const struct NFS4::SETCLIENTID4res*) {}
+
+ /*! NFSv4 "SETCLIENTID_CONFIRM" operation
+ * \param RPCProcedure - Specified operation
+ * \param SETCLIENTID_CONFIRM4args - operation arguments
+ * \param SETCLIENTID_CONFIRM4res - operation results
+ */
+ virtual void setclientid_confirm40(const RPCProcedure*,
+ const struct NFS4::SETCLIENTID_CONFIRM4args*,
+ const struct NFS4::SETCLIENTID_CONFIRM4res*) {}
+
+ /*! NFSv4 "VERIFY" operation (Verify Same Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param VERIFY4args - operation arguments
+ * \param VERIFY4res - operation results
+ */
+ virtual void verify40(const RPCProcedure*,
+ const struct NFS4::VERIFY4args*,
+ const struct NFS4::VERIFY4res*) {}
+
+ /*! NFSv4 "WRITE" operation (Write to File)
+ * \param RPCProcedure - Specified operation
+ * \param WRITE4args - operation arguments
+ * \param WRITE4res - operation results
+ */
+ virtual void write40(const RPCProcedure*,
+ const struct NFS4::WRITE4args*,
+ const struct NFS4::WRITE4res*) {}
+
+ /*! NFSv4 "RELEASE_LOCKOWNER" operation (Release Lockowner State)
+ * \param RPCProcedure - Specified operation
+ * \param RELEASE_LOCKOWNER4args - operation arguments
+ * \param RELEASE_LOCKOWNER4res - operation results
+ */
+ virtual void release_lockowner40(const RPCProcedure*,
+ const struct NFS4::RELEASE_LOCKOWNER4args*,
+ const struct NFS4::RELEASE_LOCKOWNER4res*) {}
+
+ /*! NFSv4 "GET_DIR_DELEGATION" operation (No Operation)
+ * \param RPCProcedure - Specified operation
+ * \param GET_DIR_DELEGATION4args - operation arguments
+ * \param GET_DIR_DELEGATION4res - operation results
+ */
+ virtual void get_dir_delegation40(const RPCProcedure*,
+ const struct NFS4::GET_DIR_DELEGATION4args*,
+ const struct NFS4::GET_DIR_DELEGATION4res*) {}
+
+ /*! NFSv4 "ILLEGAL" operation (Illegal operation)
+ * \param RPCProcedure - Specified operation
+ * \param ILLEGAL4res - operation results
+ */
+ virtual void illegal40(const RPCProcedure*,
+ const struct NFS4::ILLEGAL4res*) {}
+};
+
+/*! Abstract interface for plugins that collect NFS41 statistics
+ */
+class INFSv41rpcgen
+{
+public:
+ virtual ~INFSv41rpcgen() {}
+ //there is no null41 procedure, use null if needed: IAnalyzer::INFSv4rpcgen::null
+
+ /*! NFSv41 "COMPOUND" procedure (Compound Operations)
+ * \param RPCProcedure - Specified procedure
+ * \param COMPOUND4args - procedure arguments
+ * \param COMPOUND4res - procedure results
+ */
+ virtual void compound41(const RPCProcedure*,
+ const struct NFS41::COMPOUND4args*,
+ const struct NFS41::COMPOUND4res*) {}
+
+ /*! NFSv41 "ACCESS" operation (Check Access Rights)
+ * \param RPCProcedure - Specified operation
+ * \param ACCESS4args - operation arguments
+ * \param ACCESS4res - operation results
+ */
+ virtual void access41(const RPCProcedure*,
+ const struct NFS41::ACCESS4args*,
+ const struct NFS41::ACCESS4res*) {}
+
+ /*! NFSv41 "CLOSE" operation (Close File)
+ * \param RPCProcedure - Specified operation
+ * \param CLOSE4args - operation arguments
+ * \param CLOSE4res - operation results
+ */
+ virtual void close41(const RPCProcedure*,
+ const struct NFS41::CLOSE4args*,
+ const struct NFS41::CLOSE4res*) {}
+
+ /*! NFSv41 "COMMIT" operation (Commit Cached Data)
+ * \param RPCProcedure - Specified operation
+ * \param COMMIT4args - operation arguments
+ * \param COMMIT4res - operation results
+ */
+ virtual void commit41(const RPCProcedure*,
+ const struct NFS41::COMMIT4args*,
+ const struct NFS41::COMMIT4res*) {}
+
+ /*! NFSv41 "CREATE" operation (Create a Non-Regular File Object)
+ * \param RPCProcedure - Specified operation
+ * \param CREATE4args - operation arguments
+ * \param CREATE4res - operation results
+ */
+ virtual void create41(const RPCProcedure*,
+ const struct NFS41::CREATE4args*,
+ const struct NFS41::CREATE4res*) {}
+
+ /*! NFSv41 "DELEGPURGE" operation (Purge Delegations Awaiting Recovery)
+ * \param RPCProcedure - Specified operation
+ * \param DELEGPURGE4args - operation arguments
+ * \param DELEGPURGE4res - operation results
+ */
+ virtual void delegpurge41(const RPCProcedure*,
+ const struct NFS41::DELEGPURGE4args*,
+ const struct NFS41::DELEGPURGE4res*) {}
+
+ /*! NFSv41 "DELEGRETURN" operation (Return Delegation)
+ * \param RPCProcedure - Specified operation
+ * \param DELEGRETURN4args - operation arguments
+ * \param DELEGRETUR4res - operation results
+ */
+ virtual void delegreturn41(const RPCProcedure*,
+ const struct NFS41::DELEGRETURN4args*,
+ const struct NFS41::DELEGRETURN4res*) {}
+
+ /*! NFSv41 "GETATTR" operation (Get Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param GETATTR4args - operation arguments
+ * \param GETATTR4res - operation results
+ */
+ virtual void getattr41(const RPCProcedure*,
+ const struct NFS41::GETATTR4args*,
+ const struct NFS41::GETATTR4res*) {}
+
+ /*! NFSv41 "GETFH" operation (Get Current Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param GETFH4res - operation results
+ */
+ virtual void getfh41(const RPCProcedure*,
+ const struct NFS41::GETFH4res*) {}
+
+ /*! NFSv41 "LINK" operation (Create Link to a File)
+ * \param RPCProcedure - Specified operation
+ * \param LINK4args - operation arguments
+ * \param LINK4res - operation results
+ */
+ virtual void link41(const RPCProcedure*,
+ const struct NFS41::LINK4args*,
+ const struct NFS41::LINK4res*) {}
+
+ /*! NFSv41 "LOCK" operation (Create Lock)
+ * \param RPCProcedure - Specified operation
+ * \param LOCK4args - operation arguments
+ * \param LOCK4res - operation results
+ */
+ virtual void lock41(const RPCProcedure*,
+ const struct NFS41::LOCK4args*,
+ const struct NFS41::LOCK4res*) {}
+
+ /*! NFSv41 "LOCKT" operation (Test For Lock)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKT4args - operation arguments
+ * \param LOCKT4res - operation results
+ */
+ virtual void lockt41(const RPCProcedure*,
+ const struct NFS41::LOCKT4args*,
+ const struct NFS41::LOCKT4res*) {}
+
+ /*! NFSv41 "LOCKU" operation (Unlock File)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKUargs - operation arguments
+ * \param LOCKUres - operation results
+ */
+ virtual void locku41(const RPCProcedure*,
+ const struct NFS41::LOCKU4args*,
+ const struct NFS41::LOCKU4res*) {}
+
+ /*! NFSv41 "LOCKUP" operation (Lookup Filename)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKUP4args - operation arguments
+ * \param LOCKUP4res - operation results
+ */
+ virtual void lookup41(const RPCProcedure*,
+ const struct NFS41::LOOKUP4args*,
+ const struct NFS41::LOOKUP4res*) {}
+
+ /*! NFSv41 "LOCKUPP" operation (Lookup Parent Directory)
+ * \param RPCProcedure - Specified operation
+ * \param LOCKUPP4res - operation results
+ */
+ virtual void lookupp41(const RPCProcedure*,
+ const struct NFS41::LOOKUPP4res*) {}
+
+ /*! NFSv41 "NVERIFY" operation (Verify Difference in Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param NVERIFY4args - operation arguments
+ * \param NVERIFY4res - operation results
+ */
+ virtual void nverify41(const RPCProcedure*,
+ const struct NFS41::NVERIFY4args*,
+ const struct NFS41::NVERIFY4res*) {}
+
+ /*! NFSv41 "OPEN" operation (Open a Regular File)
+ * \param RPCProcedure - Specified operation
+ * \param OPEN4args - operation arguments
+ * \param OPEN4res - operation results
+ */
+ virtual void open41(const RPCProcedure*,
+ const struct NFS41::OPEN4args*,
+ const struct NFS41::OPEN4res*) {}
+
+ /*! NFSv41 "OPENATTR" operation (Open Named Attribute Directory)
+ * \param RPCProcedure - Specified operation
+ * \param OPENATTR4args - operation arguments
+ * \param OPENATTR4res - operation results
+ */
+ virtual void openattr41(const RPCProcedure*,
+ const struct NFS41::OPENATTR4args*,
+ const struct NFS41::OPENATTR4res*) {}
+
+ /*! NFSv41 "OPEN_CONFIRM" operation (Confirm Open)
+ * \param RPCProcedure - Specified operation
+ * \param OPEN_CONFIRM4args - operation arguments
+ * \param OPEN_CONFIRM4NULL3res - operation results
+ */
+ virtual void open_confirm41(const RPCProcedure*,
+ const struct NFS41::OPEN_CONFIRM4args*,
+ const struct NFS41::OPEN_CONFIRM4res*) {}
+
+ /*! NFSv41 "OPEN_DOWNGRADE" operation (Reduce Open File Access)
+ * \param RPCProcedure - Specified operation
+ * \param OPEN_DOWNGRADE4args - operation arguments
+ * \param OPEN_DOWNGRADE4res - operation results
+ */
+ virtual void open_downgrade41(const RPCProcedure*,
+ const struct NFS41::OPEN_DOWNGRADE4args*,
+ const struct NFS41::OPEN_DOWNGRADE4res*) {}
+
+ /*! NFSv41 "PUTFH" operation (Set Current Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param PUTFH4args - operation arguments
+ * \param PUTFH4res - operation results
+ */
+ virtual void putfh41(const RPCProcedure*,
+ const struct NFS41::PUTFH4args*,
+ const struct NFS41::PUTFH4res*) {}
+
+ /*! NFSv41 "PUTPUBFH" operation (Set Public Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param PUTPUBFH4res - operation results
+ */
+ virtual void putpubfh41(const RPCProcedure*,
+ const struct NFS41::PUTPUBFH4res*) {}
+
+ /*! NFSv41 "PUTROOTFH" operation (Set Root Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param PUTROOTFHargs - operation arguments
+ * \param PUTROOTFHres - operation results
+ */
+ virtual void putrootfh41(const RPCProcedure*,
+ const struct NFS41::PUTROOTFH4res*) {}
+
+ /*! NFSv41 "READ" operation (Read from File)
+ * \param RPCProcedure - Specified operation
+ * \param READ4args - operation arguments
+ * \param READ4res - operation results
+ */
+ virtual void read41(const RPCProcedure*,
+ const struct NFS41::READ4args*,
+ const struct NFS41::READ4res*) {}
+
+ /*! NFSv41 "READDIR" operation (Read Directory)
+ * \param RPCProcedure - Specified operation
+ * \param READDIR4args - operation arguments
+ * \param READDIR4res - operation results
+ */
+ virtual void readdir41(const RPCProcedure*,
+ const struct NFS41::READDIR4args*,
+ const struct NFS41::READDIR4res*) {}
+
+ /*! NFSv41 "READLINK" operation (Read Symbolic Link)
+ * \param RPCProcedure - Specified operation
+ * \param READLINK4res - operation results
+ */
+ virtual void readlink41(const RPCProcedure*,
+ const struct NFS41::READLINK4res*) {}
+
+ /*! NFSv41 "REMOVE" operation (Remove Filesystem Object)
+ * \param RPCProcedure - Specified operation
+ * \param REMOVE4args - operation arguments
+ * \param REMOVE4res - operation results
+ */
+ virtual void remove41(const RPCProcedure*,
+ const struct NFS41::REMOVE4args*,
+ const struct NFS41::REMOVE4res*) {}
+
+ /*! NFSv41 "RENAME" operation (Rename Directory Entry)
+ * \param RPCProcedure - Specified operation
+ * \param RENAME4args - operation arguments
+ * \param RENAME4res - operation results
+ */
+ virtual void rename41(const RPCProcedure*,
+ const struct NFS41::RENAME4args*,
+ const struct NFS41::RENAME4res*) {}
+
+ /*! NFSv41 "RENEW" operation (Renew a Lease)
+ * \param RPCProcedure - Specified operation
+ * \param RENEW4args - operation arguments
+ * \param RENEW4res - operation results
+ */
+ virtual void renew41(const RPCProcedure*,
+ const struct NFS41::RENEW4args*,
+ const struct NFS41::RENEW4res*) {}
+
+ /*! NFSv41 "RESTOREFH" operation (Restore Saved Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param RESTOREFH4res - operation results
+ */
+ virtual void restorefh41(const RPCProcedure*,
+ const struct NFS41::RESTOREFH4res*) {}
+
+ /*! NFSv41 "SAVEFH" operation (Save Current Filehandle)
+ * \param RPCProcedure - Specified operation
+ * \param SAVEFH4res - operation results
+ */
+ virtual void savefh41(const RPCProcedure*,
+ const struct NFS41::SAVEFH4res*) {}
+
+ /*! NFSv41 "SECINFO" operation (Obtain Available Security)
+ * \param RPCProcedure - Specified operation
+ * \param SECINFO4args - operation arguments
+ * \param SECINFO4res - operation results
+ */
+ virtual void secinfo41(const RPCProcedure*,
+ const struct NFS41::SECINFO4args*,
+ const struct NFS41::SECINFO4res*) {}
+
+ /*! NFSv41 "SETATTR" operation (Set Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param SETATTR4args - operation arguments
+ * \param SETATTR4res - operation results
+ */
+ virtual void setattr41(const RPCProcedure*,
+ const struct NFS41::SETATTR4args*,
+ const struct NFS41::SETATTR4res*) {}
+
+ /*! NFSv41 "SETCLIENTID" operation (Negotiate Clientid)
+ * \param RPCProcedure - Specified operation
+ * \param SETCLIENTID4args - operation arguments
+ * \param SETCLIENTID4res - operation results
+ */
+ virtual void setclientid41(const RPCProcedure*,
+ const struct NFS41::SETCLIENTID4args*,
+ const struct NFS41::SETCLIENTID4res*) {}
+
+ /*! NFSv41 "SETCLIENTID_CONFIRM" operation
+ * \param RPCProcedure - Specified operation
+ * \param SETCLIENTID_CONFIRM4args - operation arguments
+ * \param SETCLIENTID_CONFIRM4res - operation results
+ */
+ virtual void setclientid_confirm41(const RPCProcedure*,
+ const struct NFS41::SETCLIENTID_CONFIRM4args*,
+ const struct NFS41::SETCLIENTID_CONFIRM4res*) {}
+
+ /*! NFSv41 "VERIFY" operation (Verify Same Attributes)
+ * \param RPCProcedure - Specified operation
+ * \param VERIFY4args - operation arguments
+ * \param VERIFY4res - operation results
+ */
+ virtual void verify41(const RPCProcedure*,
+ const struct NFS41::VERIFY4args*,
+ const struct NFS41::VERIFY4res*) {}
+
+ /*! NFSv41 "WRITE" operation (Write to File)
+ * \param RPCProcedure - Specified operation
+ * \param WRITE4args - operation arguments
+ * \param WRITE4res - operation results
+ */
+ virtual void write41(const RPCProcedure*,
+ const struct NFS41::WRITE4args*,
+ const struct NFS41::WRITE4res*) {}
+
+ /*! NFSv41 "RELEASE_LOCKOWNER" operation
+ * \param RPCProcedure - Specified operation
+ * \param RELEASE_LOCKOWNER4args - operation arguments
+ * \param RELEASE_LOCKOWNER4res - operation results
+ */
+ virtual void release_lockowner41(const RPCProcedure*,
+ const struct NFS41::RELEASE_LOCKOWNER4args*,
+ const struct NFS41::RELEASE_LOCKOWNER4res*) {}
+
+ /*! NFSv41 "BACKCHANNEL_CTL" operation (Backchannel Control)
+ * \param RPCProcedure - Specified operation
+ * \param BACKCHANNEL_CTL4args - operation arguments
+ * \param BACKCHANNEL_CTL4res - operation results
+ */
+ virtual void backchannel_ctl41(const RPCProcedure*,
+ const struct NFS41::BACKCHANNEL_CTL4args*,
+ const struct NFS41::BACKCHANNEL_CTL4res*) {}
+
+ /*! NFSv41 "BIND_CONN_TO_SESSION" operation (Associate Connection with Session)
+ * \param RPCProcedure - Specified operation
+ * \param BIND_CONN_TO_SESSION4args - operation arguments
+ * \param BIND_CONN_TO_SESSION4res - operation results
+ */
+ virtual void bind_conn_to_session41(const RPCProcedure*,
+ const struct NFS41::BIND_CONN_TO_SESSION4args*,
+ const struct NFS41::BIND_CONN_TO_SESSION4res*) {}
+
+ /*! NFSv41 "EXCHANGE_ID" operation (Instantiate Client ID)
+ * \param RPCProcedure - Specified operation
+ * \param EXCHANGE_ID4args - operation arguments
+ * \param EXCHANGE_ID4res - operation results
+ */
+ virtual void exchange_id41(const RPCProcedure*,
+ const struct NFS41::EXCHANGE_ID4args*,
+ const struct NFS41::EXCHANGE_ID4res*) {}
+
+ /*! NFSv41 "CREATE_SESSION" operation (Create New Session and Confirm Client ID)
+ * \param RPCProcedure - Specified operation
+ * \param CREATE_SESSION4args - operation arguments
+ * \param CREATE_SESSION4res - operation results
+ */
+ virtual void create_session41(const RPCProcedure*,
+ const struct NFS41::CREATE_SESSION4args*,
+ const struct NFS41::CREATE_SESSION4res*) {}
+
+ /*! NFSv41 "DESTROY_SESSION" operation (Destroy a Session)
+ * \param RPCProcedure - Specified operation
+ * \param DESTROY_SESSION4args - operation arguments
+ * \param DESTROY_SESSION4res - operation results
+ */
+ virtual void destroy_session41(const RPCProcedure*,
+ const struct NFS41::DESTROY_SESSION4args*,
+ const struct NFS41::DESTROY_SESSION4res*) {}
+
+ /*! NFSv41 "FREE_STATEID" operation (Free Stateid with No Locks)
+ * \param RPCProcedure - Specified operation
+ * \param FREE_STATEID4args - operation arguments
+ * \param FREE_STATEID4res - operation results
+ */
+ virtual void free_stateid41(const RPCProcedure*,
+ const struct NFS41::FREE_STATEID4args*,
+ const struct NFS41::FREE_STATEID4res*) {}
+
+ /*! NFSv41 "GET_DIR_DELEGATION" operation (Get a Directory Delegation)
+ * \param RPCProcedure - Specified operation
+ * \param GET_DIR_DELEGATION4args - operation arguments
+ * \param GET_DIR_DELEGATION4res - operation results
+ */
+ virtual void get_dir_delegation41(const RPCProcedure*,
+ const struct NFS41::GET_DIR_DELEGATION4args*,
+ const struct NFS41::GET_DIR_DELEGATION4res*) {}
+
+ /*! NFSv41 "GETDEVICEINFO" operation (Get Device Information)
+ * \param RPCProcedure - Specified operation
+ * \param GETDEVICEINFO4args - operation arguments
+ * \param GETDEVICEINFO4res - operation results
+ */
+ virtual void getdeviceinfo41(const RPCProcedure*,
+ const struct NFS41::GETDEVICEINFO4args*,
+ const struct NFS41::GETDEVICEINFO4res*) {}
+
+ /*! NFSv41 "GETDEVICELIST" operation (Get All Device Mappings for a File System)
+ * \param RPCProcedure - Specified operation
+ * \param GETDEVICELIST4args - operation arguments
+ * \param GETDEVICELIST4res - operation results
+ */
+ virtual void getdevicelist41(const RPCProcedure*,
+ const struct NFS41::GETDEVICELIST4args*,
+ const struct NFS41::GETDEVICELIST4res*) {}
+
+ /*! NFSv41 "LAYOUTCOMMIT" operation (Commit Writes Made Using a Layout)
+ * \param RPCProcedure - Specified operation
+ * \param LAYOUTCOMMIT4args - operation arguments
+ * \param LAYOUTCOMMIT4res - operation results
+ */
+ virtual void layoutcommit41(const RPCProcedure*,
+ const struct NFS41::LAYOUTCOMMIT4args*,
+ const struct NFS41::LAYOUTCOMMIT4res*) {}
+
+ /*! NFSv41 "LAYOUTGET" operation (Get Layout Information)
+ * \param RPCProcedure - Specified operation
+ * \param LAYOUTGET4args - operation arguments
+ * \param LAYOUTGET4res - operation results
+ */
+ virtual void layoutget41(const RPCProcedure*,
+ const struct NFS41::LAYOUTGET4args*,
+ const struct NFS41::LAYOUTGET4res*) {}
+
+ /*! NFSv41 "LAYOUTRETURN" operation (Release Layout Information)
+ * \param RPCProcedure - Specified operation
+ * \param LAYOUTRETURN4args - operation arguments
+ * \param LAYOUTRETURN4res - operation results
+ */
+ virtual void layoutreturn41(const RPCProcedure*,
+ const struct NFS41::LAYOUTRETURN4args*,
+ const struct NFS41::LAYOUTRETURN4res*) {}
+
+ /*! NFSv41 "SECINFO_NO_NAME" operation (Get Security on Unnamed Object)
+ * \param RPCProcedure - Specified operation
+ * \param SECINFO_NO_NAME4args - operation arguments
+ * \param SECINFO_NO_NAME4res - operation results
+ */
+ virtual void secinfo_no_name41(const RPCProcedure*,
+ const NFS41::SECINFO_NO_NAME4args*,
+ const NFS41::SECINFO_NO_NAME4res*) {}
+
+ /*! NFSv41 "SEQUENCE" operation (Supply Per-Procedure Sequencing and Control)
+ * \param RPCProcedure - Specified operation
+ * \param SEQUENCE4args - operation arguments
+ * \param SEQUENCE4res - operation results
+ */
+ virtual void sequence41(const RPCProcedure*,
+ const struct NFS41::SEQUENCE4args*,
+ const struct NFS41::SEQUENCE4res*) {}
+
+ /*! NFSv41 "SET_SSV" operation (Update SSV for a Client ID)
+ * \param RPCProcedure - Specified operation
+ * \param SET_SSV4args - operation arguments
+ * \param SET_SSV4res - operation results
+ */
+ virtual void set_ssv41(const RPCProcedure*,
+ const struct NFS41::SET_SSV4args*,
+ const struct NFS41::SET_SSV4res*) {}
+
+ /*! NFSv41 "TEST_STATEID" operation (Test Stateids for Validity)
+ * \param RPCProcedure - Specified operation
+ * \param TEST_STATEID4args - operation arguments
+ * \param TEST_STATEID4res - operation results
+ */
+ virtual void test_stateid41(const RPCProcedure*,
+ const struct NFS41::TEST_STATEID4args*,
+ const struct NFS41::TEST_STATEID4res*) {}
+
+ /*! NFSv41 "WANT_DELEGATION" operation (Request Delegation)
+ * \param RPCProcedure - Specified operation
+ * \param WANT_DELEGATION4args - operation arguments
+ * \param WANT_DELEGATION4res - operation results
+ */
+ virtual void want_delegation41(const RPCProcedure*,
+ const struct NFS41::WANT_DELEGATION4args*,
+ const struct NFS41::WANT_DELEGATION4res*) {}
+
+ /*! NFSv41 "DESTROY_CLIENTID" operation
+ * \param RPCProcedure - Specified operation
+ * \param DESTROY_CLIENTID4args - operation arguments
+ * \param DESTROY_CLIENTID4res - operation results
+ */
+ virtual void destroy_clientid41(const RPCProcedure*,
+ const struct NFS41::DESTROY_CLIENTID4args*,
+ const struct NFS41::DESTROY_CLIENTID4res*) {}
+
+ /*! NFSv41 "RECLAIM_COMPLETE" operation (Indicates Reclaims Finished)
+ * \param RPCProcedure - Specified operation
+ * \param RECLAIM_COMPLETE4args - operation arguments
+ * \param RECLAIM_COMPLETE4res - operation results
+ */
+ virtual void reclaim_complete41(const RPCProcedure*,
+ const struct NFS41::RECLAIM_COMPLETE4args*,
+ const struct NFS41::RECLAIM_COMPLETE4res*) {}
+
+ /*! NFSv41 "ILLEGAL" operation (Illegal operation)
+ * \param RPCProcedure - Specified operation
+ * \param ILLEGAL4res - operation results
+ */
+ virtual void illegal41(const RPCProcedure*,
+ const struct NFS41::ILLEGAL4res*) {}
+};
+
+/*! Abstract interface of plugin which collects SMBv1 statistics
+ */
+class ISMBv1
+{
+public:
+ virtual ~ISMBv1() {}
+
+ /*! SMBv1 "CreateDirectory" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void createDirectorySMBv1(const SMBv1::CreateDirectoryCommand*, const SMBv1::CreateDirectoryArgumentType*, const SMBv1::CreateDirectoryResultType*) {}
+
+ /*! SMBv1 "DeleteDirectory" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void deleteDirectorySMBv1(const SMBv1::DeleteDirectoryCommand*, const SMBv1::DeleteDirectoryArgumentType*, const SMBv1::DeleteDirectoryResultType*) {}
+
+ /*! SMBv1 "Open" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void openSMBv1(const SMBv1::OpenCommand*, const SMBv1::OpenArgumentType*, const SMBv1::OpenResultType*) {}
+
+ /*! SMBv1 "Create" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void createSMBv1(const SMBv1::CreateCommand*, const SMBv1::CreateArgumentType*, const SMBv1::CreateResultType*) {}
+
+ /*! SMBv1 "Close" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void closeSMBv1(const SMBv1::CloseCommand*, const SMBv1::CloseArgumentType*, const SMBv1::CloseResultType*) {}
+
+ /*! SMBv1 "Flush" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void flushSMBv1(const SMBv1::FlushCommand*, const SMBv1::FlushArgumentType*, const SMBv1::FlushResultType*) {}
+
+ /*! SMBv1 "Delete" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void deleteSMBv1(const SMBv1::DeleteCommand*, const SMBv1::DeleteArgumentType*, const SMBv1::DeleteResultType*) {}
+
+ /*! SMBv1 "Rename" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void renameSMBv1(const SMBv1::RenameCommand*, const SMBv1::RenameArgumentType*, const SMBv1::RenameResultType*) {}
+
+ /*! SMBv1 "QueryInformation" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void queryInfoSMBv1(const SMBv1::QueryInformationCommand*, const SMBv1::QueryInformationArgumentType*, const SMBv1::QueryInformationResultType*) {}
+
+ /*! SMBv1 "SetInformation" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void setInfoSMBv1(const SMBv1::SetInformationCommand*, const SMBv1::SetInformationArgumentType*, const SMBv1::SetInformationResultType*) {}
+
+ /*! SMBv1 "Read" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void readSMBv1(const SMBv1::ReadCommand*, const SMBv1::ReadArgumentType*, const SMBv1::ReadResultType*) {}
+
+ /*! SMBv1 "Write" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeSMBv1(const SMBv1::WriteCommand*, const SMBv1::WriteArgumentType*, const SMBv1::WriteResultType*) {}
+
+ /*! SMBv1 "LockByteRange" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void lockByteRangeSMBv1(const SMBv1::LockByteRangeCommand*, const SMBv1::LockByteRangeArgumentType*, const SMBv1::LockByteRangeResultType*) {}
+
+ /*! SMBv1 "UnlockByteRange" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void unlockByteRangeSMBv1(const SMBv1::UnlockByteRangeCommand*, const SMBv1::UnlockByteRangeArgumentType*, const SMBv1::UnlockByteRangeResultType*) {}
+
+ /*! SMBv1 "CreateTemporary" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void createTmpSMBv1(const SMBv1::CreateTemporaryCommand*, const SMBv1::CreateTemporaryArgumentType*, const SMBv1::CreateTemporaryResultType*) {}
+
+ /*! SMBv1 "CreateNew" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void createNewSMBv1(const SMBv1::CreateNewCommand*, const SMBv1::CreateNewArgumentType*, const SMBv1::CreateNewResultType*) {}
+
+ /*! SMBv1 "CheckDirectory" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void checkDirectorySMBv1(const SMBv1::CheckDirectoryCommand*, const SMBv1::CheckDirectoryArgumentType*, const SMBv1::CheckDirectoryResultType*) {}
+
+ /*! SMBv1 "ProcessExit" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void processExitSMBv1(const SMBv1::ProcessExitCommand*, const SMBv1::ProcessExitArgumentType*, const SMBv1::ProcessExitResultType*) {}
+
+ /*! SMBv1 "Seek" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void seekSMBv1(const SMBv1::SeekCommand*, const SMBv1::SeekArgumentType*, const SMBv1::SeekResultType*) {}
+
+ /*! SMBv1 "LockAndRead" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void lockAndReadSMBv1(const SMBv1::LockAndReadCommand*, const SMBv1::LockAndReadArgumentType*, const SMBv1::LockAndReadResultType*) {}
+
+ /*! SMBv1 "WriteAndUnlock" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeAndUnlockSMBv1(const SMBv1::WriteAndUnlockCommand*, const SMBv1::WriteAndUnlockArgumentType*, const SMBv1::WriteAndUnlockResultType*) {}
+
+ /*! SMBv1 "ReadRaw" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void readRawSMBv1(const SMBv1::ReadRawCommand*, const SMBv1::ReadRawArgumentType*, const SMBv1::ReadRawResultType*) {}
+
+ /*! SMBv1 "ReadMpx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void readMpxSMBv1(const SMBv1::ReadMpxCommand*, const SMBv1::ReadMpxArgumentType*, const SMBv1::ReadMpxResultType*) {}
+
+ /*! SMBv1 "ReadMpxSecondary" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void readMpxSecondarySMBv1(const SMBv1::ReadMpxSecondaryCommand*, const SMBv1::ReadMpxSecondaryArgumentType*, const SMBv1::ReadMpxSecondaryResultType*) {}
+
+ /*! SMBv1 "WriteRaw" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeRawSMBv1(const SMBv1::WriteRawCommand*, const SMBv1::WriteRawArgumentType*, const SMBv1::WriteRawResultType*) {}
+
+ /*! SMBv1 "WriteMpx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeMpxSMBv1(const SMBv1::WriteMpxCommand*, const SMBv1::WriteMpxArgumentType*, const SMBv1::WriteMpxResultType*) {}
+
+ /*! SMBv1 "WriteMpxSecondary" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeMpxSecondarySMBv1(const SMBv1::WriteMpxSecondaryCommand*, const SMBv1::WriteMpxSecondaryArgumentType*, const SMBv1::WriteMpxSecondaryResultType*) {}
+
+ /*! SMBv1 "WriteComplete" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeCompleteSMBv1(const SMBv1::WriteCompleteCommand*, const SMBv1::WriteCompleteArgumentType*, const SMBv1::WriteCompleteResultType*) {}
+
+ /*! SMBv1 "QueryServer" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void queryServerSMBv1(const SMBv1::QueryServerCommand*, const SMBv1::QueryServerArgumentType*, const SMBv1::QueryServerResultType*) {}
+
+ /*! SMBv1 "SetInformation2" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void setInfo2SMBv1(const SMBv1::SetInformation2Command*, const SMBv1::SetInformation2ArgumentType*, const SMBv1::SetInformation2ResultType*) {}
+
+ /*! SMBv1 "QueryInformation2" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void queryInfo2SMBv1(const SMBv1::QueryInformation2Command*, const SMBv1::QueryInformation2ArgumentType*, const SMBv1::QueryInformation2ResultType*) {}
+
+ /*! SMBv1 "LockingAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void lockingAndxSMBv1(const SMBv1::LockingAndxCommand*, const SMBv1::LockingAndxArgumentType*, const SMBv1::LockingAndxResultType*) {}
+
+ /*! SMBv1 "Transaction" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void transactionSMBv1(const SMBv1::TransactionCommand*, const SMBv1::TransactionArgumentType*, const SMBv1::TransactionResultType*) {}
+
+ /*! SMBv1 "TransactionSecondary" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void transactionSecondarySMBv1(const SMBv1::TransactionSecondaryCommand*, const SMBv1::TransactionSecondaryArgumentType*, const SMBv1::TransactionSecondaryResultType*) {}
+
+ /*! SMBv1 "Ioctl" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ioctlSMBv1(const SMBv1::IoctlCommand*, const SMBv1::IoctlArgumentType*, const SMBv1::IoctlResultType*) {}
+
+ /*! SMBv1 "IoctlSecondary" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ioctlSecondarySMBv1(const SMBv1::IoctlSecondaryCommand*, const SMBv1::IoctlSecondaryArgumentType*, const SMBv1::IoctlSecondaryResultType*) {}
+
+ /*! SMBv1 "Copy" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void copySMBv1(const SMBv1::CopyCommand*, const SMBv1::CopyArgumentType*, const SMBv1::CopyResultType*) {}
+
+ /*! SMBv1 "Move" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void moveSMBv1(const SMBv1::MoveCommand*, const SMBv1::MoveArgumentType*, const SMBv1::MoveResultType*) {}
+
+ /*! SMBv1 "Echo" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void echoSMBv1(const SMBv1::EchoCommand*, const SMBv1::EchoArgumentType*, const SMBv1::EchoResultType*) {}
+
+ /*! SMBv1 "WriteAndClose" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeAndCloseSMBv1(const SMBv1::WriteAndCloseCommand*, const SMBv1::WriteAndCloseArgumentType*, const SMBv1::WriteAndCloseResultType*) {}
+
+ /*! SMBv1 "OpenAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void openAndxSMBv1(const SMBv1::OpenAndxCommand*, const SMBv1::OpenAndxArgumentType*, const SMBv1::OpenAndxResultType*) {}
+
+ /*! SMBv1 "ReadAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void readAndxSMBv1(const SMBv1::ReadAndxCommand*, const SMBv1::ReadAndxArgumentType*, const SMBv1::ReadAndxResultType*) {}
+
+ /*! SMBv1 "WriteAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeAndxSMBv1(const SMBv1::WriteAndxCommand*, const SMBv1::WriteAndxArgumentType*, const SMBv1::WriteAndxResultType*) {}
+
+ /*! SMBv1 "NewFileSize" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void newFileSizeSMBv1(const SMBv1::NewFileSizeCommand*, const SMBv1::NewFileSizeArgumentType*, const SMBv1::NewFileSizeResultType*) {}
+
+ /*! SMBv1 "CloseAndTreeDisc" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void closeAndTreeDiscSMBv1(const SMBv1::CloseAndTreeDiscCommand*, const SMBv1::CloseAndTreeDiscArgumentType*, const SMBv1::CloseAndTreeDiscResultType*) {}
+
+ /*! SMBv1 "Transaction2" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void transaction2SMBv1(const SMBv1::Transaction2Command*, const SMBv1::Transaction2ArgumentType*, const SMBv1::Transaction2ResultType*) {}
+
+ /*! SMBv1 "Transaction2Secondary" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void transaction2SecondarySMBv1(const SMBv1::Transaction2SecondaryCommand*, const SMBv1::Transaction2SecondaryArgumentType*, const SMBv1::Transaction2SecondaryResultType*) {}
+
+ /*! SMBv1 "FindClose2" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void findClose2SMBv1(const SMBv1::FindClose2Command*, const SMBv1::FindClose2ArgumentType*, const SMBv1::FindClose2ResultType*) {}
+
+ /*! SMBv1 "FindNotifyClose" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void findNotifyCloseSMBv1(const SMBv1::FindNotifyCloseCommand*, const SMBv1::FindNotifyCloseArgumentType*, const SMBv1::FindNotifyCloseResultType*) {}
+
+ /*! SMBv1 "TreeConnect" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void treeConnectSMBv1(const SMBv1::TreeConnectCommand*, const SMBv1::TreeConnectArgumentType*, const SMBv1::TreeConnectResultType*) {}
+
+ /*! SMBv1 "TreeDisconnect" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void treeDisconnectSMBv1(const SMBv1::TreeDisconnectCommand*, const SMBv1::TreeDisconnectArgumentType*, const SMBv1::TreeDisconnectResultType*) {}
+
+ /*! SMBv1 "Negotiate" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void negotiateSMBv1(const SMBv1::NegotiateCommand*, const SMBv1::NegotiateArgumentType*, const SMBv1::NegotiateResultType*) {}
+
+ /*! SMBv1 "SessionSetupAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void sessionSetupAndxSMBv1(const SMBv1::SessionSetupAndxCommand*, const SMBv1::SessionSetupAndxArgumentType*, const SMBv1::SessionSetupAndxResultType*) {}
+
+ /*! SMBv1 "LogoffAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void logoffAndxSMBv1(const SMBv1::LogoffAndxCommand*, const SMBv1::LogoffAndxArgumentType*, const SMBv1::LogoffAndxResultType*) {}
+
+ /*! SMBv1 "TreeConnectAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void treeConnectAndxSMBv1(const SMBv1::TreeConnectAndxCommand*, const SMBv1::TreeConnectAndxArgumentType*, const SMBv1::TreeConnectAndxResultType*) {}
+
+ /*! SMBv1 "SecurityPackageAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void securityPackageAndxSMBv1(const SMBv1::SecurityPackageAndxCommand*, const SMBv1::SecurityPackageAndxArgumentType*, const SMBv1::SecurityPackageAndxResultType*) {}
+
+ /*! SMBv1 "QueryInformationDisk" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void queryInformationDiskSMBv1(const SMBv1::QueryInformationDiskCommand*, const SMBv1::QueryInformationDiskArgumentType*, const SMBv1::QueryInformationDiskResultType*) {}
+
+ /*! SMBv1 "Search" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void searchSMBv1(const SMBv1::SearchCommand*, const SMBv1::SearchArgumentType*, const SMBv1::SearchResultType*) {}
+
+ /*! SMBv1 "Find" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void findSMBv1(const SMBv1::FindCommand*, const SMBv1::FindArgumentType*, const SMBv1::FindResultType*) {}
+
+ /*! SMBv1 "FindUnique" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void findUniqueSMBv1(const SMBv1::FindUniqueCommand*, const SMBv1::FindUniqueArgumentType*, const SMBv1::FindUniqueResultType*) {}
+
+ /*! SMBv1 "FindClose" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void findCloseSMBv1(const SMBv1::FindCloseCommand*, const SMBv1::FindCloseArgumentType*, const SMBv1::FindCloseResultType*) {}
+
+ /*! SMBv1 "NtTransact" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ntTransactSMBv1(const SMBv1::NtTransactCommand*, const SMBv1::NtTransactArgumentType*, const SMBv1::NtTransactResultType*) {}
+
+ /*! SMBv1 "NtTransactSecondary" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ntTransactSecondarySMBv1(const SMBv1::NtTransactSecondaryCommand*, const SMBv1::NtTransactSecondaryArgumentType*, const SMBv1::NtTransactSecondaryResultType*) {}
+
+ /*! SMBv1 "NtCreateAndx" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ntCreateAndxSMBv1(const SMBv1::NtCreateAndxCommand*, const SMBv1::NtCreateAndxArgumentType*, const SMBv1::NtCreateAndxResultType*) {}
+
+ /*! SMBv1 "NtCancel" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ntCancelSMBv1(const SMBv1::NtCancelCommand*, const SMBv1::NtCancelArgumentType*, const SMBv1::NtCancelResultType*) {}
+
+ /*! SMBv1 "NtRename" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ntRenameSMBv1(const SMBv1::NtRenameCommand*, const SMBv1::NtRenameArgumentType*, const SMBv1::NtRenameResultType*) {}
+
+ /*! SMBv1 "OpenPrintFile" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void openPrintFileSMBv1(const SMBv1::OpenPrintFileCommand*, const SMBv1::OpenPrintFileArgumentType*, const SMBv1::OpenPrintFileResultType*) {}
+
+ /*! SMBv1 "WritePrintFile" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writePrintFileSMBv1(const SMBv1::WritePrintFileCommand*, const SMBv1::WritePrintFileArgumentType*, const SMBv1::WritePrintFileResultType*) {}
+
+ /*! SMBv1 "ClosePrintFile" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void closePrintFileSMBv1(const SMBv1::ClosePrintFileCommand*, const SMBv1::ClosePrintFileArgumentType*, const SMBv1::ClosePrintFileResultType*) {}
+
+ /*! SMBv1 "GetPrintQueue" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void getPrintQueueSMBv1(const SMBv1::GetPrintQueueCommand*, const SMBv1::GetPrintQueueArgumentType*, const SMBv1::GetPrintQueueResultType*) {}
+
+ /*! SMBv1 "ReadBulk" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void readBulkSMBv1(const SMBv1::ReadBulkCommand*, const SMBv1::ReadBulkArgumentType*, const SMBv1::ReadBulkResultType*) {}
+
+ /*! SMBv1 "WriteBulk" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeBulkSMBv1(const SMBv1::WriteBulkCommand*, const SMBv1::WriteBulkArgumentType*, const SMBv1::WriteBulkResultType*) {}
+
+ /*! SMBv1 "WriteBulkData" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeBulkDataSMBv1(const SMBv1::WriteBulkDataCommand*, const SMBv1::WriteBulkDataArgumentType*, const SMBv1::WriteBulkDataResultType*) {}
+
+ /*! SMBv1 "Invalid" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void invalidSMBv1(const SMBv1::InvalidCommand*, const SMBv1::InvalidArgumentType*, const SMBv1::InvalidResultType*) {}
+
+ /*! SMBv1 "NoAndxCommand" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void noAndxCommandSMBv1(const SMBv1::NoAndxCommand*, const SMBv1::NoAndxCmdArgumentType*, const SMBv1::NoAndxCmdResultType*) {}
+};
+
+/*! Abstract interface of plugin which collects SMBv2 statistics
+ */
+class ISMBv2
+{
+public:
+ virtual ~ISMBv2() {}
+
+ /*! "Close file" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void closeFileSMBv2(const SMBv2::CloseFileCommand*, const SMBv2::CloseRequest*, const SMBv2::CloseResponse*) {}
+
+ /*! "Negotiate" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void negotiateSMBv2(const SMBv2::NegotiateCommand*, const SMBv2::NegotiateRequest*, const SMBv2::NegotiateResponse*) {}
+
+ /*! "session setup" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void sessionSetupSMBv2(const SMBv2::SessionSetupCommand*, const SMBv2::SessionSetupRequest*, const SMBv2::SessionSetupResponse*) {}
+
+ /*! "log off" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void logOffSMBv2(const SMBv2::LogOffCommand*, const SMBv2::LogOffRequest*, const SMBv2::LogOffResponse*) {}
+
+ /*! "Tree Connect" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void treeConnectSMBv2(const SMBv2::TreeConnectCommand*, const SMBv2::TreeConnectRequest*, const SMBv2::TreeConnectResponse*) {}
+
+ /*! "Tree disconnect" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void treeDisconnectSMBv2(const SMBv2::TreeDisconnectCommand*, const SMBv2::TreeDisconnectRequest*, const SMBv2::TreeDisconnectResponse*) {}
+
+ /*! "Create" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void createSMBv2(const SMBv2::CreateCommand*, const SMBv2::CreateRequest*, const SMBv2::CreateResponse*) {}
+
+ /*! "Flush" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void flushSMBv2(const SMBv2::FlushCommand*, const SMBv2::FlushRequest*, const SMBv2::FlushResponse*) {}
+
+ /*! "Read" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void readSMBv2(const SMBv2::ReadCommand*, const SMBv2::ReadRequest*, const SMBv2::ReadResponse*) {}
+
+ /*! "Write" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void writeSMBv2(const SMBv2::WriteCommand*, const SMBv2::WriteRequest*, const SMBv2::WriteResponse*) {}
+
+ /*! "Lock" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void lockSMBv2(const SMBv2::LockCommand*, const SMBv2::LockRequest*, const SMBv2::LockResponse*) {}
+
+ /*! "IO ctl" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void ioctlSMBv2(const SMBv2::IoctlCommand*, const SMBv2::IoCtlRequest*, const SMBv2::IoCtlResponse*) {}
+
+ /*! "Cancel" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void cancelSMBv2(const SMBv2::CancelCommand*, const SMBv2::CancelRequest*, const SMBv2::CancelResponce*) {}
+
+ /*! "Echo" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void echoSMBv2(const SMBv2::EchoCommand*, const SMBv2::EchoRequest*, const SMBv2::EchoResponse*) {}
+
+ /*! "Query directory" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void queryDirSMBv2(const SMBv2::QueryDirCommand*, const SMBv2::QueryDirRequest*, const SMBv2::QueryDirResponse*) {}
+
+ /*! "Change notify" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void changeNotifySMBv2(const SMBv2::ChangeNotifyCommand*, const SMBv2::ChangeNotifyRequest*, const SMBv2::ChangeNotifyResponse*) {}
+
+ /*! "Query Info" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void queryInfoSMBv2(const SMBv2::QueryInfoCommand*, const SMBv2::QueryInfoRequest*, const SMBv2::QueryInfoResponse*) {}
+
+ /*! "Set Info" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void setInfoSMBv2(const SMBv2::SetInfoCommand*, const SMBv2::SetInfoRequest*, const SMBv2::SetInfoResponse*) {}
+
+ /*! "Break opportunistic lock" command "on receive" event handler
+ * \param cmd - Specified command
+ * \param arg - arguments for the command
+ * \param res - result of the command
+ */
+ virtual void breakOplockSMBv2(const SMBv2::BreakOpLockCommand*, const SMBv2::OplockAcknowledgment*, const SMBv2::OplockResponse*) {}
+};
+
+/*! Base interface for all nfstrace plugins.
+ * Extends protocol interfaces: NFS3, NFS4, NFS41, SMBv1, SMBv2
+ */
+class IAnalyzer : public INFSv3rpcgen, public INFSv4rpcgen, public INFSv41rpcgen, public ISMBv1, public ISMBv2
+{
+public:
+ virtual ~IAnalyzer() {}
+ virtual void flush_statistics() = 0;
+ virtual void on_unix_signal(int /*signo*/) {}
+};
+
+} // namespace API
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//IANALYZER_TYPE_H
+//------------------------------------------------------------------------------
diff --git a/src/api/ianalyzer_type.h b/src/api/ianalyzer_type.h
deleted file mode 100644
index 833cf89..0000000
--- a/src/api/ianalyzer_type.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: IAnalyzer describe interface of analysiss expected by application.
-// The interface define set of NFS Procedure handlers with empty dummy implementation
-// and pure virtual function for flushing analysis statistics.
-// Copyright (c) 2013 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#ifndef IANALYZER_TYPE_H
-#define IANALYZER_TYPE_H
-//------------------------------------------------------------------------------
-#include "nfs_types.h"
-#include "nfs3_types_rpcgen.h"
-#include "nfs4_types_rpcgen.h"
-#include "rpc_procedure.h"
-//------------------------------------------------------------------------------
-namespace NST
-{
-namespace API
-{
-
-class INFSv3rpcgen
-{
-public:
- virtual void null(const struct RPCProcedure*,
- const struct rpcgen::NULL3args*,
- const struct rpcgen::NULL3res*) {}
- virtual void getattr3(const struct RPCProcedure*,
- const struct rpcgen::GETATTR3args*,
- const struct rpcgen::GETATTR3res*) {}
- virtual void setattr3(const struct RPCProcedure*,
- const struct rpcgen::SETATTR3args*,
- const struct rpcgen::SETATTR3res*) {}
- virtual void lookup3(const struct RPCProcedure*,
- const struct rpcgen::LOOKUP3args*,
- const struct rpcgen::LOOKUP3res*) {}
- virtual void access3(const struct RPCProcedure*,
- const struct rpcgen::ACCESS3args*,
- const struct rpcgen::ACCESS3res*) {}
- virtual void readlink3(const struct RPCProcedure*,
- const struct rpcgen::READLINK3args*,
- const struct rpcgen::READLINK3res*) {}
- virtual void read3(const struct RPCProcedure*,
- const struct rpcgen::READ3args*,
- const struct rpcgen::READ3res*) {}
- virtual void write3(const struct RPCProcedure*,
- const struct rpcgen::WRITE3args*,
- const struct rpcgen::WRITE3res*) {}
- virtual void create3(const struct RPCProcedure*,
- const struct rpcgen::CREATE3args*,
- const struct rpcgen::CREATE3res*) {}
- virtual void mkdir3(const struct RPCProcedure*,
- const struct rpcgen::MKDIR3args*,
- const struct rpcgen::MKDIR3res*) {}
- virtual void symlink3(const struct RPCProcedure*,
- const struct rpcgen::SYMLINK3args*,
- const struct rpcgen::SYMLINK3res*) {}
- virtual void mknod3(const struct RPCProcedure*,
- const struct rpcgen::MKNOD3args*,
- const struct rpcgen::MKNOD3res*) {}
- virtual void remove3(const struct RPCProcedure*,
- const struct rpcgen::REMOVE3args*,
- const struct rpcgen::REMOVE3res*) {}
- virtual void rmdir3(const struct RPCProcedure*,
- const struct rpcgen::RMDIR3args*,
- const struct rpcgen::RMDIR3res*) {}
- virtual void rename3(const struct RPCProcedure*,
- const struct rpcgen::RENAME3args*,
- const struct rpcgen::RENAME3res*) {}
- virtual void link3(const struct RPCProcedure*,
- const struct rpcgen::LINK3args*,
- const struct rpcgen::LINK3res*) {}
- virtual void readdir3(const struct RPCProcedure*,
- const struct rpcgen::READDIR3args*,
- const struct rpcgen::READDIR3res*) {}
- virtual void readdirplus3(const struct RPCProcedure*,
- const struct rpcgen::READDIRPLUS3args*,
- const struct rpcgen::READDIRPLUS3res*) {}
- virtual void fsstat3(const struct RPCProcedure*,
- const struct rpcgen::FSSTAT3args*,
- const struct rpcgen::FSSTAT3res*) {}
- virtual void fsinfo3(const struct RPCProcedure*,
- const struct rpcgen::FSINFO3args*,
- const struct rpcgen::FSINFO3res*) {}
- virtual void pathconf3(const struct RPCProcedure*,
- const struct rpcgen::PATHCONF3args*,
- const struct rpcgen::PATHCONF3res*) {}
- virtual void commit3(const struct RPCProcedure*,
- const struct rpcgen::COMMIT3args*,
- const struct rpcgen::COMMIT3res*) {}
-};
-
-class INFSv4rpcgen
-{
-public:
- virtual void null(const struct RPCProcedure*,
- const struct rpcgen::NULL4args*,
- const struct rpcgen::NULL4res*) {}
- virtual void compound4(const struct RPCProcedure*,
- const struct rpcgen::COMPOUND4args*,
- const struct rpcgen::COMPOUND4res*) {}
-};
-
-class IAnalyzer : public INFSv3rpcgen, public INFSv4rpcgen
-{
-public:
- virtual ~IAnalyzer() {};
- virtual void flush_statistics() = 0;
-};
-
-} // namespace API
-} // namespace NST
-//------------------------------------------------------------------------------
-#endif//IANALYZER_TYPE_H
-//------------------------------------------------------------------------------
diff --git a/src/api/nfs3_types_rpcgen.h b/src/api/nfs3_types_rpcgen.h
index 823bd0a..db0ba56 100644
--- a/src/api/nfs3_types_rpcgen.h
+++ b/src/api/nfs3_types_rpcgen.h
@@ -24,10 +24,12 @@
//------------------------------------------------------------------------------
#include <rpc/rpc.h>
//------------------------------------------------------------------------------
-namespace rpcgen
+namespace NST
+{
+namespace API
+{
+namespace NFS3
{
-
-extern "C" {
const uint32_t NFS3_FHSIZE {64};
const uint32_t NFS3_COOKIEVERFSIZE {8};
@@ -949,142 +951,9 @@ typedef struct COMMIT3res COMMIT3res;
#define NFS_V3 3
-bool_t xdr_uint64 (XDR *, uint64*);
-bool_t xdr_uint32 (XDR *, uint32*);
-bool_t xdr_int64 (XDR *, int64*);
-bool_t xdr_int32 (XDR *, int32*);
-bool_t xdr_filename3 (XDR *, filename3*);
-bool_t xdr_nfspath3 (XDR *, nfspath3*);
-bool_t xdr_fileid3 (XDR *, fileid3*);
-bool_t xdr_cookie3 (XDR *, cookie3*);
-bool_t xdr_cookieverf3 (XDR *, cookieverf3);
-bool_t xdr_createverf3 (XDR *, createverf3);
-bool_t xdr_writeverf3 (XDR *, writeverf3);
-bool_t xdr_uid3 (XDR *, uid3*);
-bool_t xdr_gid3 (XDR *, gid3*);
-bool_t xdr_size3 (XDR *, size3*);
-bool_t xdr_offset3 (XDR *, offset3*);
-bool_t xdr_mode3 (XDR *, mode3*);
-bool_t xdr_count3 (XDR *, count3*);
-bool_t xdr_nfsstat3 (XDR *, nfsstat3*);
-bool_t xdr_ftype3 (XDR *, ftype3*);
-bool_t xdr_specdata3 (XDR *, specdata3*);
-bool_t xdr_nfs_fh3 (XDR *, nfs_fh3*);
-bool_t xdr_nfstime3 (XDR *, nfstime3*);
-bool_t xdr_fattr3 (XDR *, fattr3*);
-bool_t xdr_post_op_attr (XDR *, post_op_attr*);
-bool_t xdr_wcc_attr (XDR *, wcc_attr*);
-bool_t xdr_pre_op_attr (XDR *, pre_op_attr*);
-bool_t xdr_wcc_data (XDR *, wcc_data*);
-bool_t xdr_post_op_fh3 (XDR *, post_op_fh3*);
-bool_t xdr_time_how (XDR *, time_how*);
-bool_t xdr_set_mode3 (XDR *, set_mode3*);
-bool_t xdr_set_uid3 (XDR *, set_uid3*);
-bool_t xdr_set_gid3 (XDR *, set_gid3*);
-bool_t xdr_set_size3 (XDR *, set_size3*);
-bool_t xdr_set_atime (XDR *, set_atime*);
-bool_t xdr_set_mtime (XDR *, set_mtime*);
-bool_t xdr_sattr3 (XDR *, sattr3*);
-bool_t xdr_diropargs3 (XDR *, diropargs3*);
-bool_t xdr_NULL3args (XDR *, NULL3args*); // for compatibility
-bool_t xdr_NULL3res (XDR *, NULL3res*); // for compatibility
-bool_t xdr_GETATTR3args (XDR *, GETATTR3args*);
-bool_t xdr_GETATTR3resok (XDR *, GETATTR3resok*);
-bool_t xdr_GETATTR3res (XDR *, GETATTR3res*);
-bool_t xdr_sattrguard3 (XDR *, sattrguard3*);
-bool_t xdr_SETATTR3args (XDR *, SETATTR3args*);
-bool_t xdr_SETATTR3resok (XDR *, SETATTR3resok*);
-bool_t xdr_SETATTR3resfail (XDR *, SETATTR3resfail*);
-bool_t xdr_SETATTR3res (XDR *, SETATTR3res*);
-bool_t xdr_LOOKUP3args (XDR *, LOOKUP3args*);
-bool_t xdr_LOOKUP3resok (XDR *, LOOKUP3resok*);
-bool_t xdr_LOOKUP3resfail (XDR *, LOOKUP3resfail*);
-bool_t xdr_LOOKUP3res (XDR *, LOOKUP3res*);
-bool_t xdr_ACCESS3args (XDR *, ACCESS3args*);
-bool_t xdr_ACCESS3resok (XDR *, ACCESS3resok*);
-bool_t xdr_ACCESS3resfail (XDR *, ACCESS3resfail*);
-bool_t xdr_ACCESS3res (XDR *, ACCESS3res*);
-bool_t xdr_READLINK3args (XDR *, READLINK3args*);
-bool_t xdr_READLINK3resok (XDR *, READLINK3resok*);
-bool_t xdr_READLINK3resfail (XDR *, READLINK3resfail*);
-bool_t xdr_READLINK3res (XDR *, READLINK3res*);
-bool_t xdr_READ3args (XDR *, READ3args*);
-bool_t xdr_READ3resok (XDR *, READ3resok*);
-bool_t xdr_READ3resfail (XDR *, READ3resfail*);
-bool_t xdr_READ3res (XDR *, READ3res*);
-bool_t xdr_stable_how (XDR *, stable_how*);
-bool_t xdr_WRITE3args (XDR *, WRITE3args*);
-bool_t xdr_WRITE3resok (XDR *, WRITE3resok*);
-bool_t xdr_WRITE3resfail (XDR *, WRITE3resfail*);
-bool_t xdr_WRITE3res (XDR *, WRITE3res*);
-bool_t xdr_createmode3 (XDR *, createmode3*);
-bool_t xdr_createhow3 (XDR *, createhow3*);
-bool_t xdr_CREATE3args (XDR *, CREATE3args*);
-bool_t xdr_CREATE3resok (XDR *, CREATE3resok*);
-bool_t xdr_CREATE3resfail (XDR *, CREATE3resfail*);
-bool_t xdr_CREATE3res (XDR *, CREATE3res*);
-bool_t xdr_MKDIR3args (XDR *, MKDIR3args*);
-bool_t xdr_MKDIR3resok (XDR *, MKDIR3resok*);
-bool_t xdr_MKDIR3resfail (XDR *, MKDIR3resfail*);
-bool_t xdr_MKDIR3res (XDR *, MKDIR3res*);
-bool_t xdr_symlinkdata3 (XDR *, symlinkdata3*);
-bool_t xdr_SYMLINK3args (XDR *, SYMLINK3args*);
-bool_t xdr_SYMLINK3resok (XDR *, SYMLINK3resok*);
-bool_t xdr_SYMLINK3resfail (XDR *, SYMLINK3resfail*);
-bool_t xdr_SYMLINK3res (XDR *, SYMLINK3res*);
-bool_t xdr_devicedata3 (XDR *, devicedata3*);
-bool_t xdr_mknoddata3 (XDR *, mknoddata3*);
-bool_t xdr_MKNOD3args (XDR *, MKNOD3args*);
-bool_t xdr_MKNOD3resok (XDR *, MKNOD3resok*);
-bool_t xdr_MKNOD3resfail (XDR *, MKNOD3resfail*);
-bool_t xdr_MKNOD3res (XDR *, MKNOD3res*);
-bool_t xdr_REMOVE3args (XDR *, REMOVE3args*);
-bool_t xdr_REMOVE3resok (XDR *, REMOVE3resok*);
-bool_t xdr_REMOVE3resfail (XDR *, REMOVE3resfail*);
-bool_t xdr_REMOVE3res (XDR *, REMOVE3res*);
-bool_t xdr_RMDIR3args (XDR *, RMDIR3args*);
-bool_t xdr_RMDIR3resok (XDR *, RMDIR3resok*);
-bool_t xdr_RMDIR3resfail (XDR *, RMDIR3resfail*);
-bool_t xdr_RMDIR3res (XDR *, RMDIR3res*);
-bool_t xdr_RENAME3args (XDR *, RENAME3args*);
-bool_t xdr_RENAME3resok (XDR *, RENAME3resok*);
-bool_t xdr_RENAME3resfail (XDR *, RENAME3resfail*);
-bool_t xdr_RENAME3res (XDR *, RENAME3res*);
-bool_t xdr_LINK3args (XDR *, LINK3args*);
-bool_t xdr_LINK3resok (XDR *, LINK3resok*);
-bool_t xdr_LINK3resfail (XDR *, LINK3resfail*);
-bool_t xdr_LINK3res (XDR *, LINK3res*);
-bool_t xdr_READDIR3args (XDR *, READDIR3args*);
-bool_t xdr_entry3 (XDR *, entry3*);
-bool_t xdr_dirlist3 (XDR *, dirlist3*);
-bool_t xdr_READDIR3resok (XDR *, READDIR3resok*);
-bool_t xdr_READDIR3resfail (XDR *, READDIR3resfail*);
-bool_t xdr_READDIR3res (XDR *, READDIR3res*);
-bool_t xdr_READDIRPLUS3args (XDR *, READDIRPLUS3args*);
-bool_t xdr_entryplus3 (XDR *, entryplus3*);
-bool_t xdr_dirlistplus3 (XDR *, dirlistplus3*);
-bool_t xdr_READDIRPLUS3resok (XDR *, READDIRPLUS3resok*);
-bool_t xdr_READDIRPLUS3resfail (XDR *, READDIRPLUS3resfail*);
-bool_t xdr_READDIRPLUS3res (XDR *, READDIRPLUS3res*);
-bool_t xdr_FSSTAT3args (XDR *, FSSTAT3args*);
-bool_t xdr_FSSTAT3resok (XDR *, FSSTAT3resok*);
-bool_t xdr_FSSTAT3resfail (XDR *, FSSTAT3resfail*);
-bool_t xdr_FSSTAT3res (XDR *, FSSTAT3res*);
-bool_t xdr_FSINFO3args (XDR *, FSINFO3args*);
-bool_t xdr_FSINFO3resok (XDR *, FSINFO3resok*);
-bool_t xdr_FSINFO3resfail (XDR *, FSINFO3resfail*);
-bool_t xdr_FSINFO3res (XDR *, FSINFO3res*);
-bool_t xdr_PATHCONF3args (XDR *, PATHCONF3args*);
-bool_t xdr_PATHCONF3resok (XDR *, PATHCONF3resok*);
-bool_t xdr_PATHCONF3resfail (XDR *, PATHCONF3resfail*);
-bool_t xdr_PATHCONF3res (XDR *, PATHCONF3res*);
-bool_t xdr_COMMIT3args (XDR *, COMMIT3args*);
-bool_t xdr_COMMIT3resok (XDR *, COMMIT3resok*);
-bool_t xdr_COMMIT3resfail (XDR *, COMMIT3resfail*);
-bool_t xdr_COMMIT3res (XDR *, COMMIT3res*);
-}
-
-} // namespace rpcgen
+} // namespace NFS3
+} // namespace API
+} // namespace NST
//------------------------------------------------------------------------------
-#endif //NFS3_TYPES_RPCGEN_H
+#endif//NFS3_TYPES_RPCGEN_H
//------------------------------------------------------------------------------
diff --git a/src/api/nfs41_types_rpcgen.h b/src/api/nfs41_types_rpcgen.h
new file mode 100644
index 0000000..74ae8be
--- /dev/null
+++ b/src/api/nfs41_types_rpcgen.h
@@ -0,0 +1,3129 @@
+//------------------------------------------------------------------------------
+// Author: Alexey Costroma
+// Generated by rpcgen with minor compatibility fixes
+// Description: All RFC5661 declared structures.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFS41_TYPES_RPCGEN_H
+#define NFS41_TYPES_RPCGEN_H
+//------------------------------------------------------------------------------
+#include <rpc/rpc.h>
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace API
+{
+namespace NFS41
+{
+
+using authsys_parms = authunix_parms;
+
+#ifndef RPCSEC_GSS
+#define RPCSEC_GSS 6
+#endif
+
+const uint32_t NFS4_FHSIZE {128};
+const uint32_t NFS4_VERIFIER_SIZE {8};
+const uint32_t NFS4_OPAQUE_LIMIT {1024};
+const uint32_t NFS4_SESSIONID_SIZE {16};
+const uint64_t NFS4_INT64_MAX {0x7fffffffffffffff};
+const uint64_t NFS4_UINT64_MAX {0xffffffffffffffff};
+const uint32_t NFS4_INT32_MAX {0x7fffffff};
+const uint32_t NFS4_UINT32_MAX {0xffffffff};
+const uint64_t NFS4_MAXFILELEN {0xffffffffffffffff};
+const uint64_t NFS4_MAXFILEOFF {0xfffffffffffffffe};
+
+enum nfs_ftype4 {
+ NF4REG = 1,
+ NF4DIR = 2,
+ NF4BLK = 3,
+ NF4CHR = 4,
+ NF4LNK = 5,
+ NF4SOCK = 6,
+ NF4FIFO = 7,
+ NF4ATTRDIR = 8,
+ NF4NAMEDATTR = 9,
+};
+typedef enum nfs_ftype4 nfs_ftype4;
+
+enum nfsstat4 {
+ NFS4_OK = 0,
+ NFS4ERR_PERM = 1,
+ NFS4ERR_NOENT = 2,
+ NFS4ERR_IO = 5,
+ NFS4ERR_NXIO = 6,
+ NFS4ERR_ACCESS = 13,
+ NFS4ERR_EXIST = 17,
+ NFS4ERR_XDEV = 18,
+ NFS4ERR_NOTDIR = 20,
+ NFS4ERR_ISDIR = 21,
+ NFS4ERR_INVAL = 22,
+ NFS4ERR_FBIG = 27,
+ NFS4ERR_NOSPC = 28,
+ NFS4ERR_ROFS = 30,
+ NFS4ERR_MLINK = 31,
+ NFS4ERR_NAMETOOLONG = 63,
+ NFS4ERR_NOTEMPTY = 66,
+ NFS4ERR_DQUOT = 69,
+ NFS4ERR_STALE = 70,
+ NFS4ERR_BADHANDLE = 10001,
+ NFS4ERR_BAD_COOKIE = 10003,
+ NFS4ERR_NOTSUPP = 10004,
+ NFS4ERR_TOOSMALL = 10005,
+ NFS4ERR_SERVERFAULT = 10006,
+ NFS4ERR_BADTYPE = 10007,
+ NFS4ERR_DELAY = 10008,
+ NFS4ERR_SAME = 10009,
+ NFS4ERR_DENIED = 10010,
+ NFS4ERR_EXPIRED = 10011,
+ NFS4ERR_LOCKED = 10012,
+ NFS4ERR_GRACE = 10013,
+ NFS4ERR_FHEXPIRED = 10014,
+ NFS4ERR_SHARE_DENIED = 10015,
+ NFS4ERR_WRONGSEC = 10016,
+ NFS4ERR_CLID_INUSE = 10017,
+ NFS4ERR_RESOURCE = 10018,
+ NFS4ERR_MOVED = 10019,
+ NFS4ERR_NOFILEHANDLE = 10020,
+ NFS4ERR_MINOR_VERS_MISMATCH = 10021,
+ NFS4ERR_STALE_CLIENTID = 10022,
+ NFS4ERR_STALE_STATEID = 10023,
+ NFS4ERR_OLD_STATEID = 10024,
+ NFS4ERR_BAD_STATEID = 10025,
+ NFS4ERR_BAD_SEQID = 10026,
+ NFS4ERR_NOT_SAME = 10027,
+ NFS4ERR_LOCK_RANGE = 10028,
+ NFS4ERR_SYMLINK = 10029,
+ NFS4ERR_RESTOREFH = 10030,
+ NFS4ERR_LEASE_MOVED = 10031,
+ NFS4ERR_ATTRNOTSUPP = 10032,
+ NFS4ERR_NO_GRACE = 10033,
+ NFS4ERR_RECLAIM_BAD = 10034,
+ NFS4ERR_RECLAIM_CONFLICT = 10035,
+ NFS4ERR_BADXDR = 10036,
+ NFS4ERR_LOCKS_HELD = 10037,
+ NFS4ERR_OPENMODE = 10038,
+ NFS4ERR_BADOWNER = 10039,
+ NFS4ERR_BADCHAR = 10040,
+ NFS4ERR_BADNAME = 10041,
+ NFS4ERR_BAD_RANGE = 10042,
+ NFS4ERR_LOCK_NOTSUPP = 10043,
+ NFS4ERR_OP_ILLEGAL = 10044,
+ NFS4ERR_DEADLOCK = 10045,
+ NFS4ERR_FILE_OPEN = 10046,
+ NFS4ERR_ADMIN_REVOKED = 10047,
+ NFS4ERR_CB_PATH_DOWN = 10048,
+ NFS4ERR_BADIOMODE = 10049,
+ NFS4ERR_BADLAYOUT = 10050,
+ NFS4ERR_BAD_SESSION_DIGEST = 10051,
+ NFS4ERR_BADSESSION = 10052,
+ NFS4ERR_BADSLOT = 10053,
+ NFS4ERR_COMPLETE_ALREADY = 10054,
+ NFS4ERR_CONN_NOT_BOUND_TO_SESSION = 10055,
+ NFS4ERR_DELEG_ALREADY_WANTED = 10056,
+ NFS4ERR_BACK_CHAN_BUSY = 10057,
+ NFS4ERR_LAYOUTTRYLATER = 10058,
+ NFS4ERR_LAYOUTUNAVAILABLE = 10059,
+ NFS4ERR_NOMATCHING_LAYOUT = 10060,
+ NFS4ERR_RECALLCONFLICT = 10061,
+ NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062,
+ NFS4ERR_SEQ_MISORDERED = 10063,
+ NFS4ERR_SEQUENCE_POS = 10064,
+ NFS4ERR_REQ_TOO_BIG = 10065,
+ NFS4ERR_REP_TOO_BIG = 10066,
+ NFS4ERR_REP_TOO_BIG_TO_CACHE = 10067,
+ NFS4ERR_RETRY_UNCACHED_REP = 10068,
+ NFS4ERR_UNSAFE_COMPOUND = 10069,
+ NFS4ERR_TOO_MANY_OPS = 10070,
+ NFS4ERR_OP_NOT_IN_SESSION = 10071,
+ NFS4ERR_HASH_ALG_UNSUPP = 10072,
+ NFS4ERR_CLIENTID_BUSY = 10074,
+ NFS4ERR_PNFS_IO_HOLE = 10075,
+ NFS4ERR_SEQ_FALSE_RETRY = 10076,
+ NFS4ERR_BAD_HIGH_SLOT = 10077,
+ NFS4ERR_DEADSESSION = 10078,
+ NFS4ERR_ENCR_ALG_UNSUPP = 10079,
+ NFS4ERR_PNFS_NO_LAYOUT = 10080,
+ NFS4ERR_NOT_ONLY_OP = 10081,
+ NFS4ERR_WRONG_CRED = 10082,
+ NFS4ERR_WRONG_TYPE = 10083,
+ NFS4ERR_DIRDELEG_UNAVAIL = 10084,
+ NFS4ERR_REJECT_DELEG = 10085,
+ NFS4ERR_RETURNCONFLICT = 10086,
+ NFS4ERR_DELEG_REVOKED = 10087,
+};
+typedef enum nfsstat4 nfsstat4;
+
+typedef struct {
+ u_int attrlist4_len;
+ char *attrlist4_val;
+} attrlist4;
+
+typedef struct {
+ u_int bitmap4_len;
+ uint32_t *bitmap4_val;
+} bitmap4;
+
+typedef uint64_t changeid4;
+
+typedef uint64_t clientid4;
+
+typedef uint32_t count4;
+
+typedef uint64_t length4;
+
+typedef uint32_t mode4;
+
+typedef uint64_t nfs_cookie4;
+
+typedef struct {
+ u_int nfs_fh4_len;
+ char *nfs_fh4_val;
+} nfs_fh4;
+
+typedef uint64_t offset4;
+
+typedef uint32_t qop4;
+
+typedef struct {
+ u_int sec_oid4_len;
+ char *sec_oid4_val;
+} sec_oid4;
+
+typedef uint32_t sequenceid4;
+
+typedef uint32_t seqid4;
+
+typedef char sessionid4[NFS4_SESSIONID_SIZE];
+
+typedef uint32_t slotid4;
+
+typedef struct {
+ u_int utf8string_len;
+ char *utf8string_val;
+} utf8string;
+
+typedef utf8string utf8str_cis;
+
+typedef utf8string utf8str_cs;
+
+typedef utf8string utf8str_mixed;
+
+typedef utf8str_cs component4;
+
+typedef utf8str_cs linktext4;
+
+typedef struct {
+ u_int pathname4_len;
+ component4 *pathname4_val;
+} pathname4;
+
+typedef char verifier4[NFS4_VERIFIER_SIZE];
+
+struct nfstime4 {
+ int64_t seconds;
+ uint32_t nseconds;
+};
+typedef struct nfstime4 nfstime4;
+
+enum time_how4 {
+ SET_TO_SERVER_TIME4 = 0,
+ SET_TO_CLIENT_TIME4 = 1,
+};
+typedef enum time_how4 time_how4;
+
+struct settime4 {
+ time_how4 set_it;
+ union {
+ nfstime4 time;
+ } settime4_u;
+};
+typedef struct settime4 settime4;
+
+typedef uint32_t nfs_lease4;
+
+struct fsid4 {
+ uint64_t major;
+ uint64_t minor;
+};
+typedef struct fsid4 fsid4;
+
+struct change_policy4 {
+ uint64_t cp_major;
+ uint64_t cp_minor;
+};
+typedef struct change_policy4 change_policy4;
+
+struct fs_location4 {
+ struct {
+ u_int server_len;
+ utf8str_cis *server_val;
+ } server;
+ pathname4 rootpath;
+};
+typedef struct fs_location4 fs_location4;
+
+struct fs_locations4 {
+ pathname4 fs_root;
+ struct {
+ u_int locations_len;
+ fs_location4 *locations_val;
+ } locations;
+};
+typedef struct fs_locations4 fs_locations4;
+
+typedef uint32_t fattr4_aclsupport;
+const fattr4_aclsupport ACL4_SUPPORT_ALLOW_ACL {0x00000001};
+const fattr4_aclsupport ACL4_SUPPORT_DENY_ACL {0x00000002};
+const fattr4_aclsupport ACL4_SUPPORT_AUDIT_ACL {0x00000004};
+const fattr4_aclsupport ACL4_SUPPORT_ALARM_ACL {0x00000008};
+
+typedef uint32_t acetype4;
+const acetype4 ACE4_ACCESS_ALLOWED_ACE_TYPE {0x00000000};
+const acetype4 ACE4_ACCESS_DENIED_ACE_TYPE {0x00000001};
+const acetype4 ACE4_SYSTEM_AUDIT_ACE_TYPE {0x00000002};
+const acetype4 ACE4_SYSTEM_ALARM_ACE_TYPE {0x00000003};
+
+typedef uint32_t aceflag4;
+const aceflag4 ACE4_FILE_INHERIT_ACE {0x00000001};
+const aceflag4 ACE4_DIRECTORY_INHERIT_ACE {0x00000002};
+const aceflag4 ACE4_NO_PROPAGATE_INHERIT_ACE {0x00000004};
+const aceflag4 ACE4_INHERIT_ONLY_ACE {0x00000008};
+const aceflag4 ACE4_SUCCESSFUL_ACCESS_ACE_FLAG {0x00000010};
+const aceflag4 ACE4_FAILED_ACCESS_ACE_FLAG {0x00000020};
+const aceflag4 ACE4_IDENTIFIER_GROUP {0x00000040};
+const aceflag4 ACE4_INHERITED_ACE {0x00000080};
+
+typedef uint32_t acemask4;
+const acemask4 ACE4_READ_DATA {0x00000001};
+const acemask4 ACE4_LIST_DIRECTORY {0x00000001};
+const acemask4 ACE4_WRITE_DATA {0x00000002};
+const acemask4 ACE4_ADD_FILE {0x00000002};
+const acemask4 ACE4_APPEND_DATA {0x00000004};
+const acemask4 ACE4_ADD_SUBDIRECTORY {0x00000004};
+const acemask4 ACE4_READ_NAMED_ATTRS {0x00000008};
+const acemask4 ACE4_WRITE_NAMED_ATTRS {0x00000010};
+const acemask4 ACE4_EXECUTE {0x00000020};
+const acemask4 ACE4_DELETE_CHILD {0x00000040};
+const acemask4 ACE4_READ_ATTRIBUTES {0x00000080};
+const acemask4 ACE4_WRITE_ATTRIBUTES {0x00000100};
+const acemask4 ACE4_WRITE_RETENTION {0x00000200};
+const acemask4 ACE4_WRITE_RETENTION_HOLD {0x00000400};
+const acemask4 ACE4_DELETE {0x00010000};
+const acemask4 ACE4_READ_ACL {0x00020000};
+const acemask4 ACE4_WRITE_ACL {0x00040000};
+const acemask4 ACE4_WRITE_OWNER {0x00080000};
+const acemask4 ACE4_SYNCHRONIZE {0x00100000};
+const acemask4 ACE4_GENERIC_READ {0x00120081};
+const acemask4 ACE4_GENERIC_WRITE {0x00160106};
+const acemask4 ACE4_GENERIC_EXECUTE {0x001200A0};
+
+struct nfsace4 {
+ acetype4 type;
+ aceflag4 flag;
+ acemask4 access_mask;
+ utf8str_mixed who;
+};
+typedef struct nfsace4 nfsace4;
+
+typedef uint32_t aclflag4;
+const aclflag4 ACL4_AUTO_INHERIT {0x00000001};
+const aclflag4 ACL4_PROTECTED {0x00000002};
+const aclflag4 ACL4_DEFAULTED {0x00000004};
+
+struct nfsacl41 {
+ aclflag4 na41_flag;
+ struct {
+ u_int na41_aces_len;
+ nfsace4 *na41_aces_val;
+ } na41_aces;
+};
+typedef struct nfsacl41 nfsacl41;
+
+const mode4 MODE4_SUID {0x800};
+const mode4 MODE4_SGID {0x400};
+const mode4 MODE4_SVTX {0x200};
+const mode4 MODE4_RUSR {0x100};
+const mode4 MODE4_WUSR {0x080};
+const mode4 MODE4_XUSR {0x040};
+const mode4 MODE4_RGRP {0x020};
+const mode4 MODE4_WGRP {0x010};
+const mode4 MODE4_XGRP {0x008};
+const mode4 MODE4_ROTH {0x004};
+const mode4 MODE4_WOTH {0x002};
+const mode4 MODE4_XOTH {0x001};
+
+struct mode_masked4 {
+ mode4 mm_value_to_set;
+ mode4 mm_mask_bits;
+};
+typedef struct mode_masked4 mode_masked4;
+
+struct specdata4 {
+ uint32_t specdata1;
+ uint32_t specdata2;
+};
+typedef struct specdata4 specdata4;
+
+const uint32_t FH4_PERSISTENT {0x00000000};
+const uint32_t FH4_NOEXPIRE_WITH_OPEN {0x00000001};
+const uint32_t FH4_VOLATILE_ANY {0x00000002};
+const uint32_t FH4_VOL_MIGRATION {0x00000004};
+const uint32_t FH4_VOL_RENAME {0x00000008};
+
+struct netaddr4 {
+ char *na_r_netid;
+ char *na_r_addr;
+};
+typedef struct netaddr4 netaddr4;
+
+struct nfs_impl_id4 {
+ utf8str_cis nii_domain;
+ utf8str_cs nii_name;
+ nfstime4 nii_date;
+};
+typedef struct nfs_impl_id4 nfs_impl_id4;
+
+struct stateid4 {
+ uint32_t seqid;
+ char other[12];
+};
+typedef struct stateid4 stateid4;
+
+enum layouttype4 {
+ LAYOUT4_NFSV4_1_FILES = 0x1,
+ LAYOUT4_OSD2_OBJECTS = 0x2,
+ LAYOUT4_BLOCK_VOLUME = 0x3,
+};
+typedef enum layouttype4 layouttype4;
+
+struct layout_content4 {
+ layouttype4 loc_type;
+ struct {
+ u_int loc_body_len;
+ char *loc_body_val;
+ } loc_body;
+};
+typedef struct layout_content4 layout_content4;
+/*
+ * LAYOUT4_OSD2_OBJECTS loc_body description
+ * is in a separate .x file
+ */
+
+/*
+ * LAYOUT4_BLOCK_VOLUME loc_body description
+ * is in a separate .x file
+ */
+
+struct layouthint4 {
+ layouttype4 loh_type;
+ struct {
+ u_int loh_body_len;
+ char *loh_body_val;
+ } loh_body;
+};
+typedef struct layouthint4 layouthint4;
+
+enum layoutiomode4 {
+ LAYOUTIOMODE4_READ = 1,
+ LAYOUTIOMODE4_RW = 2,
+ LAYOUTIOMODE4_ANY = 3,
+};
+typedef enum layoutiomode4 layoutiomode4;
+
+struct layout4 {
+ offset4 lo_offset;
+ length4 lo_length;
+ layoutiomode4 lo_iomode;
+ layout_content4 lo_content;
+};
+typedef struct layout4 layout4;
+const uint32_t NFS4_DEVICEID4_SIZE {16};
+
+typedef char deviceid4[NFS4_DEVICEID4_SIZE];
+
+struct device_addr4 {
+ layouttype4 da_layout_type;
+ struct {
+ u_int da_addr_body_len;
+ char *da_addr_body_val;
+ } da_addr_body;
+};
+typedef struct device_addr4 device_addr4;
+
+struct layoutupdate4 {
+ layouttype4 lou_type;
+ struct {
+ u_int lou_body_len;
+ char *lou_body_val;
+ } lou_body;
+};
+typedef struct layoutupdate4 layoutupdate4;
+
+const uint32_t LAYOUT4_RET_REC_FILE {1};
+const uint32_t LAYOUT4_RET_REC_FSID {2};
+const uint32_t LAYOUT4_RET_REC_ALL {3};
+
+
+enum layoutreturn_type4 {
+ LAYOUTRETURN4_FILE = LAYOUT4_RET_REC_FILE,
+ LAYOUTRETURN4_FSID = LAYOUT4_RET_REC_FSID,
+ LAYOUTRETURN4_ALL = LAYOUT4_RET_REC_ALL,
+};
+typedef enum layoutreturn_type4 layoutreturn_type4;
+ /* layouttype4 specific data */
+
+struct layoutreturn_file4 {
+ offset4 lrf_offset;
+ length4 lrf_length;
+ stateid4 lrf_stateid;
+ struct {
+ u_int lrf_body_len;
+ char *lrf_body_val;
+ } lrf_body;
+};
+typedef struct layoutreturn_file4 layoutreturn_file4;
+
+struct layoutreturn4 {
+ layoutreturn_type4 lr_returntype;
+ union {
+ layoutreturn_file4 lr_layout;
+ } layoutreturn4_u;
+};
+typedef struct layoutreturn4 layoutreturn4;
+
+
+enum fs4_status_type {
+ STATUS4_FIXED = 1,
+ STATUS4_UPDATED = 2,
+ STATUS4_VERSIONED = 3,
+ STATUS4_WRITABLE = 4,
+ STATUS4_REFERRAL = 5,
+};
+typedef enum fs4_status_type fs4_status_type;
+
+struct fs4_status {
+ bool_t fss_absent;
+ fs4_status_type fss_type;
+ utf8str_cs fss_source;
+ utf8str_cs fss_current;
+ int32_t fss_age;
+ nfstime4 fss_version;
+};
+typedef struct fs4_status fs4_status;
+const uint32_t TH4_READ_SIZE {0};
+const uint32_t TH4_WRITE_SIZE {1};
+const uint32_t TH4_READ_IOSIZE {2};
+const uint32_t TH4_WRITE_IOSIZE {3};
+
+typedef length4 threshold4_read_size;
+
+typedef length4 threshold4_write_size;
+
+typedef length4 threshold4_read_iosize;
+
+typedef length4 threshold4_write_iosize;
+
+struct threshold_item4 {
+ layouttype4 thi_layout_type;
+ bitmap4 thi_hintset;
+ struct {
+ u_int thi_hintlist_len;
+ char *thi_hintlist_val;
+ } thi_hintlist;
+};
+typedef struct threshold_item4 threshold_item4;
+
+struct mdsthreshold4 {
+ struct {
+ u_int mth_hints_len;
+ threshold_item4 *mth_hints_val;
+ } mth_hints;
+};
+typedef struct mdsthreshold4 mdsthreshold4;
+const uint64_t RET4_DURATION_INFINITE {0xffffffffffffffff};
+
+struct retention_get4 {
+ uint64_t rg_duration;
+ struct {
+ u_int rg_begin_time_len;
+ nfstime4 *rg_begin_time_val;
+ } rg_begin_time;
+};
+typedef struct retention_get4 retention_get4;
+
+struct retention_set4 {
+ bool_t rs_enable;
+ struct {
+ u_int rs_duration_len;
+ uint64_t *rs_duration_val;
+ } rs_duration;
+};
+typedef struct retention_set4 retention_set4;
+const uint32_t FSCHARSET_CAP4_CONTAINS_NON_UTF8 {0x1};
+const uint32_t FSCHARSET_CAP4_ALLOWS_ONLY_UTF8 {0x2};
+
+typedef uint32_t fs_charset_cap4;
+
+typedef bitmap4 fattr4_supported_attrs;
+
+typedef nfs_ftype4 fattr4_type;
+
+typedef uint32_t fattr4_fh_expire_type;
+
+typedef changeid4 fattr4_change;
+
+typedef uint64_t fattr4_size;
+
+typedef bool_t fattr4_link_support;
+
+typedef bool_t fattr4_symlink_support;
+
+typedef bool_t fattr4_named_attr;
+
+typedef fsid4 fattr4_fsid;
+
+typedef bool_t fattr4_unique_handles;
+
+typedef nfs_lease4 fattr4_lease_time;
+
+typedef nfsstat4 fattr4_rdattr_error;
+
+typedef struct {
+ u_int fattr4_acl_len;
+ nfsace4 *fattr4_acl_val;
+} fattr4_acl;
+
+typedef bool_t fattr4_archive;
+
+typedef bool_t fattr4_cansettime;
+
+typedef bool_t fattr4_case_insensitive;
+
+typedef bool_t fattr4_case_preserving;
+
+typedef bool_t fattr4_chown_restricted;
+
+typedef uint64_t fattr4_fileid;
+
+typedef uint64_t fattr4_files_avail;
+
+typedef nfs_fh4 fattr4_filehandle;
+
+typedef uint64_t fattr4_files_free;
+
+typedef uint64_t fattr4_files_total;
+
+typedef fs_locations4 fattr4_fs_locations;
+
+typedef bool_t fattr4_hidden;
+
+typedef bool_t fattr4_homogeneous;
+
+typedef uint64_t fattr4_maxfilesize;
+
+typedef uint32_t fattr4_maxlink;
+
+typedef uint32_t fattr4_maxname;
+
+typedef uint64_t fattr4_maxread;
+
+typedef uint64_t fattr4_maxwrite;
+
+typedef utf8str_cs fattr4_mimetype;
+
+typedef mode4 fattr4_mode;
+
+typedef mode_masked4 fattr4_mode_set_masked;
+
+typedef uint64_t fattr4_mounted_on_fileid;
+
+typedef bool_t fattr4_no_trunc;
+
+typedef uint32_t fattr4_numlinks;
+
+typedef utf8str_mixed fattr4_owner;
+
+typedef utf8str_mixed fattr4_owner_group;
+
+typedef uint64_t fattr4_quota_avail_hard;
+
+typedef uint64_t fattr4_quota_avail_soft;
+
+typedef uint64_t fattr4_quota_used;
+
+typedef specdata4 fattr4_rawdev;
+
+typedef uint64_t fattr4_space_avail;
+
+typedef uint64_t fattr4_space_free;
+
+typedef uint64_t fattr4_space_total;
+
+typedef uint64_t fattr4_space_used;
+
+typedef bool_t fattr4_system;
+
+typedef nfstime4 fattr4_time_access;
+
+typedef settime4 fattr4_time_access_set;
+
+typedef nfstime4 fattr4_time_backup;
+
+typedef nfstime4 fattr4_time_create;
+
+typedef nfstime4 fattr4_time_delta;
+
+typedef nfstime4 fattr4_time_metadata;
+
+typedef nfstime4 fattr4_time_modify;
+
+typedef settime4 fattr4_time_modify_set;
+
+typedef bitmap4 fattr4_suppattr_exclcreat;
+
+typedef nfstime4 fattr4_dir_notif_delay;
+
+typedef nfstime4 fattr4_dirent_notif_delay;
+
+typedef struct {
+ u_int fattr4_fs_layout_types_len;
+ layouttype4 *fattr4_fs_layout_types_val;
+} fattr4_fs_layout_types;
+
+typedef fs4_status fattr4_fs_status;
+
+typedef fs_charset_cap4 fattr4_fs_charset_cap;
+
+typedef uint32_t fattr4_layout_alignment;
+
+typedef uint32_t fattr4_layout_blksize;
+
+typedef layouthint4 fattr4_layout_hint;
+
+typedef struct {
+ u_int fattr4_layout_types_len;
+ layouttype4 *fattr4_layout_types_val;
+} fattr4_layout_types;
+
+typedef mdsthreshold4 fattr4_mdsthreshold;
+
+typedef retention_get4 fattr4_retention_get;
+
+typedef retention_set4 fattr4_retention_set;
+
+typedef retention_get4 fattr4_retentevt_get;
+
+typedef retention_set4 fattr4_retentevt_set;
+
+typedef uint64_t fattr4_retention_hold;
+
+typedef nfsacl41 fattr4_dacl;
+
+typedef nfsacl41 fattr4_sacl;
+
+typedef change_policy4 fattr4_change_policy;
+/*
+ * REQUIRED Attributes
+ */
+const uint32_t FATTR4_SUPPORTED_ATTRS {0};
+const uint32_t FATTR4_TYPE {1};
+const uint32_t FATTR4_FH_EXPIRE_TYPE {2};
+const uint32_t FATTR4_CHANGE {3};
+const uint32_t FATTR4_SIZE {4};
+const uint32_t FATTR4_LINK_SUPPORT {5};
+const uint32_t FATTR4_SYMLINK_SUPPORT {6};
+const uint32_t FATTR4_NAMED_ATTR {7};
+const uint32_t FATTR4_FSID {8};
+const uint32_t FATTR4_UNIQUE_HANDLES {9};
+const uint32_t FATTR4_LEASE_TIME {10};
+const uint32_t FATTR4_RDATTR_ERROR {11};
+const uint32_t FATTR4_FILEHANDLE {19};
+/* new to NFSV4.1 */
+const uint32_t FATTR4_SUPPATTR_EXCLCREAT {75};
+/*
+ * RECOMMENDED Attributes
+ */
+const uint32_t FATTR4_ACL {12};
+const uint32_t FATTR4_ACLSUPPORT {13};
+const uint32_t FATTR4_ARCHIVE {14};
+const uint32_t FATTR4_CANSETTIME {15};
+const uint32_t FATTR4_CASE_INSENSITIVE {16};
+const uint32_t FATTR4_CASE_PRESERVING {17};
+const uint32_t FATTR4_CHOWN_RESTRICTED {18};
+const uint32_t FATTR4_FILEID {20};
+const uint32_t FATTR4_FILES_AVAIL {21};
+const uint32_t FATTR4_FILES_FREE {22};
+const uint32_t FATTR4_FILES_TOTAL {23};
+const uint32_t FATTR4_FS_LOCATIONS {24};
+const uint32_t FATTR4_HIDDEN {25};
+const uint32_t FATTR4_HOMOGENEOUS {26};
+const uint32_t FATTR4_MAXFILESIZE {27};
+const uint32_t FATTR4_MAXLINK {28};
+const uint32_t FATTR4_MAXNAME {29};
+const uint32_t FATTR4_MAXREAD {30};
+const uint32_t FATTR4_MAXWRITE {31};
+const uint32_t FATTR4_MIMETYPE {32};
+const uint32_t FATTR4_MODE {33};
+const uint32_t FATTR4_NO_TRUNC {34};
+const uint32_t FATTR4_NUMLINKS {35};
+const uint32_t FATTR4_OWNER {36};
+const uint32_t FATTR4_OWNER_GROUP {37};
+const uint32_t FATTR4_QUOTA_AVAIL_HARD {38};
+const uint32_t FATTR4_QUOTA_AVAIL_SOFT {39};
+const uint32_t FATTR4_QUOTA_USED {40};
+const uint32_t FATTR4_RAWDEV {41};
+const uint32_t FATTR4_SPACE_AVAIL {42};
+const uint32_t FATTR4_SPACE_FREE {43};
+const uint32_t FATTR4_SPACE_TOTAL {44};
+const uint32_t FATTR4_SPACE_USED {45};
+const uint32_t FATTR4_SYSTEM {46};
+const uint32_t FATTR4_TIME_ACCESS {47};
+const uint32_t FATTR4_TIME_ACCESS_SET {48};
+const uint32_t FATTR4_TIME_BACKUP {49};
+const uint32_t FATTR4_TIME_CREATE {50};
+const uint32_t FATTR4_TIME_DELTA {51};
+const uint32_t FATTR4_TIME_METADATA {52};
+const uint32_t FATTR4_TIME_MODIFY {53};
+const uint32_t FATTR4_TIME_MODIFY_SET {54};
+const uint32_t FATTR4_MOUNTED_ON_FILEID {55};
+
+/* new to NFSV4.1 */
+
+const uint32_t FATTR4_DIR_NOTIF_DELAY {56};
+const uint32_t FATTR4_DIRENT_NOTIF_DELAY {57};
+const uint32_t FATTR4_DACL {58};
+const uint32_t FATTR4_SACL {59};
+const uint32_t FATTR4_CHANGE_POLICY {60};
+const uint32_t FATTR4_FS_STATUS {61};
+const uint32_t FATTR4_FS_LAYOUT_TYPES {62};
+const uint32_t FATTR4_LAYOUT_HINT {63};
+const uint32_t FATTR4_LAYOUT_TYPES {64};
+const uint32_t FATTR4_LAYOUT_BLKSIZE {65};
+const uint32_t FATTR4_LAYOUT_ALIGNMENT {66};
+const uint32_t FATTR4_FS_LOCATIONS_INFO {67};
+const uint32_t FATTR4_MDSTHRESHOLD {68};
+const uint32_t FATTR4_RETENTION_GET {69};
+const uint32_t FATTR4_RETENTION_SET {70};
+const uint32_t FATTR4_RETENTEVT_GET {71};
+const uint32_t FATTR4_RETENTEVT_SET {72};
+const uint32_t FATTR4_RETENTION_HOLD {73};
+const uint32_t FATTR4_MODE_SET_MASKED {74};
+const uint32_t FATTR4_FS_CHARSET_CAP {76};
+
+struct fattr4 {
+ bitmap4 attrmask;
+ attrlist4 attr_vals;
+};
+typedef struct fattr4 fattr4;
+
+struct change_info4 {
+ bool_t atomic;
+ changeid4 before;
+ changeid4 after;
+};
+typedef struct change_info4 change_info4;
+
+typedef netaddr4 clientaddr4;
+
+struct cb_client4 {
+ uint32_t cb_program;
+ netaddr4 cb_location;
+};
+typedef struct cb_client4 cb_client4;
+
+struct nfs_client_id4 {
+ verifier4 verifier;
+ struct {
+ u_int id_len;
+ char *id_val;
+ } id;
+};
+typedef struct nfs_client_id4 nfs_client_id4;
+
+struct client_owner4 {
+ verifier4 co_verifier;
+ struct {
+ u_int co_ownerid_len;
+ char *co_ownerid_val;
+ } co_ownerid;
+};
+typedef struct client_owner4 client_owner4;
+
+struct server_owner4 {
+ uint64_t so_minor_id;
+ struct {
+ u_int so_major_id_len;
+ char *so_major_id_val;
+ } so_major_id;
+};
+typedef struct server_owner4 server_owner4;
+
+struct state_owner4 {
+ clientid4 clientid;
+ struct {
+ u_int owner_len;
+ char *owner_val;
+ } owner;
+};
+typedef struct state_owner4 state_owner4;
+
+typedef state_owner4 open_owner4;
+
+typedef state_owner4 lock_owner4;
+
+enum nfs_lock_type4 {
+ READ_LT = 1,
+ WRITE_LT = 2,
+ READW_LT = 3,
+ WRITEW_LT = 4,
+};
+typedef enum nfs_lock_type4 nfs_lock_type4;
+
+/* Input for computing subkeys */
+
+enum ssv_subkey4 {
+ SSV4_SUBKEY_MIC_I2T = 1,
+ SSV4_SUBKEY_MIC_T2I = 2,
+ SSV4_SUBKEY_SEAL_I2T = 3,
+ SSV4_SUBKEY_SEAL_T2I = 4,
+};
+typedef enum ssv_subkey4 ssv_subkey4;
+
+
+/* Input for computing smt_hmac */
+
+struct ssv_mic_plain_tkn4 {
+ uint32_t smpt_ssv_seq;
+ struct {
+ u_int smpt_orig_plain_len;
+ char *smpt_orig_plain_val;
+ } smpt_orig_plain;
+};
+typedef struct ssv_mic_plain_tkn4 ssv_mic_plain_tkn4;
+
+
+/* SSV GSS PerMsgToken token */
+
+struct ssv_mic_tkn4 {
+ uint32_t smt_ssv_seq;
+ struct {
+ u_int smt_hmac_len;
+ char *smt_hmac_val;
+ } smt_hmac;
+};
+typedef struct ssv_mic_tkn4 ssv_mic_tkn4;
+
+
+/* Input for computing ssct_encr_data and ssct_hmac */
+
+struct ssv_seal_plain_tkn4 {
+ struct {
+ u_int sspt_confounder_len;
+ char *sspt_confounder_val;
+ } sspt_confounder;
+ uint32_t sspt_ssv_seq;
+ struct {
+ u_int sspt_orig_plain_len;
+ char *sspt_orig_plain_val;
+ } sspt_orig_plain;
+ struct {
+ u_int sspt_pad_len;
+ char *sspt_pad_val;
+ } sspt_pad;
+};
+typedef struct ssv_seal_plain_tkn4 ssv_seal_plain_tkn4;
+
+
+/* SSV GSS SealedMessage token */
+
+struct ssv_seal_cipher_tkn4 {
+ uint32_t ssct_ssv_seq;
+ struct {
+ u_int ssct_iv_len;
+ char *ssct_iv_val;
+ } ssct_iv;
+ struct {
+ u_int ssct_encr_data_len;
+ char *ssct_encr_data_val;
+ } ssct_encr_data;
+ struct {
+ u_int ssct_hmac_len;
+ char *ssct_hmac_val;
+ } ssct_hmac;
+};
+typedef struct ssv_seal_cipher_tkn4 ssv_seal_cipher_tkn4;
+
+
+struct fs_locations_server4 {
+ int32_t fls_currency;
+ struct {
+ u_int fls_info_len;
+ char *fls_info_val;
+ } fls_info;
+ utf8str_cis fls_server;
+};
+typedef struct fs_locations_server4 fs_locations_server4;
+const uint32_t FSLI4BX_GFLAGS {0};
+const uint32_t FSLI4BX_TFLAGS {1};
+const uint32_t FSLI4BX_CLSIMUL {2};
+const uint32_t FSLI4BX_CLHANDLE {3};
+const uint32_t FSLI4BX_CLFILEID {4};
+const uint32_t FSLI4BX_CLWRITEVER {5};
+const uint32_t FSLI4BX_CLCHANGE {6};
+const uint32_t FSLI4BX_CLREADDIR {7};
+const uint32_t FSLI4BX_READRANK {8};
+const uint32_t FSLI4BX_WRITERANK {9};
+const uint32_t FSLI4BX_READORDER {10};
+const uint32_t FSLI4BX_WRITEORDER {11};
+const uint32_t FSLI4GF_WRITABLE {0x01};
+const uint32_t FSLI4GF_CUR_REQ {0x02};
+const uint32_t FSLI4GF_ABSENT {0x04};
+const uint32_t FSLI4GF_GOING {0x08};
+const uint32_t FSLI4GF_SPLIT {0x10};
+const uint32_t FSLI4TF_RDMA {0x01};
+
+struct fs_locations_item4 {
+ struct {
+ u_int fli_entries_len;
+ fs_locations_server4 *fli_entries_val;
+ } fli_entries;
+ pathname4 fli_rootpath;
+};
+typedef struct fs_locations_item4 fs_locations_item4;
+
+struct fs_locations_info4 {
+ uint32_t fli_flags;
+ int32_t fli_valid_for;
+ pathname4 fli_fs_root;
+ struct {
+ u_int fli_items_len;
+ fs_locations_item4 *fli_items_val;
+ } fli_items;
+};
+typedef struct fs_locations_info4 fs_locations_info4;
+const uint32_t FSLI4IF_VAR_SUB {0x00000001};
+
+typedef fs_locations_info4 fattr4_fs_locations_info;
+const uint32_t NFL4_UFLG_MASK {0x0000003F};
+const uint32_t NFL4_UFLG_DENSE {0x00000001};
+const uint32_t NFL4_UFLG_COMMIT_THRU_MDS {0x00000002};
+const uint32_t NFL4_UFLG_STRIPE_UNIT_SIZE_MASK {0xFFFFFFC0};
+
+typedef uint32_t nfl_util4;
+
+
+enum filelayout_hint_care4 {
+ NFLH4_CARE_DENSE = NFL4_UFLG_DENSE,
+ NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS,
+ NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040,
+ NFLH4_CARE_STRIPE_COUNT = 0x00000080,
+};
+typedef enum filelayout_hint_care4 filelayout_hint_care4;
+
+/* Encoded in the loh_body field of data type layouthint4: */
+
+
+struct nfsv4_1_file_layouthint4 {
+ uint32_t nflh_care;
+ nfl_util4 nflh_util;
+ count4 nflh_stripe_count;
+};
+typedef struct nfsv4_1_file_layouthint4 nfsv4_1_file_layouthint4;
+
+
+
+typedef struct {
+ u_int multipath_list4_len;
+ netaddr4 *multipath_list4_val;
+} multipath_list4;
+
+/*
+ * Encoded in the da_addr_body field of
+ * data type device_addr4:
+ */
+
+struct nfsv4_1_file_layout_ds_addr4 {
+ struct {
+ u_int nflda_stripe_indices_len;
+ uint32_t *nflda_stripe_indices_val;
+ } nflda_stripe_indices;
+ struct {
+ u_int nflda_multipath_ds_list_len;
+ multipath_list4 *nflda_multipath_ds_list_val;
+ } nflda_multipath_ds_list;
+};
+typedef struct nfsv4_1_file_layout_ds_addr4 nfsv4_1_file_layout_ds_addr4;
+
+
+/*
+ * Encoded in the loc_body field of
+ * data type layout_content4:
+ */
+
+struct nfsv4_1_file_layout4 {
+ deviceid4 nfl_deviceid;
+ nfl_util4 nfl_util;
+ uint32_t nfl_first_stripe_index;
+ offset4 nfl_pattern_offset;
+ struct {
+ u_int nfl_fh_list_len;
+ nfs_fh4 *nfl_fh_list_val;
+ } nfl_fh_list;
+};
+typedef struct nfsv4_1_file_layout4 nfsv4_1_file_layout4;
+
+/*
+ * Encoded in the lou_body field of data type layoutupdate4:
+ * Nothing. lou_body is a zero length array of bytes.
+ */
+
+/*
+ * Encoded in the lrf_body field of
+ * data type layoutreturn_file4:
+ * Nothing. lrf_body is a zero length array of bytes.
+ */
+
+const uint32_t ACCESS4_READ {0x00000001};
+const uint32_t ACCESS4_LOOKUP {0x00000002};
+const uint32_t ACCESS4_MODIFY {0x00000004};
+const uint32_t ACCESS4_EXTEND {0x00000008};
+const uint32_t ACCESS4_DELETE {0x00000010};
+const uint32_t ACCESS4_EXECUTE {0x00000020};
+
+// for compatibility
+struct NULL4args
+{
+ bool t {};
+};
+typedef struct NULL4args NULL4args;
+
+// for compatibility
+struct NULL4res
+{
+ bool t {};
+};
+typedef struct NULL4res NULL4res;
+
+struct ACCESS4args {
+ uint32_t access;
+};
+typedef struct ACCESS4args ACCESS4args;
+
+struct ACCESS4resok {
+ uint32_t supported;
+ uint32_t access;
+};
+typedef struct ACCESS4resok ACCESS4resok;
+
+struct ACCESS4res {
+ nfsstat4 status;
+ union {
+ ACCESS4resok resok4;
+ } ACCESS4res_u;
+};
+typedef struct ACCESS4res ACCESS4res;
+
+struct CLOSE4args {
+ seqid4 seqid;
+ stateid4 open_stateid;
+};
+typedef struct CLOSE4args CLOSE4args;
+
+struct CLOSE4res {
+ nfsstat4 status;
+ union {
+ stateid4 open_stateid;
+ } CLOSE4res_u;
+};
+typedef struct CLOSE4res CLOSE4res;
+
+struct COMMIT4args {
+ offset4 offset;
+ count4 count;
+};
+typedef struct COMMIT4args COMMIT4args;
+
+struct COMMIT4resok {
+ verifier4 writeverf;
+};
+typedef struct COMMIT4resok COMMIT4resok;
+
+struct COMMIT4res {
+ nfsstat4 status;
+ union {
+ COMMIT4resok resok4;
+ } COMMIT4res_u;
+};
+typedef struct COMMIT4res COMMIT4res;
+
+struct createtype4 {
+ nfs_ftype4 type;
+ union {
+ linktext4 linkdata;
+ specdata4 devdata;
+ } createtype4_u;
+};
+typedef struct createtype4 createtype4;
+
+struct CREATE4args {
+ createtype4 objtype;
+ component4 objname;
+ fattr4 createattrs;
+};
+typedef struct CREATE4args CREATE4args;
+
+struct CREATE4resok {
+ change_info4 cinfo;
+ bitmap4 attrset;
+};
+typedef struct CREATE4resok CREATE4resok;
+
+struct CREATE4res {
+ nfsstat4 status;
+ union {
+ CREATE4resok resok4;
+ } CREATE4res_u;
+};
+typedef struct CREATE4res CREATE4res;
+
+struct DELEGPURGE4args {
+ clientid4 clientid;
+};
+typedef struct DELEGPURGE4args DELEGPURGE4args;
+
+struct DELEGPURGE4res {
+ nfsstat4 status;
+};
+typedef struct DELEGPURGE4res DELEGPURGE4res;
+
+struct DELEGRETURN4args {
+ stateid4 deleg_stateid;
+};
+typedef struct DELEGRETURN4args DELEGRETURN4args;
+
+struct DELEGRETURN4res {
+ nfsstat4 status;
+};
+typedef struct DELEGRETURN4res DELEGRETURN4res;
+
+struct GETATTR4args {
+ bitmap4 attr_request;
+};
+typedef struct GETATTR4args GETATTR4args;
+
+struct GETATTR4resok {
+ fattr4 obj_attributes;
+};
+typedef struct GETATTR4resok GETATTR4resok;
+
+struct GETATTR4res {
+ nfsstat4 status;
+ union {
+ GETATTR4resok resok4;
+ } GETATTR4res_u;
+};
+typedef struct GETATTR4res GETATTR4res;
+
+struct GETFH4resok {
+ nfs_fh4 object;
+};
+typedef struct GETFH4resok GETFH4resok;
+
+struct GETFH4res {
+ nfsstat4 status;
+ union {
+ GETFH4resok resok4;
+ } GETFH4res_u;
+};
+typedef struct GETFH4res GETFH4res;
+
+struct LINK4args {
+ component4 newname;
+};
+typedef struct LINK4args LINK4args;
+
+struct LINK4resok {
+ change_info4 cinfo;
+};
+typedef struct LINK4resok LINK4resok;
+
+struct LINK4res {
+ nfsstat4 status;
+ union {
+ LINK4resok resok4;
+ } LINK4res_u;
+};
+typedef struct LINK4res LINK4res;
+
+struct open_to_lock_owner4 {
+ seqid4 open_seqid;
+ stateid4 open_stateid;
+ seqid4 lock_seqid;
+ lock_owner4 lock_owner;
+};
+typedef struct open_to_lock_owner4 open_to_lock_owner4;
+
+struct exist_lock_owner4 {
+ stateid4 lock_stateid;
+ seqid4 lock_seqid;
+};
+typedef struct exist_lock_owner4 exist_lock_owner4;
+
+struct locker4 {
+ bool_t new_lock_owner;
+ union {
+ open_to_lock_owner4 open_owner;
+ exist_lock_owner4 lock_owner;
+ } locker4_u;
+};
+typedef struct locker4 locker4;
+
+struct LOCK4args {
+ nfs_lock_type4 locktype;
+ bool_t reclaim;
+ offset4 offset;
+ length4 length;
+ locker4 locker;
+};
+typedef struct LOCK4args LOCK4args;
+
+struct LOCK4denied {
+ offset4 offset;
+ length4 length;
+ nfs_lock_type4 locktype;
+ lock_owner4 owner;
+};
+typedef struct LOCK4denied LOCK4denied;
+
+struct LOCK4resok {
+ stateid4 lock_stateid;
+};
+typedef struct LOCK4resok LOCK4resok;
+
+struct LOCK4res {
+ nfsstat4 status;
+ union {
+ LOCK4resok resok4;
+ LOCK4denied denied;
+ } LOCK4res_u;
+};
+typedef struct LOCK4res LOCK4res;
+
+struct LOCKT4args {
+ nfs_lock_type4 locktype;
+ offset4 offset;
+ length4 length;
+ lock_owner4 owner;
+};
+typedef struct LOCKT4args LOCKT4args;
+
+struct LOCKT4res {
+ nfsstat4 status;
+ union {
+ LOCK4denied denied;
+ } LOCKT4res_u;
+};
+typedef struct LOCKT4res LOCKT4res;
+
+struct LOCKU4args {
+ nfs_lock_type4 locktype;
+ seqid4 seqid;
+ stateid4 lock_stateid;
+ offset4 offset;
+ length4 length;
+};
+typedef struct LOCKU4args LOCKU4args;
+
+struct LOCKU4res {
+ nfsstat4 status;
+ union {
+ stateid4 lock_stateid;
+ } LOCKU4res_u;
+};
+typedef struct LOCKU4res LOCKU4res;
+
+struct LOOKUP4args {
+ component4 objname;
+};
+typedef struct LOOKUP4args LOOKUP4args;
+
+struct LOOKUP4res {
+ nfsstat4 status;
+};
+typedef struct LOOKUP4res LOOKUP4res;
+
+struct LOOKUPP4res {
+ nfsstat4 status;
+};
+typedef struct LOOKUPP4res LOOKUPP4res;
+
+struct NVERIFY4args {
+ fattr4 obj_attributes;
+};
+typedef struct NVERIFY4args NVERIFY4args;
+
+struct NVERIFY4res {
+ nfsstat4 status;
+};
+typedef struct NVERIFY4res NVERIFY4res;
+
+enum createmode4 {
+ UNCHECKED4 = 0,
+ GUARDED4 = 1,
+ EXCLUSIVE4 = 2,
+ EXCLUSIVE4_1 = 3,
+};
+typedef enum createmode4 createmode4;
+
+struct creatverfattr {
+ verifier4 cva_verf;
+ fattr4 cva_attrs;
+};
+typedef struct creatverfattr creatverfattr;
+
+struct createhow4 {
+ createmode4 mode;
+ union {
+ fattr4 createattrs;
+ verifier4 createverf;
+ creatverfattr ch_createboth;
+ } createhow4_u;
+};
+typedef struct createhow4 createhow4;
+
+enum opentype4 {
+ OPEN4_NOCREATE = 0,
+ OPEN4_CREATE = 1,
+};
+typedef enum opentype4 opentype4;
+
+struct openflag4 {
+ opentype4 opentype;
+ union {
+ createhow4 how;
+ } openflag4_u;
+};
+typedef struct openflag4 openflag4;
+
+enum limit_by4 {
+ NFS_LIMIT_SIZE = 1,
+ NFS_LIMIT_BLOCKS = 2,
+};
+typedef enum limit_by4 limit_by4;
+
+struct nfs_modified_limit4 {
+ uint32_t num_blocks;
+ uint32_t bytes_per_block;
+};
+typedef struct nfs_modified_limit4 nfs_modified_limit4;
+
+struct nfs_space_limit4 {
+ limit_by4 limitby;
+ union {
+ uint64_t filesize;
+ nfs_modified_limit4 mod_blocks;
+ } nfs_space_limit4_u;
+};
+typedef struct nfs_space_limit4 nfs_space_limit4;
+const uint32_t OPEN4_SHARE_ACCESS_READ {0x00000001};
+const uint32_t OPEN4_SHARE_ACCESS_WRITE {0x00000002};
+const uint32_t OPEN4_SHARE_ACCESS_BOTH {0x00000003};
+const uint32_t OPEN4_SHARE_DENY_NONE {0x00000000};
+const uint32_t OPEN4_SHARE_DENY_READ {0x00000001};
+const uint32_t OPEN4_SHARE_DENY_WRITE {0x00000002};
+const uint32_t OPEN4_SHARE_DENY_BOTH {0x00000003};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_DELEG_MASK {0xFF00};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_NO_PREFERENCE {0x0000};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_READ_DELEG {0x0100};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG {0x0200};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_ANY_DELEG {0x0300};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_NO_DELEG {0x0400};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_CANCEL {0x0500};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL {0x10000};
+const uint32_t OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED {0x20000};
+
+enum open_delegation_type4 {
+ OPEN_DELEGATE_NONE = 0,
+ OPEN_DELEGATE_READ = 1,
+ OPEN_DELEGATE_WRITE = 2,
+ OPEN_DELEGATE_NONE_EXT = 3,
+};
+typedef enum open_delegation_type4 open_delegation_type4;
+
+enum open_claim_type4 {
+ CLAIM_NULL = 0,
+ CLAIM_PREVIOUS = 1,
+ CLAIM_DELEGATE_CUR = 2,
+ CLAIM_DELEGATE_PREV = 3,
+ CLAIM_FH = 4,
+ CLAIM_DELEG_CUR_FH = 5,
+ CLAIM_DELEG_PREV_FH = 6,
+};
+typedef enum open_claim_type4 open_claim_type4;
+
+struct open_claim_delegate_cur4 {
+ stateid4 delegate_stateid;
+ component4 file;
+};
+typedef struct open_claim_delegate_cur4 open_claim_delegate_cur4;
+
+struct open_claim4 {
+ open_claim_type4 claim;
+ union {
+ component4 file;
+ open_delegation_type4 delegate_type;
+ open_claim_delegate_cur4 delegate_cur_info;
+ component4 file_delegate_prev;
+ stateid4 oc_delegate_stateid;
+ } open_claim4_u;
+};
+typedef struct open_claim4 open_claim4;
+
+struct OPEN4args {
+ seqid4 seqid;
+ uint32_t share_access;
+ uint32_t share_deny;
+ open_owner4 owner;
+ openflag4 openhow;
+ open_claim4 claim;
+};
+typedef struct OPEN4args OPEN4args;
+
+struct open_read_delegation4 {
+ stateid4 stateid;
+ bool_t recall;
+ nfsace4 permissions;
+};
+typedef struct open_read_delegation4 open_read_delegation4;
+
+struct open_write_delegation4 {
+ stateid4 stateid;
+ bool_t recall;
+ nfs_space_limit4 space_limit;
+ nfsace4 permissions;
+};
+typedef struct open_write_delegation4 open_write_delegation4;
+
+enum why_no_delegation4 {
+ WND4_NOT_WANTED = 0,
+ WND4_CONTENTION = 1,
+ WND4_RESOURCE = 2,
+ WND4_NOT_SUPP_FTYPE = 3,
+ WND4_WRITE_DELEG_NOT_SUPP_FTYPE = 4,
+ WND4_NOT_SUPP_UPGRADE = 5,
+ WND4_NOT_SUPP_DOWNGRADE = 6,
+ WND4_CANCELLED = 7,
+ WND4_IS_DIR = 8,
+};
+typedef enum why_no_delegation4 why_no_delegation4;
+
+struct open_none_delegation4 {
+ why_no_delegation4 ond_why;
+ union {
+ bool_t ond_server_will_push_deleg;
+ bool_t ond_server_will_signal_avail;
+ } open_none_delegation4_u;
+};
+typedef struct open_none_delegation4 open_none_delegation4;
+
+struct open_delegation4 {
+ open_delegation_type4 delegation_type;
+ union {
+ open_read_delegation4 read;
+ open_write_delegation4 write;
+ open_none_delegation4 od_whynone;
+ } open_delegation4_u;
+};
+typedef struct open_delegation4 open_delegation4;
+const uint32_t OPEN4_RESULT_CONFIRM {0x00000002};
+const uint32_t OPEN4_RESULT_LOCKTYPE_POSIX {0x00000004};
+const uint32_t OPEN4_RESULT_PRESERVE_UNLINKED {0x00000008};
+const uint32_t OPEN4_RESULT_MAY_NOTIFY_LOCK {0x00000020};
+
+struct OPEN4resok {
+ stateid4 stateid;
+ change_info4 cinfo;
+ uint32_t rflags;
+ bitmap4 attrset;
+ open_delegation4 delegation;
+};
+typedef struct OPEN4resok OPEN4resok;
+
+struct OPEN4res {
+ nfsstat4 status;
+ union {
+ OPEN4resok resok4;
+ } OPEN4res_u;
+};
+typedef struct OPEN4res OPEN4res;
+
+struct OPENATTR4args {
+ bool_t createdir;
+};
+typedef struct OPENATTR4args OPENATTR4args;
+
+struct OPENATTR4res {
+ nfsstat4 status;
+};
+typedef struct OPENATTR4res OPENATTR4res;
+
+struct OPEN_CONFIRM4args {
+ stateid4 open_stateid;
+ seqid4 seqid;
+};
+typedef struct OPEN_CONFIRM4args OPEN_CONFIRM4args;
+
+struct OPEN_CONFIRM4resok {
+ stateid4 open_stateid;
+};
+typedef struct OPEN_CONFIRM4resok OPEN_CONFIRM4resok;
+
+struct OPEN_CONFIRM4res {
+ nfsstat4 status;
+ union {
+ OPEN_CONFIRM4resok resok4;
+ } OPEN_CONFIRM4res_u;
+};
+typedef struct OPEN_CONFIRM4res OPEN_CONFIRM4res;
+
+struct OPEN_DOWNGRADE4args {
+ stateid4 open_stateid;
+ seqid4 seqid;
+ uint32_t share_access;
+ uint32_t share_deny;
+};
+typedef struct OPEN_DOWNGRADE4args OPEN_DOWNGRADE4args;
+
+struct OPEN_DOWNGRADE4resok {
+ stateid4 open_stateid;
+};
+typedef struct OPEN_DOWNGRADE4resok OPEN_DOWNGRADE4resok;
+
+struct OPEN_DOWNGRADE4res {
+ nfsstat4 status;
+ union {
+ OPEN_DOWNGRADE4resok resok4;
+ } OPEN_DOWNGRADE4res_u;
+};
+typedef struct OPEN_DOWNGRADE4res OPEN_DOWNGRADE4res;
+
+struct PUTFH4args {
+ nfs_fh4 object;
+};
+typedef struct PUTFH4args PUTFH4args;
+
+struct PUTFH4res {
+ nfsstat4 status;
+};
+typedef struct PUTFH4res PUTFH4res;
+
+struct PUTPUBFH4res {
+ nfsstat4 status;
+};
+typedef struct PUTPUBFH4res PUTPUBFH4res;
+
+struct PUTROOTFH4res {
+ nfsstat4 status;
+};
+typedef struct PUTROOTFH4res PUTROOTFH4res;
+
+struct READ4args {
+ stateid4 stateid;
+ offset4 offset;
+ count4 count;
+};
+typedef struct READ4args READ4args;
+
+struct READ4resok {
+ bool_t eof;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
+};
+typedef struct READ4resok READ4resok;
+
+struct READ4res {
+ nfsstat4 status;
+ union {
+ READ4resok resok4;
+ } READ4res_u;
+};
+typedef struct READ4res READ4res;
+
+struct READDIR4args {
+ nfs_cookie4 cookie;
+ verifier4 cookieverf;
+ count4 dircount;
+ count4 maxcount;
+ bitmap4 attr_request;
+};
+typedef struct READDIR4args READDIR4args;
+
+struct entry4 {
+ nfs_cookie4 cookie;
+ component4 name;
+ fattr4 attrs;
+ struct entry4 *nextentry;
+};
+typedef struct entry4 entry4;
+
+struct dirlist4 {
+ entry4 *entries;
+ bool_t eof;
+};
+typedef struct dirlist4 dirlist4;
+
+struct READDIR4resok {
+ verifier4 cookieverf;
+ dirlist4 reply;
+};
+typedef struct READDIR4resok READDIR4resok;
+
+struct READDIR4res {
+ nfsstat4 status;
+ union {
+ READDIR4resok resok4;
+ } READDIR4res_u;
+};
+typedef struct READDIR4res READDIR4res;
+
+struct READLINK4resok {
+ linktext4 link;
+};
+typedef struct READLINK4resok READLINK4resok;
+
+struct READLINK4res {
+ nfsstat4 status;
+ union {
+ READLINK4resok resok4;
+ } READLINK4res_u;
+};
+typedef struct READLINK4res READLINK4res;
+
+struct REMOVE4args {
+ component4 target;
+};
+typedef struct REMOVE4args REMOVE4args;
+
+struct REMOVE4resok {
+ change_info4 cinfo;
+};
+typedef struct REMOVE4resok REMOVE4resok;
+
+struct REMOVE4res {
+ nfsstat4 status;
+ union {
+ REMOVE4resok resok4;
+ } REMOVE4res_u;
+};
+typedef struct REMOVE4res REMOVE4res;
+
+struct RENAME4args {
+ component4 oldname;
+ component4 newname;
+};
+typedef struct RENAME4args RENAME4args;
+
+struct RENAME4resok {
+ change_info4 source_cinfo;
+ change_info4 target_cinfo;
+};
+typedef struct RENAME4resok RENAME4resok;
+
+struct RENAME4res {
+ nfsstat4 status;
+ union {
+ RENAME4resok resok4;
+ } RENAME4res_u;
+};
+typedef struct RENAME4res RENAME4res;
+
+struct RENEW4args {
+ clientid4 clientid;
+};
+typedef struct RENEW4args RENEW4args;
+
+struct RENEW4res {
+ nfsstat4 status;
+};
+typedef struct RENEW4res RENEW4res;
+
+struct RESTOREFH4res {
+ nfsstat4 status;
+};
+typedef struct RESTOREFH4res RESTOREFH4res;
+
+struct SAVEFH4res {
+ nfsstat4 status;
+};
+typedef struct SAVEFH4res SAVEFH4res;
+
+struct SECINFO4args {
+ component4 name;
+};
+typedef struct SECINFO4args SECINFO4args;
+
+enum rpc_gss_svc_t {
+ RPC_GSS_SVC_NONE = 1,
+ RPC_GSS_SVC_INTEGRITY = 2,
+ RPC_GSS_SVC_PRIVACY = 3,
+};
+typedef enum rpc_gss_svc_t rpc_gss_svc_t;
+
+struct rpcsec_gss_info {
+ sec_oid4 oid;
+ qop4 qop;
+ rpc_gss_svc_t service;
+};
+typedef struct rpcsec_gss_info rpcsec_gss_info;
+
+struct secinfo4 {
+ uint32_t flavor;
+ union {
+ rpcsec_gss_info flavor_info;
+ } secinfo4_u;
+};
+typedef struct secinfo4 secinfo4;
+
+typedef struct {
+ u_int SECINFO4resok_len;
+ secinfo4 *SECINFO4resok_val;
+} SECINFO4resok;
+
+struct SECINFO4res {
+ nfsstat4 status;
+ union {
+ SECINFO4resok resok4;
+ } SECINFO4res_u;
+};
+typedef struct SECINFO4res SECINFO4res;
+
+struct SETATTR4args {
+ stateid4 stateid;
+ fattr4 obj_attributes;
+};
+typedef struct SETATTR4args SETATTR4args;
+
+struct SETATTR4res {
+ nfsstat4 status;
+ bitmap4 attrsset;
+};
+typedef struct SETATTR4res SETATTR4res;
+
+struct SETCLIENTID4args {
+ nfs_client_id4 client;
+ cb_client4 callback;
+ uint32_t callback_ident;
+};
+typedef struct SETCLIENTID4args SETCLIENTID4args;
+
+struct SETCLIENTID4resok {
+ clientid4 clientid;
+ verifier4 setclientid_confirm;
+};
+typedef struct SETCLIENTID4resok SETCLIENTID4resok;
+
+struct SETCLIENTID4res {
+ nfsstat4 status;
+ union {
+ SETCLIENTID4resok resok4;
+ clientaddr4 client_using;
+ } SETCLIENTID4res_u;
+};
+typedef struct SETCLIENTID4res SETCLIENTID4res;
+
+struct SETCLIENTID_CONFIRM4args {
+ clientid4 clientid;
+ verifier4 setclientid_confirm;
+};
+typedef struct SETCLIENTID_CONFIRM4args SETCLIENTID_CONFIRM4args;
+
+struct SETCLIENTID_CONFIRM4res {
+ nfsstat4 status;
+};
+typedef struct SETCLIENTID_CONFIRM4res SETCLIENTID_CONFIRM4res;
+
+struct VERIFY4args {
+ fattr4 obj_attributes;
+};
+typedef struct VERIFY4args VERIFY4args;
+
+struct VERIFY4res {
+ nfsstat4 status;
+};
+typedef struct VERIFY4res VERIFY4res;
+
+enum stable_how4 {
+ UNSTABLE4 = 0,
+ DATA_SYNC4 = 1,
+ FILE_SYNC4 = 2,
+};
+typedef enum stable_how4 stable_how4;
+
+struct WRITE4args {
+ stateid4 stateid;
+ offset4 offset;
+ stable_how4 stable;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
+};
+typedef struct WRITE4args WRITE4args;
+
+struct WRITE4resok {
+ count4 count;
+ stable_how4 committed;
+ verifier4 writeverf;
+};
+typedef struct WRITE4resok WRITE4resok;
+
+struct WRITE4res {
+ nfsstat4 status;
+ union {
+ WRITE4resok resok4;
+ } WRITE4res_u;
+};
+typedef struct WRITE4res WRITE4res;
+
+struct RELEASE_LOCKOWNER4args {
+ lock_owner4 lock_owner;
+};
+typedef struct RELEASE_LOCKOWNER4args RELEASE_LOCKOWNER4args;
+
+struct RELEASE_LOCKOWNER4res {
+ nfsstat4 status;
+};
+typedef struct RELEASE_LOCKOWNER4res RELEASE_LOCKOWNER4res;
+
+struct ILLEGAL4res {
+ nfsstat4 status;
+};
+typedef struct ILLEGAL4res ILLEGAL4res;
+
+typedef struct {
+ u_int gsshandle4_t_len;
+ char *gsshandle4_t_val;
+} gsshandle4_t;
+
+struct gss_cb_handles4 {
+ rpc_gss_svc_t gcbp_service;
+ gsshandle4_t gcbp_handle_from_server;
+ gsshandle4_t gcbp_handle_from_client;
+};
+typedef struct gss_cb_handles4 gss_cb_handles4;
+
+struct callback_sec_parms4 {
+ uint32_t cb_secflavor;
+ union {
+ authunix_parms cbsp_sys_cred;
+ gss_cb_handles4 cbsp_gss_handles;
+ } callback_sec_parms4_u;
+};
+typedef struct callback_sec_parms4 callback_sec_parms4;
+
+struct BACKCHANNEL_CTL4args {
+ uint32_t bca_cb_program;
+ struct {
+ u_int bca_sec_parms_len;
+ callback_sec_parms4 *bca_sec_parms_val;
+ } bca_sec_parms;
+};
+typedef struct BACKCHANNEL_CTL4args BACKCHANNEL_CTL4args;
+
+struct BACKCHANNEL_CTL4res {
+ nfsstat4 bcr_status;
+};
+typedef struct BACKCHANNEL_CTL4res BACKCHANNEL_CTL4res;
+
+enum channel_dir_from_client4 {
+ CDFC4_FORE = 0x1,
+ CDFC4_BACK = 0x2,
+ CDFC4_FORE_OR_BOTH = 0x3,
+ CDFC4_BACK_OR_BOTH = 0x7,
+};
+typedef enum channel_dir_from_client4 channel_dir_from_client4;
+
+struct BIND_CONN_TO_SESSION4args {
+ sessionid4 bctsa_sessid;
+ channel_dir_from_client4 bctsa_dir;
+ bool_t bctsa_use_conn_in_rdma_mode;
+};
+typedef struct BIND_CONN_TO_SESSION4args BIND_CONN_TO_SESSION4args;
+
+enum channel_dir_from_server4 {
+ CDFS4_FORE = 0x1,
+ CDFS4_BACK = 0x2,
+ CDFS4_BOTH = 0x3,
+};
+typedef enum channel_dir_from_server4 channel_dir_from_server4;
+
+struct BIND_CONN_TO_SESSION4resok {
+ sessionid4 bctsr_sessid;
+ channel_dir_from_server4 bctsr_dir;
+ bool_t bctsr_use_conn_in_rdma_mode;
+};
+typedef struct BIND_CONN_TO_SESSION4resok BIND_CONN_TO_SESSION4resok;
+
+struct BIND_CONN_TO_SESSION4res {
+ nfsstat4 bctsr_status;
+ union {
+ BIND_CONN_TO_SESSION4resok bctsr_resok4;
+ } BIND_CONN_TO_SESSION4res_u;
+};
+typedef struct BIND_CONN_TO_SESSION4res BIND_CONN_TO_SESSION4res;
+const uint32_t EXCHGID4_FLAG_SUPP_MOVED_REFER {0x00000001};
+const uint32_t EXCHGID4_FLAG_SUPP_MOVED_MIGR {0x00000002};
+const uint32_t EXCHGID4_FLAG_BIND_PRINC_STATEID {0x00000100};
+const uint32_t EXCHGID4_FLAG_USE_NON_PNFS {0x00010000};
+const uint32_t EXCHGID4_FLAG_USE_PNFS_MDS {0x00020000};
+const uint32_t EXCHGID4_FLAG_USE_PNFS_DS {0x00040000};
+const uint32_t EXCHGID4_FLAG_MASK_PNFS {0x00070000};
+const uint32_t EXCHGID4_FLAG_UPD_CONFIRMED_REC_A {0x40000000};
+const uint32_t EXCHGID4_FLAG_CONFIRMED_R {0x80000000};
+
+struct state_protect_ops4 {
+ bitmap4 spo_must_enforce;
+ bitmap4 spo_must_allow;
+};
+typedef struct state_protect_ops4 state_protect_ops4;
+
+struct ssv_sp_parms4 {
+ state_protect_ops4 ssp_ops;
+ struct {
+ u_int ssp_hash_algs_len;
+ sec_oid4 *ssp_hash_algs_val;
+ } ssp_hash_algs;
+ struct {
+ u_int ssp_encr_algs_len;
+ sec_oid4 *ssp_encr_algs_val;
+ } ssp_encr_algs;
+ uint32_t ssp_window;
+ uint32_t ssp_num_gss_handles;
+};
+typedef struct ssv_sp_parms4 ssv_sp_parms4;
+
+enum state_protect_how4 {
+ SP4_NONE = 0,
+ SP4_MACH_CRED = 1,
+ SP4_SSV = 2,
+};
+typedef enum state_protect_how4 state_protect_how4;
+
+struct state_protect4_a {
+ state_protect_how4 spa_how;
+ union {
+ state_protect_ops4 spa_mach_ops;
+ ssv_sp_parms4 spa_ssv_parms;
+ } state_protect4_a_u;
+};
+typedef struct state_protect4_a state_protect4_a;
+
+struct EXCHANGE_ID4args {
+ client_owner4 eia_clientowner;
+ uint32_t eia_flags;
+ state_protect4_a eia_state_protect;
+ struct {
+ u_int eia_client_impl_id_len;
+ nfs_impl_id4 *eia_client_impl_id_val;
+ } eia_client_impl_id;
+};
+typedef struct EXCHANGE_ID4args EXCHANGE_ID4args;
+
+struct ssv_prot_info4 {
+ state_protect_ops4 spi_ops;
+ uint32_t spi_hash_alg;
+ uint32_t spi_encr_alg;
+ uint32_t spi_ssv_len;
+ uint32_t spi_window;
+ struct {
+ u_int spi_handles_len;
+ gsshandle4_t *spi_handles_val;
+ } spi_handles;
+};
+typedef struct ssv_prot_info4 ssv_prot_info4;
+
+struct state_protect4_r {
+ state_protect_how4 spr_how;
+ union {
+ state_protect_ops4 spr_mach_ops;
+ ssv_prot_info4 spr_ssv_info;
+ } state_protect4_r_u;
+};
+typedef struct state_protect4_r state_protect4_r;
+
+struct EXCHANGE_ID4resok {
+ clientid4 eir_clientid;
+ sequenceid4 eir_sequenceid;
+ uint32_t eir_flags;
+ state_protect4_r eir_state_protect;
+ server_owner4 eir_server_owner;
+ struct {
+ u_int eir_server_scope_len;
+ char *eir_server_scope_val;
+ } eir_server_scope;
+ struct {
+ u_int eir_server_impl_id_len;
+ nfs_impl_id4 *eir_server_impl_id_val;
+ } eir_server_impl_id;
+};
+typedef struct EXCHANGE_ID4resok EXCHANGE_ID4resok;
+
+struct EXCHANGE_ID4res {
+ nfsstat4 eir_status;
+ union {
+ EXCHANGE_ID4resok eir_resok4;
+ } EXCHANGE_ID4res_u;
+};
+typedef struct EXCHANGE_ID4res EXCHANGE_ID4res;
+
+struct channel_attrs4 {
+ count4 ca_headerpadsize;
+ count4 ca_maxrequestsize;
+ count4 ca_maxresponsesize;
+ count4 ca_maxresponsesize_cached;
+ count4 ca_maxoperations;
+ count4 ca_maxrequests;
+ struct {
+ u_int ca_rdma_ird_len;
+ uint32_t *ca_rdma_ird_val;
+ } ca_rdma_ird;
+};
+typedef struct channel_attrs4 channel_attrs4;
+const uint32_t CREATE_SESSION4_FLAG_PERSIST {0x00000001};
+const uint32_t CREATE_SESSION4_FLAG_CONN_BACK_CHAN {0x00000002};
+const uint32_t CREATE_SESSION4_FLAG_CONN_RDMA {0x00000004};
+
+struct CREATE_SESSION4args {
+ clientid4 csa_clientid;
+ sequenceid4 csa_sequence;
+ uint32_t csa_flags;
+ channel_attrs4 csa_fore_chan_attrs;
+ channel_attrs4 csa_back_chan_attrs;
+ uint32_t csa_cb_program;
+ struct {
+ u_int csa_sec_parms_len;
+ callback_sec_parms4 *csa_sec_parms_val;
+ } csa_sec_parms;
+};
+typedef struct CREATE_SESSION4args CREATE_SESSION4args;
+
+struct CREATE_SESSION4resok {
+ sessionid4 csr_sessionid;
+ sequenceid4 csr_sequence;
+ uint32_t csr_flags;
+ channel_attrs4 csr_fore_chan_attrs;
+ channel_attrs4 csr_back_chan_attrs;
+};
+typedef struct CREATE_SESSION4resok CREATE_SESSION4resok;
+
+struct CREATE_SESSION4res {
+ nfsstat4 csr_status;
+ union {
+ CREATE_SESSION4resok csr_resok4;
+ } CREATE_SESSION4res_u;
+};
+typedef struct CREATE_SESSION4res CREATE_SESSION4res;
+
+struct DESTROY_SESSION4args {
+ sessionid4 dsa_sessionid;
+};
+typedef struct DESTROY_SESSION4args DESTROY_SESSION4args;
+
+struct DESTROY_SESSION4res {
+ nfsstat4 dsr_status;
+};
+typedef struct DESTROY_SESSION4res DESTROY_SESSION4res;
+
+struct FREE_STATEID4args {
+ stateid4 fsa_stateid;
+};
+typedef struct FREE_STATEID4args FREE_STATEID4args;
+
+struct FREE_STATEID4res {
+ nfsstat4 fsr_status;
+};
+typedef struct FREE_STATEID4res FREE_STATEID4res;
+
+typedef nfstime4 attr_notice4;
+
+struct GET_DIR_DELEGATION4args {
+ bool_t gdda_signal_deleg_avail;
+ bitmap4 gdda_notification_types;
+ attr_notice4 gdda_child_attr_delay;
+ attr_notice4 gdda_dir_attr_delay;
+ bitmap4 gdda_child_attributes;
+ bitmap4 gdda_dir_attributes;
+};
+typedef struct GET_DIR_DELEGATION4args GET_DIR_DELEGATION4args;
+
+struct GET_DIR_DELEGATION4resok {
+ verifier4 gddr_cookieverf;
+ stateid4 gddr_stateid;
+ bitmap4 gddr_notification;
+ bitmap4 gddr_child_attributes;
+ bitmap4 gddr_dir_attributes;
+};
+typedef struct GET_DIR_DELEGATION4resok GET_DIR_DELEGATION4resok;
+
+enum gddrnf4_status {
+ GDD4_OK = 0,
+ GDD4_UNAVAIL = 1,
+};
+typedef enum gddrnf4_status gddrnf4_status;
+
+struct GET_DIR_DELEGATION4res_non_fatal {
+ gddrnf4_status gddrnf_status;
+ union {
+ GET_DIR_DELEGATION4resok gddrnf_resok4;
+ bool_t gddrnf_will_signal_deleg_avail;
+ } GET_DIR_DELEGATION4res_non_fatal_u;
+};
+typedef struct GET_DIR_DELEGATION4res_non_fatal GET_DIR_DELEGATION4res_non_fatal;
+
+struct GET_DIR_DELEGATION4res {
+ nfsstat4 gddr_status;
+ union {
+ GET_DIR_DELEGATION4res_non_fatal gddr_res_non_fatal4;
+ } GET_DIR_DELEGATION4res_u;
+};
+typedef struct GET_DIR_DELEGATION4res GET_DIR_DELEGATION4res;
+
+struct GETDEVICEINFO4args {
+ deviceid4 gdia_device_id;
+ layouttype4 gdia_layout_type;
+ count4 gdia_maxcount;
+ bitmap4 gdia_notify_types;
+};
+typedef struct GETDEVICEINFO4args GETDEVICEINFO4args;
+
+struct GETDEVICEINFO4resok {
+ device_addr4 gdir_device_addr;
+ bitmap4 gdir_notification;
+};
+typedef struct GETDEVICEINFO4resok GETDEVICEINFO4resok;
+
+struct GETDEVICEINFO4res {
+ nfsstat4 gdir_status;
+ union {
+ GETDEVICEINFO4resok gdir_resok4;
+ count4 gdir_mincount;
+ } GETDEVICEINFO4res_u;
+};
+typedef struct GETDEVICEINFO4res GETDEVICEINFO4res;
+
+struct GETDEVICELIST4args {
+ layouttype4 gdla_layout_type;
+ count4 gdla_maxdevices;
+ nfs_cookie4 gdla_cookie;
+ verifier4 gdla_cookieverf;
+};
+typedef struct GETDEVICELIST4args GETDEVICELIST4args;
+
+struct GETDEVICELIST4resok {
+ nfs_cookie4 gdlr_cookie;
+ verifier4 gdlr_cookieverf;
+ struct {
+ u_int gdlr_deviceid_list_len;
+ deviceid4 *gdlr_deviceid_list_val;
+ } gdlr_deviceid_list;
+ bool_t gdlr_eof;
+};
+typedef struct GETDEVICELIST4resok GETDEVICELIST4resok;
+
+struct GETDEVICELIST4res {
+ nfsstat4 gdlr_status;
+ union {
+ GETDEVICELIST4resok gdlr_resok4;
+ } GETDEVICELIST4res_u;
+};
+typedef struct GETDEVICELIST4res GETDEVICELIST4res;
+
+struct newtime4 {
+ bool_t nt_timechanged;
+ union {
+ nfstime4 nt_time;
+ } newtime4_u;
+};
+typedef struct newtime4 newtime4;
+
+struct newoffset4 {
+ bool_t no_newoffset;
+ union {
+ offset4 no_offset;
+ } newoffset4_u;
+};
+typedef struct newoffset4 newoffset4;
+
+struct LAYOUTCOMMIT4args {
+ offset4 loca_offset;
+ length4 loca_length;
+ bool_t loca_reclaim;
+ stateid4 loca_stateid;
+ newoffset4 loca_last_write_offset;
+ newtime4 loca_time_modify;
+ layoutupdate4 loca_layoutupdate;
+};
+typedef struct LAYOUTCOMMIT4args LAYOUTCOMMIT4args;
+
+struct newsize4 {
+ bool_t ns_sizechanged;
+ union {
+ length4 ns_size;
+ } newsize4_u;
+};
+typedef struct newsize4 newsize4;
+
+struct LAYOUTCOMMIT4resok {
+ newsize4 locr_newsize;
+};
+typedef struct LAYOUTCOMMIT4resok LAYOUTCOMMIT4resok;
+
+struct LAYOUTCOMMIT4res {
+ nfsstat4 locr_status;
+ union {
+ LAYOUTCOMMIT4resok locr_resok4;
+ } LAYOUTCOMMIT4res_u;
+};
+typedef struct LAYOUTCOMMIT4res LAYOUTCOMMIT4res;
+
+struct LAYOUTGET4args {
+ bool_t loga_signal_layout_avail;
+ layouttype4 loga_layout_type;
+ layoutiomode4 loga_iomode;
+ offset4 loga_offset;
+ length4 loga_length;
+ length4 loga_minlength;
+ stateid4 loga_stateid;
+ count4 loga_maxcount;
+};
+typedef struct LAYOUTGET4args LAYOUTGET4args;
+
+struct LAYOUTGET4resok {
+ bool_t logr_return_on_close;
+ stateid4 logr_stateid;
+ struct {
+ u_int logr_layout_len;
+ layout4 *logr_layout_val;
+ } logr_layout;
+};
+typedef struct LAYOUTGET4resok LAYOUTGET4resok;
+
+struct LAYOUTGET4res {
+ nfsstat4 logr_status;
+ union {
+ LAYOUTGET4resok logr_resok4;
+ bool_t logr_will_signal_layout_avail;
+ } LAYOUTGET4res_u;
+};
+typedef struct LAYOUTGET4res LAYOUTGET4res;
+
+struct LAYOUTRETURN4args {
+ bool_t lora_reclaim;
+ layouttype4 lora_layout_type;
+ layoutiomode4 lora_iomode;
+ layoutreturn4 lora_layoutreturn;
+};
+typedef struct LAYOUTRETURN4args LAYOUTRETURN4args;
+
+struct layoutreturn_stateid {
+ bool_t lrs_present;
+ union {
+ stateid4 lrs_stateid;
+ } layoutreturn_stateid_u;
+};
+typedef struct layoutreturn_stateid layoutreturn_stateid;
+
+struct LAYOUTRETURN4res {
+ nfsstat4 lorr_status;
+ union {
+ layoutreturn_stateid lorr_stateid;
+ } LAYOUTRETURN4res_u;
+};
+typedef struct LAYOUTRETURN4res LAYOUTRETURN4res;
+
+enum secinfo_style4 {
+ SECINFO_STYLE4_CURRENT_FH = 0,
+ SECINFO_STYLE4_PARENT = 1,
+};
+typedef enum secinfo_style4 secinfo_style4;
+
+typedef secinfo_style4 SECINFO_NO_NAME4args;
+
+typedef SECINFO4res SECINFO_NO_NAME4res;
+
+struct SEQUENCE4args {
+ sessionid4 sa_sessionid;
+ sequenceid4 sa_sequenceid;
+ slotid4 sa_slotid;
+ slotid4 sa_highest_slotid;
+ bool_t sa_cachethis;
+};
+typedef struct SEQUENCE4args SEQUENCE4args;
+const uint32_t SEQ4_STATUS_CB_PATH_DOWN {0x00000001};
+const uint32_t SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING {0x00000002};
+const uint32_t SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED {0x00000004};
+const uint32_t SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED {0x00000008};
+const uint32_t SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED {0x00000010};
+const uint32_t SEQ4_STATUS_ADMIN_STATE_REVOKED {0x00000020};
+const uint32_t SEQ4_STATUS_RECALLABLE_STATE_REVOKED {0x00000040};
+const uint32_t SEQ4_STATUS_LEASE_MOVED {0x00000080};
+const uint32_t SEQ4_STATUS_RESTART_RECLAIM_NEEDED {0x00000100};
+const uint32_t SEQ4_STATUS_CB_PATH_DOWN_SESSION {0x00000200};
+const uint32_t SEQ4_STATUS_BACKCHANNEL_FAULT {0x00000400};
+const uint32_t SEQ4_STATUS_DEVID_CHANGED {0x00000800};
+const uint32_t SEQ4_STATUS_DEVID_DELETED {0x00001000};
+
+struct SEQUENCE4resok {
+ sessionid4 sr_sessionid;
+ sequenceid4 sr_sequenceid;
+ slotid4 sr_slotid;
+ slotid4 sr_highest_slotid;
+ slotid4 sr_target_highest_slotid;
+ uint32_t sr_status_flags;
+};
+typedef struct SEQUENCE4resok SEQUENCE4resok;
+
+struct SEQUENCE4res {
+ nfsstat4 sr_status;
+ union {
+ SEQUENCE4resok sr_resok4;
+ } SEQUENCE4res_u;
+};
+typedef struct SEQUENCE4res SEQUENCE4res;
+
+struct ssa_digest_input4 {
+ SEQUENCE4args sdi_seqargs;
+};
+typedef struct ssa_digest_input4 ssa_digest_input4;
+
+struct SET_SSV4args {
+ struct {
+ u_int ssa_ssv_len;
+ char *ssa_ssv_val;
+ } ssa_ssv;
+ struct {
+ u_int ssa_digest_len;
+ char *ssa_digest_val;
+ } ssa_digest;
+};
+typedef struct SET_SSV4args SET_SSV4args;
+
+struct ssr_digest_input4 {
+ SEQUENCE4res sdi_seqres;
+};
+typedef struct ssr_digest_input4 ssr_digest_input4;
+
+struct SET_SSV4resok {
+ struct {
+ u_int ssr_digest_len;
+ char *ssr_digest_val;
+ } ssr_digest;
+};
+typedef struct SET_SSV4resok SET_SSV4resok;
+
+struct SET_SSV4res {
+ nfsstat4 ssr_status;
+ union {
+ SET_SSV4resok ssr_resok4;
+ } SET_SSV4res_u;
+};
+typedef struct SET_SSV4res SET_SSV4res;
+
+struct TEST_STATEID4args {
+ struct {
+ u_int ts_stateids_len;
+ stateid4 *ts_stateids_val;
+ } ts_stateids;
+};
+typedef struct TEST_STATEID4args TEST_STATEID4args;
+
+struct TEST_STATEID4resok {
+ struct {
+ u_int tsr_status_codes_len;
+ nfsstat4 *tsr_status_codes_val;
+ } tsr_status_codes;
+};
+typedef struct TEST_STATEID4resok TEST_STATEID4resok;
+
+struct TEST_STATEID4res {
+ nfsstat4 tsr_status;
+ union {
+ TEST_STATEID4resok tsr_resok4;
+ } TEST_STATEID4res_u;
+};
+typedef struct TEST_STATEID4res TEST_STATEID4res;
+
+struct deleg_claim4 {
+ open_claim_type4 dc_claim;
+ union {
+ open_delegation_type4 dc_delegate_type;
+ } deleg_claim4_u;
+};
+typedef struct deleg_claim4 deleg_claim4;
+
+struct WANT_DELEGATION4args {
+ uint32_t wda_want;
+ deleg_claim4 wda_claim;
+};
+typedef struct WANT_DELEGATION4args WANT_DELEGATION4args;
+
+struct WANT_DELEGATION4res {
+ nfsstat4 wdr_status;
+ union {
+ open_delegation4 wdr_resok4;
+ } WANT_DELEGATION4res_u;
+};
+typedef struct WANT_DELEGATION4res WANT_DELEGATION4res;
+
+struct DESTROY_CLIENTID4args {
+ clientid4 dca_clientid;
+};
+typedef struct DESTROY_CLIENTID4args DESTROY_CLIENTID4args;
+
+struct DESTROY_CLIENTID4res {
+ nfsstat4 dcr_status;
+};
+typedef struct DESTROY_CLIENTID4res DESTROY_CLIENTID4res;
+
+struct RECLAIM_COMPLETE4args {
+ bool_t rca_one_fs;
+};
+typedef struct RECLAIM_COMPLETE4args RECLAIM_COMPLETE4args;
+
+struct RECLAIM_COMPLETE4res {
+ nfsstat4 rcr_status;
+};
+typedef struct RECLAIM_COMPLETE4res RECLAIM_COMPLETE4res;
+
+/* new operations for NFSv4.1 */
+
+
+enum nfs_opnum4 {
+ OP_ACCESS = 3,
+ OP_CLOSE = 4,
+ OP_COMMIT = 5,
+ OP_CREATE = 6,
+ OP_DELEGPURGE = 7,
+ OP_DELEGRETURN = 8,
+ OP_GETATTR = 9,
+ OP_GETFH = 10,
+ OP_LINK = 11,
+ OP_LOCK = 12,
+ OP_LOCKT = 13,
+ OP_LOCKU = 14,
+ OP_LOOKUP = 15,
+ OP_LOOKUPP = 16,
+ OP_NVERIFY = 17,
+ OP_OPEN = 18,
+ OP_OPENATTR = 19,
+ OP_OPEN_CONFIRM = 20,
+ OP_OPEN_DOWNGRADE = 21,
+ OP_PUTFH = 22,
+ OP_PUTPUBFH = 23,
+ OP_PUTROOTFH = 24,
+ OP_READ = 25,
+ OP_READDIR = 26,
+ OP_READLINK = 27,
+ OP_REMOVE = 28,
+ OP_RENAME = 29,
+ OP_RENEW = 30,
+ OP_RESTOREFH = 31,
+ OP_SAVEFH = 32,
+ OP_SECINFO = 33,
+ OP_SETATTR = 34,
+ OP_SETCLIENTID = 35,
+ OP_SETCLIENTID_CONFIRM = 36,
+ OP_VERIFY = 37,
+ OP_WRITE = 38,
+ OP_RELEASE_LOCKOWNER = 39,
+ OP_BACKCHANNEL_CTL = 40,
+ OP_BIND_CONN_TO_SESSION = 41,
+ OP_EXCHANGE_ID = 42,
+ OP_CREATE_SESSION = 43,
+ OP_DESTROY_SESSION = 44,
+ OP_FREE_STATEID = 45,
+ OP_GET_DIR_DELEGATION = 46,
+ OP_GETDEVICEINFO = 47,
+ OP_GETDEVICELIST = 48,
+ OP_LAYOUTCOMMIT = 49,
+ OP_LAYOUTGET = 50,
+ OP_LAYOUTRETURN = 51,
+ OP_SECINFO_NO_NAME = 52,
+ OP_SEQUENCE = 53,
+ OP_SET_SSV = 54,
+ OP_TEST_STATEID = 55,
+ OP_WANT_DELEGATION = 56,
+ OP_DESTROY_CLIENTID = 57,
+ OP_RECLAIM_COMPLETE = 58,
+ OP_ILLEGAL = 10044,
+};
+typedef enum nfs_opnum4 nfs_opnum4;
+
+union nfs_argop4_u_t {
+ ACCESS4args opaccess;
+ CLOSE4args opclose;
+ COMMIT4args opcommit;
+ CREATE4args opcreate;
+ DELEGPURGE4args opdelegpurge;
+ DELEGRETURN4args opdelegreturn;
+ GETATTR4args opgetattr;
+ LINK4args oplink;
+ LOCK4args oplock;
+ LOCKT4args oplockt;
+ LOCKU4args oplocku;
+ LOOKUP4args oplookup;
+ NVERIFY4args opnverify;
+ OPEN4args opopen;
+ OPENATTR4args opopenattr;
+ OPEN_CONFIRM4args opopen_confirm;
+ OPEN_DOWNGRADE4args opopen_downgrade;
+ PUTFH4args opputfh;
+ READ4args opread;
+ READDIR4args opreaddir;
+ REMOVE4args opremove;
+ RENAME4args oprename;
+ RENEW4args oprenew;
+ SECINFO4args opsecinfo;
+ SETATTR4args opsetattr;
+ SETCLIENTID4args opsetclientid;
+ SETCLIENTID_CONFIRM4args opsetclientid_confirm;
+ VERIFY4args opverify;
+ WRITE4args opwrite;
+ RELEASE_LOCKOWNER4args oprelease_lockowner;
+ BACKCHANNEL_CTL4args opbackchannel_ctl;
+ BIND_CONN_TO_SESSION4args opbind_conn_to_session;
+ EXCHANGE_ID4args opexchange_id;
+ CREATE_SESSION4args opcreate_session;
+ DESTROY_SESSION4args opdestroy_session;
+ FREE_STATEID4args opfree_stateid;
+ GET_DIR_DELEGATION4args opget_dir_delegation;
+ GETDEVICEINFO4args opgetdeviceinfo;
+ GETDEVICELIST4args opgetdevicelist;
+ LAYOUTCOMMIT4args oplayoutcommit;
+ LAYOUTGET4args oplayoutget;
+ LAYOUTRETURN4args oplayoutreturn;
+ SECINFO_NO_NAME4args opsecinfo_no_name;
+ SEQUENCE4args opsequence;
+ SET_SSV4args opset_ssv;
+ TEST_STATEID4args optest_stateid;
+ WANT_DELEGATION4args opwant_delegation;
+ DESTROY_CLIENTID4args opdestroy_clientid;
+ RECLAIM_COMPLETE4args opreclaim_complete;
+};
+
+struct nfs_argop4 {
+ nfs_opnum4 argop;
+ nfs_argop4_u_t nfs_argop4_u;
+};
+typedef struct nfs_argop4 nfs_argop4;
+
+union nfs_resop4_u_t {
+ ACCESS4res opaccess;
+ CLOSE4res opclose;
+ COMMIT4res opcommit;
+ CREATE4res opcreate;
+ DELEGPURGE4res opdelegpurge;
+ DELEGRETURN4res opdelegreturn;
+ GETATTR4res opgetattr;
+ GETFH4res opgetfh;
+ LINK4res oplink;
+ LOCK4res oplock;
+ LOCKT4res oplockt;
+ LOCKU4res oplocku;
+ LOOKUP4res oplookup;
+ LOOKUPP4res oplookupp;
+ NVERIFY4res opnverify;
+ OPEN4res opopen;
+ OPENATTR4res opopenattr;
+ OPEN_CONFIRM4res opopen_confirm;
+ OPEN_DOWNGRADE4res opopen_downgrade;
+ PUTFH4res opputfh;
+ PUTPUBFH4res opputpubfh;
+ PUTROOTFH4res opputrootfh;
+ READ4res opread;
+ READDIR4res opreaddir;
+ READLINK4res opreadlink;
+ REMOVE4res opremove;
+ RENAME4res oprename;
+ RENEW4res oprenew;
+ RESTOREFH4res oprestorefh;
+ SAVEFH4res opsavefh;
+ SECINFO4res opsecinfo;
+ SETATTR4res opsetattr;
+ SETCLIENTID4res opsetclientid;
+ SETCLIENTID_CONFIRM4res opsetclientid_confirm;
+ VERIFY4res opverify;
+ WRITE4res opwrite;
+ RELEASE_LOCKOWNER4res oprelease_lockowner;
+ BACKCHANNEL_CTL4res opbackchannel_ctl;
+ BIND_CONN_TO_SESSION4res opbind_conn_to_session;
+ EXCHANGE_ID4res opexchange_id;
+ CREATE_SESSION4res opcreate_session;
+ DESTROY_SESSION4res opdestroy_session;
+ FREE_STATEID4res opfree_stateid;
+ GET_DIR_DELEGATION4res opget_dir_delegation;
+ GETDEVICEINFO4res opgetdeviceinfo;
+ GETDEVICELIST4res opgetdevicelist;
+ LAYOUTCOMMIT4res oplayoutcommit;
+ LAYOUTGET4res oplayoutget;
+ LAYOUTRETURN4res oplayoutreturn;
+ SECINFO_NO_NAME4res opsecinfo_no_name;
+ SEQUENCE4res opsequence;
+ SET_SSV4res opset_ssv;
+ TEST_STATEID4res optest_stateid;
+ WANT_DELEGATION4res opwant_delegation;
+ DESTROY_CLIENTID4res opdestroy_clientid;
+ RECLAIM_COMPLETE4res opreclaim_complete;
+ ILLEGAL4res opillegal;
+};
+
+struct nfs_resop4 {
+ nfs_opnum4 resop;
+ nfs_resop4_u_t nfs_resop4_u;
+};
+typedef struct nfs_resop4 nfs_resop4;
+
+struct COMPOUND4args {
+ utf8str_cs tag;
+ uint32_t minorversion;
+ struct {
+ u_int argarray_len;
+ nfs_argop4 *argarray_val;
+ } argarray;
+};
+typedef struct COMPOUND4args COMPOUND4args;
+
+struct COMPOUND4res {
+ nfsstat4 status;
+ utf8str_cs tag;
+ struct {
+ u_int resarray_len;
+ nfs_resop4 *resarray_val;
+ } resarray;
+};
+typedef struct COMPOUND4res COMPOUND4res;
+
+struct CB_GETATTR4args {
+ nfs_fh4 fh;
+ bitmap4 attr_request;
+};
+typedef struct CB_GETATTR4args CB_GETATTR4args;
+
+struct CB_GETATTR4resok {
+ fattr4 obj_attributes;
+};
+typedef struct CB_GETATTR4resok CB_GETATTR4resok;
+
+struct CB_GETATTR4res {
+ nfsstat4 status;
+ union {
+ CB_GETATTR4resok resok4;
+ } CB_GETATTR4res_u;
+};
+typedef struct CB_GETATTR4res CB_GETATTR4res;
+
+struct CB_RECALL4args {
+ stateid4 stateid;
+ bool_t truncate;
+ nfs_fh4 fh;
+};
+typedef struct CB_RECALL4args CB_RECALL4args;
+
+struct CB_RECALL4res {
+ nfsstat4 status;
+};
+typedef struct CB_RECALL4res CB_RECALL4res;
+
+struct CB_ILLEGAL4res {
+ nfsstat4 status;
+};
+typedef struct CB_ILLEGAL4res CB_ILLEGAL4res;
+
+enum layoutrecall_type4 {
+ LAYOUTRECALL4_FILE = LAYOUT4_RET_REC_FILE,
+ LAYOUTRECALL4_FSID = LAYOUT4_RET_REC_FSID,
+ LAYOUTRECALL4_ALL = LAYOUT4_RET_REC_ALL,
+};
+typedef enum layoutrecall_type4 layoutrecall_type4;
+
+struct layoutrecall_file4 {
+ nfs_fh4 lor_fh;
+ offset4 lor_offset;
+ length4 lor_length;
+ stateid4 lor_stateid;
+};
+typedef struct layoutrecall_file4 layoutrecall_file4;
+
+struct layoutrecall4 {
+ layoutrecall_type4 lor_recalltype;
+ union {
+ layoutrecall_file4 lor_layout;
+ fsid4 lor_fsid;
+ } layoutrecall4_u;
+};
+typedef struct layoutrecall4 layoutrecall4;
+
+struct CB_LAYOUTRECALL4args {
+ layouttype4 clora_type;
+ layoutiomode4 clora_iomode;
+ bool_t clora_changed;
+ layoutrecall4 clora_recall;
+};
+typedef struct CB_LAYOUTRECALL4args CB_LAYOUTRECALL4args;
+
+struct CB_LAYOUTRECALL4res {
+ nfsstat4 clorr_status;
+};
+typedef struct CB_LAYOUTRECALL4res CB_LAYOUTRECALL4res;
+
+enum notify_type4 {
+ NOTIFY4_CHANGE_CHILD_ATTRS = 0,
+ NOTIFY4_CHANGE_DIR_ATTRS = 1,
+ NOTIFY4_REMOVE_ENTRY = 2,
+ NOTIFY4_ADD_ENTRY = 3,
+ NOTIFY4_RENAME_ENTRY = 4,
+ NOTIFY4_CHANGE_COOKIE_VERIFIER = 5,
+};
+typedef enum notify_type4 notify_type4;
+
+struct notify_entry4 {
+ component4 ne_file;
+ fattr4 ne_attrs;
+};
+typedef struct notify_entry4 notify_entry4;
+
+struct prev_entry4 {
+ notify_entry4 pe_prev_entry;
+ nfs_cookie4 pe_prev_entry_cookie;
+};
+typedef struct prev_entry4 prev_entry4;
+
+struct notify_remove4 {
+ notify_entry4 nrm_old_entry;
+ nfs_cookie4 nrm_old_entry_cookie;
+};
+typedef struct notify_remove4 notify_remove4;
+
+struct notify_add4 {
+ struct {
+ u_int nad_old_entry_len;
+ notify_remove4 *nad_old_entry_val;
+ } nad_old_entry;
+ notify_entry4 nad_new_entry;
+ struct {
+ u_int nad_new_entry_cookie_len;
+ nfs_cookie4 *nad_new_entry_cookie_val;
+ } nad_new_entry_cookie;
+ struct {
+ u_int nad_prev_entry_len;
+ prev_entry4 *nad_prev_entry_val;
+ } nad_prev_entry;
+ bool_t nad_last_entry;
+};
+typedef struct notify_add4 notify_add4;
+
+struct notify_attr4 {
+ notify_entry4 na_changed_entry;
+};
+typedef struct notify_attr4 notify_attr4;
+
+struct notify_rename4 {
+ notify_remove4 nrn_old_entry;
+ notify_add4 nrn_new_entry;
+};
+typedef struct notify_rename4 notify_rename4;
+
+struct notify_verifier4 {
+ verifier4 nv_old_cookieverf;
+ verifier4 nv_new_cookieverf;
+};
+typedef struct notify_verifier4 notify_verifier4;
+
+typedef struct {
+ u_int notifylist4_len;
+ char *notifylist4_val;
+} notifylist4;
+
+struct notify4 {
+ bitmap4 notify_mask;
+ notifylist4 notify_vals;
+};
+typedef struct notify4 notify4;
+
+struct CB_NOTIFY4args {
+ stateid4 cna_stateid;
+ nfs_fh4 cna_fh;
+ struct {
+ u_int cna_changes_len;
+ notify4 *cna_changes_val;
+ } cna_changes;
+};
+typedef struct CB_NOTIFY4args CB_NOTIFY4args;
+
+struct CB_NOTIFY4res {
+ nfsstat4 cnr_status;
+};
+typedef struct CB_NOTIFY4res CB_NOTIFY4res;
+
+struct CB_PUSH_DELEG4args {
+ nfs_fh4 cpda_fh;
+ open_delegation4 cpda_delegation;
+};
+typedef struct CB_PUSH_DELEG4args CB_PUSH_DELEG4args;
+
+struct CB_PUSH_DELEG4res {
+ nfsstat4 cpdr_status;
+};
+typedef struct CB_PUSH_DELEG4res CB_PUSH_DELEG4res;
+const uint32_t RCA4_TYPE_MASK_RDATA_DLG {0};
+const uint32_t RCA4_TYPE_MASK_WDATA_DLG {1};
+const uint32_t RCA4_TYPE_MASK_DIR_DLG {2};
+const uint32_t RCA4_TYPE_MASK_FILE_LAYOUT {3};
+const uint32_t RCA4_TYPE_MASK_BLK_LAYOUT {4};
+const uint32_t RCA4_TYPE_MASK_OBJ_LAYOUT_MIN {8};
+const uint32_t RCA4_TYPE_MASK_OBJ_LAYOUT_MAX {9};
+const uint32_t RCA4_TYPE_MASK_OTHER_LAYOUT_MIN {12};
+const uint32_t RCA4_TYPE_MASK_OTHER_LAYOUT_MAX {15};
+
+struct CB_RECALL_ANY4args {
+ uint32_t craa_objects_to_keep;
+ bitmap4 craa_type_mask;
+};
+typedef struct CB_RECALL_ANY4args CB_RECALL_ANY4args;
+
+struct CB_RECALL_ANY4res {
+ nfsstat4 crar_status;
+};
+typedef struct CB_RECALL_ANY4res CB_RECALL_ANY4res;
+
+typedef CB_RECALL_ANY4args CB_RECALLABLE_OBJ_AVAIL4args;
+
+struct CB_RECALLABLE_OBJ_AVAIL4res {
+ nfsstat4 croa_status;
+};
+typedef struct CB_RECALLABLE_OBJ_AVAIL4res CB_RECALLABLE_OBJ_AVAIL4res;
+
+struct CB_RECALL_SLOT4args {
+ slotid4 rsa_target_highest_slotid;
+};
+typedef struct CB_RECALL_SLOT4args CB_RECALL_SLOT4args;
+
+struct CB_RECALL_SLOT4res {
+ nfsstat4 rsr_status;
+};
+typedef struct CB_RECALL_SLOT4res CB_RECALL_SLOT4res;
+
+struct referring_call4 {
+ sequenceid4 rc_sequenceid;
+ slotid4 rc_slotid;
+};
+typedef struct referring_call4 referring_call4;
+
+struct referring_call_list4 {
+ sessionid4 rcl_sessionid;
+ struct {
+ u_int rcl_referring_calls_len;
+ referring_call4 *rcl_referring_calls_val;
+ } rcl_referring_calls;
+};
+typedef struct referring_call_list4 referring_call_list4;
+
+struct CB_SEQUENCE4args {
+ sessionid4 csa_sessionid;
+ sequenceid4 csa_sequenceid;
+ slotid4 csa_slotid;
+ slotid4 csa_highest_slotid;
+ bool_t csa_cachethis;
+ struct {
+ u_int csa_referring_call_lists_len;
+ referring_call_list4 *csa_referring_call_lists_val;
+ } csa_referring_call_lists;
+};
+typedef struct CB_SEQUENCE4args CB_SEQUENCE4args;
+
+struct CB_SEQUENCE4resok {
+ sessionid4 csr_sessionid;
+ sequenceid4 csr_sequenceid;
+ slotid4 csr_slotid;
+ slotid4 csr_highest_slotid;
+ slotid4 csr_target_highest_slotid;
+};
+typedef struct CB_SEQUENCE4resok CB_SEQUENCE4resok;
+
+struct CB_SEQUENCE4res {
+ nfsstat4 csr_status;
+ union {
+ CB_SEQUENCE4resok csr_resok4;
+ } CB_SEQUENCE4res_u;
+};
+typedef struct CB_SEQUENCE4res CB_SEQUENCE4res;
+
+struct CB_WANTS_CANCELLED4args {
+ bool_t cwca_contended_wants_cancelled;
+ bool_t cwca_resourced_wants_cancelled;
+};
+typedef struct CB_WANTS_CANCELLED4args CB_WANTS_CANCELLED4args;
+
+struct CB_WANTS_CANCELLED4res {
+ nfsstat4 cwcr_status;
+};
+typedef struct CB_WANTS_CANCELLED4res CB_WANTS_CANCELLED4res;
+
+struct CB_NOTIFY_LOCK4args {
+ nfs_fh4 cnla_fh;
+ lock_owner4 cnla_lock_owner;
+};
+typedef struct CB_NOTIFY_LOCK4args CB_NOTIFY_LOCK4args;
+
+struct CB_NOTIFY_LOCK4res {
+ nfsstat4 cnlr_status;
+};
+typedef struct CB_NOTIFY_LOCK4res CB_NOTIFY_LOCK4res;
+
+enum notify_deviceid_type4 {
+ NOTIFY_DEVICEID4_CHANGE = 1,
+ NOTIFY_DEVICEID4_DELETE = 2,
+};
+typedef enum notify_deviceid_type4 notify_deviceid_type4;
+
+struct notify_deviceid_delete4 {
+ layouttype4 ndd_layouttype;
+ deviceid4 ndd_deviceid;
+};
+typedef struct notify_deviceid_delete4 notify_deviceid_delete4;
+
+struct notify_deviceid_change4 {
+ layouttype4 ndc_layouttype;
+ deviceid4 ndc_deviceid;
+ bool_t ndc_immediate;
+};
+typedef struct notify_deviceid_change4 notify_deviceid_change4;
+
+struct CB_NOTIFY_DEVICEID4args {
+ struct {
+ u_int cnda_changes_len;
+ notify4 *cnda_changes_val;
+ } cnda_changes;
+};
+typedef struct CB_NOTIFY_DEVICEID4args CB_NOTIFY_DEVICEID4args;
+
+struct CB_NOTIFY_DEVICEID4res {
+ nfsstat4 cndr_status;
+};
+typedef struct CB_NOTIFY_DEVICEID4res CB_NOTIFY_DEVICEID4res;
+
+/* Callback operations new to NFSv4.1 */
+
+enum nfs_cb_opnum4 {
+ OP_CB_GETATTR = 3,
+ OP_CB_RECALL = 4,
+ OP_CB_LAYOUTRECALL = 5,
+ OP_CB_NOTIFY = 6,
+ OP_CB_PUSH_DELEG = 7,
+ OP_CB_RECALL_ANY = 8,
+ OP_CB_RECALLABLE_OBJ_AVAIL = 9,
+ OP_CB_RECALL_SLOT = 10,
+ OP_CB_SEQUENCE = 11,
+ OP_CB_WANTS_CANCELLED = 12,
+ OP_CB_NOTIFY_LOCK = 13,
+ OP_CB_NOTIFY_DEVICEID = 14,
+ OP_CB_ILLEGAL = 10044,
+};
+typedef enum nfs_cb_opnum4 nfs_cb_opnum4;
+
+struct nfs_cb_argop4 {
+ u_int argop;
+ union {
+ CB_GETATTR4args opcbgetattr;
+ CB_RECALL4args opcbrecall;
+ CB_LAYOUTRECALL4args opcblayoutrecall;
+ CB_NOTIFY4args opcbnotify;
+ CB_PUSH_DELEG4args opcbpush_deleg;
+ CB_RECALL_ANY4args opcbrecall_any;
+ CB_RECALLABLE_OBJ_AVAIL4args opcbrecallable_obj_avail;
+ CB_RECALL_SLOT4args opcbrecall_slot;
+ CB_SEQUENCE4args opcbsequence;
+ CB_WANTS_CANCELLED4args opcbwants_cancelled;
+ CB_NOTIFY_LOCK4args opcbnotify_lock;
+ CB_NOTIFY_DEVICEID4args opcbnotify_deviceid;
+ } nfs_cb_argop4_u;
+};
+typedef struct nfs_cb_argop4 nfs_cb_argop4;
+
+struct nfs_cb_resop4 {
+ u_int resop;
+ union {
+ CB_GETATTR4res opcbgetattr;
+ CB_RECALL4res opcbrecall;
+ CB_LAYOUTRECALL4res opcblayoutrecall;
+ CB_NOTIFY4res opcbnotify;
+ CB_PUSH_DELEG4res opcbpush_deleg;
+ CB_RECALL_ANY4res opcbrecall_any;
+ CB_RECALLABLE_OBJ_AVAIL4res opcbrecallable_obj_avail;
+ CB_RECALL_SLOT4res opcbrecall_slot;
+ CB_SEQUENCE4res opcbsequence;
+ CB_WANTS_CANCELLED4res opcbwants_cancelled;
+ CB_NOTIFY_LOCK4res opcbnotify_lock;
+ CB_NOTIFY_DEVICEID4res opcbnotify_deviceid;
+ CB_ILLEGAL4res opcbillegal;
+ } nfs_cb_resop4_u;
+};
+typedef struct nfs_cb_resop4 nfs_cb_resop4;
+
+struct CB_COMPOUND4args {
+ utf8str_cs tag;
+ uint32_t minorversion;
+ uint32_t callback_ident;
+ struct {
+ u_int argarray_len;
+ nfs_cb_argop4 *argarray_val;
+ } argarray;
+};
+typedef struct CB_COMPOUND4args CB_COMPOUND4args;
+
+struct CB_COMPOUND4res {
+ nfsstat4 status;
+ utf8str_cs tag;
+ struct {
+ u_int resarray_len;
+ nfs_cb_resop4 *resarray_val;
+ } resarray;
+};
+typedef struct CB_COMPOUND4res CB_COMPOUND4res;
+
+const uint32_t NFS4_PROGRAM {100003};
+
+const uint32_t NFSPROC4_NULL {0};
+const uint32_t NFSPROC4_COMPOUND {1};
+
+const uint32_t NFS4_CALLBACK {0x40000000};
+const uint32_t NFS_CB {1};
+
+const uint32_t CB_NULL {0};
+const uint32_t CB_COMPOUND {1};
+
+} // namespace NFS41
+} // namespace API
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFS41_TYPES_RPCGEN_H
+//------------------------------------------------------------------------------
diff --git a/src/api/nfs4_types_rpcgen.h b/src/api/nfs4_types_rpcgen.h
index a88ef31..ef700a3 100644
--- a/src/api/nfs4_types_rpcgen.h
+++ b/src/api/nfs4_types_rpcgen.h
@@ -25,13 +25,17 @@
//------------------------------------------------------------------------------
#include <rpc/rpc.h>
//------------------------------------------------------------------------------
-namespace rpcgen
+namespace NST
+{
+namespace API
+{
+namespace NFS4
{
-extern "C" {
#ifndef RPCSEC_GSS
-const uint32_t RPCSEC_GSS {6};
+#define RPCSEC_GSS 6
#endif
+
const uint32_t NFS4_FHSIZE {128};
const uint32_t NFS4_VERIFIER_SIZE {8};
const uint32_t NFS4_OPAQUE_LIMIT {1024};
@@ -227,47 +231,52 @@ struct fs_locations4 {
} locations;
};
typedef struct fs_locations4 fs_locations4;
-#define ACL4_SUPPORT_ALLOW_ACL 0x00000001
-#define ACL4_SUPPORT_DENY_ACL 0x00000002
-#define ACL4_SUPPORT_AUDIT_ACL 0x00000004
-#define ACL4_SUPPORT_ALARM_ACL 0x00000008
+
+typedef uint32_t fattr4_aclsupport;
+const fattr4_aclsupport ACL4_SUPPORT_ALLOW_ACL {0x00000001};
+const fattr4_aclsupport ACL4_SUPPORT_DENY_ACL {0x00000002};
+const fattr4_aclsupport ACL4_SUPPORT_AUDIT_ACL {0x00000004};
+const fattr4_aclsupport ACL4_SUPPORT_ALARM_ACL {0x00000008};
typedef uint32_t acetype4;
-#define ACE4_ACCESS_ALLOWED_ACE_TYPE 0x00000000
-#define ACE4_ACCESS_DENIED_ACE_TYPE 0x00000001
-#define ACE4_SYSTEM_AUDIT_ACE_TYPE 0x00000002
-#define ACE4_SYSTEM_ALARM_ACE_TYPE 0x00000003
+const acetype4 ACE4_ACCESS_ALLOWED_ACE_TYPE {0x00000000};
+const acetype4 ACE4_ACCESS_DENIED_ACE_TYPE {0x00000001};
+const acetype4 ACE4_SYSTEM_AUDIT_ACE_TYPE {0x00000002};
+const acetype4 ACE4_SYSTEM_ALARM_ACE_TYPE {0x00000003};
typedef uint32_t aceflag4;
-#define ACE4_FILE_INHERIT_ACE 0x00000001
-#define ACE4_DIRECTORY_INHERIT_ACE 0x00000002
-#define ACE4_NO_PROPAGATE_INHERIT_ACE 0x00000004
-#define ACE4_INHERIT_ONLY_ACE 0x00000008
-#define ACE4_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
-#define ACE4_FAILED_ACCESS_ACE_FLAG 0x00000020
-#define ACE4_IDENTIFIER_GROUP 0x00000040
+const aceflag4 ACE4_FILE_INHERIT_ACE {0x00000001};
+const aceflag4 ACE4_DIRECTORY_INHERIT_ACE {0x00000002};
+const aceflag4 ACE4_NO_PROPAGATE_INHERIT_ACE {0x00000004};
+const aceflag4 ACE4_INHERIT_ONLY_ACE {0x00000008};
+const aceflag4 ACE4_SUCCESSFUL_ACCESS_ACE_FLAG {0x00000010};
+const aceflag4 ACE4_FAILED_ACCESS_ACE_FLAG {0x00000020};
+const aceflag4 ACE4_IDENTIFIER_GROUP {0x00000040};
+const aceflag4 ACE4_INHERITED_ACE {0x00000080};
typedef uint32_t acemask4;
-#define ACE4_READ_DATA 0x00000001
-#define ACE4_LIST_DIRECTORY 0x00000001
-#define ACE4_WRITE_DATA 0x00000002
-#define ACE4_ADD_FILE 0x00000002
-#define ACE4_APPEND_DATA 0x00000004
-#define ACE4_ADD_SUBDIRECTORY 0x00000004
-#define ACE4_READ_NAMED_ATTRS 0x00000008
-#define ACE4_WRITE_NAMED_ATTRS 0x00000010
-#define ACE4_EXECUTE 0x00000020
-#define ACE4_DELETE_CHILD 0x00000040
-#define ACE4_READ_ATTRIBUTES 0x00000080
-#define ACE4_WRITE_ATTRIBUTES 0x00000100
-#define ACE4_DELETE 0x00010000
-#define ACE4_READ_ACL 0x00020000
-#define ACE4_WRITE_ACL 0x00040000
-#define ACE4_WRITE_OWNER 0x00080000
-#define ACE4_SYNCHRONIZE 0x00100000
-#define ACE4_GENERIC_READ 0x00120081
-#define ACE4_GENERIC_WRITE 0x00160106
-#define ACE4_GENERIC_EXECUTE 0x001200A0
+const acemask4 ACE4_READ_DATA {0x00000001};
+const acemask4 ACE4_LIST_DIRECTORY {0x00000001};
+const acemask4 ACE4_WRITE_DATA {0x00000002};
+const acemask4 ACE4_ADD_FILE {0x00000002};
+const acemask4 ACE4_APPEND_DATA {0x00000004};
+const acemask4 ACE4_ADD_SUBDIRECTORY {0x00000004};
+const acemask4 ACE4_READ_NAMED_ATTRS {0x00000008};
+const acemask4 ACE4_WRITE_NAMED_ATTRS {0x00000010};
+const acemask4 ACE4_EXECUTE {0x00000020};
+const acemask4 ACE4_DELETE_CHILD {0x00000040};
+const acemask4 ACE4_READ_ATTRIBUTES {0x00000080};
+const acemask4 ACE4_WRITE_ATTRIBUTES {0x00000100};
+const acemask4 ACE4_WRITE_RETENTION {0x00000200};
+const acemask4 ACE4_WRITE_RETENTION_HOLD {0x00000400};
+const acemask4 ACE4_DELETE {0x00010000};
+const acemask4 ACE4_READ_ACL {0x00020000};
+const acemask4 ACE4_WRITE_ACL {0x00040000};
+const acemask4 ACE4_WRITE_OWNER {0x00080000};
+const acemask4 ACE4_SYNCHRONIZE {0x00100000};
+const acemask4 ACE4_GENERIC_READ {0x00120081};
+const acemask4 ACE4_GENERIC_WRITE {0x00160106};
+const acemask4 ACE4_GENERIC_EXECUTE {0x001200A0};
struct nfsace4 {
acetype4 type;
@@ -276,29 +285,29 @@ struct nfsace4 {
utf8str_mixed who;
};
typedef struct nfsace4 nfsace4;
-#define MODE4_SUID 0x800
-#define MODE4_SGID 0x400
-#define MODE4_SVTX 0x200
-#define MODE4_RUSR 0x100
-#define MODE4_WUSR 0x080
-#define MODE4_XUSR 0x040
-#define MODE4_RGRP 0x020
-#define MODE4_WGRP 0x010
-#define MODE4_XGRP 0x008
-#define MODE4_ROTH 0x004
-#define MODE4_WOTH 0x002
-#define MODE4_XOTH 0x001
+const mode4 MODE4_SUID {0x800};
+const mode4 MODE4_SGID {0x400};
+const mode4 MODE4_SVTX {0x200};
+const mode4 MODE4_RUSR {0x100};
+const mode4 MODE4_WUSR {0x080};
+const mode4 MODE4_XUSR {0x040};
+const mode4 MODE4_RGRP {0x020};
+const mode4 MODE4_WGRP {0x010};
+const mode4 MODE4_XGRP {0x008};
+const mode4 MODE4_ROTH {0x004};
+const mode4 MODE4_WOTH {0x002};
+const mode4 MODE4_XOTH {0x001};
struct specdata4 {
uint32_t specdata1;
uint32_t specdata2;
};
typedef struct specdata4 specdata4;
-#define FH4_PERSISTENT 0x00000000
-#define FH4_NOEXPIRE_WITH_OPEN 0x00000001
-#define FH4_VOLATILE_ANY 0x00000002
-#define FH4_VOL_MIGRATION 0x00000004
-#define FH4_VOL_RENAME 0x00000008
+const uint32_t FH4_PERSISTENT {0x00000000};
+const uint32_t FH4_NOEXPIRE_WITH_OPEN {0x00000001};
+const uint32_t FH4_VOLATILE_ANY {0x00000002};
+const uint32_t FH4_VOL_MIGRATION {0x00000004};
+const uint32_t FH4_VOL_RENAME {0x00000008};
typedef bitmap4 fattr4_supported_attrs;
@@ -329,8 +338,6 @@ typedef struct {
nfsace4 *fattr4_acl_val;
} fattr4_acl;
-typedef uint32_t fattr4_aclsupport;
-
typedef bool_t fattr4_archive;
typedef bool_t fattr4_cansettime;
@@ -414,62 +421,62 @@ typedef nfstime4 fattr4_time_metadata;
typedef nfstime4 fattr4_time_modify;
typedef settime4 fattr4_time_modify_set;
-#define FATTR4_SUPPORTED_ATTRS 0
-#define FATTR4_TYPE 1
-#define FATTR4_FH_EXPIRE_TYPE 2
-#define FATTR4_CHANGE 3
-#define FATTR4_SIZE 4
-#define FATTR4_LINK_SUPPORT 5
-#define FATTR4_SYMLINK_SUPPORT 6
-#define FATTR4_NAMED_ATTR 7
-#define FATTR4_FSID 8
-#define FATTR4_UNIQUE_HANDLES 9
-#define FATTR4_LEASE_TIME 10
-#define FATTR4_RDATTR_ERROR 11
-#define FATTR4_FILEHANDLE 19
-#define FATTR4_ACL 12
-#define FATTR4_ACLSUPPORT 13
-#define FATTR4_ARCHIVE 14
-#define FATTR4_CANSETTIME 15
-#define FATTR4_CASE_INSENSITIVE 16
-#define FATTR4_CASE_PRESERVING 17
-#define FATTR4_CHOWN_RESTRICTED 18
-#define FATTR4_FILEID 20
-#define FATTR4_FILES_AVAIL 21
-#define FATTR4_FILES_FREE 22
-#define FATTR4_FILES_TOTAL 23
-#define FATTR4_FS_LOCATIONS 24
-#define FATTR4_HIDDEN 25
-#define FATTR4_HOMOGENEOUS 26
-#define FATTR4_MAXFILESIZE 27
-#define FATTR4_MAXLINK 28
-#define FATTR4_MAXNAME 29
-#define FATTR4_MAXREAD 30
-#define FATTR4_MAXWRITE 31
-#define FATTR4_MIMETYPE 32
-#define FATTR4_MODE 33
-#define FATTR4_NO_TRUNC 34
-#define FATTR4_NUMLINKS 35
-#define FATTR4_OWNER 36
-#define FATTR4_OWNER_GROUP 37
-#define FATTR4_QUOTA_AVAIL_HARD 38
-#define FATTR4_QUOTA_AVAIL_SOFT 39
-#define FATTR4_QUOTA_USED 40
-#define FATTR4_RAWDEV 41
-#define FATTR4_SPACE_AVAIL 42
-#define FATTR4_SPACE_FREE 43
-#define FATTR4_SPACE_TOTAL 44
-#define FATTR4_SPACE_USED 45
-#define FATTR4_SYSTEM 46
-#define FATTR4_TIME_ACCESS 47
-#define FATTR4_TIME_ACCESS_SET 48
-#define FATTR4_TIME_BACKUP 49
-#define FATTR4_TIME_CREATE 50
-#define FATTR4_TIME_DELTA 51
-#define FATTR4_TIME_METADATA 52
-#define FATTR4_TIME_MODIFY 53
-#define FATTR4_TIME_MODIFY_SET 54
-#define FATTR4_MOUNTED_ON_FILEID 55
+const uint32_t FATTR4_SUPPORTED_ATTRS {0};
+const uint32_t FATTR4_TYPE {1};
+const uint32_t FATTR4_FH_EXPIRE_TYPE {2};
+const uint32_t FATTR4_CHANGE {3};
+const uint32_t FATTR4_SIZE {4};
+const uint32_t FATTR4_LINK_SUPPORT {5};
+const uint32_t FATTR4_SYMLINK_SUPPORT {6};
+const uint32_t FATTR4_NAMED_ATTR {7};
+const uint32_t FATTR4_FSID {8};
+const uint32_t FATTR4_UNIQUE_HANDLES {9};
+const uint32_t FATTR4_LEASE_TIME {10};
+const uint32_t FATTR4_RDATTR_ERROR {11};
+const uint32_t FATTR4_FILEHANDLE {19};
+const uint32_t FATTR4_ACL {12};
+const uint32_t FATTR4_ACLSUPPORT {13};
+const uint32_t FATTR4_ARCHIVE {14};
+const uint32_t FATTR4_CANSETTIME {15};
+const uint32_t FATTR4_CASE_INSENSITIVE {16};
+const uint32_t FATTR4_CASE_PRESERVING {17};
+const uint32_t FATTR4_CHOWN_RESTRICTED {18};
+const uint32_t FATTR4_FILEID {20};
+const uint32_t FATTR4_FILES_AVAIL {21};
+const uint32_t FATTR4_FILES_FREE {22};
+const uint32_t FATTR4_FILES_TOTAL {23};
+const uint32_t FATTR4_FS_LOCATIONS {24};
+const uint32_t FATTR4_HIDDEN {25};
+const uint32_t FATTR4_HOMOGENEOUS {26};
+const uint32_t FATTR4_MAXFILESIZE {27};
+const uint32_t FATTR4_MAXLINK {28};
+const uint32_t FATTR4_MAXNAME {29};
+const uint32_t FATTR4_MAXREAD {30};
+const uint32_t FATTR4_MAXWRITE {31};
+const uint32_t FATTR4_MIMETYPE {32};
+const uint32_t FATTR4_MODE {33};
+const uint32_t FATTR4_NO_TRUNC {34};
+const uint32_t FATTR4_NUMLINKS {35};
+const uint32_t FATTR4_OWNER {36};
+const uint32_t FATTR4_OWNER_GROUP {37};
+const uint32_t FATTR4_QUOTA_AVAIL_HARD {38};
+const uint32_t FATTR4_QUOTA_AVAIL_SOFT {39};
+const uint32_t FATTR4_QUOTA_USED {40};
+const uint32_t FATTR4_RAWDEV {41};
+const uint32_t FATTR4_SPACE_AVAIL {42};
+const uint32_t FATTR4_SPACE_FREE {43};
+const uint32_t FATTR4_SPACE_TOTAL {44};
+const uint32_t FATTR4_SPACE_USED {45};
+const uint32_t FATTR4_SYSTEM {46};
+const uint32_t FATTR4_TIME_ACCESS {47};
+const uint32_t FATTR4_TIME_ACCESS_SET {48};
+const uint32_t FATTR4_TIME_BACKUP {49};
+const uint32_t FATTR4_TIME_CREATE {50};
+const uint32_t FATTR4_TIME_DELTA {51};
+const uint32_t FATTR4_TIME_METADATA {52};
+const uint32_t FATTR4_TIME_MODIFY {53};
+const uint32_t FATTR4_TIME_MODIFY_SET {54};
+const uint32_t FATTR4_MOUNTED_ON_FILEID {55};
typedef struct {
u_int attrlist4_len;
@@ -541,12 +548,12 @@ enum nfs_lock_type4 {
WRITEW_LT = 4,
};
typedef enum nfs_lock_type4 nfs_lock_type4;
-#define ACCESS4_READ 0x00000001
-#define ACCESS4_LOOKUP 0x00000002
-#define ACCESS4_MODIFY 0x00000004
-#define ACCESS4_EXTEND 0x00000008
-#define ACCESS4_DELETE 0x00000010
-#define ACCESS4_EXECUTE 0x00000020
+const uint32_t ACCESS4_READ {0x00000001};
+const uint32_t ACCESS4_LOOKUP {0x00000002};
+const uint32_t ACCESS4_MODIFY {0x00000004};
+const uint32_t ACCESS4_EXTEND {0x00000008};
+const uint32_t ACCESS4_DELETE {0x00000010};
+const uint32_t ACCESS4_EXECUTE {0x00000020};
// for compatibility
struct NULL4args
@@ -681,13 +688,13 @@ struct GETATTR4res {
} GETATTR4res_u;
};
typedef struct GETATTR4res GETATTR4res;
-#define DIR_NOTIFICATION_NONE 0x00000000
-#define DIR_NOTIFICATION_CHANGE_ENTRY_ATTRIBUTES 0x00000001
-#define DIR_NOTIFICATION_CHANGE_DIR_ATTRIBUTES 0x00000002
-#define DIR_NOTIFICATION_REMOVE_ENTRY 0x00000004
-#define DIR_NOTIFICATION_ADD_ENTRY 0x00000008
-#define DIR_NOTIFICATION_RENAME_ENTRY 0x00000010
-#define DIR_NOTIFICATION_CHANGE_COOKIE_VERIFIER 0x00000020
+const uint32_t DIR_NOTIFICATION_NONE {0x00000000};
+const uint32_t DIR_NOTIFICATION_CHANGE_ENTRY_ATTRIBUTES {0x00000001};
+const uint32_t DIR_NOTIFICATION_CHANGE_DIR_ATTRIBUTES {0x00000002};
+const uint32_t DIR_NOTIFICATION_REMOVE_ENTRY {0x00000004};
+const uint32_t DIR_NOTIFICATION_ADD_ENTRY {0x00000008};
+const uint32_t DIR_NOTIFICATION_RENAME_ENTRY {0x00000010};
+const uint32_t DIR_NOTIFICATION_CHANGE_COOKIE_VERIFIER {0x00000020};
typedef bitmap4 notification_types4;
@@ -919,13 +926,13 @@ struct nfs_space_limit4 {
} nfs_space_limit4_u;
};
typedef struct nfs_space_limit4 nfs_space_limit4;
-#define OPEN4_SHARE_ACCESS_READ 0x00000001
-#define OPEN4_SHARE_ACCESS_WRITE 0x00000002
-#define OPEN4_SHARE_ACCESS_BOTH 0x00000003
-#define OPEN4_SHARE_DENY_NONE 0x00000000
-#define OPEN4_SHARE_DENY_READ 0x00000001
-#define OPEN4_SHARE_DENY_WRITE 0x00000002
-#define OPEN4_SHARE_DENY_BOTH 0x00000003
+const uint32_t OPEN4_SHARE_ACCESS_READ {0x00000001};
+const uint32_t OPEN4_SHARE_ACCESS_WRITE {0x00000002};
+const uint32_t OPEN4_SHARE_ACCESS_BOTH {0x00000003};
+const uint32_t OPEN4_SHARE_DENY_NONE {0x00000000};
+const uint32_t OPEN4_SHARE_DENY_READ {0x00000001};
+const uint32_t OPEN4_SHARE_DENY_WRITE {0x00000002};
+const uint32_t OPEN4_SHARE_DENY_BOTH {0x00000003};
enum open_delegation_type4 {
OPEN_DELEGATE_NONE = 0,
@@ -1401,87 +1408,91 @@ enum nfs_opnum4 {
};
typedef enum nfs_opnum4 nfs_opnum4;
+union nfs_argop4_u_t {
+ ACCESS4args opaccess;
+ CLOSE4args opclose;
+ COMMIT4args opcommit;
+ CREATE4args opcreate;
+ DELEGPURGE4args opdelegpurge;
+ DELEGRETURN4args opdelegreturn;
+ GETATTR4args opgetattr;
+ LINK4args oplink;
+ LOCK4args oplock;
+ LOCKT4args oplockt;
+ LOCKU4args oplocku;
+ LOOKUP4args oplookup;
+ NVERIFY4args opnverify;
+ OPEN4args opopen;
+ OPENATTR4args opopenattr;
+ OPEN_CONFIRM4args opopen_confirm;
+ OPEN_DOWNGRADE4args opopen_downgrade;
+ PUTFH4args opputfh;
+ READ4args opread;
+ READDIR4args opreaddir;
+ REMOVE4args opremove;
+ RENAME4args oprename;
+ RENEW4args oprenew;
+ SECINFO4args opsecinfo;
+ SETATTR4args opsetattr;
+ SETCLIENTID4args opsetclientid;
+ SETCLIENTID_CONFIRM4args opsetclientid_confirm;
+ VERIFY4args opverify;
+ WRITE4args opwrite;
+ RELEASE_LOCKOWNER4args oprelease_lockowner;
+ GET_DIR_DELEGATION4args opget_dir_delegation;
+};
+
struct nfs_argop4 {
nfs_opnum4 argop;
- union {
- ACCESS4args opaccess;
- CLOSE4args opclose;
- COMMIT4args opcommit;
- CREATE4args opcreate;
- DELEGPURGE4args opdelegpurge;
- DELEGRETURN4args opdelegreturn;
- GETATTR4args opgetattr;
- LINK4args oplink;
- LOCK4args oplock;
- LOCKT4args oplockt;
- LOCKU4args oplocku;
- LOOKUP4args oplookup;
- NVERIFY4args opnverify;
- OPEN4args opopen;
- OPENATTR4args opopenattr;
- OPEN_CONFIRM4args opopen_confirm;
- OPEN_DOWNGRADE4args opopen_downgrade;
- PUTFH4args opputfh;
- READ4args opread;
- READDIR4args opreaddir;
- REMOVE4args opremove;
- RENAME4args oprename;
- RENEW4args oprenew;
- SECINFO4args opsecinfo;
- SETATTR4args opsetattr;
- SETCLIENTID4args opsetclientid;
- SETCLIENTID_CONFIRM4args opsetclientid_confirm;
- VERIFY4args opverify;
- WRITE4args opwrite;
- RELEASE_LOCKOWNER4args oprelease_lockowner;
- GET_DIR_DELEGATION4args opget_dir_delegation;
- } nfs_argop4_u;
+ nfs_argop4_u_t nfs_argop4_u;
};
typedef struct nfs_argop4 nfs_argop4;
+union nfs_resop4_u_t {
+ ACCESS4res opaccess;
+ CLOSE4res opclose;
+ COMMIT4res opcommit;
+ CREATE4res opcreate;
+ DELEGPURGE4res opdelegpurge;
+ DELEGRETURN4res opdelegreturn;
+ GETATTR4res opgetattr;
+ GETFH4res opgetfh;
+ LINK4res oplink;
+ LOCK4res oplock;
+ LOCKT4res oplockt;
+ LOCKU4res oplocku;
+ LOOKUP4res oplookup;
+ LOOKUPP4res oplookupp;
+ NVERIFY4res opnverify;
+ OPEN4res opopen;
+ OPENATTR4res opopenattr;
+ OPEN_CONFIRM4res opopen_confirm;
+ OPEN_DOWNGRADE4res opopen_downgrade;
+ PUTFH4res opputfh;
+ PUTPUBFH4res opputpubfh;
+ PUTROOTFH4res opputrootfh;
+ READ4res opread;
+ READDIR4res opreaddir;
+ READLINK4res opreadlink;
+ REMOVE4res opremove;
+ RENAME4res oprename;
+ RENEW4res oprenew;
+ RESTOREFH4res oprestorefh;
+ SAVEFH4res opsavefh;
+ SECINFO4res opsecinfo;
+ SETATTR4res opsetattr;
+ SETCLIENTID4res opsetclientid;
+ SETCLIENTID_CONFIRM4res opsetclientid_confirm;
+ VERIFY4res opverify;
+ WRITE4res opwrite;
+ RELEASE_LOCKOWNER4res oprelease_lockowner;
+ GET_DIR_DELEGATION4res opget_dir_delegation;
+ ILLEGAL4res opillegal;
+};
+
struct nfs_resop4 {
nfs_opnum4 resop;
- union {
- ACCESS4res opaccess;
- CLOSE4res opclose;
- COMMIT4res opcommit;
- CREATE4res opcreate;
- DELEGPURGE4res opdelegpurge;
- DELEGRETURN4res opdelegreturn;
- GETATTR4res opgetattr;
- GETFH4res opgetfh;
- LINK4res oplink;
- LOCK4res oplock;
- LOCKT4res oplockt;
- LOCKU4res oplocku;
- LOOKUP4res oplookup;
- LOOKUPP4res oplookupp;
- NVERIFY4res opnverify;
- OPEN4res opopen;
- OPENATTR4res opopenattr;
- OPEN_CONFIRM4res opopen_confirm;
- OPEN_DOWNGRADE4res opopen_downgrade;
- PUTFH4res opputfh;
- PUTPUBFH4res opputpubfh;
- PUTROOTFH4res opputrootfh;
- READ4res opread;
- READDIR4res opreaddir;
- READLINK4res opreadlink;
- REMOVE4res opremove;
- RENAME4res oprename;
- RENEW4res oprenew;
- RESTOREFH4res oprestorefh;
- SAVEFH4res opsavefh;
- SECINFO4res opsecinfo;
- SETATTR4res opsetattr;
- SETCLIENTID4res opsetclientid;
- SETCLIENTID_CONFIRM4res opsetclientid_confirm;
- VERIFY4res opverify;
- WRITE4res opwrite;
- RELEASE_LOCKOWNER4res oprelease_lockowner;
- GET_DIR_DELEGATION4res opget_dir_delegation;
- ILLEGAL4res opillegal;
- } nfs_resop4_u;
+ nfs_resop4_u_t nfs_resop4_u;
};
typedef struct nfs_resop4 nfs_resop4;
@@ -1588,256 +1599,21 @@ struct CB_COMPOUND4res {
};
typedef struct CB_COMPOUND4res CB_COMPOUND4res;
-#define NFS4_PROGRAM 100003
-#define NFS_V4 4
-
-#define NFSPROC4_NULL 0
-#define NFSPROC4_COMPOUND 1
-
-#define NFS4_CALLBACK 0x40000000
-#define NFS_CB 1
-
-#define CB_NULL 0
-#define CB_COMPOUND 1
-
-bool_t xdr_nfs_ftype4 (XDR *, nfs_ftype4*);
-bool_t xdr_nfsstat4 (XDR *, nfsstat4*);
-bool_t xdr_bitmap4 (XDR *, bitmap4*);
-bool_t xdr_offset4 (XDR *, offset4*);
-bool_t xdr_count4 (XDR *, count4*);
-bool_t xdr_length4 (XDR *, length4*);
-bool_t xdr_clientid4 (XDR *, clientid4*);
-bool_t xdr_seqid4 (XDR *, seqid4*);
-bool_t xdr_utf8string (XDR *, utf8string*);
-bool_t xdr_utf8str_cis (XDR *, utf8str_cis*);
-bool_t xdr_utf8str_cs (XDR *, utf8str_cs*);
-bool_t xdr_utf8str_mixed (XDR *, utf8str_mixed*);
-bool_t xdr_component4 (XDR *, component4*);
-bool_t xdr_pathname4 (XDR *, pathname4*);
-bool_t xdr_nfs_lockid4 (XDR *, nfs_lockid4*);
-bool_t xdr_nfs_cookie4 (XDR *, nfs_cookie4*);
-bool_t xdr_linktext4 (XDR *, linktext4*);
-bool_t xdr_sec_oid4 (XDR *, sec_oid4*);
-bool_t xdr_qop4 (XDR *, qop4*);
-bool_t xdr_mode4 (XDR *, mode4*);
-bool_t xdr_changeid4 (XDR *, changeid4*);
-bool_t xdr_verifier4 (XDR *, verifier4);
-bool_t xdr_nfstime4 (XDR *, nfstime4*);
-bool_t xdr_time_how4 (XDR *, time_how4*);
-bool_t xdr_settime4 (XDR *, settime4*);
-bool_t xdr_nfs_fh4 (XDR *, nfs_fh4*);
-bool_t xdr_fsid4 (XDR *, fsid4*);
-bool_t xdr_fs_location4 (XDR *, fs_location4*);
-bool_t xdr_fs_locations4 (XDR *, fs_locations4*);
-bool_t xdr_acetype4 (XDR *, acetype4*);
-bool_t xdr_aceflag4 (XDR *, aceflag4*);
-bool_t xdr_acemask4 (XDR *, acemask4*);
-bool_t xdr_nfsace4 (XDR *, nfsace4*);
-bool_t xdr_specdata4 (XDR *, specdata4*);
-bool_t xdr_fattr4_supported_attrs (XDR *, fattr4_supported_attrs*);
-bool_t xdr_fattr4_type (XDR *, fattr4_type*);
-bool_t xdr_fattr4_fh_expire_type (XDR *, fattr4_fh_expire_type*);
-bool_t xdr_fattr4_change (XDR *, fattr4_change*);
-bool_t xdr_fattr4_size (XDR *, fattr4_size*);
-bool_t xdr_fattr4_link_support (XDR *, fattr4_link_support*);
-bool_t xdr_fattr4_symlink_support (XDR *, fattr4_symlink_support*);
-bool_t xdr_fattr4_named_attr (XDR *, fattr4_named_attr*);
-bool_t xdr_fattr4_fsid (XDR *, fattr4_fsid*);
-bool_t xdr_fattr4_unique_handles (XDR *, fattr4_unique_handles*);
-bool_t xdr_fattr4_lease_time (XDR *, fattr4_lease_time*);
-bool_t xdr_fattr4_rdattr_error (XDR *, fattr4_rdattr_error*);
-bool_t xdr_fattr4_acl (XDR *, fattr4_acl*);
-bool_t xdr_fattr4_aclsupport (XDR *, fattr4_aclsupport*);
-bool_t xdr_fattr4_archive (XDR *, fattr4_archive*);
-bool_t xdr_fattr4_cansettime (XDR *, fattr4_cansettime*);
-bool_t xdr_fattr4_case_insensitive (XDR *, fattr4_case_insensitive*);
-bool_t xdr_fattr4_case_preserving (XDR *, fattr4_case_preserving*);
-bool_t xdr_fattr4_chown_restricted (XDR *, fattr4_chown_restricted*);
-bool_t xdr_fattr4_fileid (XDR *, fattr4_fileid*);
-bool_t xdr_fattr4_files_avail (XDR *, fattr4_files_avail*);
-bool_t xdr_fattr4_filehandle (XDR *, fattr4_filehandle*);
-bool_t xdr_fattr4_files_free (XDR *, fattr4_files_free*);
-bool_t xdr_fattr4_files_total (XDR *, fattr4_files_total*);
-bool_t xdr_fattr4_fs_locations (XDR *, fattr4_fs_locations*);
-bool_t xdr_fattr4_hidden (XDR *, fattr4_hidden*);
-bool_t xdr_fattr4_homogeneous (XDR *, fattr4_homogeneous*);
-bool_t xdr_fattr4_maxfilesize (XDR *, fattr4_maxfilesize*);
-bool_t xdr_fattr4_maxlink (XDR *, fattr4_maxlink*);
-bool_t xdr_fattr4_maxname (XDR *, fattr4_maxname*);
-bool_t xdr_fattr4_maxread (XDR *, fattr4_maxread*);
-bool_t xdr_fattr4_maxwrite (XDR *, fattr4_maxwrite*);
-bool_t xdr_fattr4_mimetype (XDR *, fattr4_mimetype*);
-bool_t xdr_fattr4_mode (XDR *, fattr4_mode*);
-bool_t xdr_fattr4_mounted_on_fileid (XDR *, fattr4_mounted_on_fileid*);
-bool_t xdr_fattr4_no_trunc (XDR *, fattr4_no_trunc*);
-bool_t xdr_fattr4_numlinks (XDR *, fattr4_numlinks*);
-bool_t xdr_fattr4_owner (XDR *, fattr4_owner*);
-bool_t xdr_fattr4_owner_group (XDR *, fattr4_owner_group*);
-bool_t xdr_fattr4_quota_avail_hard (XDR *, fattr4_quota_avail_hard*);
-bool_t xdr_fattr4_quota_avail_soft (XDR *, fattr4_quota_avail_soft*);
-bool_t xdr_fattr4_quota_used (XDR *, fattr4_quota_used*);
-bool_t xdr_fattr4_rawdev (XDR *, fattr4_rawdev*);
-bool_t xdr_fattr4_space_avail (XDR *, fattr4_space_avail*);
-bool_t xdr_fattr4_space_free (XDR *, fattr4_space_free*);
-bool_t xdr_fattr4_space_total (XDR *, fattr4_space_total*);
-bool_t xdr_fattr4_space_used (XDR *, fattr4_space_used*);
-bool_t xdr_fattr4_system (XDR *, fattr4_system*);
-bool_t xdr_fattr4_time_access (XDR *, fattr4_time_access*);
-bool_t xdr_fattr4_time_access_set (XDR *, fattr4_time_access_set*);
-bool_t xdr_fattr4_time_backup (XDR *, fattr4_time_backup*);
-bool_t xdr_fattr4_time_create (XDR *, fattr4_time_create*);
-bool_t xdr_fattr4_time_delta (XDR *, fattr4_time_delta*);
-bool_t xdr_fattr4_time_metadata (XDR *, fattr4_time_metadata*);
-bool_t xdr_fattr4_time_modify (XDR *, fattr4_time_modify*);
-bool_t xdr_fattr4_time_modify_set (XDR *, fattr4_time_modify_set*);
-bool_t xdr_attrlist4 (XDR *, attrlist4*);
-bool_t xdr_fattr4 (XDR *, fattr4*);
-bool_t xdr_change_info4 (XDR *, change_info4*);
-bool_t xdr_clientaddr4 (XDR *, clientaddr4*);
-bool_t xdr_cb_client4 (XDR *, cb_client4*);
-bool_t xdr_stateid4 (XDR *, stateid4*);
-bool_t xdr_nfs_client_id4 (XDR *, nfs_client_id4*);
-bool_t xdr_open_owner4 (XDR *, open_owner4*);
-bool_t xdr_lock_owner4 (XDR *, lock_owner4*);
-bool_t xdr_nfs_lock_type4 (XDR *, nfs_lock_type4*);
-bool_t xdr_NULL4args (XDR *, NULL4args*); // for compatibility
-bool_t xdr_NULL4res (XDR *, NULL4res*); // for compatibility
-bool_t xdr_ACCESS4args (XDR *, ACCESS4args*);
-bool_t xdr_ACCESS4resok (XDR *, ACCESS4resok*);
-bool_t xdr_ACCESS4res (XDR *, ACCESS4res*);
-bool_t xdr_CLOSE4args (XDR *, CLOSE4args*);
-bool_t xdr_CLOSE4res (XDR *, CLOSE4res*);
-bool_t xdr_COMMIT4args (XDR *, COMMIT4args*);
-bool_t xdr_COMMIT4resok (XDR *, COMMIT4resok*);
-bool_t xdr_COMMIT4res (XDR *, COMMIT4res*);
-bool_t xdr_createtype4 (XDR *, createtype4*);
-bool_t xdr_CREATE4args (XDR *, CREATE4args*);
-bool_t xdr_CREATE4resok (XDR *, CREATE4resok*);
-bool_t xdr_CREATE4res (XDR *, CREATE4res*);
-bool_t xdr_DELEGPURGE4args (XDR *, DELEGPURGE4args*);
-bool_t xdr_DELEGPURGE4res (XDR *, DELEGPURGE4res*);
-bool_t xdr_DELEGRETURN4args (XDR *, DELEGRETURN4args*);
-bool_t xdr_DELEGRETURN4res (XDR *, DELEGRETURN4res*);
-bool_t xdr_GETATTR4args (XDR *, GETATTR4args*);
-bool_t xdr_GETATTR4resok (XDR *, GETATTR4resok*);
-bool_t xdr_GETATTR4res (XDR *, GETATTR4res*);
-bool_t xdr_notification_types4 (XDR *, notification_types4*);
-bool_t xdr_notification_delay4 (XDR *, notification_delay4*);
-bool_t xdr_dir_delegation_status4 (XDR *, dir_delegation_status4*);
-bool_t xdr_GET_DIR_DELEGATION4args (XDR *, GET_DIR_DELEGATION4args*);
-bool_t xdr_GET_DIR_DELEGATION4resok (XDR *, GET_DIR_DELEGATION4resok*);
-bool_t xdr_GET_DIR_DELEGATION4res (XDR *, GET_DIR_DELEGATION4res*);
-bool_t xdr_GETFH4resok (XDR *, GETFH4resok*);
-bool_t xdr_GETFH4res (XDR *, GETFH4res*);
-bool_t xdr_LINK4args (XDR *, LINK4args*);
-bool_t xdr_LINK4resok (XDR *, LINK4resok*);
-bool_t xdr_LINK4res (XDR *, LINK4res*);
-bool_t xdr_open_to_lock_owner4 (XDR *, open_to_lock_owner4*);
-bool_t xdr_exist_lock_owner4 (XDR *, exist_lock_owner4*);
-bool_t xdr_locker4 (XDR *, locker4*);
-bool_t xdr_LOCK4args (XDR *, LOCK4args*);
-bool_t xdr_LOCK4denied (XDR *, LOCK4denied*);
-bool_t xdr_LOCK4resok (XDR *, LOCK4resok*);
-bool_t xdr_LOCK4res (XDR *, LOCK4res*);
-bool_t xdr_LOCKT4args (XDR *, LOCKT4args*);
-bool_t xdr_LOCKT4res (XDR *, LOCKT4res*);
-bool_t xdr_LOCKU4args (XDR *, LOCKU4args*);
-bool_t xdr_LOCKU4res (XDR *, LOCKU4res*);
-bool_t xdr_LOOKUP4args (XDR *, LOOKUP4args*);
-bool_t xdr_LOOKUP4res (XDR *, LOOKUP4res*);
-bool_t xdr_LOOKUPP4res (XDR *, LOOKUPP4res*);
-bool_t xdr_NVERIFY4args (XDR *, NVERIFY4args*);
-bool_t xdr_NVERIFY4res (XDR *, NVERIFY4res*);
-bool_t xdr_createmode4 (XDR *, createmode4*);
-bool_t xdr_createhow4 (XDR *, createhow4*);
-bool_t xdr_opentype4 (XDR *, opentype4*);
-bool_t xdr_openflag4 (XDR *, openflag4*);
-bool_t xdr_limit_by4 (XDR *, limit_by4*);
-bool_t xdr_nfs_modified_limit4 (XDR *, nfs_modified_limit4*);
-bool_t xdr_nfs_space_limit4 (XDR *, nfs_space_limit4*);
-bool_t xdr_open_delegation_type4 (XDR *, open_delegation_type4*);
-bool_t xdr_open_claim_type4 (XDR *, open_claim_type4*);
-bool_t xdr_open_claim_delegate_cur4 (XDR *, open_claim_delegate_cur4*);
-bool_t xdr_open_claim4 (XDR *, open_claim4*);
-bool_t xdr_OPEN4args (XDR *, OPEN4args*);
-bool_t xdr_open_read_delegation4 (XDR *, open_read_delegation4*);
-bool_t xdr_open_write_delegation4 (XDR *, open_write_delegation4*);
-bool_t xdr_open_delegation4 (XDR *, open_delegation4*);
-bool_t xdr_OPEN4resok (XDR *, OPEN4resok*);
-bool_t xdr_OPEN4res (XDR *, OPEN4res*);
-bool_t xdr_OPENATTR4args (XDR *, OPENATTR4args*);
-bool_t xdr_OPENATTR4res (XDR *, OPENATTR4res*);
-bool_t xdr_OPEN_CONFIRM4args (XDR *, OPEN_CONFIRM4args*);
-bool_t xdr_OPEN_CONFIRM4resok (XDR *, OPEN_CONFIRM4resok*);
-bool_t xdr_OPEN_CONFIRM4res (XDR *, OPEN_CONFIRM4res*);
-bool_t xdr_OPEN_DOWNGRADE4args (XDR *, OPEN_DOWNGRADE4args*);
-bool_t xdr_OPEN_DOWNGRADE4resok (XDR *, OPEN_DOWNGRADE4resok*);
-bool_t xdr_OPEN_DOWNGRADE4res (XDR *, OPEN_DOWNGRADE4res*);
-bool_t xdr_PUTFH4args (XDR *, PUTFH4args*);
-bool_t xdr_PUTFH4res (XDR *, PUTFH4res*);
-bool_t xdr_PUTPUBFH4res (XDR *, PUTPUBFH4res*);
-bool_t xdr_PUTROOTFH4res (XDR *, PUTROOTFH4res*);
-bool_t xdr_READ4args (XDR *, READ4args*);
-bool_t xdr_READ4resok (XDR *, READ4resok*);
-bool_t xdr_READ4res (XDR *, READ4res*);
-bool_t xdr_READDIR4args (XDR *, READDIR4args*);
-bool_t xdr_entry4 (XDR *, entry4*);
-bool_t xdr_dirlist4 (XDR *, dirlist4*);
-bool_t xdr_READDIR4resok (XDR *, READDIR4resok*);
-bool_t xdr_READDIR4res (XDR *, READDIR4res*);
-bool_t xdr_READLINK4resok (XDR *, READLINK4resok*);
-bool_t xdr_READLINK4res (XDR *, READLINK4res*);
-bool_t xdr_REMOVE4args (XDR *, REMOVE4args*);
-bool_t xdr_REMOVE4resok (XDR *, REMOVE4resok*);
-bool_t xdr_REMOVE4res (XDR *, REMOVE4res*);
-bool_t xdr_RENAME4args (XDR *, RENAME4args*);
-bool_t xdr_RENAME4resok (XDR *, RENAME4resok*);
-bool_t xdr_RENAME4res (XDR *, RENAME4res*);
-bool_t xdr_RENEW4args (XDR *, RENEW4args*);
-bool_t xdr_RENEW4res (XDR *, RENEW4res*);
-bool_t xdr_RESTOREFH4res (XDR *, RESTOREFH4res*);
-bool_t xdr_SAVEFH4res (XDR *, SAVEFH4res*);
-bool_t xdr_SECINFO4args (XDR *, SECINFO4args*);
-bool_t xdr_rpc_gss_svc_t (XDR *, rpc_gss_svc_t*);
-bool_t xdr_rpcsec_gss_info (XDR *, rpcsec_gss_info*);
-bool_t xdr_secinfo4 (XDR *, secinfo4*);
-bool_t xdr_SECINFO4resok (XDR *, SECINFO4resok*);
-bool_t xdr_SECINFO4res (XDR *, SECINFO4res*);
-bool_t xdr_SETATTR4args (XDR *, SETATTR4args*);
-bool_t xdr_SETATTR4res (XDR *, SETATTR4res*);
-bool_t xdr_SETCLIENTID4args (XDR *, SETCLIENTID4args*);
-bool_t xdr_SETCLIENTID4resok (XDR *, SETCLIENTID4resok*);
-bool_t xdr_SETCLIENTID4res (XDR *, SETCLIENTID4res*);
-bool_t xdr_SETCLIENTID_CONFIRM4args (XDR *, SETCLIENTID_CONFIRM4args*);
-bool_t xdr_SETCLIENTID_CONFIRM4res (XDR *, SETCLIENTID_CONFIRM4res*);
-bool_t xdr_VERIFY4args (XDR *, VERIFY4args*);
-bool_t xdr_VERIFY4res (XDR *, VERIFY4res*);
-bool_t xdr_stable_how4 (XDR *, stable_how4*);
-bool_t xdr_WRITE4args (XDR *, WRITE4args*);
-bool_t xdr_WRITE4resok (XDR *, WRITE4resok*);
-bool_t xdr_WRITE4res (XDR *, WRITE4res*);
-bool_t xdr_RELEASE_LOCKOWNER4args (XDR *, RELEASE_LOCKOWNER4args*);
-bool_t xdr_RELEASE_LOCKOWNER4res (XDR *, RELEASE_LOCKOWNER4res*);
-bool_t xdr_ILLEGAL4res (XDR *, ILLEGAL4res*);
-bool_t xdr_nfs_opnum4 (XDR *, nfs_opnum4*);
-bool_t xdr_nfs_argop4 (XDR *, nfs_argop4*);
-bool_t xdr_nfs_resop4 (XDR *, nfs_resop4*);
-bool_t xdr_COMPOUND4args (XDR *, COMPOUND4args*);
-bool_t xdr_COMPOUND4res (XDR *, COMPOUND4res*);
-bool_t xdr_CB_GETATTR4args (XDR *, CB_GETATTR4args*);
-bool_t xdr_CB_GETATTR4resok (XDR *, CB_GETATTR4resok*);
-bool_t xdr_CB_GETATTR4res (XDR *, CB_GETATTR4res*);
-bool_t xdr_CB_RECALL4args (XDR *, CB_RECALL4args*);
-bool_t xdr_CB_RECALL4res (XDR *, CB_RECALL4res*);
-bool_t xdr_CB_ILLEGAL4res (XDR *, CB_ILLEGAL4res*);
-bool_t xdr_nfs_cb_opnum4 (XDR *, nfs_cb_opnum4*);
-bool_t xdr_nfs_cb_argop4 (XDR *, nfs_cb_argop4*);
-bool_t xdr_nfs_cb_resop4 (XDR *, nfs_cb_resop4*);
-bool_t xdr_CB_COMPOUND4args (XDR *, CB_COMPOUND4args*);
-bool_t xdr_CB_COMPOUND4res (XDR *, CB_COMPOUND4res*);
-}
-
-} // namespace rpcgen
+const uint32_t NFS4_PROGRAM {100003};
+#define NFS_V4 4
+
+const uint32_t NFSPROC4_NULL {0};
+const uint32_t NFSPROC4_COMPOUND {1};
+
+const uint32_t NFS4_CALLBACK {0x40000000};
+const uint32_t NFS_CB {1};
+
+const uint32_t CB_NULL {0};
+const uint32_t CB_COMPOUND {1};
+
+} // namespace NFS4
+} // namespace API
+} // namespace NST
//------------------------------------------------------------------------------
-#endif //NFS4_TYPES_RPCGEN_H
+#endif//NFS4_TYPES_RPCGEN_H
//------------------------------------------------------------------------------
diff --git a/src/api/nfs_types.h b/src/api/nfs_types.h
index 199d137..49c7719 100644
--- a/src/api/nfs_types.h
+++ b/src/api/nfs_types.h
@@ -27,6 +27,10 @@ namespace NST
namespace API
{
+static const unsigned int NFS_V40 {0};
+static const unsigned int NFS_V41 {1};
+
+//! struct ProcEnumNFS3 - containts all NFSv3 procedures
struct ProcEnumNFS3
{
enum NFSProcedure
@@ -54,9 +58,10 @@ struct ProcEnumNFS3
PATHCONF = 20,
COMMIT = 21
};
- static const int32_t count {22};
+ static const unsigned int count {22}; //!< amount of procedures
};
+//! struct ProcEnumNFS4 - containts all NFSv4.0 procedures and operations
struct ProcEnumNFS4
{
enum NFSProcedure
@@ -102,11 +107,82 @@ struct ProcEnumNFS4
RELEASE_LOCKOWNER = 39,
GET_DIR_DELEGATION = 40,
ILLEGAL = 10044
- // Pleause, keep in mind that in all cases we suppose that NFSv4
+ // Pleause, keep in mind that in all cases we suppose that NFSv4.0
// operation ILLEGAL(10044) has the second position in ProcEnumNFS4
};
- static const int32_t count {41};
- static const int32_t count_proc {2};
+ static const unsigned int count {41}; //!< amount of procedures & operations together
+ static const unsigned int count_proc {2}; //!< amount of procedures
+};
+
+//! struct ProcEnumNFS41 - containts all NFSv4.1 procedures and operations
+struct ProcEnumNFS41
+{
+ enum NFSProcedure
+ {
+ NFS_NULL = 0,
+ COMPOUND = 1,
+ ACCESS = 3,
+ CLOSE = 4,
+ COMMIT = 5,
+ CREATE = 6,
+ DELEGPURGE = 7,
+ DELEGRETURN = 8,
+ GETATTR = 9,
+ GETFH = 10,
+ LINK = 11,
+ LOCK = 12,
+ LOCKT = 13,
+ LOCKU = 14,
+ LOOKUP = 15,
+ LOOKUPP = 16,
+ NVERIFY = 17,
+ OPEN = 18,
+ OPENATTR = 19,
+ OPEN_CONFIRM = 20,
+ OPEN_DOWNGRADE = 21,
+ PUTFH = 22,
+ PUTPUBFH = 23,
+ PUTROOTFH = 24,
+ READ = 25,
+ READDIR = 26,
+ READLINK = 27,
+ REMOVE = 28,
+ RENAME = 29,
+ RENEW = 30,
+ RESTOREFH = 31,
+ SAVEFH = 32,
+ SECINFO = 33,
+ SETATTR = 34,
+ SETCLIENTID = 35,
+ SETCLIENTID_CONFIRM = 36,
+ VERIFY = 37,
+ WRITE = 38,
+ RELEASE_LOCKOWNER = 39,
+ BACKCHANNEL_CTL = 40,
+ BIND_CONN_TO_SESSION = 41,
+ EXCHANGE_ID = 42,
+ CREATE_SESSION = 43,
+ DESTROY_SESSION = 44,
+ FREE_STATEID = 45,
+ GET_DIR_DELEGATION = 46,
+ GETDEVICEINFO = 47,
+ GETDEVICELIST = 48,
+ LAYOUTCOMMIT = 49,
+ LAYOUTGET = 50,
+ LAYOUTRETURN = 51,
+ SECINFO_NO_NAME = 52,
+ SEQUENCE = 53,
+ SET_SSV = 54,
+ TEST_STATEID = 55,
+ WANT_DELEGATION = 56,
+ DESTROY_CLIENTID = 57,
+ RECLAIM_COMPLETE = 58,
+ ILLEGAL = 10044
+ // Pleause, keep in mind that in all cases we suppose that NFSv4.1
+ // operation ILLEGAL(10044) has the second position in ProcEnumNFS41
+ };
+ static const unsigned int count {59}; //!< amount of procedures & operations together
+ static const unsigned int count_proc {2}; //!< amount of procedures
};
} // namespace API
diff --git a/src/api/plugin_api.h.in b/src/api/plugin_api.h.in
index f040912..5f3f020 100644
--- a/src/api/plugin_api.h.in
+++ b/src/api/plugin_api.h.in
@@ -1,8 +1,8 @@
//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
+// Author: Dzianis Huznou (Alexey Costroma)
// Description: Unique Plugin-API interface header.
// Aggregated all definitions for plugins' development
-// Copyright (c) 2013 EPAM Systems
+// Copyright (c) 2013-2015 EPAM Systems
//------------------------------------------------------------------------------
/*
This file is part of Nfstrace.
@@ -25,37 +25,96 @@
//------------------------------------------------------------------------------
#include <iostream>
-#include "ianalyzer_type.h"
+#include "cifs_commands.h"
+#include "cifs2_commands.h"
+#include "ianalyzer.h"
#include "nfs_types.h"
#include "nfs3_types_rpcgen.h"
#include "nfs4_types_rpcgen.h"
+#include "nfs41_types_rpcgen.h"
//------------------------------------------------------------------------------
#define NST_PUBLIC __attribute__ ((visibility("default")))
-#define NST_PLUGIN_ENTRY_POINTS(U, C, D) \
+/*! Macro is used to register nfstrace plugin
+ *
+ * \param U - plugin_usage_func
+ * \param C - plugin_create_func
+ * \param D - plugin_destroy_func
+ * \param G - plugin_requirements_func
+ */
+#define NST_PLUGIN_ENTRY_POINTS(U, C, D, G) \
NST_PUBLIC \
const plugin_entry_points* nst_get_entry_points() \
{ \
static const plugin_entry_points entry_points \
- {NST_PLUGIN_API_VERSION, sizeof(plugin_entry_points), U, C, D }; \
+ {NST_PLUGIN_API_VERSION, sizeof(plugin_entry_points), U, C, D, G}; \
return &entry_points; \
}
//------------------------------------------------------------------------------
using namespace NST::API;
//------------------------------------------------------------------------------
+//! Analyzer requirements structure
+struct AnalyzerRequirements
+{
+ const bool silence; //!< Exclusive control over standard output is required.
+ //! Constructs analyzer requirements
+ /*!
+ * \param exclusive_stdout Exclusive control over standard output is required
+ */
+ AnalyzerRequirements(bool v = false)
+ : silence{v}
+ {}
+};
+//------------------------------------------------------------------------------
extern "C"
{
// These calls implemented by nfstrace
+
+/*! Returns CIFSv1 command name by code
+ *
+ * \param cmd_code Command code
+ */
+const char* print_cifs1_procedures(SMBv1::SMBv1Commands cmd_code);
+
+/*! Returns CIFSv2 command name by code
+ *
+ * \param cmd_code Command code
+ */
+const char* print_cifs2_procedures(SMBv2::SMBv2Commands cmd_code);
+
+/*! Returns NFSv3 command name by procedure id
+ *
+ * \param proc ProcEnumNFS3::NFSProcedure procedure
+ */
const char* print_nfs3_procedures(const ProcEnumNFS3::NFSProcedure proc);
+
+/*! Returns NFSv4 command name by procedure id
+ *
+ * \param proc ProcEnumNFS4::NFSProcedure procedure
+ */
const char* print_nfs4_procedures(const ProcEnumNFS4::NFSProcedure proc);
+
+/*! Returns NFSv41 command name by procedure id
+ *
+ * \param proc ProcEnumNFS41::NFSProcedure procedure
+ */
+const char* print_nfs41_procedures(const ProcEnumNFS41::NFSProcedure proc);
+
+/*! Prints session information to out
+ *
+ * \param out output stream
+ * \param session session object
+ */
void print_session(std::ostream& out, const Session& session);
+
void print_nfs_fh(std::ostream& out, const char* const val, const uint32_t len);
}
// These functions must be implemented by pluggable analysis module
// Pointers to these functions must be passed to NST_PLUGIN_ENTRY_POINTS() macro
-using plugin_usage_func = const char* (*)(); // return description of options for create(opts)
-using plugin_create_func = IAnalyzer* (*)(const char*); // create an instance of an Analyzer
-using plugin_destroy_func = void (*)(IAnalyzer*); // destroy instance of an Analyzer
+using plugin_usage_func = const char* (*)(); // return description of options for create(opts)
+using plugin_create_func = IAnalyzer* (*)(const char*); // create an instance of an Analyzer
+using plugin_destroy_func = void (*)(IAnalyzer*); // destroy instance of an Analyzer
+using plugin_requirements_func = const AnalyzerRequirements* (*)(); // return Analyzer's requirements
struct plugin_entry_points
{
@@ -64,6 +123,7 @@ struct plugin_entry_points
plugin_usage_func usage;
plugin_create_func create;
plugin_destroy_func destroy;
+ plugin_requirements_func requirements;
};
// The NST_PLUGIN_ENTRY_POINTS macro defines this function
@@ -74,5 +134,5 @@ constexpr uint32_t NST_PLUGIN_API_VERSION = @NST_V_MAJOR@ * 1000
+ @NST_V_PATCH@;
//------------------------------------------------------------------------------
-#endif //PLUGIN_API_H
+#endif//PLUGIN_API_H
//------------------------------------------------------------------------------
diff --git a/src/api/rpc_procedure.h b/src/api/procedure.h
index 820b8ea..4401658 100644
--- a/src/api/rpc_procedure.h
+++ b/src/api/procedure.h
@@ -1,6 +1,6 @@
//------------------------------------------------------------------------------
-// Author: Dzianis Huznou
-// Description: Presentation info about ISO/OSI layers up to RPC protocol.
+// Author: Andrey Kuznetsov
+// Description: Abstraction of operation (CIFS or NFS)
// Copyright (c) 2013 EPAM Systems
//------------------------------------------------------------------------------
/*
@@ -19,13 +19,11 @@
along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
-#ifndef RPC_PROCEDURE_H
-#define RPC_PROCEDURE_H
+#ifndef PROCEDURE_H
+#define PROCEDURE_H
//------------------------------------------------------------------------------
-#include <rpc/rpc_msg.h>
#include <sys/time.h>
-#include "rpc_types.h"
#include "session.h"
//------------------------------------------------------------------------------
namespace NST
@@ -33,10 +31,11 @@ namespace NST
namespace API
{
-struct RPCProcedure
+template<typename ProcedureType>
+struct Procedure
{
- struct rpc_msg rpc_call;
- struct rpc_msg rpc_reply;
+ ProcedureType call;
+ ProcedureType reply;
const struct Session* session;
const struct timeval* ctimestamp;
@@ -46,5 +45,5 @@ struct RPCProcedure
} // namespace API
} // namespace NST
//------------------------------------------------------------------------------
-#endif//RPC_PROCEDURE_H
+#endif//PROCEDURE_H
//------------------------------------------------------------------------------
diff --git a/src/api/rpc_types.h b/src/api/rpc_types.h
index 0b11260..7d2e1a9 100644
--- a/src/api/rpc_types.h
+++ b/src/api/rpc_types.h
@@ -23,6 +23,7 @@
#ifndef RPC_TYPES_H
#define RPC_TYPES_H
//------------------------------------------------------------------------------
+#include "procedure.h"
#include "xdr_types.h"
//------------------------------------------------------------------------------
namespace NST
@@ -30,6 +31,8 @@ namespace NST
namespace API
{
+using RPCProcedure = Procedure<struct rpc_msg>;
+
const uint32_t SUNRPC_MSG_VERSION = 2;
enum MsgType : int32_t
diff --git a/src/controller/cmdline_args.cpp b/src/controller/cmdline_args.cpp
index 72cfbc9..91e2122 100644
--- a/src/controller/cmdline_args.cpp
+++ b/src/controller/cmdline_args.cpp
@@ -42,8 +42,8 @@ const char* const Args::draining_mode {DRAIN};
Opt Args::options[Args::num] =
{
{'m', "mode", Opt::REQ, LIVE, "set the running mode", DRAIN "|" LIVE "|" DUMP "|" STAT, nullptr, false},
- {'i', "interface", Opt::REQ, "PCAP-DEFAULT", "listen interface, it is required for " LIVE " and " DUMP " modes", "INTERFACE", nullptr, false},
- {'f', "filtration", Opt::REQ, "port 2049", "specify the packet filter in BPF syntax(see pcap-filter(7))", "BPF", nullptr, false},
+ {'i', "interface", Opt::REQ, "FIRST-NIC", "listen interface, it is required for " LIVE " and " DUMP " modes", "INTERFACE", nullptr, false},
+ {'f', "filtration", Opt::REQ, "port 2049 or port 445","specify the packet filter in BPF syntax(see pcap-filter(7))", "BPF", nullptr, false},
{'s', "snaplen", Opt::REQ, "65535", "set the max length of captured raw packet (bigger packets will be truncated). Can be used ONLY FOR UDP", "1..65535", nullptr, false},
{'t', "timeout", Opt::REQ, "100", "set the read timeout that will be used while capturing", "Milliseconds", nullptr, false},
{'b', "bsize", Opt::REQ, "20", "set the size of operation system capture buffer in MBytes; note that this option is crucial for capturing performance", "MBytes", nullptr, false},
@@ -55,11 +55,11 @@ Opt Args::options[Args::num] =
{ 0 , "log", Opt::REQ, "nfstrace.log", "specify the log file", "PATH", nullptr, false},
{'C', "command", Opt::REQ, "", "execute command for each dumped file", "\"shell command\"", nullptr, false},
{'D', "dump-size", Opt::REQ, "0", "set the size of dumping file portion, 0 means no limit", "MBytes", nullptr, false},
- {'L', "list", Opt::NOA, "false", "list all available network interfaces and exit", nullptr, nullptr, false},
+ {'E', "enum", Opt::REQ, "none", "enumerate all available network interfaces and/or all available plugins, then exit", "interfaces|plugins|-", nullptr, false},
{'M', "msg-header", Opt::REQ, "512", "Truncate RPC messages to this limit (specified in bytes) before passing to a pluggable analysis module", "1..4000", nullptr, false},
{'Q', "qcapacity", Opt::REQ, "4096", "set the initial capacity of the queue with RPC messages", "1..65535", nullptr, false},
{'T', "trace", Opt::NOA, "false", "print collected NFSv3 or NFSv4 procedures, true if no modules were passed with -a option", nullptr, nullptr, false},
- {'Z', "droproot", Opt::REQ, "", "drop root privileges after opening the capture device", "username", nullptr, false},
+ {'Z', "droproot", Opt::REQ, "", "drop root privileges after opening the capture device", "username", nullptr, false},
{'v', "verbose", Opt::REQ, "1", "specify verbosity level", "0|1|2", nullptr, false},
{'h', "help", Opt::NOA, "false", "print help message and usage for modules passed with -a options, then exit", nullptr, nullptr, false}
};
diff --git a/src/controller/cmdline_args.h b/src/controller/cmdline_args.h
index 6a7b1d9..cbedbfc 100644
--- a/src/controller/cmdline_args.h
+++ b/src/controller/cmdline_args.h
@@ -37,27 +37,27 @@ struct Args
enum Names
{
- MODE,
- INTERFACE,
- FILTER,
- SNAPLEN,
- TIMEOUT,
- BSIZE,
- PROMISC,
- DIRECTION,
- ANALYZERS,
- IFILE,
- OFILE,
- LOGPATH,
- COMMAND,
- DSIZE,
- LIST,
- MSIZE,
- QSIZE,
- TRACE,
- DROPROOT,
- VERBOSE,
- HELP,
+ ArgMode,
+ ArgInterface,
+ ArgFilter,
+ ArgSnaplen,
+ ArgTimeout,
+ ArgBSize,
+ ArgPromisc,
+ ArgDirection,
+ ArgAnalyzers,
+ ArgIFile,
+ ArgOFile,
+ ArgLogPath,
+ ArgCommand,
+ ArgDSize,
+ ArgEnum,
+ ArgMSize,
+ ArgQSize,
+ ArgTrace,
+ ArgDropRoot,
+ ArgVerbose,
+ ArgHelp,
num
};
@@ -65,7 +65,6 @@ struct Args
static const char* const dumping_mode;
static const char* const analysis_mode;
static const char* const draining_mode;
-
private:
static Opt options[num];
@@ -76,5 +75,5 @@ private:
} // namespace controller
} // namespace NST
//------------------------------------------------------------------------------
-#endif //CMDLINE_PARSER_H
+#endif//CMDLINE_PARSER_H
//------------------------------------------------------------------------------
diff --git a/src/controller/controller.cpp b/src/controller/controller.cpp
index 80611c9..2023889 100644
--- a/src/controller/controller.cpp
+++ b/src/controller/controller.cpp
@@ -70,6 +70,8 @@ Controller::Controller(const Parameters& params) try
case RunningMode::Profiling:
{
analysis.reset(new AnalysisManager{status, params});
+ if(analysis->isSilent())
+ utils::Out::Global::set_level(utils::Out::Level::Silent);
filtration->add_online_analysis(params, analysis->get_queue());
}
@@ -82,6 +84,8 @@ Controller::Controller(const Parameters& params) try
case RunningMode::Analysis:
{
analysis.reset(new AnalysisManager{status, params});
+ if(analysis->isSilent())
+ utils::Out::Global::set_level(utils::Out::Level::Silent);
filtration->add_offline_analysis(params.input_file(),
analysis->get_queue());
@@ -125,6 +129,18 @@ int Controller::run()
{
glog.reopen();
}
+ else if(s.signal_number == SIGWINCH)
+ {
+ analysis->on_unix_signal(s.signal_number);
+ }
+ else if(s.signal_number == SIGINT)
+ {
+ throw ProcessingDone{std::string{"Interrupted by user."}};
+ }
+ else if(s.signal_number == SIGTERM)
+ {
+ throw ProcessingDone{std::string{"Interrupted by SIGTERM."}};
+ }
else
{
throw ProcessingDone{std::string{"Unhandled signal presents: "} + s.what()};
@@ -214,7 +230,7 @@ void droproot(const std::string& dropuser)
{
if(utils::Out message{})
{
- message << "Superuser privileges can not be dropped.";
+ message << "Error dropping superuser privileges: " << e.what();
}
throw;
}
diff --git a/src/controller/parameters.cpp b/src/controller/parameters.cpp
index b822361..809c224 100644
--- a/src/controller/parameters.cpp
+++ b/src/controller/parameters.cpp
@@ -21,6 +21,7 @@
//------------------------------------------------------------------------------
#include <iostream>
+#include <dirent.h>
#include <unistd.h>
#include "analysis/plugin.h"
@@ -50,7 +51,7 @@ class ParametersImpl : public cmdline::CmdlineParser<CLI>
: rpc_message_limit{0}
{
parse(argc, argv);
- if(get(CLI::HELP).to_bool())
+ if(get(CLI::ArgHelp).to_bool())
{
std::cout << PROGRAM_BUILD_INFO << std::endl;
print_usage(std::cout, argv[0]);
@@ -68,12 +69,13 @@ class ParametersImpl : public cmdline::CmdlineParser<CLI>
std::cout << e.what() << std::endl;
}
}
- return;
}
validate();
- if(get(CLI::LIST).to_bool())
+ if(get(CLI::ArgEnum).is("-") || get(CLI::ArgEnum).is("interfaces"))
{
+ std::cout << "\nAvailable interfaces:" << std::endl;
+
NST::filtration::pcap::NetworkInterfaces interfaces;
if(interfaces.begin() != interfaces.end())
{
@@ -91,15 +93,48 @@ class ParametersImpl : public cmdline::CmdlineParser<CLI>
}
}
+ if(get(CLI::ArgEnum).is("-") || get(CLI::ArgEnum).is("plugins"))
+ {
+ std::cout << "\nAvailable plugins:" << std::endl;
+ DIR *dir;
+
+ if((dir = opendir(MODULES_DIRECTORY_PATH)) != nullptr)
+ {
+ struct dirent *ent;
+ while((ent = readdir(dir)) != nullptr)
+ {
+ std::string full_path = std::string{MODULES_DIRECTORY_PATH}
+ + ent->d_name;
+ std::string plugin_usage;
+ try
+ {
+ plugin_usage = NST::analysis::Plugin::usage_of(full_path);
+
+ std::cout << ent->d_name << ":" << std::endl;
+ std::cout << plugin_usage << std::endl;
+ std::cout << std::endl;
+ }
+ catch(std::runtime_error& e) { }
+ }
+ closedir(dir);
+ }
+ else
+ {
+ std::cerr << "Error: Can't access " << MODULES_DIRECTORY_PATH <<std::endl;
+ }
+ }
+
+ if(!get(CLI::ArgEnum).is("none")) return;
+
// cashed values
const std::string program_path(argv[0]);
size_t found {program_path.find_last_of("/\\")};
program = program_path.substr(found+1);
- const int limit {get(CLI::MSIZE).to_int()};
+ const int limit {get(CLI::ArgMSize).to_int()};
if(limit < 1 || limit > 4000)
{
- throw cmdline::CLIError{std::string{"Invalid limit of RPC messages: "} + get(CLI::MSIZE).to_cstr()};
+ throw cmdline::CLIError{std::string{"Invalid limit of RPC messages: "} + get(CLI::ArgMSize).to_cstr()};
}
rpc_message_limit = limit;
@@ -111,7 +146,7 @@ class ParametersImpl : public cmdline::CmdlineParser<CLI>
protected:
void set_multiple_value(int index, char *const v) override
{
- if(index == CLI::ANALYZERS) // may have multiple values
+ if(index == CLI::ArgAnalyzers) // may have multiple values
{
const std::string arg{v};
size_t ind {arg.find('#')};
@@ -134,7 +169,7 @@ private:
// create string: PROGRAMNAME-BPF-FILTER.pcap
std::string str { impl->program };
str.push_back('-');
- str.append(get(CLI::FILTER).to_cstr());
+ str.append(get(CLI::ArgFilter).to_cstr());
str.append(".pcap");
std::replace(str.begin(), str.end(), ' ', '-');
return str;
@@ -178,12 +213,12 @@ Parameters::~Parameters()
bool Parameters::show_help() const
{
- return impl->get(CLI::HELP).to_bool();
+ return impl->get(CLI::ArgHelp).to_bool();
}
-bool Parameters::show_list() const
+bool Parameters::show_enum() const
{
- return impl->get(CLI::LIST).to_bool();
+ return !impl->get(CLI::ArgEnum).is("none");
}
const std::string& Parameters::program_name() const
@@ -193,7 +228,7 @@ const std::string& Parameters::program_name() const
RunningMode Parameters::running_mode() const
{
- const auto& mode = impl->get(CLI::MODE);
+ const auto& mode = impl->get(CLI::ArgMode);
if(mode.is(CLI::profiling_mode))
{
return RunningMode::Profiling;
@@ -216,26 +251,26 @@ RunningMode Parameters::running_mode() const
std::string Parameters::input_file() const
{
// TODO: add file validation
- return impl->is_default(CLI::IFILE) ? impl->default_iofile() : impl->get(CLI::IFILE);
+ return impl->is_default(CLI::ArgIFile) ? impl->default_iofile() : impl->get(CLI::ArgIFile);
}
const std::string Parameters::dropuser() const
{
- return impl->get(CLI::DROPROOT);
+ return impl->get(CLI::ArgDropRoot);
}
const std::string Parameters::log_path() const
{
- return impl->get(CLI::LOGPATH);
+ return impl->get(CLI::ArgLogPath);
}
unsigned short Parameters::queue_capacity() const
{
- const int capacity = impl->get(CLI::QSIZE).to_int();
+ const int capacity = impl->get(CLI::ArgQSize).to_int();
if(capacity < 1 || capacity > 65535)
{
throw cmdline::CLIError(std::string{"Invalid value of queue capacity: "}
- + impl->get(CLI::QSIZE).to_cstr());
+ + impl->get(CLI::ArgQSize).to_cstr());
}
return capacity;
@@ -244,26 +279,26 @@ unsigned short Parameters::queue_capacity() const
bool Parameters::trace() const
{
// enable tracing if no analysis module was passed
- return impl->get(CLI::TRACE).to_bool() || impl->analysis_modules.empty();
+ return impl->get(CLI::ArgTrace).to_bool() || impl->analysis_modules.empty();
}
int Parameters::verbose_level() const
{
- return impl->get(CLI::VERBOSE).to_int();
+ return impl->get(CLI::ArgVerbose).to_int();
}
const Parameters::CaptureParams Parameters::capture_params() const
{
Parameters::CaptureParams params;
- params.interface = impl->get(CLI::INTERFACE);
- params.filter = impl->get(CLI::FILTER);
- params.snaplen = impl->get(CLI::SNAPLEN).to_int();
- params.timeout_ms = impl->get(CLI::TIMEOUT).to_int();
- params.buffer_size = impl->get(CLI::BSIZE).to_int() * 1024 * 1024; // MBytes
- params.promisc = impl->get(CLI::PROMISC).to_bool();
+ params.interface = impl->get(CLI::ArgInterface);
+ params.filter = impl->get(CLI::ArgFilter);
+ params.snaplen = impl->get(CLI::ArgSnaplen).to_int();
+ params.timeout_ms = impl->get(CLI::ArgTimeout).to_int();
+ params.buffer_size = impl->get(CLI::ArgBSize).to_int() * 1024 * 1024; // MBytes
+ params.promisc = impl->get(CLI::ArgPromisc).to_bool();
// check interface
- if(impl->is_default(CLI::INTERFACE))
+ if(impl->is_default(CLI::ArgInterface))
{
params.interface = NST::filtration::pcap::NetworkInterfaces::default_device();
}
@@ -272,25 +307,25 @@ const Parameters::CaptureParams Parameters::capture_params() const
if(params.buffer_size < 1024 * 1024) // less than 1 MBytes
{
throw cmdline::CLIError{std::string{"Invalid value of kernel buffer size: "}
- + impl->get(CLI::BSIZE).to_cstr()};
+ + impl->get(CLI::ArgBSize).to_cstr()};
}
// check max length of raw captured UDP packet
if(params.snaplen < 1 || params.snaplen > 65535)
{
throw cmdline::CLIError{std::string{"Invalid value of max length of raw captured UDP packet: "}
- + impl->get(CLI::SNAPLEN).to_cstr()};
+ + impl->get(CLI::ArgSnaplen).to_cstr()};
}
// check the read timeout that will be used on a capture
if(params.timeout_ms < 1)
{
throw cmdline::CLIError{std::string{"Invalid value of read timeout that will be used on a capture: "}
- + impl->get(CLI::TIMEOUT).to_cstr()};
+ + impl->get(CLI::ArgTimeout).to_cstr()};
}
// check and set capture direction
- const auto& direction = impl->get(CLI::DIRECTION);
+ const auto& direction = impl->get(CLI::ArgDirection);
if(direction.is("in"))
{
params.direction = decltype(params.direction)::IN;
@@ -314,10 +349,10 @@ const Parameters::CaptureParams Parameters::capture_params() const
const Parameters::DumpingParams Parameters::dumping_params() const
{
- std::string ofile = impl->is_default(CLI::OFILE) ? impl->default_iofile() : impl->get(CLI::OFILE);
+ std::string ofile = impl->is_default(CLI::ArgOFile) ? impl->default_iofile() : impl->get(CLI::ArgOFile);
// TODO: add file validation
- const int dsize = impl->get(CLI::DSIZE).to_int();
+ const int dsize = impl->get(CLI::ArgDSize).to_int();
if(dsize != 0 && ofile == "-") // '-' is alias for stdout in libpcap dumps
{
throw cmdline::CLIError{std::string{"Output file \"-\" means stdout, the dump-size must be 0"}};
@@ -325,7 +360,7 @@ const Parameters::DumpingParams Parameters::dumping_params() const
Parameters::DumpingParams params;
params.output_file = ofile;
- params.command = impl->get(CLI::COMMAND);
+ params.command = impl->get(CLI::ArgCommand);
params.size_limit = dsize * 1024 * 1024; // MBytes
return params;
}
diff --git a/src/controller/parameters.h b/src/controller/parameters.h
index 0256033..0732a29 100644
--- a/src/controller/parameters.h
+++ b/src/controller/parameters.h
@@ -50,6 +50,14 @@ struct AParams
const std::string args;
};
+/*! Protocol to analysis
+ */
+enum class NetProtocol
+{
+ NFS = 0x01, //!< NFS protocol
+ CIFS = 0x02 //!< CIFS protocol
+};
+
class Parameters
{
using CaptureParams = filtration::pcap::CaptureReader::Params;
@@ -64,7 +72,7 @@ public:
Parameters& operator=(const Parameters&) = delete;
bool show_help() const;
- bool show_list() const;
+ bool show_enum() const;
// access helpers
const std::string& program_name() const;
@@ -78,12 +86,11 @@ public:
const CaptureParams capture_params() const;
const DumpingParams dumping_params() const;
const std::vector<AParams>& analysis_modules() const;
-
static unsigned short rpcmsg_limit();
};
} // namespace controller
} // namespace NST
//------------------------------------------------------------------------------
-#endif //PARAMETERS_H
+#endif//PARAMETERS_H
//------------------------------------------------------------------------------
diff --git a/src/controller/running_status.h b/src/controller/running_status.h
index 6d87877..2dd928d 100644
--- a/src/controller/running_status.h
+++ b/src/controller/running_status.h
@@ -119,5 +119,5 @@ private:
} // namespace controller
} // namespace NST
//------------------------------------------------------------------------------
-#endif //RUNNING_STATUS_H
+#endif//RUNNING_STATUS_H
//------------------------------------------------------------------------------
diff --git a/src/controller/signal_handler.cpp b/src/controller/signal_handler.cpp
index edfa98a..f7fdf7a 100644
--- a/src/controller/signal_handler.cpp
+++ b/src/controller/signal_handler.cpp
@@ -69,10 +69,6 @@ static void handle_signals(const sigset_t waitmask,
"error in SignalHandler wait"});
}
}
- else if(signo == SIGINT)
- {
- status.push(ProcessingDone{"Interrupted by user."});
- }
else
{
status.push(SignalHandler::Signal{signo});
@@ -99,9 +95,11 @@ SignalHandler::SignalHandler(RunningStatus& s)
sigset_t mask;
::sigemptyset(&mask);
- ::sigaddset(&mask, SIGINT); // correct exit from program by Ctrl-C
- ::sigaddset(&mask, SIGCHLD); // stop sigwait-thread and wait children
- ::sigaddset(&mask, SIGHUP); // signal for losing terminal
+ ::sigaddset(&mask, SIGINT); // correct exit from program by Ctrl-C
+ ::sigaddset(&mask, SIGTERM); // correct exit when SIGTERM has been received
+ ::sigaddset(&mask, SIGCHLD); // stop sigwait-thread and wait children
+ ::sigaddset(&mask, SIGHUP); // signal for losing terminal
+ ::sigaddset(&mask, SIGWINCH); // signal for changing terminal size
const int err = ::pthread_sigmask(SIG_BLOCK, &mask, nullptr);
if(err != 0)
{
diff --git a/src/controller/signal_handler.h b/src/controller/signal_handler.h
index b7cebbe..2f98ddf 100644
--- a/src/controller/signal_handler.h
+++ b/src/controller/signal_handler.h
@@ -58,4 +58,3 @@ private:
//------------------------------------------------------------------------------
#endif//SIGNAL_HANDLER_H
//------------------------------------------------------------------------------
-
diff --git a/src/filtration/cifs_filtrator.h b/src/filtration/cifs_filtrator.h
new file mode 100644
index 0000000..4ad0c18
--- /dev/null
+++ b/src/filtration/cifs_filtrator.h
@@ -0,0 +1,169 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Generic processor for filtration raw pcap packets.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFS_FILTRATOR_H
+#define CIFS_FILTRATOR_H
+//------------------------------------------------------------------------------
+#include <algorithm>
+#include <cassert>
+
+#include <pcap/pcap.h>
+
+#include "filtration/packet.h"
+#include "filtration/filtratorimpl.h"
+#include "protocols/cifs/cifs.h"
+#include "protocols/cifs2/cifs2.h"
+#include "protocols/netbios/netbios.h"
+#include "utils/log.h"
+#include "api/cifs2_commands.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace filtration
+{
+
+using SMBv2Commands = NST::API::SMBv2::SMBv2Commands;
+
+template<typename Writer>
+class CIFSFiltrator : public FiltratorImpl<CIFSFiltrator<Writer>, Writer>
+{
+ using BaseImpl = FiltratorImpl<CIFSFiltrator<Writer>, Writer>;
+ size_t rw_hdr_max {512}; // limit for SMB header to truncate messages
+public:
+
+ CIFSFiltrator()
+ : BaseImpl()
+ {
+ }
+
+ constexpr static size_t lengthOfReplyHeader()
+ {
+ return lengthOfBaseHeader();
+ }
+
+ constexpr static size_t lengthOfCallHeader()
+ {
+ return lengthOfBaseHeader();
+ }
+
+ inline void set_writer(utils::NetworkSession* session_ptr, Writer* w, uint32_t max_hdr)
+ {
+ rw_hdr_max = max_hdr;
+ BaseImpl::setWriterImpl(session_ptr, w, max_hdr);
+ }
+
+ constexpr static size_t lengthOfBaseHeader()
+ {
+ return sizeof(NetBIOS::MessageHeader) + sizeof(CIFSv1::MessageHeaderHead);
+ }
+
+ constexpr static size_t lengthOfFirstSkipedPart()
+ {
+ return sizeof(NetBIOS::MessageHeader);
+ }
+
+ inline static bool isCIFSV1Header(const uint8_t* header)
+ {
+ return CIFSv1::get_header(header + sizeof(NetBIOS::MessageHeader)) != nullptr;
+ }
+
+ inline static bool isCIFSV2Header(const uint8_t* header)
+ {
+ return CIFSv2::get_header(header + sizeof(NetBIOS::MessageHeader)) != nullptr;
+ }
+
+ inline static bool isRightHeader(const uint8_t* header)
+ {
+ return NetBIOS::get_header(header) && (isCIFSV1Header(header) || isCIFSV2Header(header));
+ }
+
+ inline bool collect_header(PacketInfo& info, typename Writer::Collection& collection)
+ {
+ size_t length = 0;
+ if(collection && collection.data_size() >= lengthOfBaseHeader())
+ { //enough data is copied from previous packets to see its type
+ if(isCIFSV1Header(collection.data()))
+ {
+ length = sizeof(NetBIOS::MessageHeader) + sizeof(CIFSv1::RawMessageHeader);
+ }
+ else if(isCIFSV2Header(collection.data()))
+ {
+ length = sizeof(NetBIOS::MessageHeader) + sizeof(CIFSv2::RawMessageHeader);
+ }
+ else
+ { //got header but it is not CIFS
+ collection.reset();//dismiss copied data
+ info.dlen = 0;//skip entire packet
+ return false;
+ }
+ return BaseImpl::collect_header(info, length, length);
+ }
+ BaseImpl::collect_header(info, lengthOfBaseHeader(), lengthOfBaseHeader());//try to read base header
+ return false;//continue to read full header
+ }
+
+ inline bool find_and_read_message(PacketInfo& info, typename Writer::Collection& collection)
+ {
+ if (const NetBIOS::MessageHeader* nb_header = NetBIOS::get_header(collection.data()))
+ {
+ const size_t length = nb_header->len() + sizeof(NetBIOS::MessageHeader);
+ if (const CIFSv1::MessageHeader* header = CIFSv1::get_header(collection.data() + sizeof(NetBIOS::MessageHeader)))
+ {
+ BaseImpl::setMsgLen(length);
+ set_msg_size(header, length);
+ return BaseImpl::read_message(info);
+ }
+ else if (const CIFSv2::MessageHeader* header = CIFSv2::get_header(collection.data() + sizeof(NetBIOS::MessageHeader)))
+ {
+ BaseImpl::setMsgLen(length);
+ set_msg_size(header, length);
+ return BaseImpl::read_message(info);
+ }
+ }
+ return false;
+ }
+
+private:
+ inline void set_msg_size(const CIFSv1::MessageHeader* header, const size_t length)
+ {
+ if ((header->cmd_code == CIFSv1::Commands::READ) || (header->cmd_code == CIFSv1::Commands::WRITE))
+ {
+ return BaseImpl::setToBeCopied(std::min(length, rw_hdr_max));
+ }
+ BaseImpl::setToBeCopied(length);
+ }
+
+ inline void set_msg_size(const CIFSv2::MessageHeader* header, const size_t length)
+ {
+ if (((header->cmd_code == SMBv2Commands::READ) || (header->cmd_code == SMBv2Commands::WRITE)) && !header->nextCommand)
+ {
+ return BaseImpl::setToBeCopied(std::min(length, rw_hdr_max));
+ }
+ BaseImpl::setToBeCopied(length);
+ }
+
+};
+
+} // namespace filtration
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFS_FILTRATOR_H
+//------------------------------------------------------------------------------
diff --git a/src/filtration/filtration_manager.cpp b/src/filtration/filtration_manager.cpp
index b67f8cd..bb8f805 100644
--- a/src/filtration/filtration_manager.cpp
+++ b/src/filtration/filtration_manager.cpp
@@ -24,6 +24,7 @@
#include "filtration/dumping.h"
#include "filtration/filtration_manager.h"
#include "filtration/filtration_processor.h"
+#include "filtration/filtrators.h"
#include "filtration/pcap/capture_reader.h"
#include "filtration/pcap/file_reader.h"
#include "filtration/processing_thread.h"
@@ -52,13 +53,15 @@ template
>
class FiltrationImpl : public ProcessingThread
{
+ using Processor = FiltrationProcessor<Reader, Writer, Filtrators< Writer >>;
public:
explicit FiltrationImpl(std::unique_ptr<Reader>& reader,
std::unique_ptr<Writer>& writer,
RunningStatus& status)
: ProcessingThread {status}
- , processor{reader, writer}
+ , processor{}
{
+ processor.reset(new Processor{reader, writer});
}
~FiltrationImpl() = default;
FiltrationImpl(const FiltrationImpl&) = delete;
@@ -66,7 +69,7 @@ public:
virtual void stop() override final
{
- processor.stop();
+ processor->stop();
}
private:
@@ -74,7 +77,7 @@ private:
{
try
{
- processor.run();
+ processor->run();
}
catch(...)
{
@@ -82,7 +85,7 @@ private:
}
}
- FiltrationProcessor<Reader, Writer> processor;
+ std::unique_ptr<Processor> processor;
};
// create Filtration thread emplaced in unique_ptr
@@ -126,11 +129,7 @@ void FiltrationManager::add_online_dumping(const Parameters& params)
{
message << dumping_params;
}
- std::unique_ptr<Dumping> writer { new Dumping{ reader->get_handle(),
- dumping_params
- }
- };
-
+ std::unique_ptr<Dumping> writer { new Dumping{ reader->get_handle(), dumping_params } };
threads.emplace_back(create_thread(reader, writer, status));
}
@@ -159,7 +158,7 @@ void FiltrationManager::add_offline_dumping (const Parameters& params)
if(utils::Out message{}) // print parameters to user
{
- message << *reader.get();
+ message << *reader;
}
std::unique_ptr<Dumping> writer { new Dumping{ reader->get_handle(),
dumping_params
@@ -186,7 +185,7 @@ void FiltrationManager::add_offline_analysis(const std::string& ifile,
std::unique_ptr<FileReader> reader { new FileReader{ifile} };
if(utils::Out message{}) // print parameters to user
{
- message << *reader.get();
+ message << *reader;
}
std::unique_ptr<Queueing> writer { new Queueing{queue} };
diff --git a/src/filtration/filtration_processor.h b/src/filtration/filtration_processor.h
index cb2e5cc..8eea6cf 100644
--- a/src/filtration/filtration_processor.h
+++ b/src/filtration/filtration_processor.h
@@ -35,6 +35,7 @@
#include "utils/log.h"
#include "utils/out.h"
#include "utils/sessions.h"
+#include "utils/profiler.h"
#include "controller/parameters.h"
#include "filtration/packet.h"
#include "filtration/sessions_hash.h"
@@ -47,7 +48,10 @@ namespace NST
namespace filtration
{
-using namespace NST::protocols::rpc;
+using namespace NST::protocols::rpc;//FIXME: It is not good to use "using" in headers - should be removed
+using ProcEnumNFS3 = API::ProcEnumNFS3;
+using NFS3Validator = NST::protocols::NFS3::Validator;
+using NFS4Validator = NST::protocols::NFS4::Validator;
/*
* uint32_t: Message XID (Call or Reply)
@@ -83,19 +87,21 @@ public:
auto call = static_cast<const CallHeader*const>(msg);
if(RPCValidator::check(call))
{
- if (NFS3::Validator::check(call))
+ if (NFS3Validator::check(call))
{
uint32_t proc {call->proc()};
- if (API::ProcEnumNFS3::WRITE == proc) // truncate NFSv3 WRITE call message to NFSv3-RW-limit
+ if (ProcEnumNFS3::WRITE == proc) // truncate NFSv3 WRITE call message to NFSv3-RW-limit
+ {
hdr_len = (nfs3_rw_hdr_max < info.dlen ? nfs3_rw_hdr_max : info.dlen);
+ }
else
{
- if (API::ProcEnumNFS3::READ == proc)
+ if (ProcEnumNFS3::READ == proc)
nfs3_read_match.insert(call->xid());
hdr_len = info.dlen;
}
}
- else if (NFS4::Validator::check(call))
+ else if (NFS4Validator::check(call))
{
hdr_len = info.dlen; // fully collect NFSv4 messages
}
@@ -387,293 +393,11 @@ public:
Flow flows[2];
};
-
-/*
- Stateful reader of Sun RPC messages
- Reads data from PacketInfo passed via push() method
- aggregates length of current RPC message and length of RPC message useful for analysis
- TODO: add matching Calls and replies by XID of message
-*/
-template<typename Writer>
-class RPCFiltrator
-{
-public:
- RPCFiltrator()
- : collection{}
- {
- reset();
- }
-
- RPCFiltrator(RPCFiltrator&&) = delete;
- RPCFiltrator(const RPCFiltrator&) = delete;
- RPCFiltrator& operator=(const RPCFiltrator&) = delete;
-
- inline void reset()
- {
- msg_len = 0;
- hdr_len = 0;
- collection.reset(); // data in external memory freed
- }
-
- inline void set_writer(utils::NetworkSession* session_ptr, Writer* w, uint32_t max_rpc_hdr)
- {
- assert(w);
- collection.set(*w, session_ptr);
- nfs3_rw_hdr_max = max_rpc_hdr;
- }
-
- inline void lost(const uint32_t n) // we are lost n bytes in sequence
- {
- if(msg_len != 0)
- {
- if(hdr_len == 0 && msg_len >= n)
- {
- TRACE("We are lost %u bytes of payload marked for discard", n);
- msg_len -= n;
- }
- else
- {
- TRACE("We are lost %u bytes of useful data. lost:%u msg_len:%u", n - msg_len, n, msg_len);
- reset();
- }
- }
- else
- {
- TRACE("We are lost %u bytes of unknown payload", n);
- }
- }
-
- void push(PacketInfo& info)
- {
- assert(info.dlen != 0);
- while(info.dlen) // loop over data in packet
- {
- if(msg_len) // we are on-stream and we are looking to some message
- {
- if(!hdr_len) // message header is readout, discard the unused tail of message
- {
- if(msg_len >= info.dlen) // discard whole new packet
- {
- //TRACE("discard whole new packet");
- msg_len -= info.dlen;
- return; //info.dlen = 0; // return from while
- }
- else // discard only a part of packet payload related to current message
- {
- //TRACE("discard only a part of packet payload related to current message");
- info.dlen -= msg_len;
- info.data += msg_len;
- msg_len = 0; find_message(info); // <- optimization
- }
- }
- else // hdr_len != 0, readout a part of header of current message
- {
- if(hdr_len > info.dlen) // got new part of header (not the all!)
- {
- //TRACE("got new part of header (not the all!)");
- collection.push(info, info.dlen);
- hdr_len -= info.dlen;
- msg_len -= info.dlen;
- info.dlen = 0; // return from while
- }
- else // hdr_len <= dlen, current message will be complete, also we have some additional data
- {
- //TRACE("current message will be complete, also we have some additional data");
- collection.push(info, hdr_len);
- info.dlen -= hdr_len;
- info.data += hdr_len;
-
- msg_len -= hdr_len;
- hdr_len = 0;
-
- // we should remove RM(uin32_t) from collected data
- collection.skip_first(sizeof(RecordMark));
-
- collection.complete(info); // push complete message to queue
- }
- }
- }
- else // msg_len == 0, no one message is on reading, try to find next message
- {
- find_message(info);
- }
- }
- }
-
- inline bool collect_header(PacketInfo& info)
- {
- static const size_t max_header {sizeof(RecordMark) + sizeof(CallHeader) };
- static const size_t max_reply_header {sizeof(RecordMark) + sizeof(ReplyHeader)};
-
- if(collection && (collection.data_size() > 0)) // collection is allocated
- {
- assert(collection.capacity() >= max_header);
- const unsigned long tocopy {max_header - collection.data_size()};
- assert(tocopy != 0);
- if(info.dlen < tocopy)
- {
- collection.push(info, info.dlen);
- //info.data += info.dlen; optimization
- info.dlen = 0;
- return false;
- }
- else // info.dlen >= tocopy
- {
- collection.push(info, tocopy); // collection.data_size <= max_header
- info.dlen -= tocopy;
- info.data += tocopy;
- }
- }
- else // collection is empty
- {
- collection.allocate(); // allocate new collection from writer
- if(info.dlen >= max_header) // is data enough to message validation?
- {
- collection.push(info, max_header); // probability that message will be rejected / probability of valid message
- info.data += max_header;
- info.dlen -= max_header;
- }
- else // (info.dlen < max_header)
- {
- collection.push(info, info.dlen);
- //info.data += info.dlen; optimization
- return (info.dlen < max_reply_header ? (info.dlen = 0, false):(info.dlen = 0, true) );
- }
- }
- return true;
- }
-
- // Find next message in packet info
- inline void find_message(PacketInfo& info)
- {
- assert(msg_len == 0); // RPC Message still undetected
-
- if (!collect_header(info))
- return;
-
- assert(collection); // collection must be initialized
-
- const RecordMark* rm {reinterpret_cast<const RecordMark*>(collection.data())};
- //if(rm->is_last()); // TODO: handle sequence field of record mark
- if(collection.data_size() < (sizeof(CallHeader) + sizeof(RecordMark)) && (rm->fragment())->type() != MsgType::REPLY ) // if message not Reply, try collect the rest for Call
- {
- return;
- }
- if(rm->fragment_len() >= sizeof(ReplyHeader)) // incorrect fragment len, not valid rpc message
- {
- if(validate_header(rm->fragment(), rm->fragment_len() + sizeof(RecordMark) ) )
- {
- assert(msg_len != 0); // message is found
- assert(msg_len >= collection.data_size());
- assert(hdr_len <= msg_len);
- const uint32_t written {collection.data_size()};
- msg_len -= written; // substract how written (if written)
- hdr_len -= std::min(hdr_len, written);
- if (0 == hdr_len) // Avoid infinity loop when "msg len" == "data size(collection) (max_header)" {msg_len >= hdr_len}
- // Next find message call will finding next message
- {
- collection.skip_first(sizeof(RecordMark));
- collection.complete(info);
- }
- return;
- }
- }
- assert(msg_len == 0); // message is not found
- assert(hdr_len == 0); // header should be skipped
- collection.reset(); // skip collected data
- //[ Optimization ] skip data of current packet at all
- info.dlen = 0;
- }
-
- inline bool validate_header(const MessageHeader*const msg, const uint32_t len)
- {
- switch(msg->type())
- {
- case MsgType::CALL:
- {
- auto call = static_cast<const CallHeader*const>(msg);
- if(RPCValidator::check(call))
- {
- msg_len = len; // length of current RPC message
- if(NFS3::Validator::check(call))
- {
- uint32_t proc {call->proc()};
- if (API::ProcEnumNFS3::WRITE == proc) // truncate NFSv3 WRITE call message to NFSv3-RW-limit
- hdr_len = (nfs3_rw_hdr_max < msg_len ? nfs3_rw_hdr_max : msg_len);
- else
- {
- if (API::ProcEnumNFS3::READ == proc)
- nfs3_read_match.insert(call->xid());
- hdr_len = msg_len;
- }
- //TRACE("%p| MATCH RPC Call xid:%u len: %u procedure: %u", this, call->xid(), msg_len, call->proc());
- }
- else if (NFS4::Validator::check(call))
- {
- hdr_len = msg_len; // fully collect of NFSv4 messages
- }
- else
- {
- //* RPC call message must be read out ==> msg_len !=0
- hdr_len = 0; // don't collect headers of unknown calls
- //TRACE("Unknown RPC call of program: %u version: %u procedure: %u", call->prog(), call->vers(), call->proc());
- }
- return true;
- }
- else
- {
- return false; // isn't RPC Call, stream is corrupt
- }
- }
- break;
- case MsgType::REPLY:
- {
- auto reply = static_cast<const ReplyHeader*const>(msg);
- if(RPCValidator::check(reply))
- {
- msg_len = len;
- // Truncate NFSv3 READ reply message to NFSv3-RW-limit
- //* Collect fully if reply received before matching call
- if (nfs3_read_match.erase(reply->xid()) > 0)
- {
- hdr_len = (nfs3_rw_hdr_max < msg_len ? nfs3_rw_hdr_max : msg_len);
- }
- else
- hdr_len = msg_len; // length of current RPC message
- //TRACE("%p| MATCH RPC Reply xid:%u len: %u", this, reply->xid(), msg_len);
- return true;
- }
- else // isn't RPC reply, stream is corrupt
- {
- msg_len = 0;
- hdr_len = 0;
- return false;
- }
- }
- break;
- default:
- {
- //isn't RPC message
- }
- break;
- }
-
- return false;
- }
-
-private:
- uint32_t nfs3_rw_hdr_max {512}; // limit for NFSv3 to truncate WRITE call and READ reply messages
- uint32_t msg_len; // length of current RPC message + RM
- uint32_t hdr_len; // length of readable piece of RPC message. Initially msg_len or 0 in case of unknown msg
-
- typename Writer::Collection collection;// storage for collection packet data
- MessageSet nfs3_read_match;
-};
-
template
<
typename Reader,
- typename Writer
+ typename Writer,
+ typename Filtrator
>
class FiltrationProcessor
{
@@ -717,6 +441,7 @@ public:
static void callback(u_char *user, const struct pcap_pkthdr *pkthdr, const u_char* packet)
{
+ PROF;// Calc how much time was spent in this func
auto processor = reinterpret_cast<FiltrationProcessor*>(user);
PacketInfo info(pkthdr, packet, processor->datalink);
@@ -760,10 +485,10 @@ private:
std::unique_ptr<Reader> reader;
std::unique_ptr<Writer> writer;
- SessionsHash< IPv4TCPMapper, TCPSession < RPCFiltrator < Writer > > , Writer > ipv4_tcp_sessions;
+ SessionsHash< IPv4TCPMapper, TCPSession <Filtrator> , Writer > ipv4_tcp_sessions;
SessionsHash< IPv4UDPMapper, UDPSession < Writer > , Writer > ipv4_udp_sessions;
- SessionsHash< IPv6TCPMapper, TCPSession < RPCFiltrator < Writer > > , Writer > ipv6_tcp_sessions;
+ SessionsHash< IPv6TCPMapper, TCPSession < Filtrator> , Writer > ipv6_tcp_sessions;
SessionsHash< IPv6UDPMapper, UDPSession < Writer > , Writer > ipv6_udp_sessions;
int datalink;
diff --git a/src/filtration/filtratorimpl.h b/src/filtration/filtratorimpl.h
new file mode 100644
index 0000000..c25846a
--- /dev/null
+++ b/src/filtration/filtratorimpl.h
@@ -0,0 +1,320 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Abstract impementation of filtrator class
+// TODO: THIS CODE MUST BE TOTALLY REFACTORED!
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef IFILTRATOR_H
+#define IFILTRATOR_H
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace filtration
+{
+
+/*!
+ * Filtering TCP stream strategy (implementation)
+ * Implemented via CRTP - Curiously recurring template pattern,
+ * (see http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern)
+ */
+template<typename Filtrator, typename Writer>
+class FiltratorImpl
+{
+ size_t msg_len; //!< length of current message
+ size_t to_be_copied; //!< length of readable piece of message. Initially msg_len or 0 in case of unknown msg
+ using Collection = typename Writer::Collection; //!< Type of collection
+ Collection collection;//!< storage for collection packet data
+
+ FiltratorImpl(FiltratorImpl&&) = delete;
+ FiltratorImpl(const FiltratorImpl&) = delete;
+ FiltratorImpl& operator=(const FiltratorImpl&) = delete;
+public:
+ FiltratorImpl()
+ {
+ reset();
+
+ static_assert(std::is_function<decltype(Filtrator::lengthOfBaseHeader)>::value, "You have to define static function with signature 'size_t lengthOfBaseHeader()' in inhereted class");
+ static_assert(std::is_function<decltype(Filtrator::lengthOfFirstSkipedPart)>::value, "You have to define static function with signature 'size_t lengthOfFirstSkipedPart()' in inhereted class");
+ static_assert(std::is_function<decltype(Filtrator::isRightHeader)>::value, "You have to define static function with signature 'bool isRightHeader(const uint8_t* header)' in inhereted class");
+
+ static_assert(std::is_member_function_pointer<decltype(&Filtrator::collect_header)>::value, "You have to define static function with signature 'bool collect_header(PacketInfo& info, typename Writer::Collection& collection)' in inhereted class");
+ static_assert(std::is_member_function_pointer<decltype(&Filtrator::find_and_read_message)>::value, "You have to define static function with signature 'bool find_and_read_message(PacketInfo& info, typename Writer::Collection& collection)' in inhereted class");
+ }
+
+ /*!
+ * Resets state of the filtrator
+ */
+ inline void reset()
+ {
+ msg_len = 0;
+ to_be_copied = 0;
+ collection.reset();
+ }
+
+ /*!
+ * Checks, does the filtrator in work now?
+ * \param info - packet
+ */
+ inline bool inProgress(PacketInfo& info)
+ {
+ Filtrator* filtrator = static_cast<Filtrator* >(this);
+ constexpr size_t callHeaderLen = Filtrator::lengthOfBaseHeader();
+ if (msg_len || to_be_copied)
+ {
+ return true;
+ }
+
+ if (!collection) // collection isn't allocated
+ {
+ collection.allocate(); // allocate new collection from writer
+ }
+ const size_t data_size = collection.data_size();
+
+ if (data_size + info.dlen > callHeaderLen)
+ {
+ static uint8_t buffer[callHeaderLen];
+ const uint8_t* header = info.data;
+
+ if (data_size > 0)
+ {
+ // Coping happends only once per TCP-session
+ memcpy(buffer, collection.data(), data_size);
+ memcpy(buffer + data_size, info.data, callHeaderLen - data_size);
+ header = buffer;
+ }
+
+ // It is right header
+ if (filtrator->isRightHeader(header))
+ {
+ return true;
+ }
+
+ filtrator->reset();
+ }
+ else
+ {
+ collection.push(info, info.dlen);
+ }
+
+ return false;
+ }
+
+ /*!
+ * Handles lost bytes event
+ * \param n - lost bytes count
+ */
+ inline void lost(const uint32_t n) // we are lost n bytes in sequence
+ {
+ Filtrator* filtrator = static_cast<Filtrator* >(this);
+ if (msg_len != 0)
+ {
+ if (to_be_copied == 0 && msg_len >= n)
+ {
+ TRACE("We are lost %u bytes of payload marked for discard", n);
+ msg_len -= n;
+ }
+ else
+ {
+ TRACE("We are lost %u bytes of useful data. lost:%u msg_len:%u", n - msg_len, n, msg_len);
+ filtrator->reset();
+ }
+ }
+ else
+ {
+ TRACE("We are lost %u bytes of unknown payload", n);
+ }
+ }
+
+ /*!
+ * Handles next data part
+ * \param info - part of stream
+ */
+ inline void push(PacketInfo& info)
+ {
+ Filtrator* filtrator = static_cast<Filtrator* >(this);
+ assert(info.dlen != 0);
+
+ while (info.dlen) // loop over data in packet
+ {
+ if (msg_len) // we are on-stream and we are looking to some message
+ {
+ if (to_be_copied)
+ {
+ // hdr_len != 0, readout a part of header of current message
+ if (to_be_copied > info.dlen) // got new part of header (not the all!)
+ {
+ //TRACE("got new part of header (not the all!)");
+ collection.push(info, info.dlen);
+ to_be_copied -= info.dlen;
+ msg_len -= info.dlen;
+ info.dlen = 0; // return from while
+ }
+ else // hdr_len <= dlen, current message will be complete, also we have some additional data
+ {
+ //TRACE("current message will be complete, also we have some additional data");
+ collection.push(info, to_be_copied);
+ info.dlen -= to_be_copied;
+ info.data += to_be_copied;
+
+ msg_len -= to_be_copied;
+ to_be_copied = 0;
+
+ collection.skip_first(Filtrator::lengthOfFirstSkipedPart());
+ collection.complete(info); // push complete message to queue
+ }
+ }
+ else
+ {
+ // message header is readout, discard the unused tail of message
+ if (msg_len >= info.dlen) // discard whole new packet
+ {
+ //TRACE("discard whole new packet");
+ msg_len -= info.dlen;
+ return; //info.dlen = 0; // return from while
+ }
+ else // discard only a part of packet payload related to current message
+ {
+ //TRACE("discard only a part of packet payload related to current message");
+ info.dlen -= msg_len;
+ info.data += msg_len;
+ msg_len = 0;
+ filtrator->find_message(info); // <- optimization
+ }
+ }
+ }
+ else // msg_len == 0, no one message is on reading, try to find next message
+ {
+ filtrator->find_message(info);
+ }
+ }
+ }
+
+ /*!
+ * Find next message in packet info
+ * \param info - part of data
+ */
+ inline void find_message(PacketInfo& info)
+ {
+ assert(msg_len == 0); // Message still undetected
+ Filtrator* filtrator = static_cast<Filtrator* >(this);
+
+ if (!filtrator->collect_header(info, collection))
+ {
+ return;
+ }
+
+ assert(collection); // collection must be initialized
+
+ if (filtrator->find_and_read_message(info, collection))
+ {
+ return;
+ }
+
+ assert(msg_len == 0); // message is not found
+ assert(to_be_copied == 0); // header should be skipped
+ collection.reset(); // skip collected data
+ //[ Optimization ] skip data of current packet at all
+ info.dlen = 0;
+ }
+
+protected:
+ inline void setMsgLen(size_t value)
+ {
+ msg_len = value;
+ }
+
+ inline void setToBeCopied(size_t value)
+ {
+ to_be_copied = value;
+ }
+
+ inline void setWriterImpl(utils::NetworkSession* session_ptr, Writer* w, uint32_t )
+ {
+ assert(w);
+ collection.set(*w, session_ptr);
+ }
+
+ inline bool collect_header(PacketInfo& info, size_t callHeaderLen, size_t replyHeaderLen)
+ {
+ if (collection && (collection.data_size() > 0)) // collection is allocated
+ {
+ assert(collection.capacity() >= callHeaderLen);
+ const size_t tocopy {callHeaderLen - collection.data_size()};
+ assert(tocopy != 0);
+ if (info.dlen < tocopy)
+ {
+ collection.push(info, info.dlen);
+ info.data += info.dlen;// optimization
+ info.dlen = 0;
+ return false;
+ }
+ else // info.dlen >= tocopy
+ {
+ collection.push(info, tocopy); // collection.data_size <= header_len
+ info.dlen -= tocopy;
+ info.data += tocopy;
+ }
+ }
+ else // collection is empty
+ {
+ collection.allocate(); // allocate new collection from writer
+ if (info.dlen >= callHeaderLen) // is data enough to message validation?
+ {
+ collection.push(info, callHeaderLen); // probability that message will be rejected / probability of valid message
+ info.data += callHeaderLen;
+ info.dlen -= callHeaderLen;
+ }
+ else // (info.dlen < header_len)
+ {
+ collection.push(info, info.dlen);
+ //info.data += info.dlen;// optimization
+ size_t copied = info.dlen;
+ info.dlen = 0;
+ return copied >= replyHeaderLen;
+ }
+ }
+ return true;
+ }
+
+ inline bool read_message(PacketInfo& info)
+ {
+ assert(msg_len != 0); // message is found
+ assert(msg_len >= collection.data_size());
+ assert(to_be_copied <= msg_len);
+ Filtrator* filtrator = static_cast<Filtrator* >(this);
+
+ const size_t written {collection.data_size()};
+ msg_len -= written; // substract how written (if written)
+ to_be_copied -= std::min(to_be_copied, written);
+ if (0 == to_be_copied) // Avoid infinity loop when "msg len" == "data size(collection) (max_header)" {msg_len >= hdr_len}
+ // Next find message call will finding next message
+ {
+ collection.skip_first(filtrator->lengthOfFirstSkipedPart());
+ collection.complete(info);
+ }
+ return true;
+ }
+
+};
+
+} // namespace filtration
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//IFILTRATOR_H
+//------------------------------------------------------------------------------
diff --git a/src/filtration/filtrators.h b/src/filtration/filtrators.h
new file mode 100644
index 0000000..6589ed6
--- /dev/null
+++ b/src/filtration/filtrators.h
@@ -0,0 +1,120 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Composite filtrator which composites both CIFS&NFS
+// TODO: THIS CODE MUST BE TOTALLY REFACTORED!
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef FILTRATORS_H
+#define FILTRATORS_H
+//------------------------------------------------------------------------------
+#include "cifs_filtrator.h"
+#include "rpc_filtrator.h"
+#include "utils/log.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace filtration
+{
+
+/*!
+ * Composite filtrator which composites both CIFS&NFS
+ */
+template<typename Writer>
+class Filtrators
+{
+ enum class FiltratorTypes
+ {
+ DEFAULT = 0,
+ RPC,
+ CIFS
+ };
+
+ CIFSFiltrator<Writer> filtratorCIFS;//!< CIFS filtrator
+ RPCFiltrator<Writer> filtratorRPC;//!< RPC filtrator
+ FiltratorTypes currentFiltrator;//!< Indicates which filtrator is currently active?
+public:
+ Filtrators() :
+ currentFiltrator(FiltratorTypes::DEFAULT)
+ {
+ }
+
+ Filtrators(Filtrators&&) = delete;
+ Filtrators(const Filtrators&) = delete;
+ Filtrators& operator=(const Filtrators&) = delete;
+
+ /*!
+ * resets state of filtrator
+ */
+ inline void reset()
+ {
+ filtratorCIFS.reset();
+ filtratorRPC.reset ();
+ currentFiltrator = FiltratorTypes::DEFAULT;
+ }
+
+ /*!
+ * Sets queue
+ * \param session_ptr - TCP session
+ * \param w - queue, where we are going to write messages
+ * \param max_rpc_hdr -
+ */
+ inline void set_writer(utils::NetworkSession* session_ptr, Writer* w, uint32_t max_rpc_hdr)
+ {
+ assert(w);
+ filtratorCIFS.set_writer (session_ptr, w, max_rpc_hdr);
+ filtratorRPC.set_writer (session_ptr, w, max_rpc_hdr);
+ }
+
+ inline void lost(const uint32_t n) // we are lost n bytes in sequence
+ {
+ filtratorCIFS.lost (n);
+ filtratorRPC.lost (n);
+ }
+
+ /*!
+ * Receives and filtrates next part of TCP-stream
+ * \param info - data
+ */
+ inline void push(PacketInfo& info)
+ {
+ // is it RPC message?
+ if (currentFiltrator == FiltratorTypes::RPC || filtratorRPC.inProgress(info))
+ {
+ currentFiltrator = FiltratorTypes::RPC;
+ filtratorRPC.push (info);
+ }
+ // is it CIFS message?
+ else if (currentFiltrator == FiltratorTypes::CIFS || filtratorCIFS.inProgress(info))
+ {
+ currentFiltrator = FiltratorTypes::CIFS;
+ filtratorCIFS.push (info);
+ }
+ // it is Unknown message
+ else
+ {
+ LOG("Unknown packet");
+ }
+ }
+};
+
+} // namespace filtration
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//FILTRATORS_H
+//------------------------------------------------------------------------------
diff --git a/src/filtration/pcap/capture_reader.cpp b/src/filtration/pcap/capture_reader.cpp
index 08a96e6..bc08e2f 100644
--- a/src/filtration/pcap/capture_reader.cpp
+++ b/src/filtration/pcap/capture_reader.cpp
@@ -65,15 +65,15 @@ CaptureReader::CaptureReader(const Params& params) : BaseReader{params.interface
throw PcapError("pcap_activate", pcap_statustostr(status));
}
- pcap_direction_t diection {PCAP_D_INOUT};
+ pcap_direction_t direction {PCAP_D_INOUT};
switch(params.direction)
{
using Direction = CaptureReader::Direction;
- case Direction::IN : diection = PCAP_D_IN; break;
- case Direction::OUT : diection = PCAP_D_OUT; break;
- case Direction::INOUT: diection = PCAP_D_INOUT; break;
+ case Direction::IN : direction = PCAP_D_IN; break;
+ case Direction::OUT : direction = PCAP_D_OUT; break;
+ case Direction::INOUT: direction = PCAP_D_INOUT; break;
}
- if(int status {pcap_setdirection(handle, diection)})
+ if(int status {pcap_setdirection(handle, direction)})
{
throw PcapError("pcap_setdirection", pcap_statustostr(status));
}
@@ -97,7 +97,7 @@ void CaptureReader::print_statistic(std::ostream& out) const
struct pcap_stat stat={0,0,0};
if(pcap_stats(handle, &stat) == 0)
{
- out << "Statistic from interface: " << source << '\n'
+ out << "Statistics from interface: " << source << '\n'
<< " packets received by filtration: " << stat.ps_recv << '\n'
<< " packets dropped by kernel : " << stat.ps_drop << '\n'
<< " packets dropped by interface : " << stat.ps_ifdrop;
diff --git a/src/filtration/pcap/network_interfaces.h b/src/filtration/pcap/network_interfaces.h
index 8bfb9c4..2d9335d 100644
--- a/src/filtration/pcap/network_interfaces.h
+++ b/src/filtration/pcap/network_interfaces.h
@@ -110,13 +110,22 @@ public:
inline static std::string default_device()
{
- char errbuf[PCAP_ERRBUF_SIZE];
- const char* default_device {pcap_lookupdev(errbuf)};
- if(default_device == nullptr)
+ NST::filtration::pcap::NetworkInterfaces interfaces;
+
+ for(const auto& interface : interfaces)
{
- throw PcapError("pcap_lookupdev", errbuf);
+ for(const auto& address : interface)
+ {
+ // Do not compare string for appropriate IP4/IP6 address.
+ // If pointer to address is not null expect it has valid address.
+ if(address.address() != nullptr)
+ {
+ return interface.name();
+ }
+ }
}
- return default_device;
+
+ throw std::runtime_error{"No suitable device found.\n Note: reading an ip address of a network device may require special privileges."};
}
NetworkInterfaces(const NetworkInterfaces&) = delete;
diff --git a/src/filtration/processing_thread.h b/src/filtration/processing_thread.h
index 4f1893f..89a46c9 100644
--- a/src/filtration/processing_thread.h
+++ b/src/filtration/processing_thread.h
@@ -80,5 +80,5 @@ protected:
} // namespace filtration
} // namespace NST
//------------------------------------------------------------------------------
-#endif //PROCESSING_THREAD_H
+#endif//PROCESSING_THREAD_H
//------------------------------------------------------------------------------
diff --git a/src/filtration/rpc_filtrator.h b/src/filtration/rpc_filtrator.h
new file mode 100644
index 0000000..fc20025
--- /dev/null
+++ b/src/filtration/rpc_filtrator.h
@@ -0,0 +1,215 @@
+//------------------------------------------------------------------------------
+// Author: Pavel Karneliuk
+// Description: RPC filtrator
+// Copyright (c) 2013 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef RPC_FILTRATOR_H
+#define RPC_FILTRATOR_H
+//------------------------------------------------------------------------------
+#include <algorithm>
+#include <cassert>
+
+#include <pcap/pcap.h>
+
+#include "filtration/packet.h"
+#include "filtration/filtratorimpl.h"
+#include "protocols/nfs3/nfs3_utils.h"
+#include "protocols/nfs4/nfs4_utils.h"
+#include "protocols/netbios/netbios.h"
+#include "protocols/rpc/rpc_header.h"
+#include "utils/log.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace filtration
+{
+
+/*
+ Stateful reader of Sun RPC messages
+ Reads data from PacketInfo passed via push() method
+ aggregates length of current RPC message and length of RPC message useful for analysis
+ TODO: add matching Calls and replies by XID of message
+*/
+template<typename Writer>
+class RPCFiltrator : public FiltratorImpl<RPCFiltrator<Writer>, Writer>
+{
+ using BaseImpl = FiltratorImpl<RPCFiltrator<Writer>, Writer>;
+public:
+ RPCFiltrator()
+ : BaseImpl()
+ {
+ }
+
+ inline void set_writer(utils::NetworkSession* session_ptr, Writer* w, uint32_t max_rpc_hdr)
+ {
+ assert(w);
+ nfs3_rw_hdr_max = max_rpc_hdr;
+ BaseImpl::setWriterImpl(session_ptr, w, max_rpc_hdr);
+ }
+
+ constexpr static size_t lengthOfBaseHeader()
+ {
+ return sizeof(RecordMark) + sizeof(ReplyHeader);// Minimum of replay&call headers
+ }
+
+ constexpr static size_t lengthOfReplyHeader()
+ {
+ return sizeof(RecordMark) + sizeof(ReplyHeader);
+ }
+
+ constexpr static size_t lengthOfCallHeader()
+ {
+ return sizeof(RecordMark) + sizeof(CallHeader);
+ }
+
+ inline static bool isRightHeader(const uint8_t* header)
+ {
+ const RecordMark* rm {reinterpret_cast<const RecordMark*>(header)};
+ const MessageHeader* const msg = rm->fragment();
+ if (msg->type() == MsgType::REPLY)
+ {
+ return RPCValidator::check(static_cast<const ReplyHeader* const>(msg));
+ }
+ if (msg->type() == MsgType::CALL)
+ {
+ return RPCValidator::check(static_cast<const CallHeader* const>(msg));
+ }
+ return false;
+ }
+
+ inline constexpr static size_t lengthOfFirstSkipedPart()
+ {
+ return sizeof(RecordMark);
+ }
+
+ inline bool collect_header(PacketInfo& info, typename Writer::Collection&)
+ {
+ return BaseImpl::collect_header(info, lengthOfCallHeader(), lengthOfReplyHeader());
+ }
+
+ inline bool find_and_read_message(PacketInfo& info, typename Writer::Collection& collection)
+ {
+ const RecordMark* rm {reinterpret_cast<const RecordMark*>(collection.data())};
+ //if(rm->is_last()); // TODO: handle sequence field of record mark
+ if (collection.data_size() < (sizeof(CallHeader) + sizeof(RecordMark)) && (rm->fragment())->type() != MsgType::REPLY ) // if message not Reply, try collect the rest for Call
+ {
+ return true;
+ }
+ if (rm->fragment_len() >= sizeof(ReplyHeader)) // incorrect fragment len, not valid rpc message
+ {
+ if (validate_header(rm->fragment(), rm->fragment_len() + sizeof(RecordMark) ) )
+ {
+ return BaseImpl::read_message(info);
+ }
+ }
+ return false;
+ }
+
+ inline bool validate_header(const MessageHeader* const msg, const size_t len)
+ {
+ switch (msg->type())
+ {
+ case MsgType::CALL:
+ {
+ auto call = static_cast<const CallHeader* const>(msg);
+ if (RPCValidator::check(call))
+ {
+ BaseImpl::setMsgLen(len); // length of current RPC message
+ if (protocols::NFS3::Validator::check(call))
+ {
+ uint32_t proc {call->proc()};
+ if (API::ProcEnumNFS3::WRITE == proc) // truncate NFSv3 WRITE call message to NFSv3-RW-limit
+ {
+ BaseImpl::setToBeCopied(nfs3_rw_hdr_max < len ? nfs3_rw_hdr_max : len);
+ }
+ else
+ {
+ if (API::ProcEnumNFS3::READ == proc)
+ {
+ nfs3_read_match.insert(call->xid());
+ }
+ BaseImpl::setToBeCopied(len);
+ }
+ //TRACE("%p| MATCH RPC Call xid:%u len: %u procedure: %u", this, call->xid(), msg_len, call->proc());
+ }
+ else if (protocols::NFS4::Validator::check(call))
+ {
+ BaseImpl::setToBeCopied(len);
+ }
+ else
+ {
+ //* RPC call message must be read out ==> msg_len !=0
+ BaseImpl::setToBeCopied(0);// don't collect headers of unknown calls
+ //TRACE("Unknown RPC call of program: %u version: %u procedure: %u", call->prog(), call->vers(), call->proc());
+ }
+ return true;
+ }
+ else
+ {
+ return false; // isn't RPC Call, stream is corrupt
+ }
+ }
+ break;
+ case MsgType::REPLY:
+ {
+ auto reply = static_cast<const ReplyHeader* const>(msg);
+ if (RPCValidator::check(reply))
+ {
+ BaseImpl::setMsgLen(len); // length of current RPC message
+ // Truncate NFSv3 READ reply message to NFSv3-RW-limit
+ //* Collect fully if reply received before matching call
+ if (nfs3_read_match.erase(reply->xid()) > 0)
+ {
+ BaseImpl::setToBeCopied(std::min(nfs3_rw_hdr_max, len));
+ }
+ else
+ {
+ BaseImpl::setToBeCopied(len);// length of current RPC message
+ }
+ //TRACE("%p| MATCH RPC Reply xid:%u len: %u", this, reply->xid(), msg_len);
+ return true;
+ }
+ else // isn't RPC reply, stream is corrupt
+ {
+ BaseImpl::setMsgLen(0);
+ BaseImpl::setToBeCopied(0);
+ return false;
+ }
+ }
+ break;
+ default:
+ {
+ //isn't RPC message
+ }
+ break;
+ }
+
+ return false;
+ }
+
+private:
+ size_t nfs3_rw_hdr_max {512}; // limit for NFSv3 to truncate WRITE call and READ reply messages
+ MessageSet nfs3_read_match;
+};
+
+} // namespace filtration
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//RPC_FILTRATOR_H
+//------------------------------------------------------------------------------
diff --git a/src/main.cpp b/src/main.cpp
index 690e7ac..8d05a5e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,24 +31,23 @@ int main(int argc, char* argv[]) try
{
Parameters params(argc, argv); // set and validate CLI options
- if(params.show_help() || params.show_list())
+ if (params.show_help() || params.show_enum())
{
- return 0; // -h or -L was passed
+ return 0; // -h or -E were passed
}
Controller controller(params);
return controller.run();
}
-catch(const std::exception& e)
+catch (const std::exception& e)
{
std::cerr << argv[0] << ": " << e.what() << std::endl;
return -1;
}
-catch(...)
+catch (...)
{
std::cerr << argv[0] << ": Unknown exception" << std::endl;
return -1;
}
//------------------------------------------------------------------------------
-
diff --git a/src/protocols/cifs/cifs.cpp b/src/protocols/cifs/cifs.cpp
new file mode 100644
index 0000000..348722b
--- /dev/null
+++ b/src/protocols/cifs/cifs.cpp
@@ -0,0 +1,91 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Helpers for parsing CIFS structures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cassert>
+
+#include "protocols/cifs/cifs.h"
+//------------------------------------------------------------------------------
+using namespace NST::protocols::CIFSv1;
+using namespace NST::API;
+union SMBCode
+{
+ uint8_t codes[4];
+ uint32_t code;
+};
+
+static inline uint32_t get_code()
+{
+ SMBCode code;
+
+ code.codes[0] = static_cast<uint8_t>(ProtocolCodes::SMB1);
+ code.codes[1] = 'S';
+ code.codes[2] = 'M';
+ code.codes[3] = 'B';
+
+ return code.code;
+}
+
+const NST::protocols::CIFSv1::MessageHeader* NST::protocols::CIFSv1::get_header(const uint8_t* data)
+{
+ static uint32_t code = get_code ();
+
+ const MessageHeader* header (reinterpret_cast<const MessageHeader*>(data));
+ if (header->head_code == code)
+ {
+ return header;
+ }
+ return nullptr;
+}
+
+bool MessageHeader::isFlag(const Flags flag) const
+{
+ return static_cast<const uint8_t>(flag) & static_cast<const uint8_t>(flags);
+}
+
+const char* NST::protocols::CIFSv1::print_cifs1_procedures(SMBv1Commands cmd_code)
+{
+ assert(cmd_code < SMBv1Commands::CMD_COUNT);
+
+ static const char* const commandNames[] =
+ {
+ "CREATE_DIRECTORY", "DELETE_DIRECTORY", "OPEN", "CREATE",
+ "CLOSE", "FLUSH", "DELETE", "RENAME",
+ "QUERY_INFORMATION", "SET_INFORMATION", "READ", "WRITE",
+ "LOCK_BYTE_RANGE", "UNLOCK_BYTE_RANGE", "CREATE_TEMPORARY", "CREATE_NEW",
+ "CHECK_DIRECTORY", "PROCESS_EXIT", "SEEK", "LOCK_AND_READ",
+ "WRITE_AND_UNLOCK", "READ_RAW", "READ_MPX", "READ_MPX_SECONDARY",
+ "WRITE_RAW", "WRITE_MPX", "WRITE_MPX_SECONDARY", "WRITE_COMPLETE",
+ "QUERY_SERVER", "SET_INFORMATION2", "QUERY_INFORMATION2", "LOCKING_ANDX",
+ "TRANSACTION", "TRANSACTION_SECONDARY", "IOCTL", "IOCTL_SECONDARY",
+ "COPY", "MOVE", "ECHO", "WRITE_AND_CLOSE",
+ "OPEN_ANDX", "READ_ANDX", "WRITE_ANDX", "NEW_FILE_SIZE",
+ "CLOSE_AND_TREE_DISC", "TRANSACTION2", "TRANSACTION2_SECONDARY", "FIND_CLOSE2",
+ "FIND_NOTIFY_CLOSE", "TREE_CONNECT", "TREE_DISCONNECT", "NEGOTIATE",
+ "SESSION_SETUP_ANDX", "LOGOFF_ANDX", "TREE_CONNECT_ANDX", "SECURITY_PACKAGE_ANDX",
+ "QUERY_INFORMATION_DISK", "SEARCH", "FIND", "FIND_UNIQUE",
+ "FIND_CLOSE", "NT_TRANSACT", "NT_TRANSACT_SECONDARY", "NT_CREATE_ANDX",
+ "NT_CANCEL", "NT_RENAME", "OPEN_PRINT_FILE", "WRITE_PRINT_FILE",
+ "CLOSE_PRINT_FILE", "GET_PRINT_QUEUE", "READ_BULK", "WRITE_BULK",
+ "WRITE_BULK_DATA", "INVALID", "NO_ANDX_COMMAND"
+ };
+
+ return commandNames[static_cast<int>(cmd_code)];
+}
diff --git a/src/protocols/cifs/cifs.h b/src/protocols/cifs/cifs.h
new file mode 100644
index 0000000..7d6f557
--- /dev/null
+++ b/src/protocols/cifs/cifs.h
@@ -0,0 +1,233 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Helpers for parsing CIFS structures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFS_HEADER_H
+#define CIFS_HEADER_H
+//------------------------------------------------------------------------------
+#include <cstdint>
+
+#include "api/cifs_types.h"
+#include "protocols/netbios/netbios.h"
+//------------------------------------------------------------------------------
+#define NST_PUBLIC __attribute__ ((visibility("default")))
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace CIFSv1
+{
+
+using SMBv1Commands = NST::API::SMBv1::SMBv1Commands;
+
+/*! Flags of message
+ */
+enum class Flags : uint8_t
+{
+ LOCK_AND_READ_OK = 0x01, //!< This bit is set (1) in the SMB_COM_NEGOTIATE (0x72) Response (section 2.2.4.52.2) if the server supports SMB_COM_LOCK_AND_READ (0x13) (section 2.2.4.20) and SMB_COM_WRITE_AND_UNLOCK (0x14) (section 2.2.4.21) commands.
+ BUF_AVAIL = 0x02, //!< Obsolete. When set (on an SMB request being sent to the server), the client guarantees that there is a receive buffer posted such that a send without acknowledgment can be used by the server to respond to the client's request. This behavior is specific to an obsolete transport. This bit MUST be set to zero by the client and MUST be ignored by the server.
+ Reserved = 0x04, //!< This flag MUST be set to zero by the client and MUST be ignored by the server.
+ CASE_INSENSITIVE = 0x08, //!< Obsolete. If this bit is set then all pathnames in the SMB SHOULD be treated as case-insensitive.<26>
+ CANONICALIZED_PATHS = 0x10, //!< Obsolescent. When set in session setup, this bit indicates that all paths sent to the server are already in canonical format. That is, all file and directory names are composed of valid file name characters in all upper-case, and that the path segments are separated by backslash characters ('\').
+ OPLOCK = 0x20, //!< Obsolescent. This bit has meaning only in the deprecatedSMB_COM_OPEN (0x02) Request (section 2.2.4.3.1), SMB_COM_CREATE (0x03) Request (section 2.2.4.4.1), and SMB_COM_CREATE_NEW (0x0F) Request (section 2.2.4.16.1) messages, where it is used to indicate that the client is requesting an Exclusive OpLock. It SHOULD be set to zero by the client, and ignored by the server, in all other SMB requests. If the server grants this OpLock request, then this bit SHOULD remain set in the corresponding response SMB to indicate to the client that the OpLock request was granted.
+ OPBATCH = 0x40, //!< Obsolescent. This bit has meaning only in the deprecated SMB_COM_OPEN (0x02) Request (section 2.2.4.3.1), SMB_COM_CREATE (0x03) Request (section 2.2.4.4.1), and SMB_COM_CREATE_NEW (0x0F) Request (section 2.2.4.16.1) messages, where it is used to indicate that the client is requesting a Batch OpLock. It SHOULD be set to zero by the client, and ignored by the server, in all other SMB requests. If the server grants this OpLock request, then this bit SHOULD remain set in the corresponding response SMB to indicate to the client that the OpLock request was granted. If the SMB_FLAGS_OPLOCK bit is clear (0), then the SMB_FLAGS_OPBATCH bit is ignored.
+ REPLY = 0x80, //!< When on, this message is being sent from the server in response to a client request. The Command field usually contains the same value in a protocol request from the client to the server as in the matching response from the server to the client. This bit unambiguously distinguishes the message as a server response.
+};
+
+/*! CIFS commands
+ */
+enum class Commands : uint8_t
+{
+ CREATE_DIRECTORY = 0x00, //!< Create a new directory.
+ DELETE_DIRECTORY = 0x01, //!< Delete an empty directory.
+ OPEN = 0x02, //!< Open a file.
+ CREATE = 0x03, //!< Create or open a file.
+ CLOSE = 0x04, //!< Close a file.
+ FLUSH = 0x05, //!< Flush data for a file
+ DELETE = 0x06, //!< Delete a file.
+ RENAME = 0x07, //!< Rename a file or set of files.
+ QUERY_INFORMATION = 0x08, //!< Get file attributes.
+ SET_INFORMATION = 0x09, //!< Set file attributes.
+ READ = 0x0A, //!< Read from a file.
+ WRITE = 0x0B, //!< Write to a file.
+ LOCK_BYTE_RANGE = 0x0C, //!< Request a byte-range lock on a file.
+ UNLOCK_BYTE_RANGE = 0x0D, //!< Release a byte-range lock on a file.
+ CREATE_TEMPORARY = 0x0E, //!< Create a temporary file.
+ CREATE_NEW = 0x0F, //!< Create and open a new file.
+ CHECK_DIRECTORY = 0x10, //!< Verify that the specified pathname resolves to a directory.Listed as SMBchkpath in some documentation.
+ PROCESS_EXIT = 0x11, //!< Indicate process exit.
+ SEEK = 0x12, //!< Set the current file pointer within a file.
+ LOCK_AND_READ = 0x13, //!< Lock and read a byte-range within a file.
+ WRITE_AND_UNLOCK = 0x14, //!< Write and unlock a byte-range within a file.
+ READ_RAW = 0x1A, //!< Read a block in raw mode.
+ READ_MPX = 0x1B, //!< Multiplexed block read. Listed as SMBreadmpx in some documentation.
+ READ_MPX_SECONDARY = 0x1C, //!< Multiplexed block read
+ WRITE_RAW = 0x1D, //!< Write a block in raw mode.
+ WRITE_MPX = 0x1E, //!< Multiplexed block write.
+ WRITE_MPX_SECONDARY = 0x1F, //!< Multiplexed block write
+ WRITE_COMPLETE = 0x20, //!< Raw block write
+ QUERY_SERVER = 0x21, //!< Reserved
+ SET_INFORMATION2 = 0x22, //!< Set an extended set of file attributes.
+ QUERY_INFORMATION2 = 0x23, //!< Get an extended set of file attributes.
+ LOCKING_ANDX = 0x24, //!< Lock multiple byte ranges; AndX chaining.
+ TRANSACTION = 0x25, //!< Transaction.
+ TRANSACTION_SECONDARY = 0x26, //!< Transaction secondary request.
+ IOCTL = 0x27, //!< Pass an I/O Control function request to the server.
+ IOCTL_SECONDARY = 0x28, //!< IOCTL secondary request.
+ COPY = 0x29, //!< Copy a file or directory.
+ MOVE = 0x2A, //!< Move a file or directory.
+ ECHO = 0x2B, //!< Echo request (ping).
+ WRITE_AND_CLOSE = 0x2C, //!< Write to and close a file.
+ OPEN_ANDX = 0x2D, //!< Extended file open with AndX chaining.
+ READ_ANDX = 0x2E, //!< Extended file read with AndX chaining.
+ WRITE_ANDX = 0x2F, //!< Extended file write with AndX chaining.
+ NEW_FILE_SIZE = 0x30, //!< Reserved
+ CLOSE_AND_TREE_DISC = 0x31, //!< Close an open file and tree disconnect.
+ TRANSACTION2 = 0x32, //!< Transaction 2 format request/response.
+ TRANSACTION2_SECONDARY = 0x33, //!< Transaction 2 secondary request.
+ FIND_CLOSE2 = 0x34, //!< Close an active search.
+ FIND_NOTIFY_CLOSE = 0x35, //!< Notification of the closure of an active search.
+ TREE_CONNECT = 0x70, //!< Tree connect.
+ TREE_DISCONNECT = 0x71, //!< Tree disconnect.
+ NEGOTIATE = 0x72, //!< Negotiate protocol dialect.
+ SESSION_SETUP_ANDX = 0x73, //!< Session Setup with AndX chaining.
+ LOGOFF_ANDX = 0x74, //!< User logoff with AndX chaining.
+ TREE_CONNECT_ANDX = 0x75, //!< Tree connect with AndX chaining.
+ SECURITY_PACKAGE_ANDX = 0x7E, //!< Negotiate security packages with AndX chaining.
+ QUERY_INFORMATION_DISK = 0x80, //!< Retrieve file system information from the server.
+ SEARCH = 0x81, //!< Directory wildcard search.
+ FIND = 0x82, //!< Start or continue an extended wildcard directory search.
+ FIND_UNIQUE = 0x83, //!< Perform a one-time extended wildcard directory search.
+ FIND_CLOSE = 0x84, //!< End an extended wildcard directory search.
+ NT_TRANSACT = 0xA0, //!< NT format transaction request/response.
+ NT_TRANSACT_SECONDARY = 0xA1, //!< NT format transaction secondary request.
+ NT_CREATE_ANDX = 0xA2, //!< Create or open a file or a directory.
+ NT_CANCEL = 0xA4, //!< Cancel a request currently pending at the server.
+ NT_RENAME = 0xA5, //!< File rename with extended semantics.
+ OPEN_PRINT_FILE = 0xC0, //!< Create a print queue spool file.
+ WRITE_PRINT_FILE = 0xC1, //!< Write to a print queue spool file.
+ CLOSE_PRINT_FILE = 0xC2, //!< Close a print queue spool file.
+ GET_PRINT_QUEUE = 0xC3, //!< Request print queue information.
+ READ_BULK = 0xD8, //!< Reserved
+ WRITE_BULK = 0xD9, //!< Reserved
+ WRITE_BULK_DATA = 0xDA, //!< Reserved
+ INVALID = 0xFE, //!< As the name suggests
+ NO_ANDX_COMMAND = 0xFF //!< Also known as the NIL command. It identifies the end of an AndX Chain
+};
+
+/*! SMB protocol codes
+ */
+enum class ProtocolCodes : uint8_t
+{
+ SMB2 = 0xFE, //!< SMB v2.0-2.1
+ SMB1 = 0xFF //!< SMB v.1.0
+};
+
+/*! \class First part of CIFS header
+ */
+struct MessageHeaderHead
+{
+ ProtocolCodes protocol_code;//!< Protocol version - 0xFF or 0xF3
+ int8_t protocol[3];//!< Protocol name (SMB)
+} __attribute__ ((__packed__));
+
+/*! Security field for CIFS header
+ */
+struct SecurityField
+{
+ int8_t key[4];//!< Somethink about security
+ int16_t CID;//!< A connection identifier (CID).
+ int16_t sequenceNumber;//!< A number used to identify the sequence of a message over connectionless transports.
+};
+
+/*! \class Raw CIFS message header
+ */
+struct RawMessageHeader
+{
+ union
+ {
+ MessageHeaderHead head;//!< Head of header
+ uint32_t head_code;//!< For fast checking
+ };
+ Commands cmd_code;//!< Code of SMB command
+ int32_t status;//!< Used to communicate error messages from the server to the client.
+ Flags flags;//!< 1-bit flags describing various features in effect for the message.
+ uint8_t flags2[2];//!< A 16-bit field of 1-bit flags that represent various features in effect for the message. Unspecified bits are reserved and MUST be zero.
+
+ int16_t PIDHigh;//!< If set to a nonzero value, this field represents the high-order bytes of a process identifier (PID). It is combined with the PIDLow field below to form a full PID.
+ union // Depends on command
+ {
+ int8_t securityFeatures[8];//!< Somethink about security
+ SecurityField sec;//!< Security field structure
+ };
+ int16_t _;//!< Reserved
+
+ int16_t TID;//!< A tree identifier
+ int16_t PIDLow;//!< The lower 16-bits of the PID
+
+ int16_t UID;//!< A user identifier
+ int16_t MID;//!< A multiplex identifier
+} __attribute__ ((__packed__));
+
+/*! High level user friendly message structure
+ */
+struct MessageHeader : public RawMessageHeader
+{
+ /*! Check flag
+ * \param flag - flag to be check
+ * \return True, if flag set, and False in other case
+ */
+ bool isFlag(const Flags flag) const;
+};
+
+/*! Check is data valid CIFS message's header and return header or nullptr
+ * \param data - raw packet data
+ * \return pointer to input data which is casted to header structure or nullptr (if it is not valid header)
+ */
+const MessageHeader* get_header(const uint8_t* data);
+
+/*! Constructs new command for API from raw message
+ * \param request - Call's header
+ * \param response - Reply's header
+ * \return Command structure
+ */
+template <typename Cmd, typename Data, typename Session>
+inline const Cmd command(Data& request, Data& response, Session* session)
+{
+ Cmd cmd;
+ cmd.session = session;
+ // Set time stamps
+ cmd.ctimestamp = &request->timestamp;
+ cmd.rtimestamp = &response->timestamp;
+
+ return cmd;
+}
+
+extern "C"
+NST_PUBLIC
+const char* print_cifs1_procedures(SMBv1Commands cmd_code);
+
+} // namespace CIFSv1
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFS_HEADER_H
+//------------------------------------------------------------------------------
diff --git a/src/protocols/cifs2/cifs2.cpp b/src/protocols/cifs2/cifs2.cpp
new file mode 100644
index 0000000..980ecca
--- /dev/null
+++ b/src/protocols/cifs2/cifs2.cpp
@@ -0,0 +1,162 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Helpers for parsing CIFS structures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cassert>
+
+#include <arpa/inet.h>
+#include <assert.h>
+
+#include "protocols/cifs2/cifs2.h"
+#include "protocols/cifs/cifs.h"
+#include "api/cifs_pc_to_net.h"
+//------------------------------------------------------------------------------
+using namespace NST::protocols::CIFSv2;
+
+# if NFSTRACE_BYTE_ORDER == NFSTRACE_BIG_ENDIAN
+
+inline uint64_t ntohll(uint64_t input)
+{
+ // Network byte order == Big Endian
+ return input;
+}
+
+# else
+# if NFSTRACE_BYTE_ORDER == NFSTRACE_LITTLE_ENDIAN
+
+inline uint64_t ntohll(uint64_t input)
+{
+ return be64toh(input);
+}
+# endif
+# endif
+
+union SMBCode
+{
+ uint8_t codes[4];
+ uint32_t code;
+};
+
+static inline uint32_t get_code()
+{
+ SMBCode code;
+
+ code.codes[0] = static_cast<uint8_t>(NST::protocols::CIFSv1::ProtocolCodes::SMB2);
+ code.codes[1] = 'S';
+ code.codes[2] = 'M';
+ code.codes[3] = 'B';
+
+ return code.code;
+}
+
+const NST::protocols::CIFSv2::MessageHeader* NST::protocols::CIFSv2::get_header(const uint8_t* data)
+{
+ static uint32_t code = get_code ();
+
+ const MessageHeader* header (reinterpret_cast<const MessageHeader*>(data));
+ if (header->head_code == code)
+ {
+ return header;
+ }
+ return nullptr;
+}
+
+bool MessageHeader::isFlag(const Flags flag) const
+{
+ return static_cast<uint32_t>(flag) & flags;
+}
+
+void NST::protocols::CIFSv2::parseGuid(uint8_t (&guid)[16])
+{
+ Guid &p = reinterpret_cast<Guid&>(guid);
+ p.Data1 = le32toh(p.Data1);
+ p.Data2 = le16toh(p.Data2);
+ p.Data3 = le16toh(p.Data3);
+}
+
+void NST::protocols::CIFSv2::parse(SMBv2::ErrResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::NegotiateRequest*& p)
+{
+ parseGuid(p->clientGUID);
+}
+void NST::protocols::CIFSv2::parse(SMBv2::NegotiateResponse*& p)
+{
+ parseGuid(p->serverGUID);
+}
+void NST::protocols::CIFSv2::parse(SMBv2::SessionSetupRequest*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::SessionSetupResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::LogOffRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::LogOffResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::TreeConnectRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::TreeConnectResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::TreeDisconnectRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::TreeDisconnectResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::CreateRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::CreateResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::CloseRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::CloseResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::EchoRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::EchoResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::QueryInfoRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::QueryInfoResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::QueryDirRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::QueryDirResponse*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::FlushRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::FlushResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::ReadRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::ReadResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::Lock*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::WriteRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::WriteResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::LockRequest*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::LockResponse*&) { }
+void NST::protocols::CIFSv2::parse(SMBv2::ChangeNotifyRequest*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::FileNotifyInformation*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::ChangeNotifyResponse*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::OplockAcknowledgment*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::OplockResponse*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::IoCtlRequest*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::IoCtlResponse*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::SetInfoRequest*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::SetInfoResponse*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::CancelResponce*&){ }
+void NST::protocols::CIFSv2::parse(SMBv2::CancelRequest*&){ }
+
+// TODO: This implementation currently copy of
+// epm-nfs/analyzers/src/cifs/cifs2_commands.cpp
+// const std::string NST::breakdown::SMBv2Commands::command_name(int cmd_code)
+// Futre fix: We need to merege these enums
+// TODO: Move implementation to some common module
+const char* NST::protocols::CIFSv2::print_cifs2_procedures(SMBv2Commands cmd)
+{
+ assert(cmd < SMBv2Commands::CMD_COUNT);
+
+ static const char* const commandNames[] =
+ {
+ "NEGOTIATE", "SESSION SETUP", "LOGOFF", "TREE CONNECT",
+ "TREE DISCONNECT", "CREATE", "CLOSE", "FLUSH",
+ "READ", "WRITE", "LOCK", "IOCTL",
+ "CANCEL", "ECHO", "QUERY DIRECTORY", "CHANGE NOTIFY",
+ "QUERY INFO", "SET INFO", "OPLOCK BREAK"
+ };
+
+ return commandNames[static_cast<int>(cmd)];
+}
+
diff --git a/src/protocols/cifs2/cifs2.h b/src/protocols/cifs2/cifs2.h
new file mode 100644
index 0000000..f25020c
--- /dev/null
+++ b/src/protocols/cifs2/cifs2.h
@@ -0,0 +1,203 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Helpers for parsing CIFS v2 structures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFSv2_HEADER_H
+#define CIFSv2_HEADER_H
+//------------------------------------------------------------------------------
+#include "api/cifs_commands.h"
+#include "api/cifs2_commands.h"
+#include "protocols/cifs/cifs.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace CIFSv2
+{
+
+using SMBv2Commands = NST::API::SMBv2::SMBv2Commands;
+namespace SMBv2 = NST::API::SMBv2;
+// https://msdn.microsoft.com/en-us/library/ff718266.aspx
+struct Guid
+{
+ uint32_t Data1; // unsigned long replaced by uint32_t
+ uint16_t Data2; // unsigned short replaced by uint16_t
+ uint16_t Data3; // unsigned short replaced by uint16_t
+ uint8_t Data4[8]; // byte replaced by uint8_t
+} __attribute__ ((__packed__));
+
+/*! CIFS v2 Flags
+ */
+enum class Flags : uint32_t
+{
+ SERVER_TO_REDIR = API::SMBv2::pc_to_net<uint32_t>(0x00000001), //!< When set, indicates the message is a response, rather than a request. This MUST be set on responses sent from the server to the client and MUST NOT be set on requests sent from the client to the server.
+ ASYNC_COMMAND = API::SMBv2::pc_to_net<uint32_t>(0x00000002), //!< When set, indicates that this is an ASYNC SMB2 header. This flag MUST NOT be set when using the SYNC SMB2 header.
+ RELATED_OPERATIONS = API::SMBv2::pc_to_net<uint32_t>(0x00000004), //!< When set in an SMB2 request, indicates that this request is a related operation in a compounded request chain. The use of this flag in an SMB2 request is as specified in 3.2.4.1.4.
+ //!< When set in an SMB2 compound response, indicates that the request corresponding to this response was part of a related operation in a compounded request chain. The use of this flag in an SMB2 response is as specified in 3.3.5.2.7.2.
+ SIGNED = API::SMBv2::pc_to_net<uint32_t>(0x00000008), //!< When set, indicates that this packet has been signed. The use of this flag is as specified in 3.1.5.1.
+ DFS_OPERATIONS = API::SMBv2::pc_to_net<uint32_t>(0x01000000), //!< When set, indicates that this command is a DFS operation. The use of this flag is as specified in 3.3.5.9.
+ REPLAY_OPERATION = API::SMBv2::pc_to_net<uint32_t>(0x02000000) //!< This flag is only valid for the SMB 3.x dialect family. When set, it indicates that this command is a replay operation. The client MUST ignore this bit on receipt.
+};
+
+/*! \class Raw CIFS v2 message header
+ */
+struct RawMessageHeader
+{
+ union
+ {
+ CIFSv1::MessageHeaderHead head;//!< Head of header
+ uint32_t head_code;//!< For fast checking
+ };
+
+ int16_t StructureSize;//!< In the SMB 2.002 dialect, this field MUST NOT be used and MUST be reserved. The sender MUST set this to 0, and the receiver MUST ignore it. In all other dialects, this field indicates the number of credits that this request consumes.
+ int16_t CreditCharge;//!< In a request, this field is interpreted in different ways depending on the SMB2 dialect. In the SMB 3.x dialect family, this field is interpreted as the ChannelSequence field followed by the Reserved field in a request.
+
+ uint32_t status;//!< Used to communicate error messages from the server to the client.
+
+ SMBv2Commands cmd_code;//!< Code of SMB command
+ int16_t Credit;//!< This MUST be set to 64, which is the size, in bytes, of the SMB2 header structure.
+
+ int32_t flags;//!< 1-bit flags describing various features in effect for the message.
+
+ int32_t nextCommand;//!< For a compounded request, this field MUST be set to the offset, in bytes, from the beginning of this SMB2 header to the start of the subsequent 8-byte aligned SMB2 header. If this is not a compounded request, or this is the last header in a compounded request, this value MUST be 0.
+ int64_t messageId;//!< A value that identifies a message request and response uniquely across all messages that are sent on the same SMB 2 Protocol transport connection.
+ int32_t _;//!< The client SHOULD<3> set this field to 0. The server MAY<4> ignore this field on receipt.
+ int32_t TreeId;//!< Uniquely identifies the tree connect for the command. This MUST be 0 for the SMB2 TREE_CONNECT Request. The TreeId can be any unsigned 32-bit integer that is received from a previous SMB2 TREE_CONNECT Response. The following SMB 2 Protocol commands do not require the TreeId to be set to a nonzero value received from a previous SMB2 TREE_CONNECT Response.
+ /*!
+ TreeId SHOULD be set to 0 for the following commands:
+ SMB2 NEGOTIATE Request
+ SMB2 NEGOTIATE Response
+ SMB2 SESSION_SETUP Request
+ SMB2 SESSION_SETUP Response
+ SMB2 LOGOFF Request
+ SMB2 LOGOFF Response
+ SMB2 ECHO Request
+ SMB2 ECHO Response
+ SMB2 CANCEL Request
+ */
+ int64_t SessionId;//!< Uniquely identifies the established session for the command
+ uint8_t Signature[16];//!< he 16-byte signature of the message, if SMB2_FLAGS_SIGNED is set in the Flags field of the SMB2 header. If the message is not signed, this field MUST be 0.
+} __attribute__ ((__packed__));
+
+/*! High level user friendly message structure
+ */
+struct MessageHeader : public RawMessageHeader
+{
+ /*! Check flag
+ * \param flag - flag to be check
+ * \return True, if flag set, and False in other case
+ */
+ bool isFlag(const Flags flag) const;
+};
+
+/*! Check is data valid CIFS message's header and return header or nullptr
+ * \param data - raw packet data
+ * \return pointer to input data which is casted to header structure or nullptr (if it is not valid header)
+ */
+const MessageHeader* get_header(const uint8_t* data);
+
+void parseGuid(uint8_t (&guid)[16]);
+void parse(SMBv2::ErrResponse*&);
+void parse(SMBv2::NegotiateRequest*&);
+void parse(SMBv2::NegotiateResponse*&);
+void parse(SMBv2::SessionSetupRequest*&);
+void parse(SMBv2::SessionSetupResponse*&);
+void parse(SMBv2::LogOffRequest*&);
+void parse(SMBv2::LogOffResponse*&);
+void parse(SMBv2::TreeConnectRequest*&);
+void parse(SMBv2::TreeConnectResponse*&);
+void parse(SMBv2::TreeDisconnectRequest*&);
+void parse(SMBv2::TreeDisconnectResponse*&);
+void parse(SMBv2::CreateRequest*&);
+void parse(SMBv2::CreateResponse*&);
+void parse(SMBv2::CloseRequest*&);
+void parse(SMBv2::CloseResponse*&);
+void parse(SMBv2::EchoRequest*&);
+void parse(SMBv2::EchoResponse*&);
+void parse(SMBv2::QueryInfoRequest*&);
+void parse(SMBv2::QueryInfoResponse*&);
+void parse(SMBv2::QueryDirRequest*&);
+void parse(SMBv2::QueryDirResponse*&);
+void parse(SMBv2::FlushRequest*&);
+void parse(SMBv2::FlushResponse*&);
+void parse(SMBv2::ReadRequest*&);
+void parse(SMBv2::ReadResponse*&);
+void parse(SMBv2::Lock*&);
+void parse(SMBv2::WriteRequest*&);
+void parse(SMBv2::WriteResponse*&);
+void parse(SMBv2::LockRequest*&);
+void parse(SMBv2::LockResponse*&);
+void parse(SMBv2::ChangeNotifyRequest*&);
+void parse(SMBv2::FileNotifyInformation*&);
+void parse(SMBv2::ChangeNotifyResponse*&);
+void parse(SMBv2::OplockAcknowledgment*&);
+void parse(SMBv2::OplockResponse*&);
+void parse(SMBv2::IoCtlRequest*&);
+void parse(SMBv2::IoCtlResponse*&);
+void parse(SMBv2::SetInfoRequest*&);
+void parse(SMBv2::SetInfoResponse*&);
+void parse(SMBv2::CancelResponce*&);
+void parse(SMBv2::CancelRequest*&);
+
+/*! Constructs new command for API from raw message
+ * \param request - Call's
+ * \param response - Reply's
+ * \param session - session
+ * \return Command structure
+ */
+template <typename Cmd, typename Data, typename Session>
+inline const Cmd command(Data& request, Data& response, Session* session)
+{
+ Cmd cmd;
+ cmd.session = session;
+ // Set time stamps
+ cmd.ctimestamp = &request->timestamp;
+ cmd.rtimestamp = response ? &response->timestamp : &request->timestamp;
+
+ //
+ // Since we have to modify structures before command creation
+ // we have to cast raw data to pointer type ( in contrast to const pointer )
+ //
+ auto req_header = reinterpret_cast<RawMessageHeader*>(request->data);
+ auto pargs = reinterpret_cast<typename Cmd::RequestType*>(request->data + sizeof(RawMessageHeader));
+
+ parse(pargs);
+
+ cmd.req_header = req_header;
+ if(response)
+ {
+ cmd.res_header = reinterpret_cast<RawMessageHeader*>(response->data);
+ cmd.pres = reinterpret_cast<typename Cmd::ResponseType*>(response->data + sizeof(RawMessageHeader));
+ }
+ cmd.parg = pargs;
+ return cmd;
+}
+
+extern "C"
+NST_PUBLIC
+const char* print_cifs2_procedures(SMBv2Commands cmd_code);
+
+} // namespace CIFSv2
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFSv2_HEADER_H
+//------------------------------------------------------------------------------
diff --git a/src/protocols/cifs2/cifs2_utils.cpp b/src/protocols/cifs2/cifs2_utils.cpp
new file mode 100644
index 0000000..ec065fc
--- /dev/null
+++ b/src/protocols/cifs2/cifs2_utils.cpp
@@ -0,0 +1,719 @@
+//------------------------------------------------------------------------------
+// Author: Artsem Iliasau
+// Description: Helpers for parsing CIFSv2 structures.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <iostream>
+#include <type_traits>
+
+#include "cifs2.h"
+#include "cifs2_utils.h"
+#include "protocols/nfs/nfs_utils.h"
+//------------------------------------------------------------------------------
+static const std::string flagDelimiter = " | ";
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace CIFSv2
+{
+
+using namespace NST::API::SMBv2;
+
+namespace
+{
+
+template <typename T>
+void print_flag_if_set(std::ostream& out, const std::string& name, typename std::underlying_type<T>::type& value, T flag)
+{
+ auto int_flag = to_integral(flag);
+ if (value & int_flag)
+ {
+ out << name;
+ value = value & ~int_flag;
+ if(value > 0)
+ out << flagDelimiter;
+ }
+}
+
+const char* enumToString(OplockLevels value)
+{
+ switch (value)
+ {
+ case OplockLevels::NONE: return "NONE";
+ case OplockLevels::II: return "II";
+ case OplockLevels::EXCLUSIVE: return "EXCLUSIVE";
+ case OplockLevels::BATCH: return "BATCH";
+ case OplockLevels::LEASE: return "LEASE";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(ImpersonationLevels value)
+{
+ switch (value)
+ {
+ case ImpersonationLevels::ANONYMOUS: return "ANONYMOUS";
+ case ImpersonationLevels::IDENTIFICATION: return "IDENTIFICATION";
+ case ImpersonationLevels::IMPERSONATION: return "IMPERSONATION";
+ case ImpersonationLevels::DELEGATE: return "DELEGATE";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(CreateDisposition value)
+{
+ switch (value)
+ {
+ case CreateDisposition::SUPERSEDE: return "SUPERSEDE";
+ case CreateDisposition::OPEN: return "OPEN";
+ case CreateDisposition::CREATE: return "CREATE";
+ case CreateDisposition::OPEN_IF: return "OPEN_IF";
+ case CreateDisposition::OVERWRITE: return "OVERWRITE";
+ case CreateDisposition::OVERWRITE_IF: return "OVERWRITE_IF";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(CreateActions value)
+{
+ switch (value)
+ {
+ case CreateActions::SUPERSEDED: return "SUPERSEDED";
+ case CreateActions::OPENED: return "OPENED";
+ case CreateActions::CREATED: return "CREATED";
+ case CreateActions::FILE_OVERWRITTEN: return "FILE_OVERWRITTEN";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(ShareTypes value)
+{
+ switch (value)
+ {
+ case ShareTypes::DISK: return "SMB2_SHARE_TYPE_DISK";
+ case ShareTypes::PIPE: return "SMB2_SHARE_TYPE_PIPE";
+ case ShareTypes::PRINT: return "SMB2_SHARE_TYPE_PRINT";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(NTStatus value)
+{
+ switch (value)
+ {
+ case NTStatus::STATUS_SUCCESS: return "STATUS_SUCCESS";
+ case NTStatus::STATUS_NO_MORE_FILES: return "STATUS_NO_MORE_FILES";
+ case NTStatus::STATUS_INVALID_HANDLE: return "STATUS_INVALID_HANDLE";
+ case NTStatus::STATUS_INVALID_PARAMETER: return "STATUS_INVALID_PARAMETER";
+ case NTStatus::STATUS_NO_SUCH_FILE: return "STATUS_NO_SUCH_FILE";
+ case NTStatus::STATUS_MORE_PROCESSING_REQUIRED: return "STATUS_MORE_PROCESSING_REQUIRED";
+ case NTStatus::STATUS_INVALID_SYSTEM_SERVICE: return "STATUS_INVALID_SYSTEM_SERVICE";
+ case NTStatus::STATUS_ACCESS_DENIED: return "STATUS_ACCESS_DENIED";
+ case NTStatus::STATUS_OBJECT_NAME_INVALID: return "STATUS_OBJECT_NAME_INVALID";
+ case NTStatus::STATUS_OBJECT_NAME_NOT_FOUND: return "STATUS_OBJECT_NAME_NOT_FOUND";
+ case NTStatus::STATUS_OBJECT_NAME_COLLISION: return "STATUS_OBJECT_NAME_COLLISION";
+ case NTStatus::STATUS_OBJECT_PATH_NOT_FOUND: return "STATUS_OBJECT_PATH_NOT_FOUND";
+ case NTStatus::STATUS_OBJECT_PATH_SYNTAX_BAD: return "STATUS_OBJECT_PATH_SYNTAX_BAD";
+ case NTStatus::STATUS_SHARING_VIOLATION: return "STATUS_SHARING_VIOLATION";
+ case NTStatus::STATUS_EA_TOO_LARGE: return "STATUS_EA_TOO_LARGE";
+ case NTStatus::STATUS_FILE_LOCK_CONFLICT: return "STATUS_FILE_LOCK_CONFLICT";
+ case NTStatus::STATUS_LOCK_NOT_GRANTED: return "STATUS_LOCK_NOT_GRANTED";
+ case NTStatus::STATUS_LOGON_FAILURE: return "STATUS_LOGON_FAILURE";
+ case NTStatus::STATUS_RANGE_NOT_LOCKED: return "STATUS_RANGE_NOT_LOCKED";
+ case NTStatus::STATUS_FILE_IS_A_DIRECTORY: return "STATUS_FILE_IS_A_DIRECTORY";
+ case NTStatus::STATUS_NOT_SUPPORTED: return "STATUS_NOT_SUPPORTED";
+ case NTStatus::STATUS_BAD_DEVICE_TYPE: return "STATUS_BAD_DEVICE_TYPE";
+ case NTStatus::STATUS_REQUEST_NOT_ACCEPTED: return "STATUS_REQUEST_NOT_ACCEPTED";
+ case NTStatus::STATUS_DIRECTORY_NOT_EMPTY: return "STATUS_DIRECTORY_NOT_EMPTY";
+ case NTStatus::STATUS_NOT_A_DIRECTORY: return "STATUS_NOT_A_DIRECTORY";
+ case NTStatus::STATUS_CANCELLED: return "STATUS_CANCELLED";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(FsInfoLevels value)
+{
+ switch (value)
+ {
+ case FsInfoLevels::SMB2_FS_INFO_01: return "SMB2_FS_INFO_01";
+ case FsInfoLevels::SMB2_FS_INFO_02: return "SMB2_FS_INFO_02";
+ case FsInfoLevels::SMB2_FS_INFO_03: return "SMB2_FS_INFO_03";
+ case FsInfoLevels::SMB2_FS_INFO_04: return "SMB2_FS_INFO_04";
+ case FsInfoLevels::SMB2_FS_INFO_05: return "SMB2_FS_INFO_05";
+ case FsInfoLevels::SMB2_FS_INFO_06: return "SMB2_FS_INFO_06";
+ case FsInfoLevels::SMB2_FS_INFO_07: return "SMB2_FS_INFO_07";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(QueryInfoLevels value)
+{
+ switch (value)
+ {
+ case QueryInfoLevels::DIRECTORY_INFORMATION: return "DIRECTORY_INFORMATION";
+ case QueryInfoLevels::FULL_DIRECTORY_INFORMATION: return "FULL_DIRECTORY_INFORMATION";
+ case QueryInfoLevels::BOTH_DIRECTORY_INFORMATION: return "BOTH_DIRECTORY_INFORMATION";
+ case QueryInfoLevels::BASIC_INFORMATION: return "BASIC_INFORMATION";
+ case QueryInfoLevels::STANDARD_INFORMATION: return "STANDARD_INFORMATION";
+ case QueryInfoLevels::INTERNAL_INFORMATION: return "INTERNAL_INFORMATION";
+ case QueryInfoLevels::EA_INFORMATION: return "EA_INFORMATION";
+ case QueryInfoLevels::ACCESS_INFORMATION: return "ACCESS_INFORMATION";
+ case QueryInfoLevels::NAME_INFORMATION: return "NAME_INFORMATION";
+ case QueryInfoLevels::RENAME_INFORMATION: return "RENAME_INFORMATION";
+ case QueryInfoLevels::LINK_INFORMATION: return "LINK_INFORMATION";
+ case QueryInfoLevels::NAMES_INFORMATION: return "NAMES_INFORMATION";
+ case QueryInfoLevels::DISPOSITION_INFORMATION: return "DISPOSITION_INFORMATION";
+ case QueryInfoLevels::POSITION_INFORMATION: return "POSITION_INFORMATION";
+ case QueryInfoLevels::FULL_EA_INFORMATION: return "FULL_EA_INFORMATION";
+ case QueryInfoLevels::MODE_INFORMATION: return "MODE_INFORMATION";
+ case QueryInfoLevels::ALIGNMENT_INFORMATION: return "ALIGNMENT_INFORMATION";
+ case QueryInfoLevels::ALL_INFORMATION: return "ALL_INFORMATION";
+ case QueryInfoLevels::ALLOCATION_INFORMATION: return "ALLOCATION_INFORMATION";
+ case QueryInfoLevels::END_OF_FILE_INFORMATION: return "END_OF_FILE_INFORMATION";
+ case QueryInfoLevels::ALTERNATE_NAME_INFORMATION: return "ALTERNATE_NAME_INFORMATION";
+ case QueryInfoLevels::STREAM_INFORMATION: return "STREAM_INFORMATION";
+ case QueryInfoLevels::PIPE_INFORMATION: return "PIPE_INFORMATION";
+ case QueryInfoLevels::PIPE_LOCAL_INFORMATION: return "PIPE_LOCAL_INFORMATION";
+ case QueryInfoLevels::PIPE_REMOTE_INFORMATION: return "PIPE_REMOTE_INFORMATION";
+ case QueryInfoLevels::MAILSLOT_QUERY_INFORMATION: return "MAILSLOT_QUERY_INFORMATION";
+ case QueryInfoLevels::MAILSLOT_SET_INFORMATION: return "MAILSLOT_SET_INFORMATION";
+ case QueryInfoLevels::COMPRESSION_INFORMATION: return "COMPRESSION_INFORMATION";
+ case QueryInfoLevels::OBJECT_ID_INFORMATION: return "OBJECT_ID_INFORMATION";
+ case QueryInfoLevels::MOVE_CLUSTER_INFORMATION: return "MOVE_CLUSTER_INFORMATION";
+ case QueryInfoLevels::QUOTA_INFORMATION: return "QUOTA_INFORMATION";
+ case QueryInfoLevels::REPARSE_POINT_INFORMATION: return "REPARSE_POINT_INFORMATION";
+ case QueryInfoLevels::NETWORK_OPEN_INFORMATION: return "NETWORK_OPEN_INFORMATION";
+ case QueryInfoLevels::ATTRIBUTE_TAG_INFORMATION: return "ATTRIBUTE_TAG_INFORMATION";
+ case QueryInfoLevels::TRACKING_INFORMATION: return "TRACKING_INFORMATION";
+ case QueryInfoLevels::ID_BOTH_DIRECTORY_INFORMATION: return "ID_BOTH_DIRECTORY_INFORMATION";
+ case QueryInfoLevels::ID_FULL_DIRECTORY_INFORMATION: return "ID_FULL_DIRECTORY_INFORMATION";
+ case QueryInfoLevels::VALID_DATA_LENGTH_INFORMATION: return "VALID_DATA_LENGTH_INFORMATION";
+ case QueryInfoLevels::SHORT_NAME_INFORMATION: return "SHORT_NAME_INFORMATION";
+ case QueryInfoLevels::SFIO_RESERVE_INFORMATION: return "SFIO_RESERVE_INFORMATION";
+ case QueryInfoLevels::SFIO_VOLUME_INFORMATION: return "SFIO_VOLUME_INFORMATION";
+ case QueryInfoLevels::HARD_LINK_INFORMATION: return "HARD_LINK_INFORMATION";
+ case QueryInfoLevels::NORMALIZED_NAME_INFORMATION: return "NORMALIZED_NAME_INFORMATION";
+ case QueryInfoLevels::ID_GLOBAL_TX_DIRECTORY_INFORMATION: return "ID_GLOBAL_TX_DIRECTORY_INFORMATION";
+ case QueryInfoLevels::STANDARD_LINK_INFORMATION: return "STANDARD_LINK_INFORMATION";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(CtlCodes value)
+{
+ switch (value)
+ {
+ case CtlCodes::SCTL_DFS_GET_REFERRALS: return "SCTL_DFS_GET_REFERRALS";
+ case CtlCodes::FSCTL_PIPE_PEEK: return "FSCTL_PIPE_PEEK";
+ case CtlCodes::FSCTL_PIPE_WAIT: return "FSCTL_PIPE_WAIT";
+ case CtlCodes::FSCTL_PIPE_TRANSCEIVE: return "FSCTL_PIPE_TRANSCEIVE";
+ case CtlCodes::FSCTL_SRV_COPYCHUNK: return "FSCTL_SRV_COPYCHUNK";
+ case CtlCodes::FSCTL_SRV_ENUMERATE_SNAPSHOTS: return "FSCTL_SRV_ENUMERATE_SNAPSHOTS";
+ case CtlCodes::FSCTL_SRV_REQUEST_RESUME_KEY: return "FSCTL_SRV_REQUEST_RESUME_KEY";
+ case CtlCodes::FSCTL_SRV_READ_HASH: return "FSCTL_SRV_READ_HASH";
+ case CtlCodes::FSCTL_SRV_COPYCHUNK_WRITE: return "FSCTL_SRV_COPYCHUNK_WRITE";
+ case CtlCodes::FSCTL_LMR_REQUEST_RESILIENCY: return "FSCTL_LMR_REQUEST_RESILIENCY";
+ case CtlCodes::FSCTL_QUERY_NETWORK_INTERFACE_INFO: return "FSCTL_QUERY_NETWORK_INTERFACE_INFO";
+ case CtlCodes::FSCTL_SET_REPARSE_POINT: return "FSCTL_SET_REPARSE_POINT";
+ case CtlCodes::FSCTL_DFS_GET_REFERRALS_EX: return "FSCTL_DFS_GET_REFERRALS_EX";
+ case CtlCodes::FSCTL_FILE_LEVEL_TRIM: return "FSCTL_FILE_LEVEL_TRIM";
+ case CtlCodes::FSCTL_VALIDATE_NEGOTIATE_INFO: return "FSCTL_VALIDATE_NEGOTIATE_INFO";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(InfoTypes value)
+{
+ switch (value)
+ {
+ case InfoTypes::FILE: return "SMB2_0_INFO_FILE";
+ case InfoTypes::FILESYSTEM: return "SMB2_0_INFO_FILESYSTEM";
+ case InfoTypes::SECURITY: return "SMB2_0_INFO_SECURITY";
+ case InfoTypes::QUOTA: return "SMB2_0_INFO_QUOTA";
+ }
+
+ return nullptr;
+}
+
+const char* enumToString(SessionFlagsBinding value)
+ {
+ switch (value)
+ {
+ case SessionFlagsBinding::NONE: return "NONE";
+ case SessionFlagsBinding::BINDING: return "BINDING";
+ }
+
+ return nullptr;
+ }
+
+}
+
+std::ostream& operator<<(std::ostream& out, const SMBv2::SMBv2Commands value)
+{
+ const char* strCommand = NST::protocols::CIFSv2::print_cifs2_procedures(value);
+
+ out << "(" << strCommand << ")";
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const OplockLevels value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ImpersonationLevels value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const CreateDisposition value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const CreateActions value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ShareTypes value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const NTStatus value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const DesiredAccessFlags value)
+{
+ auto int_value = to_integral(value);
+
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "READ_DATA_LE", int_value, DesiredAccessFlags::READ_DATA_LE);
+ print_flag_if_set(out, "WRITE_DATA_LE", int_value, DesiredAccessFlags::WRITE_DATA_LE);
+ print_flag_if_set(out, "APPEND_DATA_LE", int_value, DesiredAccessFlags::APPEND_DATA_LE);
+ print_flag_if_set(out, "READ_EA_LE", int_value, DesiredAccessFlags::READ_EA_LE);
+ print_flag_if_set(out, "WRITE_EA_LE", int_value, DesiredAccessFlags::WRITE_EA_LE);
+ print_flag_if_set(out, "EXECUTE_LE", int_value, DesiredAccessFlags::EXECUTE_LE);
+ print_flag_if_set(out, "READ_ATTRIBUTES_LE", int_value, DesiredAccessFlags::READ_ATTRIBUTES_LE);
+ print_flag_if_set(out, "WRITE_ATTRIBUTES_LE", int_value, DesiredAccessFlags::WRITE_ATTRIBUTES_LE);
+ print_flag_if_set(out, "DELETE_LE", int_value, DesiredAccessFlags::DELETE_LE);
+ print_flag_if_set(out, "READ_CONTROL_LE", int_value, DesiredAccessFlags::READ_CONTROL_LE);
+ print_flag_if_set(out, "WRITE_DAC_LE", int_value, DesiredAccessFlags::WRITE_DAC_LE);
+ print_flag_if_set(out, "WRITE_OWNER_LE", int_value, DesiredAccessFlags::WRITE_OWNER_LE);
+ print_flag_if_set(out, "SYNCHRONIZE_LE", int_value, DesiredAccessFlags::SYNCHRONIZE_LE);
+ print_flag_if_set(out, "ACCESS_SYSTEM_SECURITY_LE", int_value, DesiredAccessFlags::ACCESS_SYSTEM_SECURITY_LE);
+ print_flag_if_set(out, "MAXIMAL_ACCESS_LE", int_value, DesiredAccessFlags::MAXIMAL_ACCESS_LE);
+ print_flag_if_set(out, "GENERIC_ALL_LE", int_value, DesiredAccessFlags::GENERIC_ALL_LE);
+ print_flag_if_set(out, "GENERIC_EXECUTE_LE", int_value, DesiredAccessFlags::GENERIC_EXECUTE_LE);
+ print_flag_if_set(out, "GENERIC_WRITE_LE", int_value, DesiredAccessFlags::GENERIC_WRITE_LE);
+ print_flag_if_set(out, "GENERIC_READ_LE", int_value, DesiredAccessFlags::GENERIC_READ_LE);
+ out << ")";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const FileAttributes value)
+{
+ auto int_value = to_integral(value);
+
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "READONLY", int_value, FileAttributes::READONLY);
+ print_flag_if_set(out, "HIDDEN", int_value, FileAttributes::HIDDEN);
+ print_flag_if_set(out, "SYSTEM", int_value, FileAttributes::SYSTEM);
+ print_flag_if_set(out, "DIRECTORY", int_value, FileAttributes::DIRECTORY);
+ print_flag_if_set(out, "ARCHIVE", int_value, FileAttributes::ARCHIVE);
+ print_flag_if_set(out, "NORMAL", int_value, FileAttributes::NORMAL);
+ print_flag_if_set(out, "TEMPORARY", int_value, FileAttributes::TEMPORARY);
+ print_flag_if_set(out, "SPARSE_FILE", int_value, FileAttributes::SPARSE_FILE);
+ print_flag_if_set(out, "REPARSE_POINT", int_value, FileAttributes::REPARSE_POINT);
+ print_flag_if_set(out, "COMPRESSED", int_value, FileAttributes::COMPRESSED);
+ print_flag_if_set(out, "OFFLINE", int_value, FileAttributes::OFFLINE);
+ print_flag_if_set(out, "NOT_CONTENT_INDEXED", int_value, FileAttributes::NOT_CONTENT_INDEXED);
+ print_flag_if_set(out, "ENCRYPTED", int_value, FileAttributes::ENCRYPTED);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ShareAccessFlags value)
+{
+ auto int_value = to_integral(value);
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "SHARE_READ_LE", int_value, ShareAccessFlags::SHARE_READ_LE);
+ print_flag_if_set(out, "SHARE_WRITE_LE", int_value, ShareAccessFlags::SHARE_WRITE_LE);
+ print_flag_if_set(out, "SHARE_DELETE_LE", int_value, ShareAccessFlags::SHARE_DELETE_LE);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const CreateOptionsFlags value)
+{
+ auto int_value = to_integral(value);
+
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "DIRECTORY_FILE_LE", int_value, CreateOptionsFlags::DIRECTORY_FILE_LE);
+ print_flag_if_set(out, "WRITE_THROUGH_LE", int_value, CreateOptionsFlags::WRITE_THROUGH_LE);
+ print_flag_if_set(out, "SEQUENTIAL_ONLY_LE", int_value, CreateOptionsFlags::SEQUENTIAL_ONLY_LE);
+ print_flag_if_set(out, "NO_INTERMEDIATE_BUFFERRING_LE",int_value, CreateOptionsFlags::NO_INTERMEDIATE_BUFFERRING_LE);
+ print_flag_if_set(out, "SYNCHRONOUS_IO_ALERT_LE", int_value, CreateOptionsFlags::SYNCHRONOUS_IO_ALERT_LE);
+ print_flag_if_set(out, "SYNCHRONOUS_IO_NON_ALERT_LE", int_value, CreateOptionsFlags::SYNCHRONOUS_IO_NON_ALERT_LE);
+ print_flag_if_set(out, "NON_DIRECTORY_FILE_LE", int_value, CreateOptionsFlags::NON_DIRECTORY_FILE_LE);
+ print_flag_if_set(out, "COMPLETE_IF_OPLOCKED_LE", int_value, CreateOptionsFlags::COMPLETE_IF_OPLOCKED_LE);
+ print_flag_if_set(out, "NO_EA_KNOWLEDGE_LE", int_value, CreateOptionsFlags::NO_EA_KNOWLEDGE_LE);
+ print_flag_if_set(out, "RANDOM_ACCESS_LE", int_value, CreateOptionsFlags::RANDOM_ACCESS_LE);
+ print_flag_if_set(out, "DELETE_ON_CLOSE_LE", int_value, CreateOptionsFlags::DELETE_ON_CLOSE_LE);
+ print_flag_if_set(out, "OPEN_BY_FILE_ID_LE", int_value, CreateOptionsFlags::OPEN_BY_FILE_ID_LE);
+ print_flag_if_set(out, "OPEN_FOR_BACKUP_INTENT_LE", int_value, CreateOptionsFlags::OPEN_FOR_BACKUP_INTENT_LE);
+ print_flag_if_set(out, "NO_COMPRESSION_LE", int_value, CreateOptionsFlags::NO_COMPRESSION_LE);
+ print_flag_if_set(out, "RESERVE_OPFILTER_LE", int_value, CreateOptionsFlags::RESERVE_OPFILTER_LE);
+ print_flag_if_set(out, "OPEN_REPARSE_POINT_LE", int_value, CreateOptionsFlags::OPEN_REPARSE_POINT_LE);
+ print_flag_if_set(out, "OPEN_NO_RECALL_LE", int_value, CreateOptionsFlags::OPEN_NO_RECALL_LE);
+ print_flag_if_set(out, "OPEN_FOR_FREE_SPACE_QUERY_LE", int_value, CreateOptionsFlags::OPEN_FOR_FREE_SPACE_QUERY_LE);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const WriteFlags value)
+{
+ auto int_value = to_integral(value);
+
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "SMB2_WRITEFLAG_WRITE_THROUGH", int_value, WriteFlags::SMB2_WRITEFLAG_WRITE_THROUGH);
+ print_flag_if_set(out, "SMB2_WRITEFLAG_WRITE_UNBUFFERED", int_value, WriteFlags::SMB2_WRITEFLAG_WRITE_UNBUFFERED);
+ out << ")";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ShareFlags value)
+{
+ auto int_value = to_integral(value) & ~to_integral(ShareFlags::NO_CACHING);
+
+ out << "Caching policy = ";
+ switch(to_integral(value) & to_integral(ShareFlags::NO_CACHING))
+ {
+ case to_integral(ShareFlags::MANUAL_CACHING): out << "MANUAL_CACHING"; break;
+ case to_integral(ShareFlags::AUTO_CACHING): out << "AUTO_CACHING"; break;
+ case to_integral(ShareFlags::VDO_CACHING): out << "VDO_CACHING"; break;
+ case to_integral(ShareFlags::NO_CACHING): out << "NO_CACHING"; break;
+ }
+
+ if(int_value > 0)
+ {
+ out << flagDelimiter;
+ print_flag_if_set(out, "SMB2_SHAREFLAG_DFS", int_value, ShareFlags::DFS);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_DFS_ROOT", int_value, ShareFlags::DFS_ROOT);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_RESTRICT_EXCLUSIVE_OPENS", int_value, ShareFlags::RESTRICT_EXCLUSIVE_OPENS);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_FORCE_SHARED_DELETE", int_value, ShareFlags::FORCE_SHARED_DELETE);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_ALLOW_NAMESPACE_CACHING", int_value, ShareFlags::ALLOW_NAMESPACE_CACHING);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM", int_value, ShareFlags::ACCESS_BASED_DIRECTORY_ENUM);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_FORCE_LEVELII_OPLOCK", int_value, ShareFlags::FORCE_LEVELII_OPLOCK);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_ENABLE_HASH_V1", int_value, ShareFlags::ENABLE_HASH);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_ENABLE_HASH_V2", int_value, ShareFlags::ENABLE_HASH_2);
+ print_flag_if_set(out, "SMB2_SHAREFLAG_ENCRYPT_DATA", int_value, ShareFlags::ENABLE_ENCRYPT_DATA);
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ShareCapabilities value)
+{
+ auto int_value = to_integral(value);
+
+ if(int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "SMB2_SHARE_CAP_DFS", int_value, ShareCapabilities::DFS);
+ print_flag_if_set(out, "SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY", int_value, ShareCapabilities::CONTINUOUS_AVAILABILITY);
+ print_flag_if_set(out, "SMB2_SHARE_CAP_SCALEOUT", int_value, ShareCapabilities::SCALEOUT);
+ print_flag_if_set(out, "SMB2_SHARE_CAP_CLUSTER", int_value, ShareCapabilities::CLUSTER);
+ print_flag_if_set(out, "SMB2_SHARE_CAP_ASYMMETRIC", int_value, ShareCapabilities::ASYMMETRIC);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SecurityModeShort value)
+{
+ auto int_value = to_integral(value);
+
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "SIGNING_ENABLED", int_value, SecurityModeShort::SIGNING_ENABLED);
+ print_flag_if_set(out, "SIGNING_REQUIRED", int_value, SecurityModeShort::SIGNING_REQUIRED);
+ out << ")";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const Capabilities value)
+{
+ auto int_value = to_integral(value);
+
+ if(int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "DFS", int_value, Capabilities::DFS);
+ print_flag_if_set(out, "LEASING", int_value, Capabilities::LEASING);
+ print_flag_if_set(out, "LARGE_MTU", int_value, Capabilities::LARGE_MTU);
+ print_flag_if_set(out, "MULTI_CHANNEL", int_value, Capabilities::MULTI_CHANNEL);
+ print_flag_if_set(out, "PERSISTENT_HANDLES",int_value, Capabilities::PERSISTENT_HANDLES);
+ print_flag_if_set(out, "DIRECTORY_LEASING", int_value, Capabilities::DIRECTORY_LEASING);
+ print_flag_if_set(out, "ENCRYPTION", int_value, Capabilities::ENCRYPTION);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SessionFlags value)
+{
+ auto int_value = to_integral(value);
+
+ print_flag_if_set(out, "NONE", int_value, SessionFlags::NONE);
+ print_flag_if_set(out, "SMB2_SESSION_FLAG_IS_GUEST", int_value, SessionFlags::IS_GUEST);
+ print_flag_if_set(out, "SMB2_SESSION_FLAG_IS_NULL", int_value, SessionFlags::IS_NULL);
+ print_flag_if_set(out, "SMB2_SESSION_FLAG_ENCRYPT_DATA",int_value, SessionFlags::IS_ENCRYPT_DATA);
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const AccessMask value)
+{
+ auto int_value = to_integral(value);
+
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "FILE_READ_DATA", int_value, AccessMask::FILE_READ_DATA);
+ print_flag_if_set(out, "FILE_WRITE_DATA", int_value, AccessMask::FILE_WRITE_DATA);
+ print_flag_if_set(out, "FILE_APPEND_DATA", int_value, AccessMask::FILE_APPEND_DATA);
+ print_flag_if_set(out, "FILE_READ_EA", int_value, AccessMask::FILE_READ_EA);
+ print_flag_if_set(out, "FILE_WRITE_EA", int_value, AccessMask::FILE_WRITE_EA);
+ print_flag_if_set(out, "FILE_DELETE_CHILD", int_value, AccessMask::FILE_DELETE_CHILD);
+ print_flag_if_set(out, "FILE_EXECUTE", int_value, AccessMask::FILE_EXECUTE);
+ print_flag_if_set(out, "FILE_READ_ATTRIBUTES", int_value, AccessMask::FILE_READ_ATTRIBUTES);
+ print_flag_if_set(out, "FILE_WRITE_ATTRIBUTES", int_value, AccessMask::FILE_WRITE_ATTRIBUTES);
+ print_flag_if_set(out, "DELETE", int_value, AccessMask::DELETE);
+ print_flag_if_set(out, "READ_CONTROL", int_value, AccessMask::READ_CONTROL);
+ print_flag_if_set(out, "WRITE_DAC", int_value, AccessMask::WRITE_DAC);
+ print_flag_if_set(out, "WRITE_OWNER", int_value, AccessMask::WRITE_OWNER);
+ print_flag_if_set(out, "SYNCHRONIZE", int_value, AccessMask::SYNCHRONIZE);
+ print_flag_if_set(out, "ACCESS_SYSTEM_SECURITY", int_value, AccessMask::ACCESS_SYSTEM_SECURITY);
+ print_flag_if_set(out, "MAXIMUM_ALLOWED", int_value, AccessMask::MAXIMUM_ALLOWED);
+ print_flag_if_set(out, "GENERIC_ALL", int_value, AccessMask::GENERIC_ALL);
+ print_flag_if_set(out, "GENERIC_EXECUTE", int_value, AccessMask::GENERIC_EXECUTE);
+ print_flag_if_set(out, "GENERIC_WRITE", int_value, AccessMask::GENERIC_WRITE);
+ print_flag_if_set(out, "GENERIC_READ", int_value, AccessMask::GENERIC_READ);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const CloseFlags value)
+{
+ auto int_value = to_integral(value);
+
+ if(int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "POSTQUERY_ATTRIB", int_value, CloseFlags::POSTQUERY_ATTRIB);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SecurityMode value)
+{
+ auto int_value = to_integral(value);
+
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "SIGNING_ENABLED", int_value, SecurityMode::SIGNING_ENABLED);
+ print_flag_if_set(out, "SIGNING_REQUIRED", int_value, SecurityMode::SIGNING_REQUIRED);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const FsInfoLevels value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const QueryInfoLevels value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const CtlCodes value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const InfoTypes value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SessionFlagsBinding value)
+{
+ const char *strValue = enumToString(value);
+ if (strValue != nullptr)
+ {
+ out << "(" << strValue << ")";
+ }
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const Flags value)
+{
+ auto int_value = to_integral(value);
+ if (int_value > 0)
+ {
+ out << "(";
+ print_flag_if_set(out, "SERVER_TO_REDIR", int_value, Flags::SERVER_TO_REDIR);
+ print_flag_if_set(out, "ASYNC_COMMAND", int_value, Flags::ASYNC_COMMAND);
+ print_flag_if_set(out, "RELATED_OPERATIONS", int_value, Flags::RELATED_OPERATIONS);
+ print_flag_if_set(out, "SIGNED", int_value, Flags::SIGNED);
+ print_flag_if_set(out, "DFS_OPERATIONS", int_value, Flags::DFS_OPERATIONS);
+ print_flag_if_set(out, "REPLAY_OPERATION", int_value, Flags::REPLAY_OPERATION);
+ out << ")";
+ }
+
+ return out;
+}
+
+std::ostream& print_info_levels(std::ostream& out, const InfoTypes infoType, const uint8_t infoClass)
+{
+ switch(infoType)
+ {
+ case InfoTypes::FILE:
+ print_enum(out, "InfoLevel", static_cast<QueryInfoLevels>(infoClass));
+ break;
+ case InfoTypes::FILESYSTEM:
+ print_enum(out, "InfoLevel", static_cast<FsInfoLevels>(infoClass));
+ break;
+ default:
+ //we dont handle other classes
+ ;
+ }
+ return out;
+}
+} // namespace CIFSv2
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
diff --git a/src/protocols/cifs2/cifs2_utils.h b/src/protocols/cifs2/cifs2_utils.h
new file mode 100644
index 0000000..9666630
--- /dev/null
+++ b/src/protocols/cifs2/cifs2_utils.h
@@ -0,0 +1,95 @@
+//------------------------------------------------------------------------------
+// Author: Artsem Iliasau
+// Description: Helpers for parsing CIFSv2 structures.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef CIFS2_UTILS_H
+#define CIFS2_UTILS_H
+//------------------------------------------------------------------------------
+#include <iosfwd>
+#include <sstream>
+
+#include "api/cifs2_commands.h"
+#include "protocols/nfs/nfs_utils.h"
+#include "cifs2.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace CIFSv2
+{
+
+namespace SMBv2 = NST::API::SMBv2;
+
+/*! Convert enum type to underlying integer type
+ * \param e - instance of enumeration to be converted
+ * \return integer representation of enumeration
+ */
+template<typename E>
+inline constexpr auto to_integral(E e) -> typename std::underlying_type<E>::type
+{
+ return static_cast<typename std::underlying_type<E>::type>(e);
+}
+std::ostream& operator<<(std::ostream& out, const SMBv2::SMBv2Commands value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::QueryInfoLevels value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::FsInfoLevels value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::CtlCodes value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::InfoTypes value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::ShareTypes value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::ShareFlags value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::ShareCapabilities value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::OplockLevels value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::ImpersonationLevels value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::DesiredAccessFlags value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::FileAttributes value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::ShareAccessFlags value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::CreateDisposition value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::CreateOptionsFlags value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::CreateActions value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::WriteFlags value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::SessionFlagsBinding value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::SecurityModeShort value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::Capabilities value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::SessionFlags value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::NTStatus value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::AccessMask value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::CloseFlags value);
+std::ostream& operator<<(std::ostream& out, const SMBv2::SecurityMode value);
+std::ostream& operator<<(std::ostream& out, Flags value);
+
+template <typename T>
+std::ostream& print_enum(std::ostream& out, const std::string name, T value )
+{
+ using namespace NST::protocols::NFS;
+ out << " " << name << " = ";
+ auto int_value = to_integral(value);
+ print_hex(out, int_value);
+ out << " " << value;
+ return out;
+}
+
+std::ostream& print_info_levels(std::ostream& os, const NST::API::SMBv2::InfoTypes infoType, const uint8_t infoClass);
+
+} // namespace CIFSv2
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//CIFS2_UTILS_H
+//------------------------------------------------------------------------------
diff --git a/src/protocols/ip/ipv4_header.h b/src/protocols/ip/ipv4_header.h
index 856b47f..8f649ce 100644
--- a/src/protocols/ip/ipv4_header.h
+++ b/src/protocols/ip/ipv4_header.h
@@ -76,10 +76,10 @@ struct IPv4Header : private ipv4_header
inline in_addr_t dst() const { return ipv4_dst; }
inline uint16_t checksum() const { return ntohs(ipv4_checksum); }
- inline bool is_fragmented() const { return ipv4_fragmentation & 0xff3f /*0xff3f == htons(MF | OFFMASK)*/; }
+ inline bool is_fragmented() const { return ipv4_fragmentation & htons(MF | OFFMASK); }
inline bool is_fragmented_and_not_the_first_part() const
{
- return ipv4_fragmentation & 0xff1f /*offset() != 0*/;
+ return ipv4_fragmentation & htons(OFFMASK) /*offset() != 0*/;
}
} __attribute__ ((__packed__));
diff --git a/src/protocols/netbios/netbios.cpp b/src/protocols/netbios/netbios.cpp
new file mode 100644
index 0000000..263f91a
--- /dev/null
+++ b/src/protocols/netbios/netbios.cpp
@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Helpers for parsing NETBios structures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <arpa/inet.h>
+
+#include "protocols/netbios/netbios.h"
+//------------------------------------------------------------------------------
+using namespace NST::protocols::NetBIOS;
+
+int8_t MessageHeader::start() const
+{
+ return _start;
+}
+
+size_t MessageHeader::len() const
+{
+ // reserved field "_" is used as part of "length" field when length more than 65535 bytes
+ return ntohs(length) | (_ << 16);
+}
diff --git a/src/protocols/netbios/netbios.h b/src/protocols/netbios/netbios.h
new file mode 100644
index 0000000..9fd5bd3
--- /dev/null
+++ b/src/protocols/netbios/netbios.h
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Helpers for parsing NetBIOS structures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NETBIOS_HEADER_H
+#define NETBIOS_HEADER_H
+//------------------------------------------------------------------------------
+#include <stdlib.h>
+#include <cstdint>
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace NetBIOS
+{
+
+/*! \class NetBIOS message header in SMB-direct case
+ */
+struct RawMessageHeader
+{
+ uint8_t _start;//!< In SMB direct always 0x00
+ uint8_t _;
+ uint16_t length;//!< Packet length
+} __attribute__ ((__packed__));
+
+/*! \class NetBIOS message header wrapper
+ */
+struct MessageHeader : private RawMessageHeader
+{
+ int8_t start() const;
+ size_t len() const;
+};
+
+/*! Check is data valid NetBIOS message's header and return header or nullptr
+ * \param data - raw packet data
+ * \return pointer to input data which is casted to header structure or nullptr (if it is not valid header)
+ */
+inline const struct MessageHeader* get_header(const uint8_t* data)
+{
+ const MessageHeader* header (reinterpret_cast<const MessageHeader*>(data));
+ if (header->start() == 0x00)
+ {
+ return header;
+ }
+ return nullptr;
+}
+
+} // namespace NetBIOS
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NETBIOS_HEADER_H
+//------------------------------------------------------------------------------
diff --git a/src/protocols/nfs/nfs_procedure.h b/src/protocols/nfs/nfs_procedure.h
index 765dc16..9fc93dc 100644
--- a/src/protocols/nfs/nfs_procedure.h
+++ b/src/protocols/nfs/nfs_procedure.h
@@ -24,17 +24,20 @@
//------------------------------------------------------------------------------
#include <rpc/rpc.h>
-#include "api/rpc_procedure.h"
+#include "api/rpc_types.h"
#include "protocols/nfs3/nfs3_utils.h"
#include "protocols/nfs4/nfs4_utils.h"
+#include "protocols/nfs4/nfs41_utils.h"
#include "utils/sessions.h"
//------------------------------------------------------------------------------
namespace NST
{
namespace protocols
{
-using namespace NFS3;
-using namespace NFS4;
+
+using NFS3::proc_t_of;
+using NFS4::proc_t_of;
+using NFS41::proc_t_of;
template
<
@@ -48,15 +51,15 @@ public:
: parg{&arg} // set pointer to argument
, pres{&res} // set pointer to result
{
- memset(&rpc_call, 0,sizeof(rpc_call ));
- memset(&rpc_reply,0,sizeof(rpc_reply));
+ memset(&call, 0,sizeof(call ));
+ memset(&reply,0,sizeof(reply));
memset(&arg, 0,sizeof(arg ));
memset(&res, 0,sizeof(res ));
// fill call
- if(!xdr_callmsg(c.xdr(), &rpc_call))
+ if(!xdr_callmsg(c.xdr(), &call))
{
- xdr_free((xdrproc_t)xdr_callmsg, (char*)&rpc_call);
+ xdr_free((xdrproc_t)xdr_callmsg, (char*)&call);
throw xdr::XDRDecoderError{"XDRDecoder: cann't read call data"};
}
@@ -64,31 +67,31 @@ public:
if(!proc_t_of(arg)(c.xdr(),&arg))
{
xdr_free((xdrproc_t)proc_t_of(arg), (char*)&arg );
- xdr_free((xdrproc_t)xdr_callmsg, (char*)&rpc_call);
+ xdr_free((xdrproc_t)xdr_callmsg, (char*)&call);
throw xdr::XDRDecoderError{"XDRDecoder: cann't read call arguments"};
}
- rpc_reply.ru.RM_rmb.ru.RP_ar.ru.AR_results.proc = &return_true;
+ reply.ru.RM_rmb.ru.RP_ar.ru.AR_results.proc = &return_true;
// fill reply
- if(!xdr_replymsg (r.xdr(), &rpc_reply))
+ if(!xdr_replymsg (r.xdr(), &reply))
{
- xdr_free((xdrproc_t)xdr_replymsg, (char*)&rpc_reply);
+ xdr_free((xdrproc_t)xdr_replymsg, (char*)&reply);
xdr_free((xdrproc_t)proc_t_of(arg),(char*)&arg );
- xdr_free((xdrproc_t)xdr_callmsg, (char*)&rpc_call );
+ xdr_free((xdrproc_t)xdr_callmsg, (char*)&call );
throw xdr::XDRDecoderError{"XDRDecoder: cann't read reply data"};
}
- if(rpc_reply.ru.RM_rmb.rp_stat == reply_stat::MSG_ACCEPTED &&
- rpc_reply.ru.RM_rmb.ru.RP_ar.ar_stat == accept_stat::SUCCESS)
+ if(reply.ru.RM_rmb.rp_stat == reply_stat::MSG_ACCEPTED &&
+ reply.ru.RM_rmb.ru.RP_ar.ar_stat == accept_stat::SUCCESS)
{
// fill reply results
if(!proc_t_of(res)(r.xdr(),&res))
{
xdr_free((xdrproc_t)proc_t_of(res), (char*)&res );
- xdr_free((xdrproc_t)xdr_replymsg, (char*)&rpc_reply);
+ xdr_free((xdrproc_t)xdr_replymsg, (char*)&reply);
xdr_free((xdrproc_t)proc_t_of(arg), (char*)&arg );
- xdr_free((xdrproc_t)xdr_callmsg, (char*)&rpc_call );
+ xdr_free((xdrproc_t)xdr_callmsg, (char*)&call );
throw xdr::XDRDecoderError{"XDRDecoder: cann't read reply results"};
}
}
@@ -106,9 +109,9 @@ public:
inline ~NFSProcedure()
{
if(pres) xdr_free((xdrproc_t)proc_t_of(res), (char*)&res );
- xdr_free((xdrproc_t)xdr_replymsg, (char*)&rpc_reply);
+ xdr_free((xdrproc_t)xdr_replymsg, (char*)&reply);
xdr_free((xdrproc_t)proc_t_of(arg), (char*)&arg );
- xdr_free((xdrproc_t)xdr_callmsg, (char*)&rpc_call );
+ xdr_free((xdrproc_t)xdr_callmsg, (char*)&call );
}
// pointers to procedure specific argument and result
@@ -125,34 +128,43 @@ private:
namespace NFS3
{
-using NFSPROC3RPCGEN_NULL = NFSProcedure <rpcgen::NULL3args, rpcgen::NULL3res>;
-using NFSPROC3RPCGEN_GETATTR = NFSProcedure <rpcgen::GETATTR3args, rpcgen::GETATTR3res>;
-using NFSPROC3RPCGEN_SETATTR = NFSProcedure <rpcgen::SETATTR3args, rpcgen::SETATTR3res>;
-using NFSPROC3RPCGEN_LOOKUP = NFSProcedure <rpcgen::LOOKUP3args, rpcgen::LOOKUP3res>;
-using NFSPROC3RPCGEN_ACCESS = NFSProcedure <rpcgen::ACCESS3args, rpcgen::ACCESS3res>;
-using NFSPROC3RPCGEN_READLINK = NFSProcedure <rpcgen::READLINK3args, rpcgen::READLINK3res>;
-using NFSPROC3RPCGEN_READ = NFSProcedure <rpcgen::READ3args, rpcgen::READ3res>;
-using NFSPROC3RPCGEN_WRITE = NFSProcedure <rpcgen::WRITE3args, rpcgen::WRITE3res>;
-using NFSPROC3RPCGEN_CREATE = NFSProcedure <rpcgen::CREATE3args, rpcgen::CREATE3res>;
-using NFSPROC3RPCGEN_MKDIR = NFSProcedure <rpcgen::MKDIR3args, rpcgen::MKDIR3res>;
-using NFSPROC3RPCGEN_SYMLINK = NFSProcedure <rpcgen::SYMLINK3args, rpcgen::SYMLINK3res>;
-using NFSPROC3RPCGEN_MKNOD = NFSProcedure <rpcgen::MKNOD3args, rpcgen::MKNOD3res>;
-using NFSPROC3RPCGEN_REMOVE = NFSProcedure <rpcgen::REMOVE3args, rpcgen::REMOVE3res>;
-using NFSPROC3RPCGEN_RMDIR = NFSProcedure <rpcgen::RMDIR3args, rpcgen::RMDIR3res>;
-using NFSPROC3RPCGEN_RENAME = NFSProcedure <rpcgen::RENAME3args, rpcgen::RENAME3res>;
-using NFSPROC3RPCGEN_LINK = NFSProcedure <rpcgen::LINK3args, rpcgen::LINK3res>;
-using NFSPROC3RPCGEN_READDIR = NFSProcedure <rpcgen::READDIR3args, rpcgen::READDIR3res>;
-using NFSPROC3RPCGEN_READDIRPLUS = NFSProcedure <rpcgen::READDIRPLUS3args, rpcgen::READDIRPLUS3res>;
-using NFSPROC3RPCGEN_FSSTAT = NFSProcedure <rpcgen::FSSTAT3args, rpcgen::FSSTAT3res>;
-using NFSPROC3RPCGEN_FSINFO = NFSProcedure <rpcgen::FSINFO3args, rpcgen::FSINFO3res>;
-using NFSPROC3RPCGEN_PATHCONF = NFSProcedure <rpcgen::PATHCONF3args, rpcgen::PATHCONF3res>;
-using NFSPROC3RPCGEN_COMMIT = NFSProcedure <rpcgen::COMMIT3args, rpcgen::COMMIT3res>;
+namespace NFS3 = NST::API::NFS3;
+using NFSPROC3RPCGEN_NULL = NFSProcedure <NFS3::NULL3args, NFS3::NULL3res>;
+using NFSPROC3RPCGEN_GETATTR = NFSProcedure <NFS3::GETATTR3args, NFS3::GETATTR3res>;
+using NFSPROC3RPCGEN_SETATTR = NFSProcedure <NFS3::SETATTR3args, NFS3::SETATTR3res>;
+using NFSPROC3RPCGEN_LOOKUP = NFSProcedure <NFS3::LOOKUP3args, NFS3::LOOKUP3res>;
+using NFSPROC3RPCGEN_ACCESS = NFSProcedure <NFS3::ACCESS3args, NFS3::ACCESS3res>;
+using NFSPROC3RPCGEN_READLINK = NFSProcedure <NFS3::READLINK3args, NFS3::READLINK3res>;
+using NFSPROC3RPCGEN_READ = NFSProcedure <NFS3::READ3args, NFS3::READ3res>;
+using NFSPROC3RPCGEN_WRITE = NFSProcedure <NFS3::WRITE3args, NFS3::WRITE3res>;
+using NFSPROC3RPCGEN_CREATE = NFSProcedure <NFS3::CREATE3args, NFS3::CREATE3res>;
+using NFSPROC3RPCGEN_MKDIR = NFSProcedure <NFS3::MKDIR3args, NFS3::MKDIR3res>;
+using NFSPROC3RPCGEN_SYMLINK = NFSProcedure <NFS3::SYMLINK3args, NFS3::SYMLINK3res>;
+using NFSPROC3RPCGEN_MKNOD = NFSProcedure <NFS3::MKNOD3args, NFS3::MKNOD3res>;
+using NFSPROC3RPCGEN_REMOVE = NFSProcedure <NFS3::REMOVE3args, NFS3::REMOVE3res>;
+using NFSPROC3RPCGEN_RMDIR = NFSProcedure <NFS3::RMDIR3args, NFS3::RMDIR3res>;
+using NFSPROC3RPCGEN_RENAME = NFSProcedure <NFS3::RENAME3args, NFS3::RENAME3res>;
+using NFSPROC3RPCGEN_LINK = NFSProcedure <NFS3::LINK3args, NFS3::LINK3res>;
+using NFSPROC3RPCGEN_READDIR = NFSProcedure <NFS3::READDIR3args, NFS3::READDIR3res>;
+using NFSPROC3RPCGEN_READDIRPLUS = NFSProcedure <NFS3::READDIRPLUS3args, NFS3::READDIRPLUS3res>;
+using NFSPROC3RPCGEN_FSSTAT = NFSProcedure <NFS3::FSSTAT3args, NFS3::FSSTAT3res>;
+using NFSPROC3RPCGEN_FSINFO = NFSProcedure <NFS3::FSINFO3args, NFS3::FSINFO3res>;
+using NFSPROC3RPCGEN_PATHCONF = NFSProcedure <NFS3::PATHCONF3args, NFS3::PATHCONF3res>;
+using NFSPROC3RPCGEN_COMMIT = NFSProcedure <NFS3::COMMIT3args, NFS3::COMMIT3res>;
}
namespace NFS4
{
-using NFSPROC4RPCGEN_NULL = NFSProcedure <rpcgen::NULL4args, rpcgen::NULL4res>;
-using NFSPROC4RPCGEN_COMPOUND = NFSProcedure <rpcgen::COMPOUND4args, rpcgen::COMPOUND4res>;
+namespace NFS4 = NST::API::NFS4;
+using NFSPROC4RPCGEN_NULL = NFSProcedure <NFS4::NULL4args, NFS4::NULL4res>;
+using NFSPROC4RPCGEN_COMPOUND = NFSProcedure <NFS4::COMPOUND4args, NFS4::COMPOUND4res>;
+}
+
+namespace NFS41
+{
+namespace NFS41 = NST::API::NFS41;
+using NFSPROC41RPCGEN_NULL = NFSProcedure <NFS41::NULL4args, NFS41::NULL4res>;
+using NFSPROC41RPCGEN_COMPOUND = NFSProcedure <NFS41::COMPOUND4args, NFS41::COMPOUND4res>;
}
} // namespace protocols
diff --git a/src/protocols/nfs/nfs_utils.cpp b/src/protocols/nfs/nfs_utils.cpp
index 0203634..a2517b9 100644
--- a/src/protocols/nfs/nfs_utils.cpp
+++ b/src/protocols/nfs/nfs_utils.cpp
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------
-// Author: Alexey Costroma
+// Author: Alexey Costroma
// Description: Helpers for parsing NFS structures.
// Copyright (c) 2014 EPAM Systems
//------------------------------------------------------------------------------
@@ -30,12 +30,39 @@ namespace protocols
namespace NFS
{
+void print_hex64(std::ostream& out, uint64_t val)
+
+{
+ out << "0x" << std::setfill('0') << std::setw(16) << std::hex << val
+ << std::dec << std::setfill(' ');
+}
+
+void print_hex32(std::ostream& out, uint32_t val)
+{
+ out << "0x" << std::setfill('0') << std::setw(8) << std::hex << val
+ << std::dec << std::setfill(' ');
+}
+
+void print_hex16(std::ostream& out, uint16_t val)
+{
+ out << "0x" << std::setfill('0') << std::setw(4) << std::hex << val
+ << std::dec << std::setfill(' ');
+}
+
+void print_hex8(std::ostream& out, uint8_t val)
+{
+ out << "0x" << std::setfill('0') << std::setw(2) << std::hex
+ << static_cast<u_int16_t>(val) // prevent implicit cast to char
+ << std::dec << std::setfill(' ');
+}
+
+
void print_hex(std::ostream& out, const uint32_t* const val, const uint32_t len)
{
- if(len)
+ if (len)
{
- out << std::hex << std::setfill('0');
- for(uint32_t i {0}; i < len; i++)
+ out << std::hex << std::setfill('0') << "0x";
+ for (uint32_t i {0}; i < len; i++)
{
out << std::setw(2) << val[i];
}
@@ -49,13 +76,13 @@ void print_hex(std::ostream& out, const uint32_t* const val, const uint32_t len)
void print_hex(std::ostream& out, const char* const val, const uint32_t len)
{
- if(len)
+ if (len)
{
- out << std::hex << std::setfill('0');
- for(uint32_t i {0}; i < len; i++)
+ out << std::hex << std::setfill('0') << "0x";
+ for (uint32_t i {0}; i < len; i++)
{
- out << std::setw(2)
- << ((static_cast<int32_t>(val[i])) & 0xFF);
+ out << std::setw(2)
+ << ((static_cast<int32_t>(val[i])) & 0xFF);
}
out << std::dec << std::setfill(' ');
}
@@ -67,12 +94,12 @@ void print_hex(std::ostream& out, const char* const val, const uint32_t len)
void print_nfs_fh(std::ostream& out, const char* const val, const uint32_t len)
{
- if(len)
+ if (len)
{
out << std::hex << std::setfill('0');
- if(len <= 8 || out_all())
+ if (len <= 8 || out_all())
{
- for(uint32_t i {0}; i < len; i++)
+ for (uint32_t i {0}; i < len; i++)
{
out << std::setw(2)
<< ((static_cast<int32_t>(val[i])) & 0xFF);
@@ -80,13 +107,13 @@ void print_nfs_fh(std::ostream& out, const char* const val, const uint32_t len)
}
else // truncate binary data to: 00112233...CCDDEEFF
{
- for(uint32_t i {0}; i < 4; i++)
+ for (uint32_t i {0}; i < 4; i++)
{
out << std::setw(2)
<< ((static_cast<int32_t>(val[i])) & 0xFF);
}
out << "...";
- for(uint32_t i {len-4}; i < len; i++)
+ for (uint32_t i {len - 4}; i < len; i++)
{
out << std::setw(2)
<< ((static_cast<int32_t>(val[i])) & 0xFF);
diff --git a/src/protocols/nfs/nfs_utils.h b/src/protocols/nfs/nfs_utils.h
index 402a51b..f4bedf4 100644
--- a/src/protocols/nfs/nfs_utils.h
+++ b/src/protocols/nfs/nfs_utils.h
@@ -19,16 +19,17 @@
along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
-#define NST_PUBLIC __attribute__ ((visibility("default")))
#ifndef NFS_UTILS_H
#define NFS_UTILS_H
//------------------------------------------------------------------------------
#include <ostream>
+#include <iomanip>
#include <cstring>
-#include "api/nfs3_types_rpcgen.h"
#include "utils/out.h"
//------------------------------------------------------------------------------
+#define NST_PUBLIC __attribute__ ((visibility("default")))
+//------------------------------------------------------------------------------
namespace NST
{
namespace protocols
@@ -43,6 +44,42 @@ inline bool out_all()
return Out::Global::get_level() == Out::Level::All;
}
+namespace
+{
+template <typename T>
+struct Helper
+{
+ static void print_hex(std::ostream& out, T val)
+ {
+ out << "0x" << std::setfill('0') << std::setw(sizeof(T)/4) << std::hex << val
+ << std::dec << std::setfill(' ');
+ }
+};
+template <>
+struct Helper<uint8_t>
+{
+ static void print_hex(std::ostream& out, char val)
+ {
+ out << "0x" << std::setfill('0') << std::setw(4) << std::hex <<
+ static_cast<uint16_t>(val) << std::dec << std::setfill(' ');
+ }
+};
+}
+
+template <typename T>
+void print_hex(std::ostream& out, T val)
+{
+ Helper<T>::print_hex(out, val);
+}
+
+void print_hex64(std::ostream& out, uint64_t val);
+
+void print_hex32(std::ostream& out, uint32_t val);
+
+void print_hex16(std::ostream& out, uint16_t val);
+
+void print_hex8(std::ostream& out, uint8_t val);
+
void print_hex(std::ostream& out,
const uint32_t* const val,
const uint32_t len);
diff --git a/src/protocols/nfs/nfsv41.x b/src/protocols/nfs/nfsv41.x
index b86092e..c2e7f31 100644
--- a/src/protocols/nfs/nfsv41.x
+++ b/src/protocols/nfs/nfsv41.x
@@ -1,16 +1,53 @@
/*
- * This file was machine generated for
- * draft-ietf-nfsv4-minorversion1-21
- * Last updated Mon Feb 25 16:16:21 CST 2008
- */
-/*
- * Copyright (C) The IETF Trust (2007-2008)
- * All Rights Reserved.
+ * Copyright (c) 2010 IETF Trust and the persons identified
+ * as the document authors. All rights reserved.
+ *
+ * The document authors are identified in RFC 3530 and
+ * RFC 5661.
+ *
+ * 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.
*
- * Copyright (C) The Internet Society (1998-2006).
- * All Rights Reserved.
+ * - Neither the name of Internet Society, IETF or IETF
+ * Trust, nor the names of specific 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 code was derived from RFC 3530. Please
+ * reproduce this note if possible.
+ *
+ * This code was derived from RFC 5661. Please
+ * reproduce this note if possible.
+ *
+ * This file was machine generated from RFC 5662.
*/
-
/*
* nfs4_prot.x
*/
@@ -19,34 +56,18 @@
%#define _AUTH_SYS_DEFINE_FOR_NFSv41
%#include <rpc/auth_sys.h>
%typedef struct authsys_parms authsys_parms;
-%#endif _AUTH_SYS_DEFINE_FOR_NFSv41
+%#endif /* _AUTH_SYS_DEFINE_FOR_NFSv41 */
/*
* Basic typedefs for RFC 1832 data type definitions
*/
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef hyper int64_t;
-typedef unsigned hyper uint64_t;
-
/*
- * FRED - added missing referents
+ * typedef int int32_t;
+ * typedef unsigned int uint32_t;
+ * typedef hyper int64_t;
+ * typedef unsigned hyper uint64_t;
*/
-const FALSE = 0;
-const TRUE = 1;
-
-const AUTH_NONE = 0;
-const AUTH_SYS = 1;
-const RPCSEC_GSS = 6;
-
-struct authsys_parms {
- unsigned int stamp;
- string machinename<255>;
- unsigned int uid;
- unsigned int gid;
- unsigned int gids<16>;
-};
/*
* Sizes
@@ -94,7 +115,13 @@ enum nfsstat4 {
NFS4ERR_ACCESS = 13, /* access denied */
NFS4ERR_EXIST = 17, /* file already exists */
NFS4ERR_XDEV = 18, /* different filesystems */
- /* Unused/reserved 19 */
+
+ /*
+ * Please do not allocate value 19; it was used in NFSv3
+ * and we do not want a value in NFSv3 to have a different
+ * meaning in NFSv4.x.
+ */
+
NFS4ERR_NOTDIR = 20, /* should be a directory */
NFS4ERR_ISDIR = 21, /* should not be directory */
NFS4ERR_INVAL = 22, /* invalid argument */
@@ -173,7 +200,7 @@ enum nfsstat4 {
NFS4ERR_NOMATCHING_LAYOUT = 10060,
NFS4ERR_RECALLCONFLICT = 10061,
NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062,
- NFS4ERR_SEQ_MISORDERED = 10063,/* unexpected seq.id in req*/
+ NFS4ERR_SEQ_MISORDERED = 10063,/* unexpected seq.ID in req*/
NFS4ERR_SEQUENCE_POS = 10064,/* [CB_]SEQ. op not 1st op */
NFS4ERR_REQ_TOO_BIG = 10065,/* request too big */
NFS4ERR_REP_TOO_BIG = 10066,/* reply too big */
@@ -183,7 +210,7 @@ enum nfsstat4 {
NFS4ERR_TOO_MANY_OPS = 10070,/*too many ops in [CB_]COMP*/
NFS4ERR_OP_NOT_IN_SESSION =10071,/* op needs [CB_]SEQ. op */
NFS4ERR_HASH_ALG_UNSUPP = 10072, /* hash alg. not supp. */
- NFS4ERR_CONN_BINDING_NOT_ENFORCED =10073,/* SET_SSV not OK*/
+ /* Error 10073 is unused. */
NFS4ERR_CLIENTID_BUSY = 10074,/* clientid has state */
NFS4ERR_PNFS_IO_HOLE = 10075,/* IO to _SPARSE file hole */
NFS4ERR_SEQ_FALSE_RETRY= 10076,/* Retry != original req. */
@@ -194,9 +221,10 @@ enum nfsstat4 {
NFS4ERR_NOT_ONLY_OP = 10081,/* addl ops not allowed */
NFS4ERR_WRONG_CRED = 10082,/* op done by wrong cred */
NFS4ERR_WRONG_TYPE = 10083,/* op on wrong type object */
- NFS4ERR_DIRDELEG_UNAVAIL= 10084,/* delegation not avail. */
+ NFS4ERR_DIRDELEG_UNAVAIL=10084,/* delegation not avail. */
NFS4ERR_REJECT_DELEG = 10085,/* cb rejected delegation */
- NFS4ERR_RETURNCONFLICT = 10086 /* layout get before return*/
+ NFS4ERR_RETURNCONFLICT = 10086,/* layout get before return*/
+ NFS4ERR_DELEG_REVOKED = 10087 /* deleg./layout revoked */
};
/*
@@ -291,6 +319,9 @@ struct fs_locations4 {
* Access Control Entries are supported.
* Values for the fattr4_aclsupport attribute.
*/
+
+typedef uint32_t fattr4_aclsupport;
+
const ACL4_SUPPORT_ALLOW_ACL = 0x00000001;
const ACL4_SUPPORT_DENY_ACL = 0x00000002;
const ACL4_SUPPORT_AUDIT_ACL = 0x00000004;
@@ -426,6 +457,7 @@ struct nfsacl41 {
nfsace4 na41_aces<>;
};
+
/*
* Field definitions for the fattr4_mode
* and fattr4_mode_set_masked attributes.
@@ -514,12 +546,12 @@ struct layout_content4 {
%/*
-%/* LAYOUT4_OSD2_OBJECTS loc_body description
+% * LAYOUT4_OSD2_OBJECTS loc_body description
% * is in a separate .x file
% */
%
%/*
-%/* LAYOUT4_BLOCK_VOLUME loc_body description
+% * LAYOUT4_BLOCK_VOLUME loc_body description
% * is in a separate .x file
% */
@@ -643,7 +675,6 @@ typedef uint32_t fs_charset_cap4;
* NFSv4.1 attributes
*/
typedef bitmap4 fattr4_supported_attrs;
-typedef bitmap4 fattr4_suppattr_exclcreat;
typedef nfs_ftype4 fattr4_type;
typedef uint32_t fattr4_fh_expire_type;
typedef changeid4 fattr4_change;
@@ -656,7 +687,6 @@ typedef bool fattr4_unique_handles;
typedef nfs_lease4 fattr4_lease_time;
typedef nfsstat4 fattr4_rdattr_error;
typedef nfsace4 fattr4_acl<>;
-typedef uint32_t fattr4_aclsupport;
typedef bool fattr4_archive;
typedef bool fattr4_cansettime;
typedef bool fattr4_case_insensitive;
@@ -703,16 +733,16 @@ typedef settime4 fattr4_time_modify_set;
/*
* attributes new to NFSv4.1
*/
+typedef bitmap4 fattr4_suppattr_exclcreat;
typedef nfstime4 fattr4_dir_notif_delay;
typedef nfstime4 fattr4_dirent_notif_delay;
-typedef bool fattr4_absent;
-typedef layouttype4 fattr4_fs_layout_type<>; /* FRED */
+typedef layouttype4 fattr4_fs_layout_types<>;
typedef fs4_status fattr4_fs_status;
-typedef fs_charset_cap4 fattr4_fs_charset_cap4;
+typedef fs_charset_cap4 fattr4_fs_charset_cap;
typedef uint32_t fattr4_layout_alignment;
typedef uint32_t fattr4_layout_blksize;
typedef layouthint4 fattr4_layout_hint;
-typedef layouttype4 fattr4_layout_type<>; /* FRED */
+typedef layouttype4 fattr4_layout_types<>;
typedef mdsthreshold4 fattr4_mdsthreshold;
typedef retention_get4 fattr4_retention_get;
typedef retention_set4 fattr4_retention_set;
@@ -721,11 +751,11 @@ typedef retention_set4 fattr4_retentevt_set;
typedef uint64_t fattr4_retention_hold;
typedef nfsacl41 fattr4_dacl;
typedef nfsacl41 fattr4_sacl;
+typedef change_policy4 fattr4_change_policy;
-
-/*
- * Mandatory Attributes
- */
+%/*
+% * REQUIRED Attributes
+% */
const FATTR4_SUPPORTED_ATTRS = 0;
const FATTR4_TYPE = 1;
const FATTR4_FH_EXPIRE_TYPE = 2;
@@ -739,11 +769,12 @@ const FATTR4_UNIQUE_HANDLES = 9;
const FATTR4_LEASE_TIME = 10;
const FATTR4_RDATTR_ERROR = 11;
const FATTR4_FILEHANDLE = 19;
+%/* new to NFSV4.1 */
const FATTR4_SUPPATTR_EXCLCREAT = 75;
-/*
- * Recommended Attributes
- */
+%/*
+% * RECOMMENDED Attributes
+% */
const FATTR4_ACL = 12;
const FATTR4_ACLSUPPORT = 13;
const FATTR4_ARCHIVE = 14;
@@ -787,15 +818,18 @@ const FATTR4_TIME_METADATA = 52;
const FATTR4_TIME_MODIFY = 53;
const FATTR4_TIME_MODIFY_SET = 54;
const FATTR4_MOUNTED_ON_FILEID = 55;
+%
+%/* new to NFSV4.1 */
+%
const FATTR4_DIR_NOTIF_DELAY = 56;
const FATTR4_DIRENT_NOTIF_DELAY = 57;
const FATTR4_DACL = 58;
const FATTR4_SACL = 59;
const FATTR4_CHANGE_POLICY = 60;
const FATTR4_FS_STATUS = 61;
-const FATTR4_FS_LAYOUT_TYPE = 62;
+const FATTR4_FS_LAYOUT_TYPES = 62;
const FATTR4_LAYOUT_HINT = 63;
-const FATTR4_LAYOUT_TYPE = 64;
+const FATTR4_LAYOUT_TYPES = 64;
const FATTR4_LAYOUT_BLKSIZE = 65;
const FATTR4_LAYOUT_ALIGNMENT = 66;
const FATTR4_FS_LOCATIONS_INFO = 67;
@@ -844,7 +878,7 @@ struct nfs_client_id4 {
};
/*
- * NFSv4.1 Client Owner (aka long hand client id)
+ * NFSv4.1 Client Owner (aka long hand client ID)
*/
struct client_owner4 {
verifier4 co_verifier;
@@ -1018,7 +1052,7 @@ enum filelayout_hint_care4 {
NFLH4_CARE_STRIPE_COUNT = 0x00000080
};
%
-%/* Encoded in the loh_body field of type layouthint4: */
+%/* Encoded in the loh_body field of data type layouthint4: */
%
struct nfsv4_1_file_layouthint4 {
uint32_t nflh_care;
@@ -1031,7 +1065,10 @@ struct nfsv4_1_file_layouthint4 {
%
typedef netaddr4 multipath_list4<>;
%
-%/* Encoded in the da_addr_body field of type device_addr4: */
+%/*
+% * Encoded in the da_addr_body field of
+% * data type device_addr4:
+% */
struct nfsv4_1_file_layout_ds_addr4 {
uint32_t nflda_stripe_indices<>;
multipath_list4 nflda_multipath_ds_list<>;
@@ -1040,7 +1077,10 @@ struct nfsv4_1_file_layout_ds_addr4 {
%
%
-%/* Encoded in the loc_body field of type layout_content4: */
+%/*
+% * Encoded in the loc_body field of
+% * data type layout_content4:
+% */
struct nfsv4_1_file_layout4 {
deviceid4 nfl_deviceid;
nfl_util4 nfl_util;
@@ -1052,11 +1092,17 @@ struct nfsv4_1_file_layout4 {
%
%/*
-% * Encoded in the lou_body field of type layoutupdate4:
-% * Nothing. lou_body is a zero length array of octets.
+% * Encoded in the lou_body field of data type layoutupdate4:
+% * Nothing. lou_body is a zero length array of bytes.
% */
%
+%/*
+% * Encoded in the lrf_body field of
+% * data type layoutreturn_file4:
+% * Nothing. lrf_body is a zero length array of bytes.
+% */
+%
const ACCESS4_READ = 0x00000001;
@@ -1498,8 +1544,8 @@ union open_claim4 switch (open_claim_type4 claim) {
component4 file_delegate_prev;
/*
- * Like CLAIM_NULL. No special rights
- * to file. Ordinary OPEN of the
+ * Like CLAIM_NULL. No special rights
+ * to file. Ordinary OPEN of the
* specified file by current filehandle.
*/
case CLAIM_FH: /* new to v4.1 */
@@ -1507,7 +1553,7 @@ union open_claim4 switch (open_claim_type4 claim) {
void;
/*
- * Like CLAIM_DELEGATE_PREV. Right to file based on a
+ * Like CLAIM_DELEGATE_PREV. Right to file based on a
* delegation granted to a previous boot
* instance of the client. File is identified by
* by filehandle.
@@ -1517,7 +1563,7 @@ union open_claim4 switch (open_claim_type4 claim) {
void;
/*
- * Like CLAIM_DELEGATE_CUR. Right to file based on
+ * Like CLAIM_DELEGATE_CUR. Right to file based on
* a delegation granted by the server.
* File is identified by filehandle.
*/
@@ -1579,7 +1625,7 @@ enum why_no_delegation4 { /* new to v4.1 */
WND4_WRITE_DELEG_NOT_SUPP_FTYPE = 4,
WND4_NOT_SUPP_UPGRADE = 5,
WND4_NOT_SUPP_DOWNGRADE = 6,
- WND4_CANCELED = 7,
+ WND4_CANCELLED = 7,
WND4_IS_DIR = 8
};
@@ -2455,11 +2501,12 @@ union TEST_STATEID4res switch (nfsstat4 tsr_status) {
union deleg_claim4 switch (open_claim_type4 dc_claim) {
/*
- * No special rights to object. Ordinary delegation
- * request of the specified object. Object identified
+ * No special rights to object. Ordinary delegation
+ * request of the specified object. Object identified
* by filehandle.
*/
case CLAIM_FH: /* new to v4.1 */
+ /* CURRENT_FH: object being delegated */
void;
/*
@@ -2689,7 +2736,7 @@ union nfs_argop4 switch (nfs_opnum4 argop) {
case OP_ILLEGAL: void;
};
-union nfs_resop4 switch (nfs_opnum4 resop){
+union nfs_resop4 switch (nfs_opnum4 resop) {
case OP_ACCESS: ACCESS4res opaccess;
case OP_CLOSE: CLOSE4res opclose;
case OP_COMMIT: COMMIT4res opcommit;
@@ -2995,10 +3042,9 @@ const RCA4_TYPE_MASK_RDATA_DLG = 0;
const RCA4_TYPE_MASK_WDATA_DLG = 1;
const RCA4_TYPE_MASK_DIR_DLG = 2;
const RCA4_TYPE_MASK_FILE_LAYOUT = 3;
-const RCA4_TYPE_MASK_BLK_LAYOUT_MIN = 4;
-const RCA4_TYPE_MASK_BLK_LAYOUT_MAX = 7;
+const RCA4_TYPE_MASK_BLK_LAYOUT = 4;
const RCA4_TYPE_MASK_OBJ_LAYOUT_MIN = 8;
-const RCA4_TYPE_MASK_OBJ_LAYOUT_MAX = 11;
+const RCA4_TYPE_MASK_OBJ_LAYOUT_MAX = 9;
const RCA4_TYPE_MASK_OTHER_LAYOUT_MIN = 12;
const RCA4_TYPE_MASK_OTHER_LAYOUT_MAX = 15;
@@ -3128,7 +3174,7 @@ enum nfs_cb_opnum4 {
OP_CB_ILLEGAL = 10044
};
-union nfs_cb_argop4 switch (nfs_cb_opnum4 argop) { /* FRED */
+union nfs_cb_argop4 switch (unsigned argop) {
case OP_CB_GETATTR:
CB_GETATTR4args opcbgetattr;
case OP_CB_RECALL:
@@ -3156,7 +3202,7 @@ union nfs_cb_argop4 switch (nfs_cb_opnum4 argop) { /* FRED */
case OP_CB_ILLEGAL: void;
};
-union nfs_cb_resop4 switch (nfs_cb_opnum4 resop){ /* FRED */
+union nfs_cb_resop4 switch (unsigned resop) {
case OP_CB_GETATTR: CB_GETATTR4res opcbgetattr;
case OP_CB_RECALL: CB_RECALL4res opcbrecall;
diff --git a/src/protocols/nfs3/nfs3_rpcgen.cpp b/src/protocols/nfs3/nfs3_rpcgen.cpp
deleted file mode 100644
index 8c0d710..0000000
--- a/src/protocols/nfs3/nfs3_rpcgen.cpp
+++ /dev/null
@@ -1,1808 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Alexey Costroma
-// Description: Definition and fill up NFSv3 procedures.
-// Copyright (c) 2014 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include "api/nfs3_types_rpcgen.h"
-//------------------------------------------------------------------------------
-namespace rpcgen
-{
-
-bool_t
-xdr_uint64 (XDR *xdrs, uint64 *objp)
-{
-
- if (!xdr_u_longlong_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_uint32 (XDR *xdrs, uint32 *objp)
-{
-
- if (!xdr_u_int (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_int64 (XDR *xdrs, int64 *objp)
-{
-
- if (!xdr_longlong_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_int32 (XDR *xdrs, int32 *objp)
-{
-
- if (!xdr_int (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_filename3 (XDR *xdrs, filename3 *objp)
-{
-
- if (!xdr_string (xdrs, objp, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfspath3 (XDR *xdrs, nfspath3 *objp)
-{
-
- if (!xdr_string (xdrs, objp, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fileid3 (XDR *xdrs, fileid3 *objp)
-{
-
- if (!xdr_uint64 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_cookie3 (XDR *xdrs, cookie3 *objp)
-{
-
- if (!xdr_uint64 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_cookieverf3 (XDR *xdrs, cookieverf3 objp)
-{
-
- if (!xdr_opaque (xdrs, objp, NFS3_COOKIEVERFSIZE))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_createverf3 (XDR *xdrs, createverf3 objp)
-{
-
- if (!xdr_opaque (xdrs, objp, NFS3_CREATEVERFSIZE))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_writeverf3 (XDR *xdrs, writeverf3 objp)
-{
-
- if (!xdr_opaque (xdrs, objp, NFS3_WRITEVERFSIZE))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_uid3 (XDR *xdrs, uid3 *objp)
-{
-
- if (!xdr_uint32 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_gid3 (XDR *xdrs, gid3 *objp)
-{
-
- if (!xdr_uint32 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_size3 (XDR *xdrs, size3 *objp)
-{
-
- if (!xdr_uint64 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_offset3 (XDR *xdrs, offset3 *objp)
-{
-
- if (!xdr_uint64 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_mode3 (XDR *xdrs, mode3 *objp)
-{
-
- if (!xdr_uint32 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_count3 (XDR *xdrs, count3 *objp)
-{
-
- if (!xdr_uint32 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfsstat3 (XDR *xdrs, nfsstat3 *objp)
-{
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ftype3 (XDR *xdrs, ftype3 *objp)
-{
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_specdata3 (XDR *xdrs, specdata3 *objp)
-{
-
- if (!xdr_uint32 (xdrs, &objp->specdata1))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->specdata2))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_fh3 (XDR *xdrs, nfs_fh3 *objp)
-{
-
- if (!xdr_bytes (xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, NFS3_FHSIZE))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfstime3 (XDR *xdrs, nfstime3 *objp)
-{
-
- if (!xdr_uint32 (xdrs, &objp->seconds))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->nseconds))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr3 (XDR *xdrs, fattr3 *objp)
-{
-
- if (!xdr_ftype3 (xdrs, &objp->type))
- return FALSE;
- if (!xdr_mode3 (xdrs, &objp->mode))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->nlink))
- return FALSE;
- if (!xdr_uid3 (xdrs, &objp->uid))
- return FALSE;
- if (!xdr_gid3 (xdrs, &objp->gid))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->size))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->used))
- return FALSE;
- if (!xdr_specdata3 (xdrs, &objp->rdev))
- return FALSE;
- if (!xdr_uint64 (xdrs, &objp->fsid))
- return FALSE;
- if (!xdr_fileid3 (xdrs, &objp->fileid))
- return FALSE;
- if (!xdr_nfstime3 (xdrs, &objp->atime))
- return FALSE;
- if (!xdr_nfstime3 (xdrs, &objp->mtime))
- return FALSE;
- if (!xdr_nfstime3 (xdrs, &objp->ctime))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_post_op_attr (XDR *xdrs, post_op_attr *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->attributes_follow))
- return FALSE;
- switch (objp->attributes_follow) {
- case TRUE:
- if (!xdr_fattr3 (xdrs, &objp->post_op_attr_u.attributes))
- return FALSE;
- break;
- case FALSE:
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_wcc_attr (XDR *xdrs, wcc_attr *objp)
-{
-
- if (!xdr_size3 (xdrs, &objp->size))
- return FALSE;
- if (!xdr_nfstime3 (xdrs, &objp->mtime))
- return FALSE;
- if (!xdr_nfstime3 (xdrs, &objp->ctime))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_pre_op_attr (XDR *xdrs, pre_op_attr *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->attributes_follow))
- return FALSE;
- switch (objp->attributes_follow) {
- case TRUE:
- if (!xdr_wcc_attr (xdrs, &objp->pre_op_attr_u.attributes))
- return FALSE;
- break;
- case FALSE:
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_wcc_data (XDR *xdrs, wcc_data *objp)
-{
-
- if (!xdr_pre_op_attr (xdrs, &objp->before))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->after))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_post_op_fh3 (XDR *xdrs, post_op_fh3 *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->handle_follows))
- return FALSE;
- switch (objp->handle_follows) {
- case TRUE:
- if (!xdr_nfs_fh3 (xdrs, &objp->post_op_fh3_u.handle))
- return FALSE;
- break;
- case FALSE:
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_time_how (XDR *xdrs, time_how *objp)
-{
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_set_mode3 (XDR *xdrs, set_mode3 *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->set_it))
- return FALSE;
- switch (objp->set_it) {
- case TRUE:
- if (!xdr_mode3 (xdrs, &objp->set_mode3_u.mode))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_set_uid3 (XDR *xdrs, set_uid3 *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->set_it))
- return FALSE;
- switch (objp->set_it) {
- case TRUE:
- if (!xdr_uid3 (xdrs, &objp->set_uid3_u.uid))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_set_gid3 (XDR *xdrs, set_gid3 *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->set_it))
- return FALSE;
- switch (objp->set_it) {
- case TRUE:
- if (!xdr_gid3 (xdrs, &objp->set_gid3_u.gid))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_set_size3 (XDR *xdrs, set_size3 *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->set_it))
- return FALSE;
- switch (objp->set_it) {
- case TRUE:
- if (!xdr_size3 (xdrs, &objp->set_size3_u.size))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_set_atime (XDR *xdrs, set_atime *objp)
-{
-
- if (!xdr_time_how (xdrs, &objp->set_it))
- return FALSE;
- switch (objp->set_it) {
- case SET_TO_CLIENT_TIME:
- if (!xdr_nfstime3 (xdrs, &objp->set_atime_u.atime))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_set_mtime (XDR *xdrs, set_mtime *objp)
-{
-
- if (!xdr_time_how (xdrs, &objp->set_it))
- return FALSE;
- switch (objp->set_it) {
- case SET_TO_CLIENT_TIME:
- if (!xdr_nfstime3 (xdrs, &objp->set_mtime_u.mtime))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_sattr3 (XDR *xdrs, sattr3 *objp)
-{
-
- if (!xdr_set_mode3 (xdrs, &objp->mode))
- return FALSE;
- if (!xdr_set_uid3 (xdrs, &objp->uid))
- return FALSE;
- if (!xdr_set_gid3 (xdrs, &objp->gid))
- return FALSE;
- if (!xdr_set_size3 (xdrs, &objp->size))
- return FALSE;
- if (!xdr_set_atime (xdrs, &objp->atime))
- return FALSE;
- if (!xdr_set_mtime (xdrs, &objp->mtime))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_diropargs3 (XDR *xdrs, diropargs3 *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->dir))
- return FALSE;
- if (!xdr_filename3 (xdrs, &objp->name))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GETATTR3args (XDR *xdrs, GETATTR3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->object))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GETATTR3resok (XDR *xdrs, GETATTR3resok *objp)
-{
-
- if (!xdr_fattr3 (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GETATTR3res (XDR *xdrs, GETATTR3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_GETATTR3resok (xdrs, &objp->GETATTR3res_u.resok))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_sattrguard3 (XDR *xdrs, sattrguard3 *objp)
-{
-
- if (!xdr_bool (xdrs, &objp->check))
- return FALSE;
- switch (objp->check) {
- case TRUE:
- if (!xdr_nfstime3 (xdrs, &objp->sattrguard3_u.obj_ctime))
- return FALSE;
- break;
- case FALSE:
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-// handmade for compatibility
-bool_t
-xdr_NULL3args (XDR*, NULL3args*)
-{
- return TRUE;
-}
-
-// handmade for compatibility
-bool_t
-xdr_NULL3res (XDR*, NULL3res*)
-{
- return TRUE;
-}
-
-bool_t
-xdr_SETATTR3args (XDR *xdrs, SETATTR3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->object))
- return FALSE;
- if (!xdr_sattr3 (xdrs, &objp->new_attributes))
- return FALSE;
- if (!xdr_sattrguard3 (xdrs, &objp->guard))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETATTR3resok (XDR *xdrs, SETATTR3resok *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->obj_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETATTR3resfail (XDR *xdrs, SETATTR3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->obj_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETATTR3res (XDR *xdrs, SETATTR3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_SETATTR3resok (xdrs, &objp->SETATTR3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_SETATTR3resfail (xdrs, &objp->SETATTR3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_LOOKUP3args (XDR *xdrs, LOOKUP3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->what))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOOKUP3resok (XDR *xdrs, LOOKUP3resok *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->object))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOOKUP3resfail (XDR *xdrs, LOOKUP3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOOKUP3res (XDR *xdrs, LOOKUP3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_LOOKUP3resok (xdrs, &objp->LOOKUP3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_LOOKUP3resfail (xdrs, &objp->LOOKUP3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_ACCESS3args (XDR *xdrs, ACCESS3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->object))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->access))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ACCESS3resok (XDR *xdrs, ACCESS3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->access))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ACCESS3resfail (XDR *xdrs, ACCESS3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ACCESS3res (XDR *xdrs, ACCESS3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_ACCESS3resok (xdrs, &objp->ACCESS3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_ACCESS3resfail (xdrs, &objp->ACCESS3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_READLINK3args (XDR *xdrs, READLINK3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->symlink))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READLINK3resok (XDR *xdrs, READLINK3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->symlink_attributes))
- return FALSE;
- if (!xdr_nfspath3 (xdrs, &objp->data))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READLINK3resfail (XDR *xdrs, READLINK3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->symlink_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READLINK3res (XDR *xdrs, READLINK3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_READLINK3resok (xdrs, &objp->READLINK3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_READLINK3resfail (xdrs, &objp->READLINK3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_READ3args (XDR *xdrs, READ3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->file))
- return FALSE;
- if (!xdr_offset3 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->count))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READ3resok (XDR *xdrs, READ3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->count))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->eof))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READ3resfail (XDR *xdrs, READ3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READ3res (XDR *xdrs, READ3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_READ3resok (xdrs, &objp->READ3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_READ3resfail (xdrs, &objp->READ3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_stable_how (XDR *xdrs, stable_how *objp)
-{
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_WRITE3args (XDR *xdrs, WRITE3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->file))
- return FALSE;
- if (!xdr_offset3 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->count))
- return FALSE;
- if (!xdr_stable_how (xdrs, &objp->stable))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_WRITE3resok (XDR *xdrs, WRITE3resok *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->file_wcc))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->count))
- return FALSE;
- if (!xdr_stable_how (xdrs, &objp->committed))
- return FALSE;
- if (!xdr_writeverf3 (xdrs, objp->verf))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_WRITE3resfail (XDR *xdrs, WRITE3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->file_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_WRITE3res (XDR *xdrs, WRITE3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_WRITE3resok (xdrs, &objp->WRITE3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_WRITE3resfail (xdrs, &objp->WRITE3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_createmode3 (XDR *xdrs, createmode3 *objp)
-{
-
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_createhow3 (XDR *xdrs, createhow3 *objp)
-{
-
- if (!xdr_createmode3 (xdrs, &objp->mode))
- return FALSE;
- switch (objp->mode) {
- case UNCHECKED:
- case GUARDED:
- if (!xdr_sattr3 (xdrs, &objp->createhow3_u.obj_attributes))
- return FALSE;
- break;
- case EXCLUSIVE:
- if (!xdr_createverf3 (xdrs, objp->createhow3_u.verf))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_CREATE3args (XDR *xdrs, CREATE3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->where))
- return FALSE;
- if (!xdr_createhow3 (xdrs, &objp->how))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CREATE3resok (XDR *xdrs, CREATE3resok *objp)
-{
-
- if (!xdr_post_op_fh3 (xdrs, &objp->obj))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CREATE3resfail (XDR *xdrs, CREATE3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CREATE3res (XDR *xdrs, CREATE3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_CREATE3resok (xdrs, &objp->CREATE3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_CREATE3resfail (xdrs, &objp->CREATE3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_MKDIR3args (XDR *xdrs, MKDIR3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->where))
- return FALSE;
- if (!xdr_sattr3 (xdrs, &objp->attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_MKDIR3resok (XDR *xdrs, MKDIR3resok *objp)
-{
-
- if (!xdr_post_op_fh3 (xdrs, &objp->obj))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_MKDIR3resfail (XDR *xdrs, MKDIR3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_MKDIR3res (XDR *xdrs, MKDIR3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_MKDIR3resok (xdrs, &objp->MKDIR3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_MKDIR3resfail (xdrs, &objp->MKDIR3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_symlinkdata3 (XDR *xdrs, symlinkdata3 *objp)
-{
-
- if (!xdr_sattr3 (xdrs, &objp->symlink_attributes))
- return FALSE;
- if (!xdr_nfspath3 (xdrs, &objp->symlink_data))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SYMLINK3args (XDR *xdrs, SYMLINK3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->where))
- return FALSE;
- if (!xdr_symlinkdata3 (xdrs, &objp->symlink))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SYMLINK3resok (XDR *xdrs, SYMLINK3resok *objp)
-{
-
- if (!xdr_post_op_fh3 (xdrs, &objp->obj))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SYMLINK3resfail (XDR *xdrs, SYMLINK3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SYMLINK3res (XDR *xdrs, SYMLINK3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_SYMLINK3resok (xdrs, &objp->SYMLINK3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_SYMLINK3resfail (xdrs, &objp->SYMLINK3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_devicedata3 (XDR *xdrs, devicedata3 *objp)
-{
-
- if (!xdr_sattr3 (xdrs, &objp->dev_attributes))
- return FALSE;
- if (!xdr_specdata3 (xdrs, &objp->spec))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_mknoddata3 (XDR *xdrs, mknoddata3 *objp)
-{
-
- if (!xdr_ftype3 (xdrs, &objp->type))
- return FALSE;
- switch (objp->type) {
- case NF3CHR:
- case NF3BLK:
- if (!xdr_devicedata3 (xdrs, &objp->mknoddata3_u.device))
- return FALSE;
- break;
- case NF3SOCK:
- case NF3FIFO:
- if (!xdr_sattr3 (xdrs, &objp->mknoddata3_u.pipe_attributes))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_MKNOD3args (XDR *xdrs, MKNOD3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->where))
- return FALSE;
- if (!xdr_mknoddata3 (xdrs, &objp->what))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_MKNOD3resok (XDR *xdrs, MKNOD3resok *objp)
-{
-
- if (!xdr_post_op_fh3 (xdrs, &objp->obj))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_MKNOD3resfail (XDR *xdrs, MKNOD3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_MKNOD3res (XDR *xdrs, MKNOD3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_MKNOD3resok (xdrs, &objp->MKNOD3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_MKNOD3resfail (xdrs, &objp->MKNOD3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_REMOVE3args (XDR *xdrs, REMOVE3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->object))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_REMOVE3resok (XDR *xdrs, REMOVE3resok *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_REMOVE3resfail (XDR *xdrs, REMOVE3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_REMOVE3res (XDR *xdrs, REMOVE3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_REMOVE3resok (xdrs, &objp->REMOVE3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_REMOVE3resfail (xdrs, &objp->REMOVE3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_RMDIR3args (XDR *xdrs, RMDIR3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->object))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RMDIR3resok (XDR *xdrs, RMDIR3resok *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RMDIR3resfail (XDR *xdrs, RMDIR3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RMDIR3res (XDR *xdrs, RMDIR3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_RMDIR3resok (xdrs, &objp->RMDIR3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_RMDIR3resfail (xdrs, &objp->RMDIR3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_RENAME3args (XDR *xdrs, RENAME3args *objp)
-{
-
- if (!xdr_diropargs3 (xdrs, &objp->from))
- return FALSE;
- if (!xdr_diropargs3 (xdrs, &objp->to))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RENAME3resok (XDR *xdrs, RENAME3resok *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->fromdir_wcc))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->todir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RENAME3resfail (XDR *xdrs, RENAME3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->fromdir_wcc))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->todir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RENAME3res (XDR *xdrs, RENAME3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_RENAME3resok (xdrs, &objp->RENAME3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_RENAME3resfail (xdrs, &objp->RENAME3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_LINK3args (XDR *xdrs, LINK3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->file))
- return FALSE;
- if (!xdr_diropargs3 (xdrs, &objp->link))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LINK3resok (XDR *xdrs, LINK3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->linkdir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LINK3resfail (XDR *xdrs, LINK3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
- return FALSE;
- if (!xdr_wcc_data (xdrs, &objp->linkdir_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LINK3res (XDR *xdrs, LINK3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_LINK3resok (xdrs, &objp->LINK3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_LINK3resfail (xdrs, &objp->LINK3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_READDIR3args (XDR *xdrs, READDIR3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->dir))
- return FALSE;
- if (!xdr_cookie3 (xdrs, &objp->cookie))
- return FALSE;
- if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->count))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_entry3 (XDR *xdrs, entry3 *objp)
-{
-
- if (!xdr_fileid3 (xdrs, &objp->fileid))
- return FALSE;
- if (!xdr_filename3 (xdrs, &objp->name))
- return FALSE;
- if (!xdr_cookie3 (xdrs, &objp->cookie))
- return FALSE;
- if (!xdr_pointer (xdrs, (char **)&objp->nextentry, sizeof (entry3), (xdrproc_t) xdr_entry3))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_dirlist3 (XDR *xdrs, dirlist3 *objp)
-{
-
- if (!xdr_pointer (xdrs, (char **)&objp->entries, sizeof (entry3), (xdrproc_t) xdr_entry3))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->eof))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIR3resok (XDR *xdrs, READDIR3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
- return FALSE;
- if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
- return FALSE;
- if (!xdr_dirlist3 (xdrs, &objp->reply))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIR3resfail (XDR *xdrs, READDIR3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIR3res (XDR *xdrs, READDIR3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_READDIR3resok (xdrs, &objp->READDIR3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_READDIR3resfail (xdrs, &objp->READDIR3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_READDIRPLUS3args (XDR *xdrs, READDIRPLUS3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->dir))
- return FALSE;
- if (!xdr_cookie3 (xdrs, &objp->cookie))
- return FALSE;
- if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->dircount))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->maxcount))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_entryplus3 (XDR *xdrs, entryplus3 *objp)
-{
-
- if (!xdr_fileid3 (xdrs, &objp->fileid))
- return FALSE;
- if (!xdr_filename3 (xdrs, &objp->name))
- return FALSE;
- if (!xdr_cookie3 (xdrs, &objp->cookie))
- return FALSE;
- if (!xdr_post_op_attr (xdrs, &objp->name_attributes))
- return FALSE;
- if (!xdr_post_op_fh3 (xdrs, &objp->name_handle))
- return FALSE;
- if (!xdr_pointer (xdrs, (char **)&objp->nextentry, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_dirlistplus3 (XDR *xdrs, dirlistplus3 *objp)
-{
-
- if (!xdr_pointer (xdrs, (char **)&objp->entries, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->eof))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIRPLUS3resok (XDR *xdrs, READDIRPLUS3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
- return FALSE;
- if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
- return FALSE;
- if (!xdr_dirlistplus3 (xdrs, &objp->reply))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIRPLUS3resfail (XDR *xdrs, READDIRPLUS3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIRPLUS3res (XDR *xdrs, READDIRPLUS3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_READDIRPLUS3resok (xdrs, &objp->READDIRPLUS3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_READDIRPLUS3resfail (xdrs, &objp->READDIRPLUS3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_FSSTAT3args (XDR *xdrs, FSSTAT3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->fsroot))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_FSSTAT3resok (XDR *xdrs, FSSTAT3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->tbytes))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->fbytes))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->abytes))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->tfiles))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->ffiles))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->afiles))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->invarsec))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_FSSTAT3resfail (XDR *xdrs, FSSTAT3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_FSSTAT3res (XDR *xdrs, FSSTAT3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_FSSTAT3resok (xdrs, &objp->FSSTAT3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_FSSTAT3resfail (xdrs, &objp->FSSTAT3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_FSINFO3args (XDR *xdrs, FSINFO3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->fsroot))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_FSINFO3resok (XDR *xdrs, FSINFO3resok *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->rtmax))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->rtpref))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->rtmult))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->wtmax))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->wtpref))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->wtmult))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->dtpref))
- return FALSE;
- if (!xdr_size3 (xdrs, &objp->maxfilesize))
- return FALSE;
- if (!xdr_nfstime3 (xdrs, &objp->time_delta))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->properties))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_FSINFO3resfail (XDR *xdrs, FSINFO3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_FSINFO3res (XDR *xdrs, FSINFO3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_FSINFO3resok (xdrs, &objp->FSINFO3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_FSINFO3resfail (xdrs, &objp->FSINFO3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_PATHCONF3args (XDR *xdrs, PATHCONF3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->object))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_PATHCONF3resok (XDR *xdrs, PATHCONF3resok *objp)
-{
- int32_t *buf;
-
- if (xdrs->x_op == XDR_ENCODE) {
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->linkmax))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->name_max))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_bool (xdrs, &objp->no_trunc))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->chown_restricted))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->case_insensitive))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->case_preserving))
- return FALSE;
- } else {
- IXDR_PUT_BOOL(buf, objp->no_trunc);
- IXDR_PUT_BOOL(buf, objp->chown_restricted);
- IXDR_PUT_BOOL(buf, objp->case_insensitive);
- IXDR_PUT_BOOL(buf, objp->case_preserving);
- }
- return TRUE;
- } else if (xdrs->x_op == XDR_DECODE) {
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->linkmax))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->name_max))
- return FALSE;
- buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_bool (xdrs, &objp->no_trunc))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->chown_restricted))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->case_insensitive))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->case_preserving))
- return FALSE;
- } else {
- objp->no_trunc = IXDR_GET_BOOL(buf);
- objp->chown_restricted = IXDR_GET_BOOL(buf);
- objp->case_insensitive = IXDR_GET_BOOL(buf);
- objp->case_preserving = IXDR_GET_BOOL(buf);
- }
- return TRUE;
- }
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->linkmax))
- return FALSE;
- if (!xdr_uint32 (xdrs, &objp->name_max))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->no_trunc))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->chown_restricted))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->case_insensitive))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->case_preserving))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_PATHCONF3resfail (XDR *xdrs, PATHCONF3resfail *objp)
-{
-
- if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_PATHCONF3res (XDR *xdrs, PATHCONF3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_PATHCONF3resok (xdrs, &objp->PATHCONF3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_PATHCONF3resfail (xdrs, &objp->PATHCONF3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_COMMIT3args (XDR *xdrs, COMMIT3args *objp)
-{
-
- if (!xdr_nfs_fh3 (xdrs, &objp->file))
- return FALSE;
- if (!xdr_offset3 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_count3 (xdrs, &objp->count))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_COMMIT3resok (XDR *xdrs, COMMIT3resok *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->file_wcc))
- return FALSE;
- if (!xdr_writeverf3 (xdrs, objp->verf))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_COMMIT3resfail (XDR *xdrs, COMMIT3resfail *objp)
-{
-
- if (!xdr_wcc_data (xdrs, &objp->file_wcc))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_COMMIT3res (XDR *xdrs, COMMIT3res *objp)
-{
-
- if (!xdr_nfsstat3 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS3_OK:
- if (!xdr_COMMIT3resok (xdrs, &objp->COMMIT3res_u.resok))
- return FALSE;
- break;
- default:
- if (!xdr_COMMIT3resfail (xdrs, &objp->COMMIT3res_u.resfail))
- return FALSE;
- break;
- }
- return TRUE;
-}
-
-}// namespace rpcgen
diff --git a/src/protocols/nfs3/nfs3_utils.cpp b/src/protocols/nfs3/nfs3_utils.cpp
index 7ce8b2c..50a0961 100644
--- a/src/protocols/nfs3/nfs3_utils.cpp
+++ b/src/protocols/nfs3/nfs3_utils.cpp
@@ -22,6 +22,7 @@
#include "protocols/nfs/nfs_utils.h"
#include "protocols/nfs3/nfs3_utils.h"
//------------------------------------------------------------------------------
+using namespace NST::API::NFS3;
using namespace NST::protocols::NFS;
using namespace NST::protocols::xdr;
//------------------------------------------------------------------------------
@@ -63,7 +64,7 @@ enum
S_IXOTH = 0x00001 // Search in directory
};
-void print_mode3(std::ostream& out, const rpcgen::uint32 val)
+void print_mode3(std::ostream& out, const uint32 val)
{
if (val & S_ISUID) out << "USER_ID_EXEC ";
if (val & S_ISGID) out << "GROUP_ID_EXEC ";
@@ -79,116 +80,116 @@ void print_mode3(std::ostream& out, const rpcgen::uint32 val)
if (val & S_IXOTH) out << "OTHER_EXEC";
}
-void print_access3(std::ostream& out, const rpcgen::uint32 val)
+void print_access3(std::ostream& out, const uint32 val)
{
- if (val & rpcgen::ACCESS3_READ) out << "READ ";
- if (val & rpcgen::ACCESS3_LOOKUP) out << "LOOKUP ";
- if (val & rpcgen::ACCESS3_MODIFY) out << "MODIFY ";
- if (val & rpcgen::ACCESS3_EXTEND) out << "EXTEND ";
- if (val & rpcgen::ACCESS3_DELETE) out << "DELETE ";
- if (val & rpcgen::ACCESS3_EXECUTE) out << "EXECUTE ";
+ if (val & ACCESS3_READ) out << "READ ";
+ if (val & ACCESS3_LOOKUP) out << "LOOKUP ";
+ if (val & ACCESS3_MODIFY) out << "MODIFY ";
+ if (val & ACCESS3_EXTEND) out << "EXTEND ";
+ if (val & ACCESS3_DELETE) out << "DELETE ";
+ if (val & ACCESS3_EXECUTE) out << "EXECUTE ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfsstat3& obj)
+std::ostream& operator<<(std::ostream& out, const nfsstat3& obj)
{
switch(obj)
{
- case rpcgen::nfsstat3::NFS3_OK:
+ case nfsstat3::NFS3_OK:
return out << "OK";
- case rpcgen::nfsstat3::NFS3ERR_PERM:
+ case nfsstat3::NFS3ERR_PERM:
return out << "ERR_PERM";
- case rpcgen::nfsstat3::NFS3ERR_NOENT:
+ case nfsstat3::NFS3ERR_NOENT:
return out << "ERR_NOENT";
- case rpcgen::nfsstat3::NFS3ERR_IO:
+ case nfsstat3::NFS3ERR_IO:
return out << "ERR_IO";
- case rpcgen::nfsstat3::NFS3ERR_NXIO:
+ case nfsstat3::NFS3ERR_NXIO:
return out << "ERR_NXIO";
- case rpcgen::nfsstat3::NFS3ERR_ACCES:
+ case nfsstat3::NFS3ERR_ACCES:
return out << "ERR_ACCES";
- case rpcgen::nfsstat3::NFS3ERR_EXIST:
+ case nfsstat3::NFS3ERR_EXIST:
return out << "ERR_EXIST";
- case rpcgen::nfsstat3::NFS3ERR_XDEV:
+ case nfsstat3::NFS3ERR_XDEV:
return out << "ERR_XDEV";
- case rpcgen::nfsstat3::NFS3ERR_NODEV:
+ case nfsstat3::NFS3ERR_NODEV:
return out << "ERR_NODEV";
- case rpcgen::nfsstat3::NFS3ERR_NOTDIR:
+ case nfsstat3::NFS3ERR_NOTDIR:
return out << "ERR_NOTDIR";
- case rpcgen::nfsstat3::NFS3ERR_ISDIR:
+ case nfsstat3::NFS3ERR_ISDIR:
return out << "ERR_ISDIR";
- case rpcgen::nfsstat3::NFS3ERR_INVAL:
+ case nfsstat3::NFS3ERR_INVAL:
return out << "ERR_INVAL";
- case rpcgen::nfsstat3::NFS3ERR_FBIG:
+ case nfsstat3::NFS3ERR_FBIG:
return out << "ERR_FBIG";
- case rpcgen::nfsstat3::NFS3ERR_NOSPC:
+ case nfsstat3::NFS3ERR_NOSPC:
return out << "ERR_NOSPC";
- case rpcgen::nfsstat3::NFS3ERR_ROFS:
+ case nfsstat3::NFS3ERR_ROFS:
return out << "ERR_ROFS";
- case rpcgen::nfsstat3::NFS3ERR_MLINK:
+ case nfsstat3::NFS3ERR_MLINK:
return out << "ERR_MLINK";
- case rpcgen::nfsstat3::NFS3ERR_NAMETOOLONG:
+ case nfsstat3::NFS3ERR_NAMETOOLONG:
return out << "ERR_NAMETOOLONG";
- case rpcgen::nfsstat3::NFS3ERR_NOTEMPTY:
+ case nfsstat3::NFS3ERR_NOTEMPTY:
return out << "ERR_NOTEMPTY";
- case rpcgen::nfsstat3::NFS3ERR_DQUOT:
+ case nfsstat3::NFS3ERR_DQUOT:
return out << "ERR_DQUOT";
- case rpcgen::nfsstat3::NFS3ERR_STALE:
+ case nfsstat3::NFS3ERR_STALE:
return out << "ERR_STALE";
- case rpcgen::nfsstat3::NFS3ERR_REMOTE:
+ case nfsstat3::NFS3ERR_REMOTE:
return out << "ERR_REMOTE";
- case rpcgen::nfsstat3::NFS3ERR_BADHANDLE:
+ case nfsstat3::NFS3ERR_BADHANDLE:
return out << "ERR_BADHANDLE";
- case rpcgen::nfsstat3::NFS3ERR_NOT_SYNC:
+ case nfsstat3::NFS3ERR_NOT_SYNC:
return out << "ERR_NOT_SYNC";
- case rpcgen::nfsstat3::NFS3ERR_BAD_COOKIE:
+ case nfsstat3::NFS3ERR_BAD_COOKIE:
return out << "ERR_BAD_COOKIE";
- case rpcgen::nfsstat3::NFS3ERR_NOTSUPP:
+ case nfsstat3::NFS3ERR_NOTSUPP:
return out << "ERR_NOTSUPP";
- case rpcgen::nfsstat3::NFS3ERR_TOOSMALL:
+ case nfsstat3::NFS3ERR_TOOSMALL:
return out << "ERR_TOOSMALL";
- case rpcgen::nfsstat3::NFS3ERR_SERVERFAULT:
+ case nfsstat3::NFS3ERR_SERVERFAULT:
return out << "ERR_SERVERFAULT";
- case rpcgen::nfsstat3::NFS3ERR_BADTYPE:
+ case nfsstat3::NFS3ERR_BADTYPE:
return out << "ERR_BADTYPE";
- case rpcgen::nfsstat3::NFS3ERR_JUKEBOX:
+ case nfsstat3::NFS3ERR_JUKEBOX:
return out << "ERR_JUKEBOX";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::ftype3& obj)
+std::ostream& operator<<(std::ostream& out, const ftype3& obj)
{
switch(obj)
{
- case rpcgen::ftype3::NF3REG: return out << "REG";
- case rpcgen::ftype3::NF3DIR: return out << "DIR";
- case rpcgen::ftype3::NF3BLK: return out << "BLK";
- case rpcgen::ftype3::NF3CHR: return out << "CHR";
- case rpcgen::ftype3::NF3LNK: return out << "LNK";
- case rpcgen::ftype3::NF3SOCK: return out << "SOCK";
- case rpcgen::ftype3::NF3FIFO: return out << "FIFO";
+ case ftype3::NF3REG: return out << "REG";
+ case ftype3::NF3DIR: return out << "DIR";
+ case ftype3::NF3BLK: return out << "BLK";
+ case ftype3::NF3CHR: return out << "CHR";
+ case ftype3::NF3LNK: return out << "LNK";
+ case ftype3::NF3SOCK: return out << "SOCK";
+ case ftype3::NF3FIFO: return out << "FIFO";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::specdata3& obj)
+std::ostream& operator<<(std::ostream& out, const specdata3& obj)
{
return out << " specdata1: " << obj.specdata1
<< " specdata2: " << obj.specdata2;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_fh3& obj)
+std::ostream& operator<<(std::ostream& out, const nfs_fh3& obj)
{
NFS::print_nfs_fh(out, obj.data.data_val, obj.data.data_len);
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfstime3& obj)
+std::ostream& operator<<(std::ostream& out, const nfstime3& obj)
{
return out << "seconds: " << obj.seconds
<< " nseconds: " << obj.nseconds << ' ';
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::fattr3& obj)
+std::ostream& operator<<(std::ostream& out, const fattr3& obj)
{
out << " type: " << obj.type
<< " mode: ";
@@ -209,90 +210,90 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::fattr3& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::post_op_attr& obj)
+std::ostream& operator<<(std::ostream& out, const post_op_attr& obj)
{
if(obj.attributes_follow) return out << obj.post_op_attr_u.attributes;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::wcc_attr& obj)
+std::ostream& operator<<(std::ostream& out, const wcc_attr& obj)
{
return out << " size: " << obj.size
<< " mtime: " << obj.mtime
<< " ctime: " << obj.ctime;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::pre_op_attr& obj)
+std::ostream& operator<<(std::ostream& out, const pre_op_attr& obj)
{
if(obj.attributes_follow) return out << obj.pre_op_attr_u.attributes;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::wcc_data& obj)
+std::ostream& operator<<(std::ostream& out, const wcc_data& obj)
{
return out << " before: " << obj.before << "after: " << obj.after;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::post_op_fh3& obj)
+std::ostream& operator<<(std::ostream& out, const post_op_fh3& obj)
{
if(obj.handle_follows) return out << " handle: "
<< obj.post_op_fh3_u.handle;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::time_how& obj)
+std::ostream& operator<<(std::ostream& out, const time_how& obj)
{
switch(obj)
{
- case rpcgen::time_how::DONT_CHANGE:
+ case time_how::DONT_CHANGE:
return out << "DONT_CHANGE";
- case rpcgen::time_how::SET_TO_SERVER_TIME:
+ case time_how::SET_TO_SERVER_TIME:
return out << "SET_TO_SERVER_TIME";
- case rpcgen::time_how::SET_TO_CLIENT_TIME:
+ case time_how::SET_TO_CLIENT_TIME:
return out << "SET_TO_CLIENT_TIME";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_mode3& obj)
+std::ostream& operator<<(std::ostream& out, const set_mode3& obj)
{
if(obj.set_it) return out << obj.set_mode3_u.mode;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_uid3& obj)
+std::ostream& operator<<(std::ostream& out, const set_uid3& obj)
{
if(obj.set_it) return out << obj.set_uid3_u.uid;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_gid3& obj)
+std::ostream& operator<<(std::ostream& out, const set_gid3& obj)
{
if(obj.set_it) return out << obj.set_gid3_u.gid;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_size3& obj)
+std::ostream& operator<<(std::ostream& out, const set_size3& obj)
{
if(obj.set_it) return out << obj.set_size3_u.size;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_atime& obj)
+std::ostream& operator<<(std::ostream& out, const set_atime& obj)
{
- if(obj.set_it == rpcgen::time_how::SET_TO_CLIENT_TIME)
+ if(obj.set_it == time_how::SET_TO_CLIENT_TIME)
return out << obj.set_it << " " << obj.set_atime_u.atime;
else return out << obj.set_it;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_mtime& obj)
+std::ostream& operator<<(std::ostream& out, const set_mtime& obj)
{
- if(obj.set_it == rpcgen::time_how::SET_TO_CLIENT_TIME)
+ if(obj.set_it == time_how::SET_TO_CLIENT_TIME)
return out << obj.set_it << " " << obj.set_mtime_u.mtime;
else return out << obj.set_it;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::sattr3& obj)
+std::ostream& operator<<(std::ostream& out, const sattr3& obj)
{
if(obj.mode.set_it)
{
@@ -303,94 +304,94 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::sattr3& obj)
if(obj.uid.set_it) out << " uid: " << obj.uid.set_uid3_u.uid;
if(obj.gid.set_it) out << " gid: " << obj.gid.set_gid3_u.gid;
if(obj.size.set_it) out << " size: " << obj.size.set_size3_u.size;
- if(obj.atime.set_it == rpcgen::time_how::SET_TO_CLIENT_TIME)
+ if(obj.atime.set_it == time_how::SET_TO_CLIENT_TIME)
out << " atime: " << obj.atime.set_atime_u.atime;
- if(obj.mtime.set_it == rpcgen::time_how::SET_TO_CLIENT_TIME)
+ if(obj.mtime.set_it == time_how::SET_TO_CLIENT_TIME)
out << " atime: " << obj.mtime.set_mtime_u.mtime;
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::diropargs3& obj)
+std::ostream& operator<<(std::ostream& out, const diropargs3& obj)
{
return out << " dir: " << obj.dir
<< " name: " << obj.name;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::sattrguard3& obj)
+std::ostream& operator<<(std::ostream& out, const sattrguard3& obj)
{
if(obj.check) return out << " obj_ctime: " << obj.sattrguard3_u.obj_ctime;
else return out << " void ";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::stable_how& obj)
+std::ostream& operator<<(std::ostream& out, const stable_how& obj)
{
switch(obj)
{
- case rpcgen::stable_how::UNSTABLE: return out << "UNSTABLE";
- case rpcgen::stable_how::DATA_SYNC: return out << "DATA_SYNC";
- case rpcgen::stable_how::FILE_SYNC: return out << "FILE_SYNC";
+ case stable_how::UNSTABLE: return out << "UNSTABLE";
+ case stable_how::DATA_SYNC: return out << "DATA_SYNC";
+ case stable_how::FILE_SYNC: return out << "FILE_SYNC";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::createmode3& obj)
+std::ostream& operator<<(std::ostream& out, const createmode3& obj)
{
switch(obj)
{
- case rpcgen::createmode3::UNCHECKED: return out << "UNCHECKED";
- case rpcgen::createmode3::GUARDED: return out << "GUARDED";
- case rpcgen::createmode3::EXCLUSIVE: return out << "EXCLUSIVE";
+ case createmode3::UNCHECKED: return out << "UNCHECKED";
+ case createmode3::GUARDED: return out << "GUARDED";
+ case createmode3::EXCLUSIVE: return out << "EXCLUSIVE";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::createhow3& obj)
+std::ostream& operator<<(std::ostream& out, const createhow3& obj)
{
switch(obj.mode)
{
- case rpcgen::createmode3::UNCHECKED:
- case rpcgen::createmode3::GUARDED:
+ case createmode3::UNCHECKED:
+ case createmode3::GUARDED:
return out << obj.mode << " obj attributes: "
<< obj.createhow3_u.obj_attributes;
- case rpcgen::createmode3::EXCLUSIVE:
+ case createmode3::EXCLUSIVE:
out << obj.mode << " verf: ";
- print_hex(out, obj.createhow3_u.verf, rpcgen::NFS3_COOKIEVERFSIZE);
+ print_hex(out, obj.createhow3_u.verf, NFS3_COOKIEVERFSIZE);
break;
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::symlinkdata3& obj)
+std::ostream& operator<<(std::ostream& out, const symlinkdata3& obj)
{
return out << " symlink_attributes: " << obj.symlink_attributes
<< " symlink_data: " << obj.symlink_data;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::devicedata3& obj)
+std::ostream& operator<<(std::ostream& out, const devicedata3& obj)
{
return out << " dev_attributes: " << obj.dev_attributes
<< " spec: " << obj.spec;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::mknoddata3& obj)
+std::ostream& operator<<(std::ostream& out, const mknoddata3& obj)
{
out << " type: " << obj.type;
switch(obj.type)
{
- case rpcgen::ftype3::NF3CHR:
- case rpcgen::ftype3::NF3BLK:
+ case ftype3::NF3CHR:
+ case ftype3::NF3BLK:
return out << " device: " << obj.mknoddata3_u.device;
- case rpcgen::ftype3::NF3SOCK:
- case rpcgen::ftype3::NF3FIFO:
+ case ftype3::NF3SOCK:
+ case ftype3::NF3FIFO:
return out << " pipe_attributes: " << obj.mknoddata3_u.pipe_attributes;
default: break;
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::entry3& obj)
+std::ostream& operator<<(std::ostream& out, const entry3& obj)
{
out << " file id: " << obj.fileid
<< " name: " << obj.name
@@ -399,14 +400,14 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::entry3& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::dirlist3& obj)
+std::ostream& operator<<(std::ostream& out, const dirlist3& obj)
{
out << " eof: " << obj.eof;
if(obj.entries) out << *obj.entries;
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::entryplus3& obj)
+std::ostream& operator<<(std::ostream& out, const entryplus3& obj)
{
out << " file id: " << obj.fileid
<< " name: " << obj.name
@@ -417,13 +418,2450 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::entryplus3& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::dirlistplus3& obj)
+std::ostream& operator<<(std::ostream& out, const dirlistplus3& obj)
{
out << " eof: " << obj.eof;
if(obj.entries) out << *obj.entries;
return out;
}
+bool_t
+xdr_uint64 (XDR* xdrs, uint64* objp)
+{
+
+ if (!xdr_u_longlong_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_uint32 (XDR* xdrs, uint32* objp)
+{
+
+ if (!xdr_u_int (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_int64 (XDR* xdrs, int64* objp)
+{
+
+ if (!xdr_longlong_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_int32 (XDR* xdrs, int32* objp)
+{
+
+ if (!xdr_int (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_filename3 (XDR* xdrs, filename3* objp)
+{
+
+ if (!xdr_string (xdrs, objp, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfspath3 (XDR* xdrs, nfspath3* objp)
+{
+
+ if (!xdr_string (xdrs, objp, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fileid3 (XDR* xdrs, fileid3* objp)
+{
+
+ if (!xdr_uint64 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_cookie3 (XDR* xdrs, cookie3* objp)
+{
+
+ if (!xdr_uint64 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_cookieverf3 (XDR* xdrs, cookieverf3 objp)
+{
+
+ if (!xdr_opaque (xdrs, objp, NFS3_COOKIEVERFSIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createverf3 (XDR* xdrs, createverf3 objp)
+{
+
+ if (!xdr_opaque (xdrs, objp, NFS3_CREATEVERFSIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_writeverf3 (XDR* xdrs, writeverf3 objp)
+{
+
+ if (!xdr_opaque (xdrs, objp, NFS3_WRITEVERFSIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_uid3 (XDR* xdrs, uid3* objp)
+{
+
+ if (!xdr_uint32 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_gid3 (XDR* xdrs, gid3* objp)
+{
+
+ if (!xdr_uint32 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_size3 (XDR* xdrs, size3* objp)
+{
+
+ if (!xdr_uint64 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_offset3 (XDR* xdrs, offset3* objp)
+{
+
+ if (!xdr_uint64 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_mode3 (XDR* xdrs, mode3* objp)
+{
+
+ if (!xdr_uint32 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_count3 (XDR* xdrs, count3* objp)
+{
+
+ if (!xdr_uint32 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfsstat3 (XDR* xdrs, nfsstat3* objp)
+{
+
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ftype3 (XDR* xdrs, ftype3* objp)
+{
+
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_specdata3 (XDR* xdrs, specdata3* objp)
+{
+
+ if (!xdr_uint32 (xdrs, &objp->specdata1))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->specdata2))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_fh3 (XDR* xdrs, nfs_fh3* objp)
+{
+
+ if (!xdr_bytes (xdrs, (char**)&objp->data.data_val, (u_int*) &objp->data.data_len, NFS3_FHSIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfstime3 (XDR* xdrs, nfstime3* objp)
+{
+
+ if (!xdr_uint32 (xdrs, &objp->seconds))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->nseconds))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr3 (XDR* xdrs, fattr3* objp)
+{
+
+ if (!xdr_ftype3 (xdrs, &objp->type))
+ {
+ return FALSE;
+ }
+ if (!xdr_mode3 (xdrs, &objp->mode))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->nlink))
+ {
+ return FALSE;
+ }
+ if (!xdr_uid3 (xdrs, &objp->uid))
+ {
+ return FALSE;
+ }
+ if (!xdr_gid3 (xdrs, &objp->gid))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->size))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->used))
+ {
+ return FALSE;
+ }
+ if (!xdr_specdata3 (xdrs, &objp->rdev))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint64 (xdrs, &objp->fsid))
+ {
+ return FALSE;
+ }
+ if (!xdr_fileid3 (xdrs, &objp->fileid))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime3 (xdrs, &objp->atime))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime3 (xdrs, &objp->mtime))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime3 (xdrs, &objp->ctime))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_post_op_attr (XDR* xdrs, post_op_attr* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->attributes_follow))
+ {
+ return FALSE;
+ }
+ switch (objp->attributes_follow)
+ {
+ case TRUE:
+ if (!xdr_fattr3 (xdrs, &objp->post_op_attr_u.attributes))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_wcc_attr (XDR* xdrs, wcc_attr* objp)
+{
+
+ if (!xdr_size3 (xdrs, &objp->size))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime3 (xdrs, &objp->mtime))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime3 (xdrs, &objp->ctime))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_pre_op_attr (XDR* xdrs, pre_op_attr* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->attributes_follow))
+ {
+ return FALSE;
+ }
+ switch (objp->attributes_follow)
+ {
+ case TRUE:
+ if (!xdr_wcc_attr (xdrs, &objp->pre_op_attr_u.attributes))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_wcc_data (XDR* xdrs, wcc_data* objp)
+{
+
+ if (!xdr_pre_op_attr (xdrs, &objp->before))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->after))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_post_op_fh3 (XDR* xdrs, post_op_fh3* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->handle_follows))
+ {
+ return FALSE;
+ }
+ switch (objp->handle_follows)
+ {
+ case TRUE:
+ if (!xdr_nfs_fh3 (xdrs, &objp->post_op_fh3_u.handle))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_time_how (XDR* xdrs, time_how* objp)
+{
+
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_set_mode3 (XDR* xdrs, set_mode3* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case TRUE:
+ if (!xdr_mode3 (xdrs, &objp->set_mode3_u.mode))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_set_uid3 (XDR* xdrs, set_uid3* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case TRUE:
+ if (!xdr_uid3 (xdrs, &objp->set_uid3_u.uid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_set_gid3 (XDR* xdrs, set_gid3* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case TRUE:
+ if (!xdr_gid3 (xdrs, &objp->set_gid3_u.gid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_set_size3 (XDR* xdrs, set_size3* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case TRUE:
+ if (!xdr_size3 (xdrs, &objp->set_size3_u.size))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_set_atime (XDR* xdrs, set_atime* objp)
+{
+
+ if (!xdr_time_how (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case SET_TO_CLIENT_TIME:
+ if (!xdr_nfstime3 (xdrs, &objp->set_atime_u.atime))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_set_mtime (XDR* xdrs, set_mtime* objp)
+{
+
+ if (!xdr_time_how (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case SET_TO_CLIENT_TIME:
+ if (!xdr_nfstime3 (xdrs, &objp->set_mtime_u.mtime))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_sattr3 (XDR* xdrs, sattr3* objp)
+{
+
+ if (!xdr_set_mode3 (xdrs, &objp->mode))
+ {
+ return FALSE;
+ }
+ if (!xdr_set_uid3 (xdrs, &objp->uid))
+ {
+ return FALSE;
+ }
+ if (!xdr_set_gid3 (xdrs, &objp->gid))
+ {
+ return FALSE;
+ }
+ if (!xdr_set_size3 (xdrs, &objp->size))
+ {
+ return FALSE;
+ }
+ if (!xdr_set_atime (xdrs, &objp->atime))
+ {
+ return FALSE;
+ }
+ if (!xdr_set_mtime (xdrs, &objp->mtime))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_diropargs3 (XDR* xdrs, diropargs3* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->dir))
+ {
+ return FALSE;
+ }
+ if (!xdr_filename3 (xdrs, &objp->name))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR3args (XDR* xdrs, GETATTR3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR3resok (XDR* xdrs, GETATTR3resok* objp)
+{
+
+ if (!xdr_fattr3 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR3res (XDR* xdrs, GETATTR3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_GETATTR3resok (xdrs, &objp->GETATTR3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_sattrguard3 (XDR* xdrs, sattrguard3* objp)
+{
+
+ if (!xdr_bool (xdrs, &objp->check))
+ {
+ return FALSE;
+ }
+ switch (objp->check)
+ {
+ case TRUE:
+ if (!xdr_nfstime3 (xdrs, &objp->sattrguard3_u.obj_ctime))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+// handmade for compatibility
+bool_t
+xdr_NULL3args (XDR*, NULL3args*)
+{
+ return TRUE;
+}
+
+// handmade for compatibility
+bool_t
+xdr_NULL3res (XDR*, NULL3res*)
+{
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR3args (XDR* xdrs, SETATTR3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ if (!xdr_sattr3 (xdrs, &objp->new_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_sattrguard3 (xdrs, &objp->guard))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR3resok (XDR* xdrs, SETATTR3resok* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->obj_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR3resfail (XDR* xdrs, SETATTR3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->obj_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR3res (XDR* xdrs, SETATTR3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_SETATTR3resok (xdrs, &objp->SETATTR3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_SETATTR3resfail (xdrs, &objp->SETATTR3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP3args (XDR* xdrs, LOOKUP3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->what))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP3resok (XDR* xdrs, LOOKUP3resok* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP3resfail (XDR* xdrs, LOOKUP3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP3res (XDR* xdrs, LOOKUP3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_LOOKUP3resok (xdrs, &objp->LOOKUP3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_LOOKUP3resfail (xdrs, &objp->LOOKUP3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS3args (XDR* xdrs, ACCESS3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->access))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS3resok (XDR* xdrs, ACCESS3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->access))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS3resfail (XDR* xdrs, ACCESS3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS3res (XDR* xdrs, ACCESS3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_ACCESS3resok (xdrs, &objp->ACCESS3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_ACCESS3resfail (xdrs, &objp->ACCESS3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK3args (XDR* xdrs, READLINK3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->symlink))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK3resok (XDR* xdrs, READLINK3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->symlink_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfspath3 (xdrs, &objp->data))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK3resfail (XDR* xdrs, READLINK3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->symlink_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK3res (XDR* xdrs, READLINK3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_READLINK3resok (xdrs, &objp->READLINK3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_READLINK3resfail (xdrs, &objp->READLINK3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ3args (XDR* xdrs, READ3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->file))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset3 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ3resok (XDR* xdrs, READ3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->eof))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ3resfail (XDR* xdrs, READ3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ3res (XDR* xdrs, READ3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_READ3resok (xdrs, &objp->READ3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_READ3resfail (xdrs, &objp->READ3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_stable_how (XDR* xdrs, stable_how* objp)
+{
+
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE3args (XDR* xdrs, WRITE3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->file))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset3 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ if (!xdr_stable_how (xdrs, &objp->stable))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE3resok (XDR* xdrs, WRITE3resok* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->file_wcc))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ if (!xdr_stable_how (xdrs, &objp->committed))
+ {
+ return FALSE;
+ }
+ if (!xdr_writeverf3 (xdrs, objp->verf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE3resfail (XDR* xdrs, WRITE3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->file_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE3res (XDR* xdrs, WRITE3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_WRITE3resok (xdrs, &objp->WRITE3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_WRITE3resfail (xdrs, &objp->WRITE3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createmode3 (XDR* xdrs, createmode3* objp)
+{
+
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createhow3 (XDR* xdrs, createhow3* objp)
+{
+
+ if (!xdr_createmode3 (xdrs, &objp->mode))
+ {
+ return FALSE;
+ }
+ switch (objp->mode)
+ {
+ case UNCHECKED:
+ case GUARDED:
+ if (!xdr_sattr3 (xdrs, &objp->createhow3_u.obj_attributes))
+ {
+ return FALSE;
+ }
+ break;
+ case EXCLUSIVE:
+ if (!xdr_createverf3 (xdrs, objp->createhow3_u.verf))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE3args (XDR* xdrs, CREATE3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->where))
+ {
+ return FALSE;
+ }
+ if (!xdr_createhow3 (xdrs, &objp->how))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE3resok (XDR* xdrs, CREATE3resok* objp)
+{
+
+ if (!xdr_post_op_fh3 (xdrs, &objp->obj))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE3resfail (XDR* xdrs, CREATE3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE3res (XDR* xdrs, CREATE3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_CREATE3resok (xdrs, &objp->CREATE3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_CREATE3resfail (xdrs, &objp->CREATE3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKDIR3args (XDR* xdrs, MKDIR3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->where))
+ {
+ return FALSE;
+ }
+ if (!xdr_sattr3 (xdrs, &objp->attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKDIR3resok (XDR* xdrs, MKDIR3resok* objp)
+{
+
+ if (!xdr_post_op_fh3 (xdrs, &objp->obj))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKDIR3resfail (XDR* xdrs, MKDIR3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKDIR3res (XDR* xdrs, MKDIR3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_MKDIR3resok (xdrs, &objp->MKDIR3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_MKDIR3resfail (xdrs, &objp->MKDIR3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_symlinkdata3 (XDR* xdrs, symlinkdata3* objp)
+{
+
+ if (!xdr_sattr3 (xdrs, &objp->symlink_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfspath3 (xdrs, &objp->symlink_data))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SYMLINK3args (XDR* xdrs, SYMLINK3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->where))
+ {
+ return FALSE;
+ }
+ if (!xdr_symlinkdata3 (xdrs, &objp->symlink))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SYMLINK3resok (XDR* xdrs, SYMLINK3resok* objp)
+{
+
+ if (!xdr_post_op_fh3 (xdrs, &objp->obj))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SYMLINK3resfail (XDR* xdrs, SYMLINK3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SYMLINK3res (XDR* xdrs, SYMLINK3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_SYMLINK3resok (xdrs, &objp->SYMLINK3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_SYMLINK3resfail (xdrs, &objp->SYMLINK3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_devicedata3 (XDR* xdrs, devicedata3* objp)
+{
+
+ if (!xdr_sattr3 (xdrs, &objp->dev_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_specdata3 (xdrs, &objp->spec))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_mknoddata3 (XDR* xdrs, mknoddata3* objp)
+{
+
+ if (!xdr_ftype3 (xdrs, &objp->type))
+ {
+ return FALSE;
+ }
+ switch (objp->type)
+ {
+ case NF3CHR:
+ case NF3BLK:
+ if (!xdr_devicedata3 (xdrs, &objp->mknoddata3_u.device))
+ {
+ return FALSE;
+ }
+ break;
+ case NF3SOCK:
+ case NF3FIFO:
+ if (!xdr_sattr3 (xdrs, &objp->mknoddata3_u.pipe_attributes))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKNOD3args (XDR* xdrs, MKNOD3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->where))
+ {
+ return FALSE;
+ }
+ if (!xdr_mknoddata3 (xdrs, &objp->what))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKNOD3resok (XDR* xdrs, MKNOD3resok* objp)
+{
+
+ if (!xdr_post_op_fh3 (xdrs, &objp->obj))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKNOD3resfail (XDR* xdrs, MKNOD3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_MKNOD3res (XDR* xdrs, MKNOD3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_MKNOD3resok (xdrs, &objp->MKNOD3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_MKNOD3resfail (xdrs, &objp->MKNOD3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE3args (XDR* xdrs, REMOVE3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE3resok (XDR* xdrs, REMOVE3resok* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE3resfail (XDR* xdrs, REMOVE3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE3res (XDR* xdrs, REMOVE3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_REMOVE3resok (xdrs, &objp->REMOVE3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_REMOVE3resfail (xdrs, &objp->REMOVE3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RMDIR3args (XDR* xdrs, RMDIR3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RMDIR3resok (XDR* xdrs, RMDIR3resok* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RMDIR3resfail (XDR* xdrs, RMDIR3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->dir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RMDIR3res (XDR* xdrs, RMDIR3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_RMDIR3resok (xdrs, &objp->RMDIR3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_RMDIR3resfail (xdrs, &objp->RMDIR3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME3args (XDR* xdrs, RENAME3args* objp)
+{
+
+ if (!xdr_diropargs3 (xdrs, &objp->from))
+ {
+ return FALSE;
+ }
+ if (!xdr_diropargs3 (xdrs, &objp->to))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME3resok (XDR* xdrs, RENAME3resok* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->fromdir_wcc))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->todir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME3resfail (XDR* xdrs, RENAME3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->fromdir_wcc))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->todir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME3res (XDR* xdrs, RENAME3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_RENAME3resok (xdrs, &objp->RENAME3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_RENAME3resfail (xdrs, &objp->RENAME3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK3args (XDR* xdrs, LINK3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->file))
+ {
+ return FALSE;
+ }
+ if (!xdr_diropargs3 (xdrs, &objp->link))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK3resok (XDR* xdrs, LINK3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->linkdir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK3resfail (XDR* xdrs, LINK3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->file_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_wcc_data (xdrs, &objp->linkdir_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK3res (XDR* xdrs, LINK3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_LINK3resok (xdrs, &objp->LINK3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_LINK3resfail (xdrs, &objp->LINK3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR3args (XDR* xdrs, READDIR3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->dir))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookie3 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_entry3 (XDR* xdrs, entry3* objp)
+{
+
+ if (!xdr_fileid3 (xdrs, &objp->fileid))
+ {
+ return FALSE;
+ }
+ if (!xdr_filename3 (xdrs, &objp->name))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookie3 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_pointer (xdrs, (char**)&objp->nextentry, sizeof (entry3), (xdrproc_t) xdr_entry3))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_dirlist3 (XDR* xdrs, dirlist3* objp)
+{
+
+ if (!xdr_pointer (xdrs, (char**)&objp->entries, sizeof (entry3), (xdrproc_t) xdr_entry3))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->eof))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR3resok (XDR* xdrs, READDIR3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_dirlist3 (xdrs, &objp->reply))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR3resfail (XDR* xdrs, READDIR3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR3res (XDR* xdrs, READDIR3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_READDIR3resok (xdrs, &objp->READDIR3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_READDIR3resfail (xdrs, &objp->READDIR3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIRPLUS3args (XDR* xdrs, READDIRPLUS3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->dir))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookie3 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->dircount))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->maxcount))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_entryplus3 (XDR* xdrs, entryplus3* objp)
+{
+
+ if (!xdr_fileid3 (xdrs, &objp->fileid))
+ {
+ return FALSE;
+ }
+ if (!xdr_filename3 (xdrs, &objp->name))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookie3 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_attr (xdrs, &objp->name_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_post_op_fh3 (xdrs, &objp->name_handle))
+ {
+ return FALSE;
+ }
+ if (!xdr_pointer (xdrs, (char**)&objp->nextentry, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_dirlistplus3 (XDR* xdrs, dirlistplus3* objp)
+{
+
+ if (!xdr_pointer (xdrs, (char**)&objp->entries, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->eof))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIRPLUS3resok (XDR* xdrs, READDIRPLUS3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_cookieverf3 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_dirlistplus3 (xdrs, &objp->reply))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIRPLUS3resfail (XDR* xdrs, READDIRPLUS3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->dir_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIRPLUS3res (XDR* xdrs, READDIRPLUS3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_READDIRPLUS3resok (xdrs, &objp->READDIRPLUS3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_READDIRPLUS3resfail (xdrs, &objp->READDIRPLUS3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSSTAT3args (XDR* xdrs, FSSTAT3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->fsroot))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSSTAT3resok (XDR* xdrs, FSSTAT3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->tbytes))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->fbytes))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->abytes))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->tfiles))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->ffiles))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->afiles))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->invarsec))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSSTAT3resfail (XDR* xdrs, FSSTAT3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSSTAT3res (XDR* xdrs, FSSTAT3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_FSSTAT3resok (xdrs, &objp->FSSTAT3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_FSSTAT3resfail (xdrs, &objp->FSSTAT3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSINFO3args (XDR* xdrs, FSINFO3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->fsroot))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSINFO3resok (XDR* xdrs, FSINFO3resok* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->rtmax))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->rtpref))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->rtmult))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->wtmax))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->wtpref))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->wtmult))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->dtpref))
+ {
+ return FALSE;
+ }
+ if (!xdr_size3 (xdrs, &objp->maxfilesize))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime3 (xdrs, &objp->time_delta))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->properties))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSINFO3resfail (XDR* xdrs, FSINFO3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FSINFO3res (XDR* xdrs, FSINFO3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_FSINFO3resok (xdrs, &objp->FSINFO3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_FSINFO3resfail (xdrs, &objp->FSINFO3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PATHCONF3args (XDR* xdrs, PATHCONF3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PATHCONF3resok (XDR* xdrs, PATHCONF3resok* objp)
+{
+ int32_t* buf;
+
+ if (xdrs->x_op == XDR_ENCODE)
+ {
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->linkmax))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->name_max))
+ {
+ return FALSE;
+ }
+ buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL)
+ {
+ if (!xdr_bool (xdrs, &objp->no_trunc))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->chown_restricted))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->case_insensitive))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->case_preserving))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ IXDR_PUT_BOOL(buf, objp->no_trunc);
+ IXDR_PUT_BOOL(buf, objp->chown_restricted);
+ IXDR_PUT_BOOL(buf, objp->case_insensitive);
+ IXDR_PUT_BOOL(buf, objp->case_preserving);
+ }
+ return TRUE;
+ }
+ else if (xdrs->x_op == XDR_DECODE)
+ {
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->linkmax))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->name_max))
+ {
+ return FALSE;
+ }
+ buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
+ if (buf == NULL)
+ {
+ if (!xdr_bool (xdrs, &objp->no_trunc))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->chown_restricted))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->case_insensitive))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->case_preserving))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ objp->no_trunc = IXDR_GET_BOOL(buf);
+ objp->chown_restricted = IXDR_GET_BOOL(buf);
+ objp->case_insensitive = IXDR_GET_BOOL(buf);
+ objp->case_preserving = IXDR_GET_BOOL(buf);
+ }
+ return TRUE;
+ }
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->linkmax))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32 (xdrs, &objp->name_max))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->no_trunc))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->chown_restricted))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->case_insensitive))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->case_preserving))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PATHCONF3resfail (XDR* xdrs, PATHCONF3resfail* objp)
+{
+
+ if (!xdr_post_op_attr (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PATHCONF3res (XDR* xdrs, PATHCONF3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_PATHCONF3resok (xdrs, &objp->PATHCONF3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_PATHCONF3resfail (xdrs, &objp->PATHCONF3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT3args (XDR* xdrs, COMMIT3args* objp)
+{
+
+ if (!xdr_nfs_fh3 (xdrs, &objp->file))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset3 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_count3 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT3resok (XDR* xdrs, COMMIT3resok* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->file_wcc))
+ {
+ return FALSE;
+ }
+ if (!xdr_writeverf3 (xdrs, objp->verf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT3resfail (XDR* xdrs, COMMIT3resfail* objp)
+{
+
+ if (!xdr_wcc_data (xdrs, &objp->file_wcc))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT3res (XDR* xdrs, COMMIT3res* objp)
+{
+
+ if (!xdr_nfsstat3 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS3_OK:
+ if (!xdr_COMMIT3resok (xdrs, &objp->COMMIT3res_u.resok))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ if (!xdr_COMMIT3resfail (xdrs, &objp->COMMIT3res_u.resfail))
+ {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+
} // namespace NFS3
} // namespace protocols
} // namespace NST
diff --git a/src/protocols/nfs3/nfs3_utils.h b/src/protocols/nfs3/nfs3_utils.h
index 5010d1f..8b16806 100644
--- a/src/protocols/nfs3/nfs3_utils.h
+++ b/src/protocols/nfs3/nfs3_utils.h
@@ -19,7 +19,6 @@
along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
-#define NST_PUBLIC __attribute__ ((visibility("default")))
#ifndef NFS3_UTILS_H
#define NFS3_UTILS_H
//------------------------------------------------------------------------------
@@ -32,8 +31,7 @@
#include "protocols/xdr/xdr_decoder.h"
#include "protocols/rpc/rpc_header.h"
//------------------------------------------------------------------------------
-using namespace NST::API;
-using namespace NST::protocols::xdr;
+#define NST_PUBLIC __attribute__ ((visibility("default")))
//------------------------------------------------------------------------------
namespace NST
{
@@ -42,6 +40,10 @@ namespace protocols
namespace NFS3
{
+namespace NFS3 = NST::API::NFS3;
+
+using ProcEnumNFS3 = API::ProcEnumNFS3;
+
using Validator = rpc::RPCProgramValidator
<
100003, // SunRPC/NFS program
@@ -50,246 +52,380 @@ using Validator = rpc::RPCProgramValidator
ProcEnumNFS3::COMMIT // NFSPROC3_COMMIT
>;
+bool_t xdr_uint64 (XDR *, NFS3::uint64*);
+bool_t xdr_uint32 (XDR *, NFS3::uint32*);
+bool_t xdr_int64 (XDR *, NFS3::int64*);
+bool_t xdr_int32 (XDR *, NFS3::int32*);
+bool_t xdr_filename3 (XDR *, NFS3::filename3*);
+bool_t xdr_nfspath3 (XDR *, NFS3::nfspath3*);
+bool_t xdr_fileid3 (XDR *, NFS3::fileid3*);
+bool_t xdr_cookie3 (XDR *, NFS3::cookie3*);
+bool_t xdr_cookieverf3 (XDR *, NFS3::cookieverf3);
+bool_t xdr_createverf3 (XDR *, NFS3::createverf3);
+bool_t xdr_writeverf3 (XDR *, NFS3::writeverf3);
+bool_t xdr_uid3 (XDR *, NFS3::uid3*);
+bool_t xdr_gid3 (XDR *, NFS3::gid3*);
+bool_t xdr_size3 (XDR *, NFS3::size3*);
+bool_t xdr_offset3 (XDR *, NFS3::offset3*);
+bool_t xdr_mode3 (XDR *, NFS3::mode3*);
+bool_t xdr_count3 (XDR *, NFS3::count3*);
+bool_t xdr_nfsstat3 (XDR *, NFS3::nfsstat3*);
+bool_t xdr_ftype3 (XDR *, NFS3::ftype3*);
+bool_t xdr_specdata3 (XDR *, NFS3::specdata3*);
+bool_t xdr_nfs_fh3 (XDR *, NFS3::nfs_fh3*);
+bool_t xdr_nfstime3 (XDR *, NFS3::nfstime3*);
+bool_t xdr_fattr3 (XDR *, NFS3::fattr3*);
+bool_t xdr_post_op_attr (XDR *, NFS3::post_op_attr*);
+bool_t xdr_wcc_attr (XDR *, NFS3::wcc_attr*);
+bool_t xdr_pre_op_attr (XDR *, NFS3::pre_op_attr*);
+bool_t xdr_wcc_data (XDR *, NFS3::wcc_data*);
+bool_t xdr_post_op_fh3 (XDR *, NFS3::post_op_fh3*);
+bool_t xdr_time_how (XDR *, NFS3::time_how*);
+bool_t xdr_set_mode3 (XDR *, NFS3::set_mode3*);
+bool_t xdr_set_uid3 (XDR *, NFS3::set_uid3*);
+bool_t xdr_set_gid3 (XDR *, NFS3::set_gid3*);
+bool_t xdr_set_size3 (XDR *, NFS3::set_size3*);
+bool_t xdr_set_atime (XDR *, NFS3::set_atime*);
+bool_t xdr_set_mtime (XDR *, NFS3::set_mtime*);
+bool_t xdr_sattr3 (XDR *, NFS3::sattr3*);
+bool_t xdr_diropargs3 (XDR *, NFS3::diropargs3*);
+bool_t xdr_NULL3args (XDR *, NFS3::NULL3args*); // for compatibility
+bool_t xdr_NULL3res (XDR *, NFS3::NULL3res*); // for compatibility
+bool_t xdr_GETATTR3args (XDR *, NFS3::GETATTR3args*);
+bool_t xdr_GETATTR3resok (XDR *, NFS3::GETATTR3resok*);
+bool_t xdr_GETATTR3res (XDR *, NFS3::GETATTR3res*);
+bool_t xdr_sattrguard3 (XDR *, NFS3::sattrguard3*);
+bool_t xdr_SETATTR3args (XDR *, NFS3::SETATTR3args*);
+bool_t xdr_SETATTR3resok (XDR *, NFS3::SETATTR3resok*);
+bool_t xdr_SETATTR3resfail (XDR *, NFS3::SETATTR3resfail*);
+bool_t xdr_SETATTR3res (XDR *, NFS3::SETATTR3res*);
+bool_t xdr_LOOKUP3args (XDR *, NFS3::LOOKUP3args*);
+bool_t xdr_LOOKUP3resok (XDR *, NFS3::LOOKUP3resok*);
+bool_t xdr_LOOKUP3resfail (XDR *, NFS3::LOOKUP3resfail*);
+bool_t xdr_LOOKUP3res (XDR *, NFS3::LOOKUP3res*);
+bool_t xdr_ACCESS3args (XDR *, NFS3::ACCESS3args*);
+bool_t xdr_ACCESS3resok (XDR *, NFS3::ACCESS3resok*);
+bool_t xdr_ACCESS3resfail (XDR *, NFS3::ACCESS3resfail*);
+bool_t xdr_ACCESS3res (XDR *, NFS3::ACCESS3res*);
+bool_t xdr_READLINK3args (XDR *, NFS3::READLINK3args*);
+bool_t xdr_READLINK3resok (XDR *, NFS3::READLINK3resok*);
+bool_t xdr_READLINK3resfail (XDR *, NFS3::READLINK3resfail*);
+bool_t xdr_READLINK3res (XDR *, NFS3::READLINK3res*);
+bool_t xdr_READ3args (XDR *, NFS3::READ3args*);
+bool_t xdr_READ3resok (XDR *, NFS3::READ3resok*);
+bool_t xdr_READ3resfail (XDR *, NFS3::READ3resfail*);
+bool_t xdr_READ3res (XDR *, NFS3::READ3res*);
+bool_t xdr_stable_how (XDR *, NFS3::stable_how*);
+bool_t xdr_WRITE3args (XDR *, NFS3::WRITE3args*);
+bool_t xdr_WRITE3resok (XDR *, NFS3::WRITE3resok*);
+bool_t xdr_WRITE3resfail (XDR *, NFS3::WRITE3resfail*);
+bool_t xdr_WRITE3res (XDR *, NFS3::WRITE3res*);
+bool_t xdr_createmode3 (XDR *, NFS3::createmode3*);
+bool_t xdr_createhow3 (XDR *, NFS3::createhow3*);
+bool_t xdr_CREATE3args (XDR *, NFS3::CREATE3args*);
+bool_t xdr_CREATE3resok (XDR *, NFS3::CREATE3resok*);
+bool_t xdr_CREATE3resfail (XDR *, NFS3::CREATE3resfail*);
+bool_t xdr_CREATE3res (XDR *, NFS3::CREATE3res*);
+bool_t xdr_MKDIR3args (XDR *, NFS3::MKDIR3args*);
+bool_t xdr_MKDIR3resok (XDR *, NFS3::MKDIR3resok*);
+bool_t xdr_MKDIR3resfail (XDR *, NFS3::MKDIR3resfail*);
+bool_t xdr_MKDIR3res (XDR *, NFS3::MKDIR3res*);
+bool_t xdr_symlinkdata3 (XDR *, NFS3::symlinkdata3*);
+bool_t xdr_SYMLINK3args (XDR *, NFS3::SYMLINK3args*);
+bool_t xdr_SYMLINK3resok (XDR *, NFS3::SYMLINK3resok*);
+bool_t xdr_SYMLINK3resfail (XDR *, NFS3::SYMLINK3resfail*);
+bool_t xdr_SYMLINK3res (XDR *, NFS3::SYMLINK3res*);
+bool_t xdr_devicedata3 (XDR *, NFS3::devicedata3*);
+bool_t xdr_mknoddata3 (XDR *, NFS3::mknoddata3*);
+bool_t xdr_MKNOD3args (XDR *, NFS3::MKNOD3args*);
+bool_t xdr_MKNOD3resok (XDR *, NFS3::MKNOD3resok*);
+bool_t xdr_MKNOD3resfail (XDR *, NFS3::MKNOD3resfail*);
+bool_t xdr_MKNOD3res (XDR *, NFS3::MKNOD3res*);
+bool_t xdr_REMOVE3args (XDR *, NFS3::REMOVE3args*);
+bool_t xdr_REMOVE3resok (XDR *, NFS3::REMOVE3resok*);
+bool_t xdr_REMOVE3resfail (XDR *, NFS3::REMOVE3resfail*);
+bool_t xdr_REMOVE3res (XDR *, NFS3::REMOVE3res*);
+bool_t xdr_RMDIR3args (XDR *, NFS3::RMDIR3args*);
+bool_t xdr_RMDIR3resok (XDR *, NFS3::RMDIR3resok*);
+bool_t xdr_RMDIR3resfail (XDR *, NFS3::RMDIR3resfail*);
+bool_t xdr_RMDIR3res (XDR *, NFS3::RMDIR3res*);
+bool_t xdr_RENAME3args (XDR *, NFS3::RENAME3args*);
+bool_t xdr_RENAME3resok (XDR *, NFS3::RENAME3resok*);
+bool_t xdr_RENAME3resfail (XDR *, NFS3::RENAME3resfail*);
+bool_t xdr_RENAME3res (XDR *, NFS3::RENAME3res*);
+bool_t xdr_LINK3args (XDR *, NFS3::LINK3args*);
+bool_t xdr_LINK3resok (XDR *, NFS3::LINK3resok*);
+bool_t xdr_LINK3resfail (XDR *, NFS3::LINK3resfail*);
+bool_t xdr_LINK3res (XDR *, NFS3::LINK3res*);
+bool_t xdr_READDIR3args (XDR *, NFS3::READDIR3args*);
+bool_t xdr_entry3 (XDR *, NFS3::entry3*);
+bool_t xdr_dirlist3 (XDR *, NFS3::dirlist3*);
+bool_t xdr_READDIR3resok (XDR *, NFS3::READDIR3resok*);
+bool_t xdr_READDIR3resfail (XDR *, NFS3::READDIR3resfail*);
+bool_t xdr_READDIR3res (XDR *, NFS3::READDIR3res*);
+bool_t xdr_READDIRPLUS3args (XDR *, NFS3::READDIRPLUS3args*);
+bool_t xdr_entryplus3 (XDR *, NFS3::entryplus3*);
+bool_t xdr_dirlistplus3 (XDR *, NFS3::dirlistplus3*);
+bool_t xdr_READDIRPLUS3resok (XDR *, NFS3::READDIRPLUS3resok*);
+bool_t xdr_READDIRPLUS3resfail (XDR *, NFS3::READDIRPLUS3resfail*);
+bool_t xdr_READDIRPLUS3res (XDR *, NFS3::READDIRPLUS3res*);
+bool_t xdr_FSSTAT3args (XDR *, NFS3::FSSTAT3args*);
+bool_t xdr_FSSTAT3resok (XDR *, NFS3::FSSTAT3resok*);
+bool_t xdr_FSSTAT3resfail (XDR *, NFS3::FSSTAT3resfail*);
+bool_t xdr_FSSTAT3res (XDR *, NFS3::FSSTAT3res*);
+bool_t xdr_FSINFO3args (XDR *, NFS3::FSINFO3args*);
+bool_t xdr_FSINFO3resok (XDR *, NFS3::FSINFO3resok*);
+bool_t xdr_FSINFO3resfail (XDR *, NFS3::FSINFO3resfail*);
+bool_t xdr_FSINFO3res (XDR *, NFS3::FSINFO3res*);
+bool_t xdr_PATHCONF3args (XDR *, NFS3::PATHCONF3args*);
+bool_t xdr_PATHCONF3resok (XDR *, NFS3::PATHCONF3resok*);
+bool_t xdr_PATHCONF3resfail (XDR *, NFS3::PATHCONF3resfail*);
+bool_t xdr_PATHCONF3res (XDR *, NFS3::PATHCONF3res*);
+bool_t xdr_COMMIT3args (XDR *, NFS3::COMMIT3args*);
+bool_t xdr_COMMIT3resok (XDR *, NFS3::COMMIT3resok*);
+bool_t xdr_COMMIT3resfail (XDR *, NFS3::COMMIT3resfail*);
+bool_t xdr_COMMIT3res (XDR *, NFS3::COMMIT3res*);
+
// Procedure 0: NULL - Do nothing
-inline auto proc_t_of(rpcgen::NULL3args&)->decltype(&rpcgen::xdr_NULL3args)
+inline auto proc_t_of(NFS3::NULL3args&)->decltype(&xdr_NULL3args)
{
- return &rpcgen::xdr_NULL3args;
+ return &xdr_NULL3args;
}
-inline auto proc_t_of(rpcgen::NULL3res&)->decltype(&rpcgen::xdr_NULL3res)
+inline auto proc_t_of(NFS3::NULL3res&)->decltype(&xdr_NULL3res)
{
- return &rpcgen::xdr_NULL3res;
+ return &xdr_NULL3res;
}
// Procedure 1: GETATTR - Get file attributes
-inline auto proc_t_of(rpcgen::GETATTR3args&)->decltype(&rpcgen::xdr_GETATTR3args)
+inline auto proc_t_of(NFS3::GETATTR3args&)->decltype(&xdr_GETATTR3args)
{
- return &rpcgen::xdr_GETATTR3args;
+ return &xdr_GETATTR3args;
}
-inline auto proc_t_of(rpcgen::GETATTR3res&)->decltype(&rpcgen::xdr_GETATTR3res)
+inline auto proc_t_of(NFS3::GETATTR3res&)->decltype(&xdr_GETATTR3res)
{
- return &rpcgen::xdr_GETATTR3res;
+ return &xdr_GETATTR3res;
}
// Procedure 2: SETATTR - Set file attributes
-inline auto proc_t_of(rpcgen::SETATTR3args&)->decltype(&rpcgen::xdr_SETATTR3args)
+inline auto proc_t_of(NFS3::SETATTR3args&)->decltype(&xdr_SETATTR3args)
{
- return &rpcgen::xdr_SETATTR3args;
+ return &xdr_SETATTR3args;
}
-inline auto proc_t_of(rpcgen::SETATTR3res&)->decltype(&rpcgen::xdr_SETATTR3res)
+inline auto proc_t_of(NFS3::SETATTR3res&)->decltype(&xdr_SETATTR3res)
{
- return &rpcgen::xdr_SETATTR3res;
+ return &xdr_SETATTR3res;
}
// Procedure 3: LOOKUP - Lookup filename
-inline auto proc_t_of(rpcgen::LOOKUP3args&)->decltype(&rpcgen::xdr_LOOKUP3args)
+inline auto proc_t_of(NFS3::LOOKUP3args&)->decltype(&xdr_LOOKUP3args)
{
- return &rpcgen::xdr_LOOKUP3args;
+ return &xdr_LOOKUP3args;
}
-inline auto proc_t_of(rpcgen::LOOKUP3res&)->decltype(&rpcgen::xdr_LOOKUP3res)
+inline auto proc_t_of(NFS3::LOOKUP3res&)->decltype(&xdr_LOOKUP3res)
{
- return &rpcgen::xdr_LOOKUP3res;
+ return &xdr_LOOKUP3res;
}
// Procedure 4: ACCESS - Check Access Permission
-inline auto proc_t_of(rpcgen::ACCESS3args&)->decltype(&rpcgen::xdr_ACCESS3args)
+inline auto proc_t_of(NFS3::ACCESS3args&)->decltype(&xdr_ACCESS3args)
{
- return &rpcgen::xdr_ACCESS3args;
+ return &xdr_ACCESS3args;
}
-inline auto proc_t_of(rpcgen::ACCESS3res&)->decltype(&rpcgen::xdr_ACCESS3res)
+inline auto proc_t_of(NFS3::ACCESS3res&)->decltype(&xdr_ACCESS3res)
{
- return &rpcgen::xdr_ACCESS3res;
+ return &xdr_ACCESS3res;
}
// Procedure 5: READLINK - Read from symbolic link
-inline auto proc_t_of(rpcgen::READLINK3args&)->decltype(&rpcgen::xdr_READLINK3args)
+inline auto proc_t_of(NFS3::READLINK3args&)->decltype(&xdr_READLINK3args)
{
- return &rpcgen::xdr_READLINK3args;
+ return &xdr_READLINK3args;
}
-inline auto proc_t_of(rpcgen::READLINK3res&)->decltype(&rpcgen::xdr_READLINK3res)
+inline auto proc_t_of(NFS3::READLINK3res&)->decltype(&xdr_READLINK3res)
{
- return &rpcgen::xdr_READLINK3res;
+ return &xdr_READLINK3res;
}
// Procedure 6: READ - Read From file
-inline auto proc_t_of(rpcgen::READ3args&)->decltype(&rpcgen::xdr_READ3args)
+inline auto proc_t_of(NFS3::READ3args&)->decltype(&xdr_READ3args)
{
- return &rpcgen::xdr_READ3args;
+ return &xdr_READ3args;
}
-inline auto proc_t_of(rpcgen::READ3res&)->decltype(&rpcgen::xdr_READ3res)
+inline auto proc_t_of(NFS3::READ3res&)->decltype(&xdr_READ3res)
{
- return &rpcgen::xdr_READ3res;
+ return &xdr_READ3res;
}
// Procedure 7: WRITE - Write to file
-inline auto proc_t_of(rpcgen::WRITE3args&)->decltype(&rpcgen::xdr_WRITE3args)
+inline auto proc_t_of(NFS3::WRITE3args&)->decltype(&xdr_WRITE3args)
{
- return &rpcgen::xdr_WRITE3args;
+ return &xdr_WRITE3args;
}
-inline auto proc_t_of(rpcgen::WRITE3res&)->decltype(&rpcgen::xdr_WRITE3res)
+inline auto proc_t_of(NFS3::WRITE3res&)->decltype(&xdr_WRITE3res)
{
- return &rpcgen::xdr_WRITE3res;
+ return &xdr_WRITE3res;
}
// Procedure 8: CREATE - Create a file
-inline auto proc_t_of(rpcgen::CREATE3args&)->decltype(&rpcgen::xdr_CREATE3args)
+inline auto proc_t_of(NFS3::CREATE3args&)->decltype(&xdr_CREATE3args)
{
- return &rpcgen::xdr_CREATE3args;
+ return &xdr_CREATE3args;
}
-inline auto proc_t_of(rpcgen::CREATE3res&)->decltype(&rpcgen::xdr_CREATE3res)
+inline auto proc_t_of(NFS3::CREATE3res&)->decltype(&xdr_CREATE3res)
{
- return &rpcgen::xdr_CREATE3res;
+ return &xdr_CREATE3res;
}
// Procedure 9: MKDIR - Create a directory
-inline auto proc_t_of(rpcgen::MKDIR3args&)->decltype(&rpcgen::xdr_MKDIR3args)
+inline auto proc_t_of(NFS3::MKDIR3args&)->decltype(&xdr_MKDIR3args)
{
- return &rpcgen::xdr_MKDIR3args;
+ return &xdr_MKDIR3args;
}
-inline auto proc_t_of(rpcgen::MKDIR3res&)->decltype(&rpcgen::xdr_MKDIR3res)
+inline auto proc_t_of(NFS3::MKDIR3res&)->decltype(&xdr_MKDIR3res)
{
- return &rpcgen::xdr_MKDIR3res;
+ return &xdr_MKDIR3res;
}
// Procedure 10: SYMLINK - Create a symbolic link
-inline auto proc_t_of(rpcgen::SYMLINK3args&)->decltype(&rpcgen::xdr_SYMLINK3args)
+inline auto proc_t_of(NFS3::SYMLINK3args&)->decltype(&xdr_SYMLINK3args)
{
- return &rpcgen::xdr_SYMLINK3args;
+ return &xdr_SYMLINK3args;
}
-inline auto proc_t_of(rpcgen::SYMLINK3res&)->decltype(&rpcgen::xdr_SYMLINK3res)
+inline auto proc_t_of(NFS3::SYMLINK3res&)->decltype(&xdr_SYMLINK3res)
{
- return &rpcgen::xdr_SYMLINK3res;
+ return &xdr_SYMLINK3res;
}
// Procedure 11: MKNOD - Create a special device
-inline auto proc_t_of(rpcgen::MKNOD3args&)->decltype(&rpcgen::xdr_MKNOD3args)
+inline auto proc_t_of(NFS3::MKNOD3args&)->decltype(&xdr_MKNOD3args)
{
- return &rpcgen::xdr_MKNOD3args;
+ return &xdr_MKNOD3args;
}
-inline auto proc_t_of(rpcgen::MKNOD3res&)->decltype(&rpcgen::xdr_MKNOD3res)
+inline auto proc_t_of(NFS3::MKNOD3res&)->decltype(&xdr_MKNOD3res)
{
- return &rpcgen::xdr_MKNOD3res;
+ return &xdr_MKNOD3res;
}
// Procedure 12: REMOVE - Remove a File
-inline auto proc_t_of(rpcgen::REMOVE3args&)->decltype(&rpcgen::xdr_REMOVE3args)
+inline auto proc_t_of(NFS3::REMOVE3args&)->decltype(&xdr_REMOVE3args)
{
- return &rpcgen::xdr_REMOVE3args;
+ return &xdr_REMOVE3args;
}
-inline auto proc_t_of(rpcgen::REMOVE3res&)->decltype(&rpcgen::xdr_REMOVE3res)
+inline auto proc_t_of(NFS3::REMOVE3res&)->decltype(&xdr_REMOVE3res)
{
- return &rpcgen::xdr_REMOVE3res;
+ return &xdr_REMOVE3res;
}
// Procedure 13: RMDIR - Remove a Directory
-inline auto proc_t_of(rpcgen::RMDIR3args&)->decltype(&rpcgen::xdr_RMDIR3args)
+inline auto proc_t_of(NFS3::RMDIR3args&)->decltype(&xdr_RMDIR3args)
{
- return &rpcgen::xdr_RMDIR3args;
+ return &xdr_RMDIR3args;
}
-inline auto proc_t_of(rpcgen::RMDIR3res&)->decltype(&rpcgen::xdr_RMDIR3res)
+inline auto proc_t_of(NFS3::RMDIR3res&)->decltype(&xdr_RMDIR3res)
{
- return &rpcgen::xdr_RMDIR3res;
+ return &xdr_RMDIR3res;
}
// Procedure 14: RENAME - Rename a File or Directory
-inline auto proc_t_of(rpcgen::RENAME3args&)->decltype(&rpcgen::xdr_RENAME3args)
+inline auto proc_t_of(NFS3::RENAME3args&)->decltype(&xdr_RENAME3args)
{
- return &rpcgen::xdr_RENAME3args;
+ return &xdr_RENAME3args;
}
-inline auto proc_t_of(rpcgen::RENAME3res&)->decltype(&rpcgen::xdr_RENAME3res)
+inline auto proc_t_of(NFS3::RENAME3res&)->decltype(&xdr_RENAME3res)
{
- return &rpcgen::xdr_RENAME3res;
+ return &xdr_RENAME3res;
}
// Procedure 15: LINK - Create Link to an object
-inline auto proc_t_of(rpcgen::LINK3args&)->decltype(&rpcgen::xdr_LINK3args)
+inline auto proc_t_of(NFS3::LINK3args&)->decltype(&xdr_LINK3args)
{
- return &rpcgen::xdr_LINK3args;
+ return &xdr_LINK3args;
}
-inline auto proc_t_of(rpcgen::LINK3res&)->decltype(&rpcgen::xdr_LINK3res)
+inline auto proc_t_of(NFS3::LINK3res&)->decltype(&xdr_LINK3res)
{
- return &rpcgen::xdr_LINK3res;
+ return &xdr_LINK3res;
}
// Procedure 16: READDIR - Read From Directory
-inline auto proc_t_of(rpcgen::READDIR3args&)->decltype(&rpcgen::xdr_READDIR3args)
+inline auto proc_t_of(NFS3::READDIR3args&)->decltype(&xdr_READDIR3args)
{
- return &rpcgen::xdr_READDIR3args;
+ return &xdr_READDIR3args;
}
-inline auto proc_t_of(rpcgen::READDIR3res&)->decltype(&rpcgen::xdr_READDIR3res)
+inline auto proc_t_of(NFS3::READDIR3res&)->decltype(&xdr_READDIR3res)
{
- return &rpcgen::xdr_READDIR3res;
+ return &xdr_READDIR3res;
}
// Procedure 17: READDIRPLUS - Extended read from directory
-inline auto proc_t_of(rpcgen::READDIRPLUS3args&)->decltype(&rpcgen::xdr_READDIRPLUS3args)
+inline auto proc_t_of(NFS3::READDIRPLUS3args&)->decltype(&xdr_READDIRPLUS3args)
{
- return &rpcgen::xdr_READDIRPLUS3args;
+ return &xdr_READDIRPLUS3args;
}
-inline auto proc_t_of(rpcgen::READDIRPLUS3res&)->decltype(&rpcgen::xdr_READDIRPLUS3res)
+inline auto proc_t_of(NFS3::READDIRPLUS3res&)->decltype(&xdr_READDIRPLUS3res)
{
- return &rpcgen::xdr_READDIRPLUS3res;
+ return &xdr_READDIRPLUS3res;
}
// Procedure 18: FSSTAT - Get dynamic file system information
-inline auto proc_t_of(rpcgen::FSSTAT3args&)->decltype(&rpcgen::xdr_FSSTAT3args)
+inline auto proc_t_of(NFS3::FSSTAT3args&)->decltype(&xdr_FSSTAT3args)
{
- return &rpcgen::xdr_FSSTAT3args;
+ return &xdr_FSSTAT3args;
}
-inline auto proc_t_of(rpcgen::FSSTAT3res&)->decltype(&rpcgen::xdr_FSSTAT3res)
+inline auto proc_t_of(NFS3::FSSTAT3res&)->decltype(&xdr_FSSTAT3res)
{
- return &rpcgen::xdr_FSSTAT3res;
+ return &xdr_FSSTAT3res;
}
// Procedure 19: FSINFO - Get static file system Information
-inline auto proc_t_of(rpcgen::FSINFO3args&)->decltype(&rpcgen::xdr_FSINFO3args)
+inline auto proc_t_of(NFS3::FSINFO3args&)->decltype(&xdr_FSINFO3args)
{
- return &rpcgen::xdr_FSINFO3args;
+ return &xdr_FSINFO3args;
}
-inline auto proc_t_of(rpcgen::FSINFO3res&)->decltype(&rpcgen::xdr_FSINFO3res)
+inline auto proc_t_of(NFS3::FSINFO3res&)->decltype(&xdr_FSINFO3res)
{
- return &rpcgen::xdr_FSINFO3res;
+ return &xdr_FSINFO3res;
}
// Procedure 20: PATHCONF - Retrieve POSIX information
-inline auto proc_t_of(rpcgen::PATHCONF3args&)->decltype(&rpcgen::xdr_PATHCONF3args)
+inline auto proc_t_of(NFS3::PATHCONF3args&)->decltype(&xdr_PATHCONF3args)
{
- return &rpcgen::xdr_PATHCONF3args;
+ return &xdr_PATHCONF3args;
}
-inline auto proc_t_of(rpcgen::PATHCONF3res&)->decltype(&rpcgen::xdr_PATHCONF3res)
+inline auto proc_t_of(NFS3::PATHCONF3res&)->decltype(&xdr_PATHCONF3res)
{
- return &rpcgen::xdr_PATHCONF3res;
+ return &xdr_PATHCONF3res;
}
// Procedure 21: COMMIT - Commit cached data on a server to stable storage
-inline auto proc_t_of(rpcgen::COMMIT3args&)->decltype(&rpcgen::xdr_COMMIT3args)
+inline auto proc_t_of(NFS3::COMMIT3args&)->decltype(&xdr_COMMIT3args)
{
- return &rpcgen::xdr_COMMIT3args;
+ return &xdr_COMMIT3args;
}
-inline auto proc_t_of(rpcgen::COMMIT3res&)->decltype(&rpcgen::xdr_COMMIT3res)
+inline auto proc_t_of(NFS3::COMMIT3res&)->decltype(&xdr_COMMIT3res)
{
- return &rpcgen::xdr_COMMIT3res;
+ return &xdr_COMMIT3res;
}
extern "C"
@@ -298,39 +434,39 @@ const char* print_nfs3_procedures(const ProcEnumNFS3::NFSProcedure proc);
std::ostream& operator<<(std::ostream& out, const ProcEnumNFS3::NFSProcedure proc);
-void print_mode3(std::ostream& out, const rpcgen::uint32 val);
-void print_access3(std::ostream& out, const rpcgen::uint32 val);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfsstat3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::ftype3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::specdata3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_fh3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfstime3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::fattr3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::post_op_attr& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::wcc_attr& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::pre_op_attr& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::wcc_data& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::post_op_fh3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::time_how& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_mode3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_uid3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_gid3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_size3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_atime& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::set_mtime& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::sattr3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::diropargs3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::sattrguard3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::stable_how& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::createmode3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::createhow3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::symlinkdata3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::devicedata3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::mknoddata3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::entry3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::dirlist3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::entryplus3& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::dirlistplus3& obj);
+void print_mode3(std::ostream& out, const NFS3::uint32 val);
+void print_access3(std::ostream& out, const NFS3::uint32 val);
+std::ostream& operator<<(std::ostream& out, const NFS3::nfsstat3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::ftype3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::specdata3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::nfs_fh3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::nfstime3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::fattr3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::post_op_attr& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::wcc_attr& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::pre_op_attr& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::wcc_data& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::post_op_fh3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::time_how& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::set_mode3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::set_uid3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::set_gid3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::set_size3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::set_atime& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::set_mtime& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::sattr3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::diropargs3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::sattrguard3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::stable_how& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::createmode3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::createhow3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::symlinkdata3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::devicedata3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::mknoddata3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::entry3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::dirlist3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::entryplus3& obj);
+std::ostream& operator<<(std::ostream& out, const NFS3::dirlistplus3& obj);
} // namespace NFS3
} // namespace protocols
diff --git a/src/protocols/nfs4/nfs41_utils.cpp b/src/protocols/nfs4/nfs41_utils.cpp
new file mode 100644
index 0000000..f90c42f
--- /dev/null
+++ b/src/protocols/nfs4/nfs41_utils.cpp
@@ -0,0 +1,8691 @@
+//------------------------------------------------------------------------------
+// Author: Alexey Costroma
+// Description: Helpers for parsing NFS structures.
+// Copyright (c) 2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <iomanip>
+
+#include "protocols/nfs/nfs_utils.h"
+#include "protocols/nfs4/nfs41_utils.h"
+//------------------------------------------------------------------------------
+using namespace NST::API::NFS41;
+using namespace NST::protocols::NFS; // NFS helpers
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace NFS41
+{
+
+std::ostream& operator<<(std::ostream& out, const ProcEnumNFS41::NFSProcedure proc)
+{
+ return out << print_nfs41_procedures(proc);
+}
+
+const char* print_nfs41_procedures(const ProcEnumNFS41::NFSProcedure proc)
+{
+ // In all cases we suppose, that NFSv4 operation ILLEGAL(10044)
+ // has the second position in ProcEnumNFS41
+ uint32_t i = proc;
+ if(proc == ProcEnumNFS41::ILLEGAL) i = 2;
+
+ static const char* const NFS41ProcedureTitles[(ProcEnumNFS41::count+1)] =
+ {
+ "NULL","COMPOUND", "ILLEGAL", "ACCESS", "CLOSE",
+ "COMMIT", "CREATE", "DELEGPURGE", "DELEGRETURN",
+ "GETATTR", "GETFH", "LINK", "LOCK",
+ "LOCKT", "LOCKU", "LOOKUP", "LOOKUPP",
+ "NVERIFY", "OPEN", "OPENATTR", "OPEN_CONFIRM",
+ "OPEN_DOWNGRADE", "PUTFH", "PUTPUBFH", "PUTROOTFH",
+ "READ", "READDIR", "READLINK", "REMOVE",
+ "RENAME", "RENEW", "RESTOREFH", "SAVEFH",
+ "SECINFO", "SETATTR", "SETCLIENTID", "SETCLIENTID_CONFIRM",
+ "VERIFY", "WRITE", "RELEASE_LOCKOWNER","BACKCHANNEL_CTL",
+ "BIND_CONN_TO_SESSION", "EXCHANGE_ID", "CREATE_SESSION", "DESTROY_SESSION",
+ "FREE_STATEID", "GET_DIR_DELEGATION", "GETDEVICEINFO", "GETDEVICELIST",
+ "LAYOUTCOMMIT", "LAYOUTGET", "LAYOUTRETURN", "SECINFO_NO_NAME",
+ "SEQUENCE", "SET_SSV", "TEST_STATEID", "WANT_DELEGATION",
+ "DESTROY_CLIENTID", "RECLAIM_COMPLETE"
+ };
+
+ return NFS41ProcedureTitles[i];
+}
+
+std::ostream& operator<<(std::ostream& out, const nfs_ftype4& obj)
+{
+ switch(obj)
+ {
+ case nfs_ftype4::NF4REG: return out << "REG";
+ case nfs_ftype4::NF4DIR: return out << "DIR";
+ case nfs_ftype4::NF4BLK: return out << "BLK";
+ case nfs_ftype4::NF4CHR: return out << "CHR";
+ case nfs_ftype4::NF4LNK: return out << "LNK";
+ case nfs_ftype4::NF4SOCK: return out << "SOCK";
+ case nfs_ftype4::NF4FIFO: return out << "FIFO";
+ case nfs_ftype4::NF4ATTRDIR: return out << "ATTRDIR";
+ case nfs_ftype4::NF4NAMEDATTR: return out << "NAMEDATTR";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfsstat4& obj)
+{
+ switch(obj)
+ {
+ case nfsstat4::NFS4_OK:
+ return out << "OK";
+ case nfsstat4::NFS4ERR_PERM:
+ return out << "ERROR_PERM";
+ case nfsstat4::NFS4ERR_NOENT:
+ return out << "ERROR_NOENT";
+ case nfsstat4::NFS4ERR_IO:
+ return out << "ERROR_IO";
+ case nfsstat4::NFS4ERR_NXIO:
+ return out << "ERROR_NXIO";
+ case nfsstat4::NFS4ERR_ACCESS:
+ return out << "ERROR_ACCESS";
+ case nfsstat4::NFS4ERR_EXIST:
+ return out << "ERROR_EXIST";
+ case nfsstat4::NFS4ERR_XDEV:
+ return out << "ERROR_XDEV";
+ case nfsstat4::NFS4ERR_NOTDIR:
+ return out << "ERROR_NOTDIR";
+ case nfsstat4::NFS4ERR_ISDIR:
+ return out << "ERROR_ISDIR";
+ case nfsstat4::NFS4ERR_INVAL:
+ return out << "ERROR_INVAL";
+ case nfsstat4::NFS4ERR_FBIG:
+ return out << "ERROR_FBIG";
+ case nfsstat4::NFS4ERR_NOSPC:
+ return out << "ERROR_NOSPC";
+ case nfsstat4::NFS4ERR_ROFS:
+ return out << "ERROR_ROFS";
+ case nfsstat4::NFS4ERR_MLINK:
+ return out << "ERROR_MLINK";
+ case nfsstat4::NFS4ERR_NAMETOOLONG:
+ return out << "ERROR_NAMETOOLONG";
+ case nfsstat4::NFS4ERR_NOTEMPTY:
+ return out << "ERROR_NOTEMPTY";
+ case nfsstat4::NFS4ERR_DQUOT:
+ return out << "ERROR_DQUOT";
+ case nfsstat4::NFS4ERR_STALE:
+ return out << "ERROR_STALE";
+ case nfsstat4::NFS4ERR_BADHANDLE:
+ return out << "ERROR_BADHANDLE";
+ case nfsstat4::NFS4ERR_BAD_COOKIE:
+ return out << "ERROR_BAD_COOKIE";
+ case nfsstat4::NFS4ERR_NOTSUPP:
+ return out << "ERROR_NOTSUPP";
+ case nfsstat4::NFS4ERR_TOOSMALL:
+ return out << "ERROR_TOOSMALL";
+ case nfsstat4::NFS4ERR_SERVERFAULT:
+ return out << "ERROR_SERVERFAULT";
+ case nfsstat4::NFS4ERR_BADTYPE:
+ return out << "ERROR_BADTYPE";
+ case nfsstat4::NFS4ERR_DELAY:
+ return out << "ERROR_DELAY";
+ case nfsstat4::NFS4ERR_SAME:
+ return out << "ERROR_SAME";
+ case nfsstat4::NFS4ERR_DENIED:
+ return out << "ERROR_DENIED";
+ case nfsstat4::NFS4ERR_EXPIRED:
+ return out << "ERROR_EXPIRED";
+ case nfsstat4::NFS4ERR_LOCKED:
+ return out << "ERROR_LOCKED";
+ case nfsstat4::NFS4ERR_GRACE:
+ return out << "ERROR_GRACE";
+ case nfsstat4::NFS4ERR_FHEXPIRED:
+ return out << "ERROR_FHEXPIRED";
+ case nfsstat4::NFS4ERR_SHARE_DENIED:
+ return out << "ERROR_SHARE_DENIED";
+ case nfsstat4::NFS4ERR_WRONGSEC:
+ return out << "ERROR_WRONGSEC";
+ case nfsstat4::NFS4ERR_CLID_INUSE:
+ return out << "ERROR_CLID_INUSE";
+ case nfsstat4::NFS4ERR_RESOURCE:
+ return out << "ERROR_RESOURCE";
+ case nfsstat4::NFS4ERR_MOVED:
+ return out << "ERROR_MOVED";
+ case nfsstat4::NFS4ERR_NOFILEHANDLE:
+ return out << "ERROR_NOFILEHANDLE";
+ case nfsstat4::NFS4ERR_MINOR_VERS_MISMATCH:
+ return out << "ERROR_MINOR_VERS_MISMATCH";
+ case nfsstat4::NFS4ERR_STALE_CLIENTID:
+ return out << "ERROR_STALE_CLIENTID";
+ case nfsstat4::NFS4ERR_STALE_STATEID:
+ return out << "ERROR_STALE_STATEID";
+ case nfsstat4::NFS4ERR_OLD_STATEID:
+ return out << "ERROR_OLD_STATEID";
+ case nfsstat4::NFS4ERR_BAD_STATEID:
+ return out << "ERROR_BAD_STATEID";
+ case nfsstat4::NFS4ERR_BAD_SEQID:
+ return out << "ERROR_BAD_SEQID";
+ case nfsstat4::NFS4ERR_NOT_SAME:
+ return out << "ERROR_NOT_SAME";
+ case nfsstat4::NFS4ERR_LOCK_RANGE:
+ return out << "ERROR_LOCK_RANGE";
+ case nfsstat4::NFS4ERR_SYMLINK:
+ return out << "ERROR_SYMLINK";
+ case nfsstat4::NFS4ERR_RESTOREFH:
+ return out << "ERROR_RESTOREFH";
+ case nfsstat4::NFS4ERR_LEASE_MOVED:
+ return out << "ERROR_LEASE_MOVED";
+ case nfsstat4::NFS4ERR_ATTRNOTSUPP:
+ return out << "ERROR_ATTRNOTSUPP";
+ case nfsstat4::NFS4ERR_NO_GRACE:
+ return out << "ERROR_NO_GRACE";
+ case nfsstat4::NFS4ERR_RECLAIM_BAD:
+ return out << "ERROR_RECLAIM_BAD";
+ case nfsstat4::NFS4ERR_RECLAIM_CONFLICT:
+ return out << "ERROR_RECLAIM_CONFLICT";
+ case nfsstat4::NFS4ERR_BADXDR:
+ return out << "ERROR_BADXDR";
+ case nfsstat4::NFS4ERR_LOCKS_HELD:
+ return out << "ERROR_LOCKS_HELD";
+ case nfsstat4::NFS4ERR_OPENMODE:
+ return out << "ERROR_OPENMODE";
+ case nfsstat4::NFS4ERR_BADOWNER:
+ return out << "ERROR_BADOWNER";
+ case nfsstat4::NFS4ERR_BADCHAR:
+ return out << "ERROR_BADCHAR";
+ case nfsstat4::NFS4ERR_BADNAME:
+ return out << "ERROR_BADNAME";
+ case nfsstat4::NFS4ERR_BAD_RANGE:
+ return out << "ERROR_BAD_RANGE";
+ case nfsstat4::NFS4ERR_LOCK_NOTSUPP:
+ return out << "ERROR_LOCK_NOTSUPP";
+ case nfsstat4::NFS4ERR_OP_ILLEGAL:
+ return out << "ERROR_OP_ILLEGAL";
+ case nfsstat4::NFS4ERR_DEADLOCK:
+ return out << "ERROR_DEADLOCK";
+ case nfsstat4::NFS4ERR_FILE_OPEN:
+ return out << "ERROR_FILE_OPEN";
+ case nfsstat4::NFS4ERR_ADMIN_REVOKED:
+ return out << "ERROR_ADMIN_REVOKED";
+ case nfsstat4::NFS4ERR_CB_PATH_DOWN:
+ return out << "ERROR_CB_PATH_DOWN";
+ case nfsstat4::NFS4ERR_BADIOMODE:
+ return out << "NFS4ERR_BADIOMODE";
+ case nfsstat4::NFS4ERR_BADLAYOUT:
+ return out << "NFS4ERR_BADLAYOUT";
+ case nfsstat4::NFS4ERR_BAD_SESSION_DIGEST:
+ return out << "NFS4ERR_BAD_SESSION_DIGEST";
+ case nfsstat4::NFS4ERR_BADSESSION:
+ return out << "NFS4ERR_BADSESSION";
+ case nfsstat4::NFS4ERR_BADSLOT:
+ return out << "NFS4ERR_BADSLOT";
+ case nfsstat4::NFS4ERR_COMPLETE_ALREADY:
+ return out << "NFS4ERR_COMPLETE_ALREADY";
+ case nfsstat4::NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
+ return out << "NFS4ERR_CONN_NOT_BOUND_TO_SESSION";
+ case nfsstat4::NFS4ERR_DELEG_ALREADY_WANTED:
+ return out << "NFS4ERR_DELEG_ALREADY_WANTED";
+ case nfsstat4::NFS4ERR_BACK_CHAN_BUSY:
+ return out << "NFS4ERR_BACK_CHAN_BUSY";
+ case nfsstat4::NFS4ERR_LAYOUTTRYLATER:
+ return out << "NFS4ERR_LAYOUTTRYLATER";
+ case nfsstat4::NFS4ERR_LAYOUTUNAVAILABLE:
+ return out << "NFS4ERR_LAYOUTUNAVAILABLE";
+ case nfsstat4::NFS4ERR_NOMATCHING_LAYOUT:
+ return out << "NFS4ERR_NOMATCHING_LAYOUT";
+ case nfsstat4::NFS4ERR_RECALLCONFLICT:
+ return out << "NFS4ERR_RECALLCONFLICT";
+ case nfsstat4::NFS4ERR_UNKNOWN_LAYOUTTYPE:
+ return out << "NFS4ERR_UNKNOWN_LAYOUTTYPE";
+ case nfsstat4::NFS4ERR_SEQ_MISORDERED:
+ return out << "NFS4ERR_SEQ_MISORDERED";
+ case nfsstat4::NFS4ERR_SEQUENCE_POS:
+ return out << "NFS4ERR_SEQUENCE_POS";
+ case nfsstat4::NFS4ERR_REQ_TOO_BIG:
+ return out << "NFS4ERR_REQ_TOO_BIG";
+ case nfsstat4::NFS4ERR_REP_TOO_BIG:
+ return out << "NFS4ERR_REP_TOO_BIG";
+ case nfsstat4::NFS4ERR_REP_TOO_BIG_TO_CACHE:
+ return out << "NFS4ERR_REP_TOO_BIG_TO_CACHE";
+ case nfsstat4::NFS4ERR_RETRY_UNCACHED_REP:
+ return out << "NFS4ERR_RETRY_UNCACHED_REP";
+ case nfsstat4::NFS4ERR_UNSAFE_COMPOUND:
+ return out << "NFS4ERR_UNSAFE_COMPOUND";
+ case nfsstat4::NFS4ERR_TOO_MANY_OPS:
+ return out << "NFS4ERR_TOO_MANY_OPS";
+ case nfsstat4::NFS4ERR_OP_NOT_IN_SESSION:
+ return out << "NFS4ERR_OP_NOT_IN_SESSION";
+ case nfsstat4::NFS4ERR_HASH_ALG_UNSUPP:
+ return out << "NFS4ERR_HASH_ALG_UNSUPP";
+ case nfsstat4::NFS4ERR_CLIENTID_BUSY:
+ return out << "NFS4ERR_CLIENTID_BUSY";
+ case nfsstat4::NFS4ERR_PNFS_IO_HOLE:
+ return out << "NFS4ERR_PNFS_IO_HOLE";
+ case nfsstat4::NFS4ERR_SEQ_FALSE_RETRY:
+ return out << "NFS4ERR_SEQ_FALSE_RETRY";
+ case nfsstat4::NFS4ERR_BAD_HIGH_SLOT:
+ return out << "NFS4ERR_BAD_HIGH_SLOT";
+ case nfsstat4::NFS4ERR_DEADSESSION:
+ return out << "NFS4ERR_DEADSESSION";
+ case nfsstat4::NFS4ERR_ENCR_ALG_UNSUPP:
+ return out << "NFS4ERR_ENCR_ALG_UNSUPP";
+ case nfsstat4::NFS4ERR_PNFS_NO_LAYOUT:
+ return out << "NFS4ERR_PNFS_NO_LAYOUT";
+ case nfsstat4::NFS4ERR_NOT_ONLY_OP:
+ return out << "NFS4ERR_NOT_ONLY_OP";
+ case nfsstat4::NFS4ERR_WRONG_CRED:
+ return out << "NFS4ERR_WRONG_CRED";
+ case nfsstat4::NFS4ERR_WRONG_TYPE:
+ return out << "NFS4ERR_WRONG_TYPE";
+ case nfsstat4::NFS4ERR_DIRDELEG_UNAVAIL:
+ return out << "NFS4ERR_DIRDELEG_UNAVAIL";
+ case nfsstat4::NFS4ERR_REJECT_DELEG:
+ return out << "NFS4ERR_REJECT_DELEG";
+ case nfsstat4::NFS4ERR_RETURNCONFLICT:
+ return out << "NFS4ERR_RETURNCONFLICT";
+ case nfsstat4::NFS4ERR_DELEG_REVOKED:
+ return out << "NFS4ERR_DELEG_REVOKED";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const bitmap4& obj)
+{
+ if(obj.bitmap4_len)
+ {
+ out << "mask: ";
+ print_hex(out, obj.bitmap4_val, obj.bitmap4_len);
+ const size_t nbits {obj.bitmap4_len << 5}; // obj.bitmap4_len * 32
+
+ static const char* const FATTR4Attributes[] =
+ {
+ "SUPPORTED_ATTRS", "TYPE", "FH_EXPIRE_TYPE", "CHANGE",
+ "SIZE", "LINK_SUPPORT", "SYMLINK_SUPPORT", "NAMED_ATTR",
+ "FSID", "UNIQUE_HANDLES", "LEASE_TIME", "RDATTR_ERROR",
+ "ACL", "ACLSUPPORT", "ARCHIVE", "CANSETTIME",
+ "CASE_INSENSITIVE","CASE_PRESERVING", "CHOWN_RESTRICTED","FILEHANDLE",
+ "FILEID", "FILES_AVAIL", "FILES_FREE", "FILES_TOTAL",
+ "FS_LOCATIONS", "HIDDEN", "HOMOGENEOUS", "MAXFILESIZE",
+ "MAXLINK", "MAXNAME", "MAXREAD", "MAXWRITE",
+ "MIMETYPE", "MODE", "NO_TRUNC", "NUMLINKS",
+ "OWNER", "OWNER_GROUP", "QUOTA_AVAIL_HARD","QUOTA_AVAIL_SOFT",
+ "QUOTA_USED", "RAWDEV", "SPACE_AVAIL", "SPACE_FREE",
+ "SPACE_TOTAL", "SPACE_USED", "SYSTEM", "TIME_ACCESS",
+ "TIME_ACCESS_SET", "TIME_BACKUP", "TIME_CREATE", "TIME_DELTA",
+ "TIME_METADATA", "TIME_MODIFY", "TIME_MODIFY_SET", "MOUNTED_ON_FILEID",
+ "DIR_NOTIF_DELAY", "DIRENT_NOTIF_DELAY","DACL", "SACL",
+ "CHANGE_POLICY", "FS_STATUS", "FS_LAYOUT_TYPES", "LAYOUT_HINT",
+ "LAYOUT_TYPES", "LAYOUT_BLKSIZE", "LAYOUT_ALIGNMENT","FS_LOCATIONS_INFO",
+ "MDSTHRESHOLD", "RETENTION_GET", "RETENTION_SET", "RETENTEVT_GET",
+ "RETENTEVT_SET", "RETENTION_HOLD", "MODE_SET_MASKED", "SUPPATTR_EXCLCREAT",
+ "FS_CHARSET_CAP"
+ };
+ for(size_t i {0}; i<nbits; i++)
+ {
+ //obj.bitmap4_val[i / 32] >> (i % 32)) & 0x1;
+ const int bit = (obj.bitmap4_val[i >> 5] >> (i & 31)) & 0x1;
+ if( bit !=0 && i < ( sizeof(FATTR4Attributes)/
+ sizeof(FATTR4Attributes[0]) ) )
+ out << ' ' << FATTR4Attributes[i];
+ }
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfs_fh4& obj)
+{
+ NFS::print_nfs_fh(out,
+ obj.nfs_fh4_val,
+ obj.nfs_fh4_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const sec_oid4& obj)
+{
+ print_hex(out,
+ obj.sec_oid4_val,
+ obj.sec_oid4_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const utf8string& obj)
+{
+ if(obj.utf8string_len)
+ {
+ out.write(obj.utf8string_val,
+ obj.utf8string_len);
+ }
+ else
+ {
+ out << "void";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const pathname4& obj)
+{
+ component4 *current_el = obj.pathname4_val;
+ for(size_t i {0}; i<obj.pathname4_len; i++,current_el++)
+ {
+ out.write(current_el->utf8string_val,
+ current_el->utf8string_len);
+ out << ' ';
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfstime4& obj)
+{
+ return out << "sec: " << obj.seconds
+ << " nsec: " << obj.nseconds;
+}
+
+std::ostream& operator<<(std::ostream& out, const time_how4& obj)
+{
+ switch(obj)
+ {
+ case time_how4::SET_TO_SERVER_TIME4:
+ return out << "server time";
+ case time_how4::SET_TO_CLIENT_TIME4:
+ return out << "client time";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const settime4& obj)
+{
+ return out << obj.set_it << ": " << obj.settime4_u.time;
+}
+
+std::ostream& operator<<(std::ostream& out, const fsid4& obj)
+{
+ return out << "major: " << obj.major
+ << " minor: " << obj.minor;
+}
+
+std::ostream& operator<<(std::ostream& out, const fs_location4& obj)
+{
+ out << "root path: " << obj.rootpath;
+ utf8str_cis *current_el {obj.server.server_val};
+ for(size_t i {0}; i<obj.server.server_len; i++,current_el++)
+ {
+ out.write(current_el->utf8string_val,
+ current_el->utf8string_len);
+ out << ' ';
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fs_locations4& obj)
+{
+ out << "root: " << obj.fs_root;
+ if(obj.locations.locations_len)
+ {
+ fs_location4* current_el {obj.locations.locations_val};
+ for(u_int i {0}; i<obj.locations.locations_len; i++,current_el++)
+ {
+ out << current_el;
+ }
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfsace4& obj)
+{
+ return out << "type: " << obj.type
+ << " flag: " << obj.flag
+ << " access mask: " << obj.access_mask
+ << " who: " << obj.who;
+}
+
+std::ostream& operator<<(std::ostream& out, const change_policy4& obj)
+{
+ return out << "major: " << obj.cp_major
+ << " minor: " << obj.cp_minor;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfsacl41& obj)
+{
+ out << "flag: " << obj.na41_flag;
+ if(obj.na41_aces.na41_aces_len)
+ {
+ nfsace4* current_el {obj.na41_aces.na41_aces_val};
+ for(u_int i {0}; i<obj.na41_aces.na41_aces_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const mode_masked4& obj)
+{
+ return out << "value to set: " << obj.mm_value_to_set
+ << " mask bits: " << obj.mm_mask_bits;
+}
+
+std::ostream& operator<<(std::ostream& out, const specdata4& obj)
+{
+ return out << "specdata 1: " << obj.specdata1
+ << " specdata 2: " << obj.specdata2;
+}
+
+std::ostream& operator<<(std::ostream& out, const netaddr4& obj)
+{
+ return out << "netid: " << obj.na_r_netid
+ << " addr: " << obj.na_r_addr;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfs_impl_id4& obj)
+{
+ out << "domain: ";
+ out.write(obj.nii_domain.utf8string_val,
+ obj.nii_domain.utf8string_len);
+
+ out << " name: ";
+ out.write(obj.nii_name.utf8string_val,
+ obj.nii_name.utf8string_len);
+
+ out << " date: " << obj.nii_date;
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const stateid4& obj)
+{
+ out << " seqid: " << std::hex << obj.seqid << " data: ";
+ print_hex(out,
+ obj.other,
+ 12);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layouttype4& obj)
+{
+ switch(obj)
+ {
+ case layouttype4::LAYOUT4_NFSV4_1_FILES: return out << "NFSV4_1_FILES";
+ case layouttype4::LAYOUT4_OSD2_OBJECTS: return out << "OSD2_OBJECTS";
+ case layouttype4::LAYOUT4_BLOCK_VOLUME: return out << "BLOCK_VOLUME";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layout_content4& obj)
+{
+ out << "type: " << obj.loc_type;
+ out.write(obj.loc_body.loc_body_val,
+ obj.loc_body.loc_body_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layouthint4& obj)
+{
+ out << "type: " << obj.loh_type;
+ out.write(obj.loh_body.loh_body_val,
+ obj.loh_body.loh_body_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutiomode4& obj)
+{
+ switch(obj)
+ {
+ case layoutiomode4::LAYOUTIOMODE4_READ: return out << "READ";
+ case layoutiomode4::LAYOUTIOMODE4_RW: return out << "RW";
+ case layoutiomode4::LAYOUTIOMODE4_ANY: return out << "ANYE";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layout4& obj)
+{
+ out << "offset: " << obj.lo_offset
+ << " length: " << obj.lo_length
+ << " iomode: " << obj.lo_iomode
+ << " content: " << obj.lo_content;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const device_addr4& obj)
+{
+ out << "layout type: " << obj.da_layout_type;
+ out.write(obj.da_addr_body.da_addr_body_val,
+ obj.da_addr_body.da_addr_body_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutupdate4& obj)
+{
+ out << "type: " << obj.lou_type;
+ out.write(obj.lou_body.lou_body_val,
+ obj.lou_body.lou_body_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutreturn_type4& obj)
+{
+ switch(obj)
+ {
+ case layoutreturn_type4::LAYOUTRETURN4_FILE: return out << "FILE";
+ case layoutreturn_type4::LAYOUTRETURN4_FSID: return out << "FSID";
+ case layoutreturn_type4::LAYOUTRETURN4_ALL: return out << "ALL";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutreturn_file4& obj)
+{
+ out << "offset: " << obj.lrf_offset
+ << " length: " << obj.lrf_length
+ << " stateid: " << obj.lrf_stateid
+ << " content: ";
+ out.write(obj.lrf_body.lrf_body_val,
+ obj.lrf_body.lrf_body_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutreturn4& obj)
+{
+ out << "type: " << obj.lr_returntype;
+ if(obj.lr_returntype == layoutreturn_type4::LAYOUTRETURN4_FILE)
+ out << " layout: " << obj.layoutreturn4_u.lr_layout;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fs4_status_type& obj)
+{
+ switch(obj)
+ {
+ case fs4_status_type::STATUS4_FIXED: return out << "FIXED";
+ case fs4_status_type::STATUS4_UPDATED: return out << "UPDATED";
+ case fs4_status_type::STATUS4_VERSIONED: return out << "VERSIONED";
+ case fs4_status_type::STATUS4_WRITABLE: return out << "WRITABLE";
+ case fs4_status_type::STATUS4_REFERRAL: return out << "REFERRAL";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fs4_status& obj)
+{
+ out << "absent: " << obj.fss_absent
+ << " status: " << obj.fss_type
+ << " source: " << obj.fss_source
+ << " current: " << obj.fss_current
+ << " age: " << obj.fss_age
+ << " version: " << obj.fss_version;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const threshold_item4& obj)
+{
+ out << "layout type: " << obj.thi_layout_type
+ << " hint set: " << obj.thi_hintset
+ << " content: ";
+ out.write(obj.thi_hintlist.thi_hintlist_val,
+ obj.thi_hintlist.thi_hintlist_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const mdsthreshold4& obj)
+{
+ threshold_item4 *current_el = obj.mth_hints.mth_hints_val;
+ for(size_t i {0}; i<obj.mth_hints.mth_hints_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const retention_get4& obj)
+{
+ out << "duration: " << obj.rg_duration;
+ nfstime4 *current_el = obj.rg_begin_time.rg_begin_time_val;
+ for(size_t i {0}; i<obj.rg_begin_time.rg_begin_time_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const retention_set4& obj)
+{
+ out << "enable: " << obj.rs_enable;
+ uint64_t *current_el = obj.rs_duration.rs_duration_val;
+ for(size_t i {0}; i<obj.rs_duration.rs_duration_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fattr4_acl& obj)
+{
+ if(obj.fattr4_acl_len) return out << *obj.fattr4_acl_val;
+ else return out << "void";
+}
+
+std::ostream& operator<<(std::ostream& out, const fattr4_fs_layout_types& obj)
+{
+ layouttype4 *current_el = obj.fattr4_fs_layout_types_val;
+ for(size_t i {0}; i<obj.fattr4_fs_layout_types_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fattr4_layout_types& obj)
+{
+ layouttype4 *current_el = obj.fattr4_layout_types_val;
+ for(size_t i {0}; i<obj.fattr4_layout_types_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fattr4& obj)
+{
+ return out << obj.attrmask;
+}
+
+std::ostream& operator<<(std::ostream& out, const change_info4& obj)
+{
+ out << " atomic: ";
+ if(obj.atomic) out << "YES";
+ else out << "NO";
+
+ return out << " change id before: " << obj.before
+ << " change id after: " << obj.after;
+}
+
+std::ostream& operator<<(std::ostream& out, const cb_client4& obj)
+{
+ return out << "program: " << std::hex << obj.cb_program
+ << " location: " << obj.cb_location;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfs_client_id4& obj)
+{
+ out << "verifier: ";
+ print_hex(out,
+ obj.verifier,
+ NFS4_VERIFIER_SIZE);
+ out << " client id: ";
+ if(obj.id.id_len) out.write(obj.id.id_val,
+ obj.id.id_len);
+ else out << " void";
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const client_owner4& obj)
+{
+ out << "verifier: ";
+ print_hex(out,
+ obj.co_verifier,
+ NFS4_VERIFIER_SIZE);
+ out << " client id: ";
+ if(obj.co_ownerid.co_ownerid_len)
+ out.write(obj.co_ownerid.co_ownerid_val,
+ obj.co_ownerid.co_ownerid_len);
+ else out << " void";
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const server_owner4& obj)
+{
+ out << "minor id: " << obj.so_minor_id;
+ out << " major id: ";
+ if(obj.so_major_id.so_major_id_len)
+ out.write(obj.so_major_id.so_major_id_val,
+ obj.so_major_id.so_major_id_len);
+ else out << " void";
+
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const state_owner4& obj)
+{
+ out << "client id: 0x" << std::hex << obj.clientid << " owner: 0x";
+ print_hex(out,
+ obj.owner.owner_val,
+ obj.owner.owner_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfs_lock_type4& obj)
+{
+ switch(obj)
+ {
+ case nfs_lock_type4::READ_LT: return out << "READ_LOCK_TYPE";
+ case nfs_lock_type4::WRITE_LT: return out << "WRITE_LOCK_TYPE";
+ case nfs_lock_type4::READW_LT: return out << "READW_LOCK_TYPE";
+ case nfs_lock_type4::WRITEW_LT: return out << "WRITEW_LOCK_TYPE";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssv_subkey4& obj)
+{
+ out << "SSV4_SUBKEY_";
+ switch(obj)
+ {
+ case ssv_subkey4::SSV4_SUBKEY_MIC_I2T: return out << "MIC_I2T";
+ case ssv_subkey4::SSV4_SUBKEY_MIC_T2I: return out << "MIC_T2I";
+ case ssv_subkey4::SSV4_SUBKEY_SEAL_I2T: return out << "MIC_I2T";
+ case ssv_subkey4::SSV4_SUBKEY_SEAL_T2I: return out << "MIC_T2I";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssv_mic_plain_tkn4& obj)
+{
+ out << "ssv seq: " << obj.smpt_ssv_seq << ' ';
+ out.write(obj.smpt_orig_plain.smpt_orig_plain_val,
+ obj.smpt_orig_plain.smpt_orig_plain_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssv_mic_tkn4& obj)
+{
+ out << "ssv seq: " << obj.smt_ssv_seq << ' ';
+ out.write(obj.smt_hmac.smt_hmac_val,
+ obj.smt_hmac.smt_hmac_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssv_seal_plain_tkn4& obj)
+{
+ out << "confounder: ";
+ out.write(obj.sspt_confounder.sspt_confounder_val,
+ obj.sspt_confounder.sspt_confounder_len);
+ out << " ssv seq: " << obj.sspt_ssv_seq
+ << " orig plain: ";
+ out.write(obj.sspt_orig_plain.sspt_orig_plain_val,
+ obj.sspt_orig_plain.sspt_orig_plain_len);
+ out << " pad: ";
+ out.write(obj.sspt_pad.sspt_pad_val,
+ obj.sspt_pad.sspt_pad_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssv_seal_cipher_tkn4& obj)
+{
+ out << "ssv seq: " << obj.ssct_ssv_seq
+ << " iv: ";
+ out.write(obj.ssct_iv.ssct_iv_val,
+ obj.ssct_iv.ssct_iv_len);
+ out << " encrypted data: ";
+ out.write(obj.ssct_encr_data.ssct_encr_data_val,
+ obj.ssct_encr_data.ssct_encr_data_len);
+ out << " hmac: ";
+ out.write(obj.ssct_hmac.ssct_hmac_val,
+ obj.ssct_hmac.ssct_hmac_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fs_locations_server4& obj)
+{
+ out << "currency: " << obj.fls_currency
+ << " info: ";
+ out.write(obj.fls_info.fls_info_val,
+ obj.fls_info.fls_info_len);
+ out << " server: " << obj.fls_server;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fs_locations_item4& obj)
+{
+ fs_locations_server4 *current_el = obj.fli_entries.fli_entries_val;
+ for(size_t i {0}; i<obj.fli_entries.fli_entries_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ out << " rootpath: " << obj.fli_rootpath;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const fs_locations_info4& obj)
+{
+ out << "flags: " << obj.fli_flags
+ << " valid for: " << obj.fli_valid_for
+ << " fs root: " << obj.fli_fs_root
+ << " items:";
+ fs_locations_item4 *current_el = obj.fli_items.fli_items_val;
+ for(size_t i {0}; i<obj.fli_items.fli_items_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const filelayout_hint_care4& obj)
+{
+ switch(obj)
+ {
+ case filelayout_hint_care4::NFLH4_CARE_DENSE:
+ return out << "DENSE";
+ case filelayout_hint_care4::NFLH4_CARE_COMMIT_THRU_MDS:
+ return out << "COMMIT_THRU_MDS";
+ case filelayout_hint_care4::NFLH4_CARE_STRIPE_UNIT_SIZE:
+ return out << "STRIPE_UNIT_SIZE";
+ case filelayout_hint_care4::NFLH4_CARE_STRIPE_COUNT:
+ return out << "STRIPE_COUNT";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfsv4_1_file_layouthint4& obj)
+{
+ out << "nflh care: " << obj.nflh_care
+ << " nflh util: " << obj.nflh_util
+ << " stripe count: " << obj.nflh_stripe_count;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const multipath_list4& obj)
+{
+ netaddr4 *current_el = obj.multipath_list4_val;
+ for(size_t i {0}; i<obj.multipath_list4_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfsv4_1_file_layout_ds_addr4& obj)
+{
+ out << "stripe indices: ";
+ print_hex(out,
+ obj.nflda_stripe_indices.nflda_stripe_indices_val,
+ obj.nflda_stripe_indices.nflda_stripe_indices_len);
+ out << " multipath ds list: ";
+ multipath_list4 *current_el = obj.nflda_multipath_ds_list.nflda_multipath_ds_list_val;
+ for(size_t i {0}; i<obj.nflda_multipath_ds_list.nflda_multipath_ds_list_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfsv4_1_file_layout4& obj)
+{
+ out << "device id: " << obj.nfl_deviceid
+ << " nfl util: " << obj.nfl_util
+ << " 1st stripe index: " << obj.nfl_first_stripe_index
+ << " pattern offset: " << obj.nfl_pattern_offset
+ << " fh list:";
+ nfs_fh4 *current_el = obj.nfl_fh_list.nfl_fh_list_val;
+ for(size_t i {0}; i<obj.nfl_fh_list.nfl_fh_list_len; i++,current_el++)
+ {
+ out << ' ';
+ print_nfs_fh(out,
+ current_el->nfs_fh4_val,
+ current_el->nfs_fh4_len);
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const createtype4& obj)
+{
+ out << "type: " << obj.type;
+ switch(obj.type)
+ {
+ case nfs_ftype4::NF4BLK:
+ case nfs_ftype4::NF4CHR:
+ return out << " dev data: " << obj.createtype4_u.devdata;
+ case nfs_ftype4::NF4LNK:
+ return out << " link data: " << obj.createtype4_u.linkdata;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_to_lock_owner4& obj)
+{
+ return out << "open seqid: " << obj.open_seqid
+ << " open state id: " << obj.open_stateid
+ << " lock seqid: " << obj.lock_seqid
+ << " lock owner: " << obj.lock_owner;
+}
+
+std::ostream& operator<<(std::ostream& out, const exist_lock_owner4& obj)
+{
+ return out << "lock state id: " << obj.lock_stateid
+ << " lock seqid: " << obj.lock_seqid;
+}
+
+std::ostream& operator<<(std::ostream& out, const locker4& obj)
+{
+ out << "new lock owner: " << obj.new_lock_owner;
+ if(obj.new_lock_owner)
+ return out << " open owner: " << obj.locker4_u.open_owner;
+ else
+ return out << " lock owner: " << obj.locker4_u.lock_owner;
+}
+
+std::ostream& operator<<(std::ostream& out, const createmode4& obj)
+{
+ switch(obj)
+ {
+ case createmode4::UNCHECKED4: return out << "UNCHECKED";
+ case createmode4::GUARDED4: return out << "GUARDED";
+ case createmode4::EXCLUSIVE4: return out << "EXCLUSIVE4";
+ case createmode4::EXCLUSIVE4_1: return out << "EXCLUSIVE4_1";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const creatverfattr& obj)
+{
+ out << "verf: ";
+ print_hex(out, obj.cva_verf, NFS4_VERIFIER_SIZE);
+ out << " attrs: " << obj.cva_attrs;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const createhow4& obj)
+{
+ out << " mode: " << obj.mode;
+ switch(obj.mode)
+ {
+ case createmode4::UNCHECKED4:
+ case createmode4::GUARDED4:
+ return out << " attributes: " << obj.createhow4_u.createattrs;
+ case createmode4::EXCLUSIVE4:
+ out << " verifier: ";
+ print_hex(out, obj.createhow4_u.createverf, NFS4_VERIFIER_SIZE);
+ case createmode4::EXCLUSIVE4_1:
+ out << " verifier: ";
+ print_hex(out, obj.createhow4_u.ch_createboth.cva_verf, NFS4_VERIFIER_SIZE);
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const opentype4& obj)
+{
+ switch(obj)
+ {
+ case opentype4::OPEN4_NOCREATE: return out << "NO CREATE";
+ case opentype4::OPEN4_CREATE: return out << "CREATE";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const openflag4& obj)
+{
+ out << "open type: " << obj.opentype;
+ if(obj.opentype == opentype4::OPEN4_CREATE)
+ return out << obj.openflag4_u.how;
+ else
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const limit_by4& obj)
+{
+ switch(obj)
+ {
+ case limit_by4::NFS_LIMIT_SIZE: return out << "SIZE";
+ case limit_by4::NFS_LIMIT_BLOCKS: return out << "BLOCKS";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfs_modified_limit4& obj)
+{
+ return out << "blocks number: " << obj.num_blocks
+ << " bytes per block: " << obj.bytes_per_block;
+}
+
+std::ostream& operator<<(std::ostream& out, const nfs_space_limit4& obj)
+{
+ out << "limit by: " << obj.limitby;
+ switch(obj.limitby)
+ {
+ case limit_by4::NFS_LIMIT_SIZE:
+ return out << " filesize: "
+ << obj.nfs_space_limit4_u.filesize;
+ case limit_by4::NFS_LIMIT_BLOCKS:
+ return out << " modified blocks: "
+ << obj.nfs_space_limit4_u.mod_blocks;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_delegation_type4& obj)
+{
+ switch(obj)
+ {
+ case open_delegation_type4::OPEN_DELEGATE_NONE:
+ return out << "NONE";
+ case open_delegation_type4::OPEN_DELEGATE_READ:
+ return out << "READ";
+ case open_delegation_type4::OPEN_DELEGATE_WRITE:
+ return out << "WRITE";
+ case open_delegation_type4::OPEN_DELEGATE_NONE_EXT:
+ return out << "NONE_EXT";
+ }
+ return out;
+}
+
+
+std::ostream& operator<<(std::ostream& out, const open_claim_type4& obj)
+{
+ switch(obj)
+ {
+ case open_claim_type4::CLAIM_NULL:
+ return out << "NULL";
+ case open_claim_type4::CLAIM_PREVIOUS:
+ return out << "PREVIOUS";
+ case open_claim_type4::CLAIM_DELEGATE_CUR:
+ return out << "DELEGATE CURRENT";
+ case open_claim_type4::CLAIM_DELEGATE_PREV:
+ return out << "DELEGATE PREVIOUS";
+ case open_claim_type4::CLAIM_FH:
+ return out << "FH";
+ case open_claim_type4::CLAIM_DELEG_CUR_FH:
+ return out << "DELEGATE CURRENT FH";
+ case open_claim_type4::CLAIM_DELEG_PREV_FH:
+ return out << "DELEGATE PREVIOUS FH";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_claim_delegate_cur4& obj)
+{
+ return out << "delegate state id: " << obj.delegate_stateid
+ << " file: " << obj.file;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_claim4& obj)
+{
+ out << "claim: " << obj.claim;
+ switch(obj.claim)
+ {
+ case open_claim_type4::CLAIM_NULL:
+ out << " file: ";
+ return out.write(obj.open_claim4_u.file.utf8string_val,
+ obj.open_claim4_u.file.utf8string_len);
+ case open_claim_type4::CLAIM_PREVIOUS:
+ return out << " delegate type: "
+ << obj.open_claim4_u.delegate_type;
+ case open_claim_type4::CLAIM_DELEGATE_CUR:
+ return out << " delegate current info: "
+ << obj.open_claim4_u.delegate_cur_info;
+ case open_claim_type4::CLAIM_DELEGATE_PREV:
+ return out << " file delegate previous: "
+ << obj.open_claim4_u.file_delegate_prev;
+ case open_claim_type4::CLAIM_FH:
+ case open_claim_type4::CLAIM_DELEG_PREV_FH:
+ break;
+ case open_claim_type4::CLAIM_DELEG_CUR_FH:
+ return out << " oc delegate stateid: "
+ << obj.open_claim4_u.oc_delegate_stateid;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_read_delegation4& obj)
+{
+ return out << "stateid: " << obj.stateid
+ << " recall: " << obj.recall
+ << " permissions: " << obj.permissions;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_write_delegation4& obj)
+{
+ return out << "stateid: " << obj.stateid
+ << " recall: " << obj.recall
+ << " space limit: " << obj.space_limit
+ << " permissions: " << obj.permissions;
+}
+
+std::ostream& operator<<(std::ostream& out, const why_no_delegation4& obj)
+{
+ switch(obj)
+ {
+ case why_no_delegation4::WND4_NOT_WANTED:
+ return out << "NOT WANTED";
+ case why_no_delegation4::WND4_CONTENTION:
+ return out << "CONTENTION";
+ case why_no_delegation4::WND4_RESOURCE:
+ return out << "RESOURCE";
+ case why_no_delegation4::WND4_NOT_SUPP_FTYPE:
+ return out << "NOT_SUPP_FTYPE";
+ case why_no_delegation4::WND4_WRITE_DELEG_NOT_SUPP_FTYPE:
+ return out << "WRITE_DELEG_NOT_SUPP_FTYPE";
+ case why_no_delegation4::WND4_NOT_SUPP_UPGRADE:
+ return out << "NOT_SUPP_UPGRADE";
+ case why_no_delegation4::WND4_NOT_SUPP_DOWNGRADE:
+ return out << "NOT_SUPP_DOWNGRADE";
+ case why_no_delegation4::WND4_CANCELLED:
+ return out << "CANCELLED";
+ case why_no_delegation4::WND4_IS_DIR:
+ return out << "IS_DIR";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_none_delegation4& obj)
+{
+ out << "why: " << obj.ond_why;
+ switch(obj.ond_why)
+ {
+ case why_no_delegation4::WND4_CONTENTION:
+ out << " server will push deleg: "
+ << obj.open_none_delegation4_u.ond_server_will_push_deleg;
+ case why_no_delegation4::WND4_RESOURCE:
+ out << " server will signal available: "
+ << obj.open_none_delegation4_u.ond_server_will_signal_avail;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const open_delegation4& obj)
+{
+ out << "delegation type: " << obj.delegation_type;
+ switch(obj.delegation_type)
+ {
+ case open_delegation_type4::OPEN_DELEGATE_NONE:
+ break;
+ case open_delegation_type4::OPEN_DELEGATE_READ:
+ return out << ": " << obj.open_delegation4_u.read;
+ case open_delegation_type4::OPEN_DELEGATE_WRITE:
+ return out << ": " << obj.open_delegation4_u.write;
+ case open_delegation_type4::OPEN_DELEGATE_NONE_EXT:
+ return out << ": " << obj.open_delegation4_u.od_whynone;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const entry4& obj)
+{
+ out << "cookie: " << obj.cookie
+ << " name: " << obj.name
+ << " attributes: " << obj.attrs << '\n';
+ if(obj.nextentry) return out << ' ' << *obj.nextentry;
+ else return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const dirlist4& obj)
+{
+ out << "eof: " << obj.eof;
+ if(obj.entries) return out << " entries:\n"
+ << *obj.entries;
+ else return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const rpc_gss_svc_t& obj)
+{
+ switch(obj)
+ {
+ case rpc_gss_svc_t::RPC_GSS_SVC_NONE:
+ return out << "NONE";
+ case rpc_gss_svc_t::RPC_GSS_SVC_INTEGRITY:
+ return out << "INTEGRITY";
+ case rpc_gss_svc_t::RPC_GSS_SVC_PRIVACY:
+ return out << "PRIVACY";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const rpcsec_gss_info& obj)
+{
+ return out << "oid: " << obj.oid
+ << " qop: " << obj.qop
+ << " service: " << obj.service;
+}
+
+std::ostream& operator<<(std::ostream& out, const secinfo4& obj)
+{
+ out << " flavor: " << obj.flavor;
+ if(obj.flavor == RPCSEC_GSS) return out << " info: "
+ << obj.secinfo4_u.flavor_info;
+ else return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const stable_how4& obj)
+{
+ switch(obj)
+ {
+ case stable_how4::UNSTABLE4: return out << "UNSTABLE";
+ case stable_how4::DATA_SYNC4: return out << "DATA SYNC";
+ case stable_how4::FILE_SYNC4: return out << "FILE SYNC";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const gsshandle4_t& obj)
+{
+ print_hex(out,
+ obj.gsshandle4_t_val,
+ obj.gsshandle4_t_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const gss_cb_handles4& obj)
+{
+ out << "service: " << obj.gcbp_service
+ << " server: " << obj.gcbp_handle_from_server
+ << " client: " << obj.gcbp_handle_from_client;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const authunix_parms& obj)
+{
+ out << "time: " << obj.aup_time
+ << " machine name: " << obj.aup_machname
+ << " uid: " << obj.aup_uid
+ << " gid: " << obj.aup_gid;
+ __gid_t *current_el = obj.aup_gids;
+ for(size_t i {0}; i<obj.aup_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+/*
+std::ostream& operator<<(std::ostream& out, const authsys_parms& obj)
+{
+ out << "timestamp: " << obj.stamp
+ << " machine name: " << obj.machinename
+ << " uid: " << obj.uid
+ << " gid: " << obj.gid;
+ u_int *current_el = obj.gids.gids_val;
+ for(size_t i {0}; i<obj.gids.gids_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+*/
+std::ostream& operator<<(std::ostream& out, const callback_sec_parms4& obj)
+{
+ out << " sec flavor: " << obj.cb_secflavor;
+ switch(obj.cb_secflavor)
+ {
+ case AUTH_NONE:
+ break;
+ case AUTH_SYS:
+ out << obj.callback_sec_parms4_u.cbsp_sys_cred;
+ case RPCSEC_GSS:
+ out << obj.callback_sec_parms4_u.cbsp_gss_handles;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const channel_dir_from_client4& obj)
+{
+ switch(obj)
+ {
+ case channel_dir_from_client4::CDFC4_FORE: return out << "FORE";
+ case channel_dir_from_client4::CDFC4_BACK: return out << "BACK";
+ case channel_dir_from_client4::CDFC4_FORE_OR_BOTH: return out << "FORE_OR_BOTH";
+ case channel_dir_from_client4::CDFC4_BACK_OR_BOTH: return out << "BACK_OR_BOTH";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const channel_dir_from_server4& obj)
+{
+ switch(obj)
+ {
+ case channel_dir_from_server4::CDFS4_FORE: return out << "FORE";
+ case channel_dir_from_server4::CDFS4_BACK: return out << "BACK";
+ case channel_dir_from_server4::CDFS4_BOTH: return out << "BOTH";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const state_protect_ops4& obj)
+{
+ out << "must enforce: " << obj.spo_must_enforce
+ << " must allow: " << obj.spo_must_allow;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssv_sp_parms4& obj)
+{
+ out << "ops: " << obj.ssp_ops;
+ sec_oid4 *current_el = obj.ssp_hash_algs.ssp_hash_algs_val;
+ for(size_t i {0}; i<obj.ssp_hash_algs.ssp_hash_algs_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ out << " encr algs: ";
+ current_el = obj.ssp_encr_algs.ssp_encr_algs_val;
+ for(size_t i {0}; i<obj.ssp_encr_algs.ssp_encr_algs_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ out << " window: " << obj.ssp_window
+ << " num_gss_handles: " << obj.ssp_num_gss_handles;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const state_protect_how4& obj)
+{
+ switch(obj)
+ {
+ case state_protect_how4::SP4_NONE: return out << "NONE";
+ case state_protect_how4::SP4_MACH_CRED: return out << "MACH_CRED";
+ case state_protect_how4::SP4_SSV: return out << "SSV";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const state_protect4_a& obj)
+{
+ out << "how: " << obj.spa_how;
+ switch(obj.spa_how)
+ {
+ case state_protect_how4::SP4_NONE: break;
+ case state_protect_how4::SP4_MACH_CRED:
+ return out << " mach ops: " << obj.state_protect4_a_u.spa_mach_ops;
+ case state_protect_how4::SP4_SSV:
+ return out << " ssv ops: " << obj.state_protect4_a_u.spa_ssv_parms;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssv_prot_info4& obj)
+{
+ out << "ops: " << obj.spi_ops
+ << " hash alg: " << obj.spi_hash_alg
+ << " encr alg: " << obj.spi_encr_alg
+ << " ssv len: " << obj.spi_ssv_len
+ << " window: " << obj.spi_window
+ << " handles:";
+ gsshandle4_t *current_el = obj.spi_handles.spi_handles_val;
+ for(size_t i {0}; i<obj.spi_handles.spi_handles_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const state_protect4_r& obj)
+{
+ out << "how: " << obj.spr_how;
+ switch(obj.spr_how)
+ {
+ case state_protect_how4::SP4_NONE: break;
+ case state_protect_how4::SP4_MACH_CRED:
+ return out << " mach ops: " << obj.state_protect4_r_u.spr_mach_ops;
+ case state_protect_how4::SP4_SSV:
+ return out << " ssv ops: " << obj.state_protect4_r_u.spr_ssv_info;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const channel_attrs4& obj)
+{
+ out << "header pad size: " << obj.ca_headerpadsize
+ << "; max request size: " << obj.ca_maxrequestsize
+ << "; max response size: " << obj.ca_maxresponsesize
+ << "; max response size cached: " << obj.ca_maxresponsesize_cached
+ << "; max operations: " << obj.ca_maxoperations
+ << "; max requests: " << obj.ca_maxrequests
+ << "; rdma ird: ";
+ print_hex(out,
+ obj.ca_rdma_ird.ca_rdma_ird_val,
+ obj.ca_rdma_ird.ca_rdma_ird_len);
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const gddrnf4_status& obj)
+{
+ switch(obj)
+ {
+ case gddrnf4_status::GDD4_OK: return out << "OK";
+ case gddrnf4_status::GDD4_UNAVAIL: return out << "UNAVAIL";
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const newtime4& obj)
+{
+ out << "time changed: " << obj.nt_timechanged;
+ switch(obj.nt_timechanged)
+ {
+ case TRUE: return out << " time: " << obj.newtime4_u.nt_time;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const newoffset4& obj)
+{
+ out << "no new offset: " << obj.no_newoffset;
+ switch(obj.no_newoffset)
+ {
+ case TRUE: return out << " offset: " << obj.newoffset4_u.no_offset;
+ default: break;
+ }
+ return out;
+}
+
+
+std::ostream& operator<<(std::ostream& out, const newsize4& obj)
+{
+ out << "size changed: " << obj.ns_sizechanged;
+ switch(obj.ns_sizechanged)
+ {
+ case TRUE: return out << " size: " << obj.newsize4_u.ns_size;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutreturn_stateid& obj)
+{
+ out << "present: " << obj.lrs_present;
+ switch(obj.lrs_present)
+ {
+ case TRUE: return out << " stateid: " << obj.layoutreturn_stateid_u.lrs_stateid;
+ default: break;
+ }
+ return out;
+}
+
+
+std::ostream& operator<<(std::ostream& out, const secinfo_style4& obj)
+{
+ switch(obj)
+ {
+ case secinfo_style4::SECINFO_STYLE4_CURRENT_FH:
+ return out << "CURRENT_FH";
+ case secinfo_style4::SECINFO_STYLE4_PARENT:
+ return out << "PARENT";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SEQUENCE4args& obj)
+{
+ out << "sessionid: " << obj.sa_sessionid
+ << " sequenceid: 0x" << obj.sa_sequenceid
+ << " slotid: " << obj.sa_slotid
+ << " cache this: " << obj.sa_cachethis;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SEQUENCE4resok& obj)
+{
+ out << "session: " << obj.sr_sessionid
+ << " sequenceid: 0x" << obj.sr_sequenceid
+ << " slotid: " << obj.sr_slotid
+ << " highest slotid: " << obj.sr_highest_slotid
+ << " target highest slotid: " << obj.sr_target_highest_slotid
+ << " status flags: " << obj.sr_status_flags;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const SEQUENCE4res& obj)
+{
+ out << "status: " << obj.sr_status;
+ if(obj.sr_status == nfsstat4::NFS4_OK)
+ {
+ out << obj.SEQUENCE4res_u.sr_resok4;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssa_digest_input4& obj)
+{
+ return out << obj.sdi_seqargs;
+}
+
+std::ostream& operator<<(std::ostream& out, const ssr_digest_input4& obj)
+{
+ return out << obj.sdi_seqres;
+}
+
+std::ostream& operator<<(std::ostream& out, const deleg_claim4& obj)
+{
+ out << "claim: " << obj.dc_claim;
+ switch(obj.dc_claim)
+ {
+ case open_claim_type4::CLAIM_PREVIOUS:
+ return out << " delegate type: " << obj.deleg_claim4_u.dc_delegate_type;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutrecall_type4& obj)
+{
+ switch(obj)
+ {
+ case layoutrecall_type4::LAYOUTRECALL4_FILE:
+ return out << "FILE";
+ case layoutrecall_type4::LAYOUTRECALL4_FSID:
+ return out << "FSID";
+ case layoutrecall_type4::LAYOUTRECALL4_ALL:
+ return out << "ALL";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutrecall_file4& obj)
+{
+ out << "fh: ";
+ print_nfs_fh(out,
+ obj.lor_fh.nfs_fh4_val,
+ obj.lor_fh.nfs_fh4_len);
+ out << " offset: " << obj.lor_offset;
+ out << " length: " << obj.lor_length;
+ out << " stateid: " << obj.lor_stateid;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const layoutrecall4& obj)
+{
+ out << "type: ";
+ switch(obj.lor_recalltype)
+ {
+ case layoutrecall_type4::LAYOUTRECALL4_FILE:
+ return out << " layout: " << obj.layoutrecall4_u.lor_layout;
+ case layoutrecall_type4::LAYOUTRECALL4_FSID:
+ return out << " fsid: " << obj.layoutrecall4_u.lor_fsid;
+ default: break;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_type4& obj)
+{
+ switch(obj)
+ {
+ case notify_type4::NOTIFY4_CHANGE_CHILD_ATTRS:
+ return out << "CHANGE_CHILD_ATTRS";
+ case notify_type4::NOTIFY4_CHANGE_DIR_ATTRS:
+ return out << "CHANGE_DIR_ATTRS";
+ case notify_type4::NOTIFY4_REMOVE_ENTRY:
+ return out << "REMOVE_ENTRY";
+ case notify_type4::NOTIFY4_ADD_ENTRY:
+ return out << "ADD_ENTRY";
+ case notify_type4::NOTIFY4_RENAME_ENTRY:
+ return out << "RENAME_ENTRY";
+ case notify_type4::NOTIFY4_CHANGE_COOKIE_VERIFIER:
+ return out << "CHANGE_COOKIE_VERIFIER";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_entry4& obj)
+{
+ out << "file: " << obj.ne_file
+ << " attrs: " << obj.ne_attrs;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const prev_entry4& obj)
+{
+ out << "prev entry: " << obj.pe_prev_entry
+ << " prev entry cookie: " << obj.pe_prev_entry_cookie;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_remove4& obj)
+{
+ out << "old entry: " << obj.nrm_old_entry
+ << " old entry cookie: " << obj.nrm_old_entry_cookie;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_add4& obj)
+{
+ out << "old entries: ";
+ notify_remove4 *current_el = obj.nad_old_entry.nad_old_entry_val;
+ for(size_t i {0}; i<obj.nad_old_entry.nad_old_entry_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ out << " new entry: " << obj.nad_new_entry
+ << " new entry cookie:";
+ nfs_cookie4 *current_el2 = obj.nad_new_entry_cookie.nad_new_entry_cookie_val;
+ for(size_t i {0}; i<obj.nad_new_entry_cookie.nad_new_entry_cookie_len; i++,current_el2++)
+ {
+ out << ' ' << current_el2;
+ }
+ out << " prev entry:";
+ prev_entry4 *current_el3 = obj.nad_prev_entry.nad_prev_entry_val;
+ for(size_t i {0}; i<obj.nad_prev_entry.nad_prev_entry_len; i++,current_el3++)
+ {
+ out << ' ' << current_el3;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_attr4& obj)
+{
+ return out << "changed entry: " << obj.na_changed_entry;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_rename4& obj)
+{
+ return out << "old entry: " << obj.nrn_old_entry
+ << " new entry: " << obj.nrn_new_entry;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_verifier4& obj)
+{
+ return out << "old cookieverf: " << obj.nv_old_cookieverf
+ << " new cookieverf: " << obj.nv_new_cookieverf;
+}
+
+std::ostream& operator<<(std::ostream& out, const notifylist4& obj)
+{
+ return out.write(obj.notifylist4_val,
+ obj.notifylist4_len);
+}
+
+std::ostream& operator<<(std::ostream& out, const notify4& obj)
+{
+ return out << "mask: " << obj.notify_mask
+ << " vals: " << obj.notify_vals;
+}
+
+std::ostream& operator<<(std::ostream& out, const referring_call4& obj)
+{
+ return out << "sequenceid: 0x" << std::hex << obj.rc_sequenceid << std::dec
+ << " slotid: " << obj.rc_slotid;
+}
+
+std::ostream& operator<<(std::ostream& out, const referring_call_list4& obj)
+{
+ out << "sessionid: ";
+ print_hex(out,
+ obj.rcl_sessionid,
+ NFS4_SESSIONID_SIZE);
+ out << " referring calls:";
+ referring_call4 *current_el = obj.rcl_referring_calls.rcl_referring_calls_val;
+ for(size_t i {0}; i<obj.rcl_referring_calls.rcl_referring_calls_len; i++,current_el++)
+ {
+ out << ' ' << current_el;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_deviceid_type4& obj)
+{
+ switch(obj)
+ {
+ case notify_deviceid_type4::NOTIFY_DEVICEID4_CHANGE:
+ return out << "CHANGE";
+ case notify_deviceid_type4::NOTIFY_DEVICEID4_DELETE:
+ return out << "DELETE";
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_deviceid_delete4& obj)
+{
+ return out << "layout type: " << obj.ndd_layouttype
+ << " deviceid: " << obj.ndd_deviceid;
+}
+
+std::ostream& operator<<(std::ostream& out, const notify_deviceid_change4& obj)
+{
+ return out << "layout type: " << obj.ndc_layouttype
+ << " deviceid: " << obj.ndc_deviceid
+ << " immediate: " << obj.ndc_immediate;
+}
+
+bool_t
+xdr_nfs_ftype4 (XDR* xdrs, nfs_ftype4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfsstat4 (XDR* xdrs, nfsstat4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_attrlist4 (XDR* xdrs, attrlist4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->attrlist4_val, (u_int*) &objp->attrlist4_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_bitmap4 (XDR* xdrs, bitmap4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->bitmap4_val, (u_int*) &objp->bitmap4_len, ~0,
+ sizeof (uint32_t), (xdrproc_t) xdr_uint32_t))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_changeid4 (XDR* xdrs, changeid4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_clientid4 (XDR* xdrs, clientid4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_count4 (XDR* xdrs, count4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_length4 (XDR* xdrs, length4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_mode4 (XDR* xdrs, mode4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_cookie4 (XDR* xdrs, nfs_cookie4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_fh4 (XDR* xdrs, nfs_fh4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->nfs_fh4_val, (u_int*) &objp->nfs_fh4_len, NFS4_FHSIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_offset4 (XDR* xdrs, offset4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_qop4 (XDR* xdrs, qop4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_sec_oid4 (XDR* xdrs, sec_oid4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->sec_oid4_val, (u_int*) &objp->sec_oid4_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_sequenceid4 (XDR* xdrs, sequenceid4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_seqid4 (XDR* xdrs, seqid4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_sessionid4 (XDR* xdrs, sessionid4 objp)
+{
+ if (!xdr_opaque (xdrs, objp, NFS4_SESSIONID_SIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_slotid4 (XDR* xdrs, slotid4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8string (XDR* xdrs, utf8string* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->utf8string_val, (u_int*) &objp->utf8string_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8str_cis (XDR* xdrs, utf8str_cis* objp)
+{
+ if (!xdr_utf8string (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8str_cs (XDR* xdrs, utf8str_cs* objp)
+{
+ if (!xdr_utf8string (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8str_mixed (XDR* xdrs, utf8str_mixed* objp)
+{
+ if (!xdr_utf8string (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_component4 (XDR* xdrs, component4* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_linktext4 (XDR* xdrs, linktext4* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_pathname4 (XDR* xdrs, pathname4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->pathname4_val, (u_int*) &objp->pathname4_len, ~0,
+ sizeof (component4), (xdrproc_t) xdr_component4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_verifier4 (XDR* xdrs, verifier4 objp)
+{
+ if (!xdr_opaque (xdrs, objp, NFS4_VERIFIER_SIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfstime4 (XDR* xdrs, nfstime4* objp)
+{
+ if (!xdr_int64_t (xdrs, &objp->seconds))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->nseconds))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_time_how4 (XDR* xdrs, time_how4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_settime4 (XDR* xdrs, settime4* objp)
+{
+ if (!xdr_time_how4 (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case SET_TO_CLIENT_TIME4:
+ if (!xdr_nfstime4 (xdrs, &objp->settime4_u.time))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_lease4 (XDR* xdrs, nfs_lease4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fsid4 (XDR* xdrs, fsid4* objp)
+{
+ if (!xdr_uint64_t (xdrs, &objp->major))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint64_t (xdrs, &objp->minor))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_change_policy4 (XDR* xdrs, change_policy4* objp)
+{
+ if (!xdr_uint64_t (xdrs, &objp->cp_major))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint64_t (xdrs, &objp->cp_minor))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs_location4 (XDR* xdrs, fs_location4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->server.server_val, (u_int*) &objp->server.server_len, ~0,
+ sizeof (utf8str_cis), (xdrproc_t) xdr_utf8str_cis))
+ {
+ return FALSE;
+ }
+ if (!xdr_pathname4 (xdrs, &objp->rootpath))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs_locations4 (XDR* xdrs, fs_locations4* objp)
+{
+ if (!xdr_pathname4 (xdrs, &objp->fs_root))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->locations.locations_val, (u_int*) &objp->locations.locations_len, ~0,
+ sizeof (fs_location4), (xdrproc_t) xdr_fs_location4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_acetype4 (XDR* xdrs, acetype4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_aceflag4 (XDR* xdrs, aceflag4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_acemask4 (XDR* xdrs, acemask4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfsace4 (XDR* xdrs, nfsace4* objp)
+{
+ if (!xdr_acetype4 (xdrs, &objp->type))
+ {
+ return FALSE;
+ }
+ if (!xdr_aceflag4 (xdrs, &objp->flag))
+ {
+ return FALSE;
+ }
+ if (!xdr_acemask4 (xdrs, &objp->access_mask))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_mixed (xdrs, &objp->who))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_aclflag4 (XDR* xdrs, aclflag4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfsacl41 (XDR* xdrs, nfsacl41* objp)
+{
+ if (!xdr_aclflag4 (xdrs, &objp->na41_flag))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->na41_aces.na41_aces_val, (u_int*) &objp->na41_aces.na41_aces_len, ~0,
+ sizeof (nfsace4), (xdrproc_t) xdr_nfsace4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_mode_masked4 (XDR* xdrs, mode_masked4* objp)
+{
+ if (!xdr_mode4 (xdrs, &objp->mm_value_to_set))
+ {
+ return FALSE;
+ }
+ if (!xdr_mode4 (xdrs, &objp->mm_mask_bits))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_specdata4 (XDR* xdrs, specdata4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->specdata1))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->specdata2))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_netaddr4 (XDR* xdrs, netaddr4* objp)
+{
+ if (!xdr_string (xdrs, &objp->na_r_netid, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_string (xdrs, &objp->na_r_addr, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_impl_id4 (XDR* xdrs, nfs_impl_id4* objp)
+{
+ if (!xdr_utf8str_cis (xdrs, &objp->nii_domain))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cs (xdrs, &objp->nii_name))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime4 (xdrs, &objp->nii_date))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_stateid4 (XDR* xdrs, stateid4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_opaque (xdrs, objp->other, 12))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layouttype4 (XDR* xdrs, layouttype4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layout_content4 (XDR* xdrs, layout_content4* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->loc_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->loc_body.loc_body_val, (u_int*) &objp->loc_body.loc_body_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+/*
+ * LAYOUT4_OSD2_OBJECTS loc_body description
+ * is in a separate .x file
+ */
+
+/*
+ * LAYOUT4_BLOCK_VOLUME loc_body description
+ * is in a separate .x file
+ */
+
+bool_t
+xdr_layouthint4 (XDR* xdrs, layouthint4* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->loh_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->loh_body.loh_body_val, (u_int*) &objp->loh_body.loh_body_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layoutiomode4 (XDR* xdrs, layoutiomode4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layout4 (XDR* xdrs, layout4* objp)
+{
+ if (!xdr_offset4 (xdrs, &objp->lo_offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->lo_length))
+ {
+ return FALSE;
+ }
+ if (!xdr_layoutiomode4 (xdrs, &objp->lo_iomode))
+ {
+ return FALSE;
+ }
+ if (!xdr_layout_content4 (xdrs, &objp->lo_content))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_deviceid4 (XDR* xdrs, deviceid4 objp)
+{
+ if (!xdr_opaque (xdrs, objp, NFS4_DEVICEID4_SIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_device_addr4 (XDR* xdrs, device_addr4* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->da_layout_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->da_addr_body.da_addr_body_val, (u_int*) &objp->da_addr_body.da_addr_body_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layoutupdate4 (XDR* xdrs, layoutupdate4* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->lou_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->lou_body.lou_body_val, (u_int*) &objp->lou_body.lou_body_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+
+bool_t
+xdr_layoutreturn_type4 (XDR* xdrs, layoutreturn_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+/* layouttype4 specific data */
+
+bool_t
+xdr_layoutreturn_file4 (XDR* xdrs, layoutreturn_file4* objp)
+{
+ if (!xdr_offset4 (xdrs, &objp->lrf_offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->lrf_length))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->lrf_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->lrf_body.lrf_body_val, (u_int*) &objp->lrf_body.lrf_body_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layoutreturn4 (XDR* xdrs, layoutreturn4* objp)
+{
+ if (!xdr_layoutreturn_type4 (xdrs, &objp->lr_returntype))
+ {
+ return FALSE;
+ }
+ switch (objp->lr_returntype)
+ {
+ case LAYOUTRETURN4_FILE:
+ if (!xdr_layoutreturn_file4 (xdrs, &objp->layoutreturn4_u.lr_layout))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+
+bool_t
+xdr_fs4_status_type (XDR* xdrs, fs4_status_type* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs4_status (XDR* xdrs, fs4_status* objp)
+{
+ if (!xdr_bool (xdrs, &objp->fss_absent))
+ {
+ return FALSE;
+ }
+ if (!xdr_fs4_status_type (xdrs, &objp->fss_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cs (xdrs, &objp->fss_source))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cs (xdrs, &objp->fss_current))
+ {
+ return FALSE;
+ }
+ if (!xdr_int32_t (xdrs, &objp->fss_age))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfstime4 (xdrs, &objp->fss_version))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_threshold4_read_size (XDR* xdrs, threshold4_read_size* objp)
+{
+ if (!xdr_length4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_threshold4_write_size (XDR* xdrs, threshold4_write_size* objp)
+{
+ if (!xdr_length4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_threshold4_read_iosize (XDR* xdrs, threshold4_read_iosize* objp)
+{
+ if (!xdr_length4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_threshold4_write_iosize (XDR* xdrs, threshold4_write_iosize* objp)
+{
+ if (!xdr_length4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_threshold_item4 (XDR* xdrs, threshold_item4* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->thi_layout_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->thi_hintset))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->thi_hintlist.thi_hintlist_val, (u_int*) &objp->thi_hintlist.thi_hintlist_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_mdsthreshold4 (XDR* xdrs, mdsthreshold4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->mth_hints.mth_hints_val, (u_int*) &objp->mth_hints.mth_hints_len, ~0,
+ sizeof (threshold_item4), (xdrproc_t) xdr_threshold_item4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_retention_get4 (XDR* xdrs, retention_get4* objp)
+{
+ if (!xdr_uint64_t (xdrs, &objp->rg_duration))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->rg_begin_time.rg_begin_time_val, (u_int*) &objp->rg_begin_time.rg_begin_time_len, 1,
+ sizeof (nfstime4), (xdrproc_t) xdr_nfstime4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_retention_set4 (XDR* xdrs, retention_set4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->rs_enable))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->rs_duration.rs_duration_val, (u_int*) &objp->rs_duration.rs_duration_len, 1,
+ sizeof (uint64_t), (xdrproc_t) xdr_uint64_t))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs_charset_cap4 (XDR* xdrs, fs_charset_cap4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_supported_attrs (XDR* xdrs, fattr4_supported_attrs* objp)
+{
+ if (!xdr_bitmap4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_type (XDR* xdrs, fattr4_type* objp)
+{
+ if (!xdr_nfs_ftype4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fh_expire_type (XDR* xdrs, fattr4_fh_expire_type* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_change (XDR* xdrs, fattr4_change* objp)
+{
+ if (!xdr_changeid4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_size (XDR* xdrs, fattr4_size* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_link_support (XDR* xdrs, fattr4_link_support* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_symlink_support (XDR* xdrs, fattr4_symlink_support* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_named_attr (XDR* xdrs, fattr4_named_attr* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fsid (XDR* xdrs, fattr4_fsid* objp)
+{
+ if (!xdr_fsid4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_unique_handles (XDR* xdrs, fattr4_unique_handles* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_lease_time (XDR* xdrs, fattr4_lease_time* objp)
+{
+ if (!xdr_nfs_lease4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_rdattr_error (XDR* xdrs, fattr4_rdattr_error* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_acl (XDR* xdrs, fattr4_acl* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->fattr4_acl_val, (u_int*) &objp->fattr4_acl_len, ~0,
+ sizeof (nfsace4), (xdrproc_t) xdr_nfsace4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_aclsupport (XDR* xdrs, fattr4_aclsupport* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_archive (XDR* xdrs, fattr4_archive* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_cansettime (XDR* xdrs, fattr4_cansettime* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_case_insensitive (XDR* xdrs, fattr4_case_insensitive* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_case_preserving (XDR* xdrs, fattr4_case_preserving* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_chown_restricted (XDR* xdrs, fattr4_chown_restricted* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fileid (XDR* xdrs, fattr4_fileid* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_files_avail (XDR* xdrs, fattr4_files_avail* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_filehandle (XDR* xdrs, fattr4_filehandle* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_files_free (XDR* xdrs, fattr4_files_free* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_files_total (XDR* xdrs, fattr4_files_total* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fs_locations (XDR* xdrs, fattr4_fs_locations* objp)
+{
+ if (!xdr_fs_locations4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_hidden (XDR* xdrs, fattr4_hidden* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_homogeneous (XDR* xdrs, fattr4_homogeneous* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxfilesize (XDR* xdrs, fattr4_maxfilesize* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxlink (XDR* xdrs, fattr4_maxlink* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxname (XDR* xdrs, fattr4_maxname* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxread (XDR* xdrs, fattr4_maxread* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxwrite (XDR* xdrs, fattr4_maxwrite* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mimetype (XDR* xdrs, fattr4_mimetype* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mode (XDR* xdrs, fattr4_mode* objp)
+{
+ if (!xdr_mode4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mode_set_masked (XDR* xdrs, fattr4_mode_set_masked* objp)
+{
+ if (!xdr_mode_masked4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mounted_on_fileid (XDR* xdrs, fattr4_mounted_on_fileid* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_no_trunc (XDR* xdrs, fattr4_no_trunc* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_numlinks (XDR* xdrs, fattr4_numlinks* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_owner (XDR* xdrs, fattr4_owner* objp)
+{
+ if (!xdr_utf8str_mixed (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_owner_group (XDR* xdrs, fattr4_owner_group* objp)
+{
+ if (!xdr_utf8str_mixed (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_quota_avail_hard (XDR* xdrs, fattr4_quota_avail_hard* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_quota_avail_soft (XDR* xdrs, fattr4_quota_avail_soft* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_quota_used (XDR* xdrs, fattr4_quota_used* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_rawdev (XDR* xdrs, fattr4_rawdev* objp)
+{
+ if (!xdr_specdata4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_avail (XDR* xdrs, fattr4_space_avail* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_free (XDR* xdrs, fattr4_space_free* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_total (XDR* xdrs, fattr4_space_total* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_used (XDR* xdrs, fattr4_space_used* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_system (XDR* xdrs, fattr4_system* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_access (XDR* xdrs, fattr4_time_access* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_access_set (XDR* xdrs, fattr4_time_access_set* objp)
+{
+ if (!xdr_settime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_backup (XDR* xdrs, fattr4_time_backup* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_create (XDR* xdrs, fattr4_time_create* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_delta (XDR* xdrs, fattr4_time_delta* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_metadata (XDR* xdrs, fattr4_time_metadata* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_modify (XDR* xdrs, fattr4_time_modify* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_modify_set (XDR* xdrs, fattr4_time_modify_set* objp)
+{
+ if (!xdr_settime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_suppattr_exclcreat (XDR* xdrs, fattr4_suppattr_exclcreat* objp)
+{
+ if (!xdr_bitmap4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_dir_notif_delay (XDR* xdrs, fattr4_dir_notif_delay* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_dirent_notif_delay (XDR* xdrs, fattr4_dirent_notif_delay* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fs_layout_types (XDR* xdrs, fattr4_fs_layout_types* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->fattr4_fs_layout_types_val, (u_int*) &objp->fattr4_fs_layout_types_len, ~0,
+ sizeof (layouttype4), (xdrproc_t) xdr_layouttype4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fs_status (XDR* xdrs, fattr4_fs_status* objp)
+{
+ if (!xdr_fs4_status (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fs_charset_cap (XDR* xdrs, fattr4_fs_charset_cap* objp)
+{
+ if (!xdr_fs_charset_cap4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_layout_alignment (XDR* xdrs, fattr4_layout_alignment* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_layout_blksize (XDR* xdrs, fattr4_layout_blksize* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_layout_hint (XDR* xdrs, fattr4_layout_hint* objp)
+{
+ if (!xdr_layouthint4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_layout_types (XDR* xdrs, fattr4_layout_types* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->fattr4_layout_types_val, (u_int*) &objp->fattr4_layout_types_len, ~0,
+ sizeof (layouttype4), (xdrproc_t) xdr_layouttype4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mdsthreshold (XDR* xdrs, fattr4_mdsthreshold* objp)
+{
+ if (!xdr_mdsthreshold4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_retention_get (XDR* xdrs, fattr4_retention_get* objp)
+{
+ if (!xdr_retention_get4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_retention_set (XDR* xdrs, fattr4_retention_set* objp)
+{
+ if (!xdr_retention_set4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_retentevt_get (XDR* xdrs, fattr4_retentevt_get* objp)
+{
+ if (!xdr_retention_get4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_retentevt_set (XDR* xdrs, fattr4_retentevt_set* objp)
+{
+ if (!xdr_retention_set4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_retention_hold (XDR* xdrs, fattr4_retention_hold* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_dacl (XDR* xdrs, fattr4_dacl* objp)
+{
+ if (!xdr_nfsacl41 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_sacl (XDR* xdrs, fattr4_sacl* objp)
+{
+ if (!xdr_nfsacl41 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_change_policy (XDR* xdrs, fattr4_change_policy* objp)
+{
+ if (!xdr_change_policy4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+/*
+ * REQUIRED Attributes
+ */
+/* new to NFSV4.1 */
+/*
+ * RECOMMENDED Attributes
+ */
+
+/* new to NFSV4.1 */
+
+
+bool_t
+xdr_fattr4 (XDR* xdrs, fattr4* objp)
+{
+ if (!xdr_bitmap4 (xdrs, &objp->attrmask))
+ {
+ return FALSE;
+ }
+ if (!xdr_attrlist4 (xdrs, &objp->attr_vals))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_change_info4 (XDR* xdrs, change_info4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->atomic))
+ {
+ return FALSE;
+ }
+ if (!xdr_changeid4 (xdrs, &objp->before))
+ {
+ return FALSE;
+ }
+ if (!xdr_changeid4 (xdrs, &objp->after))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_clientaddr4 (XDR* xdrs, clientaddr4* objp)
+{
+ if (!xdr_netaddr4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_cb_client4 (XDR* xdrs, cb_client4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->cb_program))
+ {
+ return FALSE;
+ }
+ if (!xdr_netaddr4 (xdrs, &objp->cb_location))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_client_id4 (XDR* xdrs, nfs_client_id4* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->verifier))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->id.id_val, (u_int*) &objp->id.id_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_client_owner4 (XDR* xdrs, client_owner4* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->co_verifier))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->co_ownerid.co_ownerid_val, (u_int*) &objp->co_ownerid.co_ownerid_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_server_owner4 (XDR* xdrs, server_owner4* objp)
+{
+ if (!xdr_uint64_t (xdrs, &objp->so_minor_id))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->so_major_id.so_major_id_val, (u_int*) &objp->so_major_id.so_major_id_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_state_owner4 (XDR* xdrs, state_owner4* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->owner.owner_val, (u_int*) &objp->owner.owner_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_owner4 (XDR* xdrs, open_owner4* objp)
+{
+ if (!xdr_state_owner4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_lock_owner4 (XDR* xdrs, lock_owner4* objp)
+{
+ if (!xdr_state_owner4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_lock_type4 (XDR* xdrs, nfs_lock_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* Input for computing subkeys */
+
+bool_t
+xdr_ssv_subkey4 (XDR* xdrs, ssv_subkey4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/* Input for computing smt_hmac */
+
+bool_t
+xdr_ssv_mic_plain_tkn4 (XDR* xdrs, ssv_mic_plain_tkn4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->smpt_ssv_seq))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->smpt_orig_plain.smpt_orig_plain_val, (u_int*) &objp->smpt_orig_plain.smpt_orig_plain_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/* SSV GSS PerMsgToken token */
+
+bool_t
+xdr_ssv_mic_tkn4 (XDR* xdrs, ssv_mic_tkn4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->smt_ssv_seq))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->smt_hmac.smt_hmac_val, (u_int*) &objp->smt_hmac.smt_hmac_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/* Input for computing ssct_encr_data and ssct_hmac */
+
+bool_t
+xdr_ssv_seal_plain_tkn4 (XDR* xdrs, ssv_seal_plain_tkn4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->sspt_confounder.sspt_confounder_val, (u_int*) &objp->sspt_confounder.sspt_confounder_len, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->sspt_ssv_seq))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->sspt_orig_plain.sspt_orig_plain_val, (u_int*) &objp->sspt_orig_plain.sspt_orig_plain_len, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->sspt_pad.sspt_pad_val, (u_int*) &objp->sspt_pad.sspt_pad_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/* SSV GSS SealedMessage token */
+
+bool_t
+xdr_ssv_seal_cipher_tkn4 (XDR* xdrs, ssv_seal_cipher_tkn4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->ssct_ssv_seq))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->ssct_iv.ssct_iv_val, (u_int*) &objp->ssct_iv.ssct_iv_len, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->ssct_encr_data.ssct_encr_data_val, (u_int*) &objp->ssct_encr_data.ssct_encr_data_len, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->ssct_hmac.ssct_hmac_val, (u_int*) &objp->ssct_hmac.ssct_hmac_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+bool_t
+xdr_fs_locations_server4 (XDR* xdrs, fs_locations_server4* objp)
+{
+ if (!xdr_int32_t (xdrs, &objp->fls_currency))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->fls_info.fls_info_val, (u_int*) &objp->fls_info.fls_info_len, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cis (xdrs, &objp->fls_server))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs_locations_item4 (XDR* xdrs, fs_locations_item4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->fli_entries.fli_entries_val, (u_int*) &objp->fli_entries.fli_entries_len, ~0,
+ sizeof (fs_locations_server4), (xdrproc_t) xdr_fs_locations_server4))
+ {
+ return FALSE;
+ }
+ if (!xdr_pathname4 (xdrs, &objp->fli_rootpath))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs_locations_info4 (XDR* xdrs, fs_locations_info4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->fli_flags))
+ {
+ return FALSE;
+ }
+ if (!xdr_int32_t (xdrs, &objp->fli_valid_for))
+ {
+ return FALSE;
+ }
+ if (!xdr_pathname4 (xdrs, &objp->fli_fs_root))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->fli_items.fli_items_val, (u_int*) &objp->fli_items.fli_items_len, ~0,
+ sizeof (fs_locations_item4), (xdrproc_t) xdr_fs_locations_item4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fs_locations_info (XDR* xdrs, fattr4_fs_locations_info* objp)
+{
+ if (!xdr_fs_locations_info4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfl_util4 (XDR* xdrs, nfl_util4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+bool_t
+xdr_filelayout_hint_care4 (XDR* xdrs, filelayout_hint_care4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* Encoded in the loh_body field of data type layouthint4: */
+
+
+bool_t
+xdr_nfsv4_1_file_layouthint4 (XDR* xdrs, nfsv4_1_file_layouthint4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->nflh_care))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfl_util4 (xdrs, &objp->nflh_util))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->nflh_stripe_count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+
+bool_t
+xdr_multipath_list4 (XDR* xdrs, multipath_list4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->multipath_list4_val, (u_int*) &objp->multipath_list4_len, ~0,
+ sizeof (netaddr4), (xdrproc_t) xdr_netaddr4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * Encoded in the da_addr_body field of
+ * data type device_addr4:
+ */
+
+bool_t
+xdr_nfsv4_1_file_layout_ds_addr4 (XDR* xdrs, nfsv4_1_file_layout_ds_addr4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->nflda_stripe_indices.nflda_stripe_indices_val, (u_int*) &objp->nflda_stripe_indices.nflda_stripe_indices_len, ~0,
+ sizeof (uint32_t), (xdrproc_t) xdr_uint32_t))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->nflda_multipath_ds_list.nflda_multipath_ds_list_val, (u_int*) &objp->nflda_multipath_ds_list.nflda_multipath_ds_list_len, ~0,
+ sizeof (multipath_list4), (xdrproc_t) xdr_multipath_list4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/*
+ * Encoded in the loc_body field of
+ * data type layout_content4:
+ */
+
+bool_t
+xdr_nfsv4_1_file_layout4 (XDR* xdrs, nfsv4_1_file_layout4* objp)
+{
+ if (!xdr_deviceid4 (xdrs, objp->nfl_deviceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfl_util4 (xdrs, &objp->nfl_util))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->nfl_first_stripe_index))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->nfl_pattern_offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->nfl_fh_list.nfl_fh_list_val, (u_int*) &objp->nfl_fh_list.nfl_fh_list_len, ~0,
+ sizeof (nfs_fh4), (xdrproc_t) xdr_nfs_fh4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * Encoded in the lou_body field of data type layoutupdate4:
+ * Nothing. lou_body is a zero length array of bytes.
+ */
+
+/*
+ * Encoded in the lrf_body field of
+ * data type layoutreturn_file4:
+ * Nothing. lrf_body is a zero length array of bytes.
+ */
+
+//for compatibility
+bool_t
+xdr_NULL4args(XDR*, NULL4args*)
+{
+ return TRUE;
+}
+
+bool_t
+xdr_NULL4res(XDR*, NULL4res*)
+{
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS4args (XDR* xdrs, ACCESS4args* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->access))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS4resok (XDR* xdrs, ACCESS4resok* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->supported))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->access))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS4res (XDR* xdrs, ACCESS4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_ACCESS4resok (xdrs, &objp->ACCESS4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CLOSE4args (XDR* xdrs, CLOSE4args* objp)
+{
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CLOSE4res (XDR* xdrs, CLOSE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_stateid4 (xdrs, &objp->CLOSE4res_u.open_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT4args (XDR* xdrs, COMMIT4args* objp)
+{
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT4resok (XDR* xdrs, COMMIT4resok* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->writeverf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT4res (XDR* xdrs, COMMIT4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_COMMIT4resok (xdrs, &objp->COMMIT4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createtype4 (XDR* xdrs, createtype4* objp)
+{
+ if (!xdr_nfs_ftype4 (xdrs, &objp->type))
+ {
+ return FALSE;
+ }
+ switch (objp->type)
+ {
+ case NF4LNK:
+ if (!xdr_linktext4 (xdrs, &objp->createtype4_u.linkdata))
+ {
+ return FALSE;
+ }
+ break;
+ case NF4BLK:
+ case NF4CHR:
+ if (!xdr_specdata4 (xdrs, &objp->createtype4_u.devdata))
+ {
+ return FALSE;
+ }
+ break;
+ case NF4SOCK:
+ case NF4FIFO:
+ case NF4DIR:
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE4args (XDR* xdrs, CREATE4args* objp)
+{
+ if (!xdr_createtype4 (xdrs, &objp->objtype))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->objname))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->createattrs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE4resok (XDR* xdrs, CREATE4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attrset))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE4res (XDR* xdrs, CREATE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_CREATE4resok (xdrs, &objp->CREATE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGPURGE4args (XDR* xdrs, DELEGPURGE4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGPURGE4res (XDR* xdrs, DELEGPURGE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGRETURN4args (XDR* xdrs, DELEGRETURN4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->deleg_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGRETURN4res (XDR* xdrs, DELEGRETURN4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR4args (XDR* xdrs, GETATTR4args* objp)
+{
+ if (!xdr_bitmap4 (xdrs, &objp->attr_request))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR4resok (XDR* xdrs, GETATTR4resok* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR4res (XDR* xdrs, GETATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_GETATTR4resok (xdrs, &objp->GETATTR4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETFH4resok (XDR* xdrs, GETFH4resok* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETFH4res (XDR* xdrs, GETFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_GETFH4resok (xdrs, &objp->GETFH4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK4args (XDR* xdrs, LINK4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->newname))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK4resok (XDR* xdrs, LINK4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK4res (XDR* xdrs, LINK4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_LINK4resok (xdrs, &objp->LINK4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_to_lock_owner4 (XDR* xdrs, open_to_lock_owner4* objp)
+{
+ if (!xdr_seqid4 (xdrs, &objp->open_seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->lock_seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_lock_owner4 (xdrs, &objp->lock_owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_exist_lock_owner4 (XDR* xdrs, exist_lock_owner4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->lock_seqid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_locker4 (XDR* xdrs, locker4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->new_lock_owner))
+ {
+ return FALSE;
+ }
+ switch (objp->new_lock_owner)
+ {
+ case TRUE:
+ if (!xdr_open_to_lock_owner4 (xdrs, &objp->locker4_u.open_owner))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ if (!xdr_exist_lock_owner4 (xdrs, &objp->locker4_u.lock_owner))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4args (XDR* xdrs, LOCK4args* objp)
+{
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->reclaim))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ if (!xdr_locker4 (xdrs, &objp->locker))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4denied (XDR* xdrs, LOCK4denied* objp)
+{
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_lock_owner4 (xdrs, &objp->owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4resok (XDR* xdrs, LOCK4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4res (XDR* xdrs, LOCK4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_LOCK4resok (xdrs, &objp->LOCK4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4ERR_DENIED:
+ if (!xdr_LOCK4denied (xdrs, &objp->LOCK4res_u.denied))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKT4args (XDR* xdrs, LOCKT4args* objp)
+{
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ if (!xdr_lock_owner4 (xdrs, &objp->owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKT4res (XDR* xdrs, LOCKT4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4ERR_DENIED:
+ if (!xdr_LOCK4denied (xdrs, &objp->LOCKT4res_u.denied))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4_OK:
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKU4args (XDR* xdrs, LOCKU4args* objp)
+{
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKU4res (XDR* xdrs, LOCKU4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_stateid4 (xdrs, &objp->LOCKU4res_u.lock_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP4args (XDR* xdrs, LOOKUP4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->objname))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP4res (XDR* xdrs, LOOKUP4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUPP4res (XDR* xdrs, LOOKUPP4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_NVERIFY4args (XDR* xdrs, NVERIFY4args* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_NVERIFY4res (XDR* xdrs, NVERIFY4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createmode4 (XDR* xdrs, createmode4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_creatverfattr (XDR* xdrs, creatverfattr* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->cva_verf))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->cva_attrs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createhow4 (XDR* xdrs, createhow4* objp)
+{
+ if (!xdr_createmode4 (xdrs, &objp->mode))
+ {
+ return FALSE;
+ }
+ switch (objp->mode)
+ {
+ case UNCHECKED4:
+ case GUARDED4:
+ if (!xdr_fattr4 (xdrs, &objp->createhow4_u.createattrs))
+ {
+ return FALSE;
+ }
+ break;
+ case EXCLUSIVE4:
+ if (!xdr_verifier4 (xdrs, objp->createhow4_u.createverf))
+ {
+ return FALSE;
+ }
+ break;
+ case EXCLUSIVE4_1:
+ if (!xdr_creatverfattr (xdrs, &objp->createhow4_u.ch_createboth))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_opentype4 (XDR* xdrs, opentype4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_openflag4 (XDR* xdrs, openflag4* objp)
+{
+ if (!xdr_opentype4 (xdrs, &objp->opentype))
+ {
+ return FALSE;
+ }
+ switch (objp->opentype)
+ {
+ case OPEN4_CREATE:
+ if (!xdr_createhow4 (xdrs, &objp->openflag4_u.how))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_limit_by4 (XDR* xdrs, limit_by4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_modified_limit4 (XDR* xdrs, nfs_modified_limit4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->num_blocks))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->bytes_per_block))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_space_limit4 (XDR* xdrs, nfs_space_limit4* objp)
+{
+ if (!xdr_limit_by4 (xdrs, &objp->limitby))
+ {
+ return FALSE;
+ }
+ switch (objp->limitby)
+ {
+ case NFS_LIMIT_SIZE:
+ if (!xdr_uint64_t (xdrs, &objp->nfs_space_limit4_u.filesize))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS_LIMIT_BLOCKS:
+ if (!xdr_nfs_modified_limit4 (xdrs, &objp->nfs_space_limit4_u.mod_blocks))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_delegation_type4 (XDR* xdrs, open_delegation_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_claim_type4 (XDR* xdrs, open_claim_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_claim_delegate_cur4 (XDR* xdrs, open_claim_delegate_cur4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->delegate_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->file))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_claim4 (XDR* xdrs, open_claim4* objp)
+{
+ if (!xdr_open_claim_type4 (xdrs, &objp->claim))
+ {
+ return FALSE;
+ }
+ switch (objp->claim)
+ {
+ case CLAIM_NULL:
+ if (!xdr_component4 (xdrs, &objp->open_claim4_u.file))
+ {
+ return FALSE;
+ }
+ break;
+ case CLAIM_PREVIOUS:
+ if (!xdr_open_delegation_type4 (xdrs, &objp->open_claim4_u.delegate_type))
+ {
+ return FALSE;
+ }
+ break;
+ case CLAIM_DELEGATE_CUR:
+ if (!xdr_open_claim_delegate_cur4 (xdrs, &objp->open_claim4_u.delegate_cur_info))
+ {
+ return FALSE;
+ }
+ break;
+ case CLAIM_DELEGATE_PREV:
+ if (!xdr_component4 (xdrs, &objp->open_claim4_u.file_delegate_prev))
+ {
+ return FALSE;
+ }
+ break;
+ case CLAIM_FH:
+ break;
+ case CLAIM_DELEG_PREV_FH:
+ break;
+ case CLAIM_DELEG_CUR_FH:
+ if (!xdr_stateid4 (xdrs, &objp->open_claim4_u.oc_delegate_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN4args (XDR* xdrs, OPEN4args* objp)
+{
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_access))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_deny))
+ {
+ return FALSE;
+ }
+ if (!xdr_open_owner4 (xdrs, &objp->owner))
+ {
+ return FALSE;
+ }
+ if (!xdr_openflag4 (xdrs, &objp->openhow))
+ {
+ return FALSE;
+ }
+ if (!xdr_open_claim4 (xdrs, &objp->claim))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_read_delegation4 (XDR* xdrs, open_read_delegation4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->recall))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfsace4 (xdrs, &objp->permissions))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_write_delegation4 (XDR* xdrs, open_write_delegation4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->recall))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_space_limit4 (xdrs, &objp->space_limit))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfsace4 (xdrs, &objp->permissions))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_why_no_delegation4 (XDR* xdrs, why_no_delegation4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_none_delegation4 (XDR* xdrs, open_none_delegation4* objp)
+{
+ if (!xdr_why_no_delegation4 (xdrs, &objp->ond_why))
+ {
+ return FALSE;
+ }
+ switch (objp->ond_why)
+ {
+ case WND4_CONTENTION:
+ if (!xdr_bool (xdrs, &objp->open_none_delegation4_u.ond_server_will_push_deleg))
+ {
+ return FALSE;
+ }
+ break;
+ case WND4_RESOURCE:
+ if (!xdr_bool (xdrs, &objp->open_none_delegation4_u.ond_server_will_signal_avail))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_delegation4 (XDR* xdrs, open_delegation4* objp)
+{
+ if (!xdr_open_delegation_type4 (xdrs, &objp->delegation_type))
+ {
+ return FALSE;
+ }
+ switch (objp->delegation_type)
+ {
+ case OPEN_DELEGATE_NONE:
+ break;
+ case OPEN_DELEGATE_READ:
+ if (!xdr_open_read_delegation4 (xdrs, &objp->open_delegation4_u.read))
+ {
+ return FALSE;
+ }
+ break;
+ case OPEN_DELEGATE_WRITE:
+ if (!xdr_open_write_delegation4 (xdrs, &objp->open_delegation4_u.write))
+ {
+ return FALSE;
+ }
+ break;
+ case OPEN_DELEGATE_NONE_EXT:
+ if (!xdr_open_none_delegation4 (xdrs, &objp->open_delegation4_u.od_whynone))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN4resok (XDR* xdrs, OPEN4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->rflags))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attrset))
+ {
+ return FALSE;
+ }
+ if (!xdr_open_delegation4 (xdrs, &objp->delegation))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN4res (XDR* xdrs, OPEN4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_OPEN4resok (xdrs, &objp->OPEN4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPENATTR4args (XDR* xdrs, OPENATTR4args* objp)
+{
+ if (!xdr_bool (xdrs, &objp->createdir))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPENATTR4res (XDR* xdrs, OPENATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_CONFIRM4args (XDR* xdrs, OPEN_CONFIRM4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_CONFIRM4resok (XDR* xdrs, OPEN_CONFIRM4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_CONFIRM4res (XDR* xdrs, OPEN_CONFIRM4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_OPEN_CONFIRM4resok (xdrs, &objp->OPEN_CONFIRM4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_DOWNGRADE4args (XDR* xdrs, OPEN_DOWNGRADE4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_access))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_deny))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_DOWNGRADE4resok (XDR* xdrs, OPEN_DOWNGRADE4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_DOWNGRADE4res (XDR* xdrs, OPEN_DOWNGRADE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_OPEN_DOWNGRADE4resok (xdrs, &objp->OPEN_DOWNGRADE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTFH4args (XDR* xdrs, PUTFH4args* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTFH4res (XDR* xdrs, PUTFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTPUBFH4res (XDR* xdrs, PUTPUBFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTROOTFH4res (XDR* xdrs, PUTROOTFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ4args (XDR* xdrs, READ4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ4resok (XDR* xdrs, READ4resok* objp)
+{
+ if (!xdr_bool (xdrs, &objp->eof))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->data.data_val, (u_int*) &objp->data.data_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ4res (XDR* xdrs, READ4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_READ4resok (xdrs, &objp->READ4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR4args (XDR* xdrs, READDIR4args* objp)
+{
+ if (!xdr_nfs_cookie4 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->dircount))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->maxcount))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attr_request))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_entry4 (XDR* xdrs, entry4* objp)
+{
+ if (!xdr_nfs_cookie4 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->name))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->attrs))
+ {
+ return FALSE;
+ }
+ if (!xdr_pointer (xdrs, (char**)&objp->nextentry, sizeof (entry4), (xdrproc_t) xdr_entry4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_dirlist4 (XDR* xdrs, dirlist4* objp)
+{
+ if (!xdr_pointer (xdrs, (char**)&objp->entries, sizeof (entry4), (xdrproc_t) xdr_entry4))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->eof))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR4resok (XDR* xdrs, READDIR4resok* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_dirlist4 (xdrs, &objp->reply))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR4res (XDR* xdrs, READDIR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_READDIR4resok (xdrs, &objp->READDIR4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK4resok (XDR* xdrs, READLINK4resok* objp)
+{
+ if (!xdr_linktext4 (xdrs, &objp->link))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK4res (XDR* xdrs, READLINK4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_READLINK4resok (xdrs, &objp->READLINK4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE4args (XDR* xdrs, REMOVE4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->target))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE4resok (XDR* xdrs, REMOVE4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE4res (XDR* xdrs, REMOVE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_REMOVE4resok (xdrs, &objp->REMOVE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME4args (XDR* xdrs, RENAME4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->oldname))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->newname))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME4resok (XDR* xdrs, RENAME4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->source_cinfo))
+ {
+ return FALSE;
+ }
+ if (!xdr_change_info4 (xdrs, &objp->target_cinfo))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME4res (XDR* xdrs, RENAME4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_RENAME4resok (xdrs, &objp->RENAME4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENEW4args (XDR* xdrs, RENEW4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENEW4res (XDR* xdrs, RENEW4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RESTOREFH4res (XDR* xdrs, RESTOREFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SAVEFH4res (XDR* xdrs, SAVEFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO4args (XDR* xdrs, SECINFO4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->name))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_rpc_gss_svc_t (XDR* xdrs, rpc_gss_svc_t* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_rpcsec_gss_info (XDR* xdrs, rpcsec_gss_info* objp)
+{
+ if (!xdr_sec_oid4 (xdrs, &objp->oid))
+ {
+ return FALSE;
+ }
+ if (!xdr_qop4 (xdrs, &objp->qop))
+ {
+ return FALSE;
+ }
+ if (!xdr_rpc_gss_svc_t (xdrs, &objp->service))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_secinfo4 (XDR* xdrs, secinfo4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->flavor))
+ {
+ return FALSE;
+ }
+ switch (objp->flavor)
+ {
+ case RPCSEC_GSS:
+ if (!xdr_rpcsec_gss_info (xdrs, &objp->secinfo4_u.flavor_info))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO4resok (XDR* xdrs, SECINFO4resok* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->SECINFO4resok_val, (u_int*) &objp->SECINFO4resok_len, ~0,
+ sizeof (secinfo4), (xdrproc_t) xdr_secinfo4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO4res (XDR* xdrs, SECINFO4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_SECINFO4resok (xdrs, &objp->SECINFO4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR4args (XDR* xdrs, SETATTR4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR4res (XDR* xdrs, SETATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attrsset))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID4args (XDR* xdrs, SETCLIENTID4args* objp)
+{
+ if (!xdr_nfs_client_id4 (xdrs, &objp->client))
+ {
+ return FALSE;
+ }
+ if (!xdr_cb_client4 (xdrs, &objp->callback))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->callback_ident))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID4resok (XDR* xdrs, SETCLIENTID4resok* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->setclientid_confirm))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID4res (XDR* xdrs, SETCLIENTID4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_SETCLIENTID4resok (xdrs, &objp->SETCLIENTID4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4ERR_CLID_INUSE:
+ if (!xdr_clientaddr4 (xdrs, &objp->SETCLIENTID4res_u.client_using))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID_CONFIRM4args (XDR* xdrs, SETCLIENTID_CONFIRM4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->setclientid_confirm))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID_CONFIRM4res (XDR* xdrs, SETCLIENTID_CONFIRM4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_VERIFY4args (XDR* xdrs, VERIFY4args* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_VERIFY4res (XDR* xdrs, VERIFY4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_stable_how4 (XDR* xdrs, stable_how4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE4args (XDR* xdrs, WRITE4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_stable_how4 (xdrs, &objp->stable))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->data.data_val, (u_int*) &objp->data.data_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE4resok (XDR* xdrs, WRITE4resok* objp)
+{
+ if (!xdr_count4 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ if (!xdr_stable_how4 (xdrs, &objp->committed))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->writeverf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE4res (XDR* xdrs, WRITE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_WRITE4resok (xdrs, &objp->WRITE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RELEASE_LOCKOWNER4args (XDR* xdrs, RELEASE_LOCKOWNER4args* objp)
+{
+ if (!xdr_lock_owner4 (xdrs, &objp->lock_owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RELEASE_LOCKOWNER4res (XDR* xdrs, RELEASE_LOCKOWNER4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ILLEGAL4res (XDR* xdrs, ILLEGAL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_gsshandle4_t (XDR* xdrs, gsshandle4_t* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->gsshandle4_t_val, (u_int*) &objp->gsshandle4_t_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_gss_cb_handles4 (XDR* xdrs, gss_cb_handles4* objp)
+{
+ if (!xdr_rpc_gss_svc_t (xdrs, &objp->gcbp_service))
+ {
+ return FALSE;
+ }
+ if (!xdr_gsshandle4_t (xdrs, &objp->gcbp_handle_from_server))
+ {
+ return FALSE;
+ }
+ if (!xdr_gsshandle4_t (xdrs, &objp->gcbp_handle_from_client))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_callback_sec_parms4 (XDR* xdrs, callback_sec_parms4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->cb_secflavor))
+ {
+ return FALSE;
+ }
+ switch (objp->cb_secflavor)
+ {
+ case AUTH_NONE:
+ break;
+ case AUTH_SYS:
+ if (!xdr_authunix_parms (xdrs, &objp->callback_sec_parms4_u.cbsp_sys_cred))
+ {
+ return FALSE;
+ }
+ break;
+ case RPCSEC_GSS:
+ if (!xdr_gss_cb_handles4 (xdrs, &objp->callback_sec_parms4_u.cbsp_gss_handles))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_BACKCHANNEL_CTL4args (XDR* xdrs, BACKCHANNEL_CTL4args* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->bca_cb_program))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->bca_sec_parms.bca_sec_parms_val, (u_int*) &objp->bca_sec_parms.bca_sec_parms_len, ~0,
+ sizeof (callback_sec_parms4), (xdrproc_t) xdr_callback_sec_parms4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_BACKCHANNEL_CTL4res (XDR* xdrs, BACKCHANNEL_CTL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->bcr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_channel_dir_from_client4 (XDR* xdrs, channel_dir_from_client4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_BIND_CONN_TO_SESSION4args (XDR* xdrs, BIND_CONN_TO_SESSION4args* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->bctsa_sessid))
+ {
+ return FALSE;
+ }
+ if (!xdr_channel_dir_from_client4 (xdrs, &objp->bctsa_dir))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->bctsa_use_conn_in_rdma_mode))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_channel_dir_from_server4 (XDR* xdrs, channel_dir_from_server4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_BIND_CONN_TO_SESSION4resok (XDR* xdrs, BIND_CONN_TO_SESSION4resok* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->bctsr_sessid))
+ {
+ return FALSE;
+ }
+ if (!xdr_channel_dir_from_server4 (xdrs, &objp->bctsr_dir))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->bctsr_use_conn_in_rdma_mode))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_BIND_CONN_TO_SESSION4res (XDR* xdrs, BIND_CONN_TO_SESSION4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->bctsr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->bctsr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_BIND_CONN_TO_SESSION4resok (xdrs, &objp->BIND_CONN_TO_SESSION4res_u.bctsr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_state_protect_ops4 (XDR* xdrs, state_protect_ops4* objp)
+{
+ if (!xdr_bitmap4 (xdrs, &objp->spo_must_enforce))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->spo_must_allow))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ssv_sp_parms4 (XDR* xdrs, ssv_sp_parms4* objp)
+{
+ if (!xdr_state_protect_ops4 (xdrs, &objp->ssp_ops))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->ssp_hash_algs.ssp_hash_algs_val, (u_int*) &objp->ssp_hash_algs.ssp_hash_algs_len, ~0,
+ sizeof (sec_oid4), (xdrproc_t) xdr_sec_oid4))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->ssp_encr_algs.ssp_encr_algs_val, (u_int*) &objp->ssp_encr_algs.ssp_encr_algs_len, ~0,
+ sizeof (sec_oid4), (xdrproc_t) xdr_sec_oid4))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->ssp_window))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->ssp_num_gss_handles))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_state_protect_how4 (XDR* xdrs, state_protect_how4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_state_protect4_a (XDR* xdrs, state_protect4_a* objp)
+{
+ if (!xdr_state_protect_how4 (xdrs, &objp->spa_how))
+ {
+ return FALSE;
+ }
+ switch (objp->spa_how)
+ {
+ case SP4_NONE:
+ break;
+ case SP4_MACH_CRED:
+ if (!xdr_state_protect_ops4 (xdrs, &objp->state_protect4_a_u.spa_mach_ops))
+ {
+ return FALSE;
+ }
+ break;
+ case SP4_SSV:
+ if (!xdr_ssv_sp_parms4 (xdrs, &objp->state_protect4_a_u.spa_ssv_parms))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_EXCHANGE_ID4args (XDR* xdrs, EXCHANGE_ID4args* objp)
+{
+ if (!xdr_client_owner4 (xdrs, &objp->eia_clientowner))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->eia_flags))
+ {
+ return FALSE;
+ }
+ if (!xdr_state_protect4_a (xdrs, &objp->eia_state_protect))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->eia_client_impl_id.eia_client_impl_id_val, (u_int*) &objp->eia_client_impl_id.eia_client_impl_id_len, 1,
+ sizeof (nfs_impl_id4), (xdrproc_t) xdr_nfs_impl_id4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ssv_prot_info4 (XDR* xdrs, ssv_prot_info4* objp)
+{
+ if (!xdr_state_protect_ops4 (xdrs, &objp->spi_ops))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->spi_hash_alg))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->spi_encr_alg))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->spi_ssv_len))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->spi_window))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->spi_handles.spi_handles_val, (u_int*) &objp->spi_handles.spi_handles_len, ~0,
+ sizeof (gsshandle4_t), (xdrproc_t) xdr_gsshandle4_t))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_state_protect4_r (XDR* xdrs, state_protect4_r* objp)
+{
+ if (!xdr_state_protect_how4 (xdrs, &objp->spr_how))
+ {
+ return FALSE;
+ }
+ switch (objp->spr_how)
+ {
+ case SP4_NONE:
+ break;
+ case SP4_MACH_CRED:
+ if (!xdr_state_protect_ops4 (xdrs, &objp->state_protect4_r_u.spr_mach_ops))
+ {
+ return FALSE;
+ }
+ break;
+ case SP4_SSV:
+ if (!xdr_ssv_prot_info4 (xdrs, &objp->state_protect4_r_u.spr_ssv_info))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_EXCHANGE_ID4resok (XDR* xdrs, EXCHANGE_ID4resok* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->eir_clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_sequenceid4 (xdrs, &objp->eir_sequenceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->eir_flags))
+ {
+ return FALSE;
+ }
+ if (!xdr_state_protect4_r (xdrs, &objp->eir_state_protect))
+ {
+ return FALSE;
+ }
+ if (!xdr_server_owner4 (xdrs, &objp->eir_server_owner))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->eir_server_scope.eir_server_scope_val, (u_int*) &objp->eir_server_scope.eir_server_scope_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->eir_server_impl_id.eir_server_impl_id_val, (u_int*) &objp->eir_server_impl_id.eir_server_impl_id_len, 1,
+ sizeof (nfs_impl_id4), (xdrproc_t) xdr_nfs_impl_id4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_EXCHANGE_ID4res (XDR* xdrs, EXCHANGE_ID4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->eir_status))
+ {
+ return FALSE;
+ }
+ switch (objp->eir_status)
+ {
+ case NFS4_OK:
+ if (!xdr_EXCHANGE_ID4resok (xdrs, &objp->EXCHANGE_ID4res_u.eir_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_channel_attrs4 (XDR* xdrs, channel_attrs4* objp)
+{
+ if (!xdr_count4 (xdrs, &objp->ca_headerpadsize))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->ca_maxrequestsize))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->ca_maxresponsesize))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->ca_maxresponsesize_cached))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->ca_maxoperations))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->ca_maxrequests))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->ca_rdma_ird.ca_rdma_ird_val, (u_int*) &objp->ca_rdma_ird.ca_rdma_ird_len, 1,
+ sizeof (uint32_t), (xdrproc_t) xdr_uint32_t))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE_SESSION4args (XDR* xdrs, CREATE_SESSION4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->csa_clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_sequenceid4 (xdrs, &objp->csa_sequence))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->csa_flags))
+ {
+ return FALSE;
+ }
+ if (!xdr_channel_attrs4 (xdrs, &objp->csa_fore_chan_attrs))
+ {
+ return FALSE;
+ }
+ if (!xdr_channel_attrs4 (xdrs, &objp->csa_back_chan_attrs))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->csa_cb_program))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->csa_sec_parms.csa_sec_parms_val, (u_int*) &objp->csa_sec_parms.csa_sec_parms_len, ~0,
+ sizeof (callback_sec_parms4), (xdrproc_t) xdr_callback_sec_parms4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE_SESSION4resok (XDR* xdrs, CREATE_SESSION4resok* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->csr_sessionid))
+ {
+ return FALSE;
+ }
+ if (!xdr_sequenceid4 (xdrs, &objp->csr_sequence))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->csr_flags))
+ {
+ return FALSE;
+ }
+ if (!xdr_channel_attrs4 (xdrs, &objp->csr_fore_chan_attrs))
+ {
+ return FALSE;
+ }
+ if (!xdr_channel_attrs4 (xdrs, &objp->csr_back_chan_attrs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE_SESSION4res (XDR* xdrs, CREATE_SESSION4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->csr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->csr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_CREATE_SESSION4resok (xdrs, &objp->CREATE_SESSION4res_u.csr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DESTROY_SESSION4args (XDR* xdrs, DESTROY_SESSION4args* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->dsa_sessionid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DESTROY_SESSION4res (XDR* xdrs, DESTROY_SESSION4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->dsr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FREE_STATEID4args (XDR* xdrs, FREE_STATEID4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->fsa_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_FREE_STATEID4res (XDR* xdrs, FREE_STATEID4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->fsr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_attr_notice4 (XDR* xdrs, attr_notice4* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GET_DIR_DELEGATION4args (XDR* xdrs, GET_DIR_DELEGATION4args* objp)
+{
+ if (!xdr_bool (xdrs, &objp->gdda_signal_deleg_avail))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gdda_notification_types))
+ {
+ return FALSE;
+ }
+ if (!xdr_attr_notice4 (xdrs, &objp->gdda_child_attr_delay))
+ {
+ return FALSE;
+ }
+ if (!xdr_attr_notice4 (xdrs, &objp->gdda_dir_attr_delay))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gdda_child_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gdda_dir_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GET_DIR_DELEGATION4resok (XDR* xdrs, GET_DIR_DELEGATION4resok* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->gddr_cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->gddr_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gddr_notification))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gddr_child_attributes))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gddr_dir_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_gddrnf4_status (XDR* xdrs, gddrnf4_status* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GET_DIR_DELEGATION4res_non_fatal (XDR* xdrs, GET_DIR_DELEGATION4res_non_fatal* objp)
+{
+ if (!xdr_gddrnf4_status (xdrs, &objp->gddrnf_status))
+ {
+ return FALSE;
+ }
+ switch (objp->gddrnf_status)
+ {
+ case GDD4_OK:
+ if (!xdr_GET_DIR_DELEGATION4resok (xdrs, &objp->GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ case GDD4_UNAVAIL:
+ if (!xdr_bool (xdrs, &objp->GET_DIR_DELEGATION4res_non_fatal_u.gddrnf_will_signal_deleg_avail))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GET_DIR_DELEGATION4res (XDR* xdrs, GET_DIR_DELEGATION4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->gddr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->gddr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_GET_DIR_DELEGATION4res_non_fatal (xdrs, &objp->GET_DIR_DELEGATION4res_u.gddr_res_non_fatal4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETDEVICEINFO4args (XDR* xdrs, GETDEVICEINFO4args* objp)
+{
+ if (!xdr_deviceid4 (xdrs, objp->gdia_device_id))
+ {
+ return FALSE;
+ }
+ if (!xdr_layouttype4 (xdrs, &objp->gdia_layout_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->gdia_maxcount))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gdia_notify_types))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETDEVICEINFO4resok (XDR* xdrs, GETDEVICEINFO4resok* objp)
+{
+ if (!xdr_device_addr4 (xdrs, &objp->gdir_device_addr))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->gdir_notification))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETDEVICEINFO4res (XDR* xdrs, GETDEVICEINFO4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->gdir_status))
+ {
+ return FALSE;
+ }
+ switch (objp->gdir_status)
+ {
+ case NFS4_OK:
+ if (!xdr_GETDEVICEINFO4resok (xdrs, &objp->GETDEVICEINFO4res_u.gdir_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4ERR_TOOSMALL:
+ if (!xdr_count4 (xdrs, &objp->GETDEVICEINFO4res_u.gdir_mincount))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETDEVICELIST4args (XDR* xdrs, GETDEVICELIST4args* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->gdla_layout_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->gdla_maxdevices))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_cookie4 (xdrs, &objp->gdla_cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->gdla_cookieverf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETDEVICELIST4resok (XDR* xdrs, GETDEVICELIST4resok* objp)
+{
+ if (!xdr_nfs_cookie4 (xdrs, &objp->gdlr_cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->gdlr_cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->gdlr_deviceid_list.gdlr_deviceid_list_val, (u_int*) &objp->gdlr_deviceid_list.gdlr_deviceid_list_len, ~0,
+ sizeof (deviceid4), (xdrproc_t) xdr_deviceid4))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->gdlr_eof))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETDEVICELIST4res (XDR* xdrs, GETDEVICELIST4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->gdlr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->gdlr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_GETDEVICELIST4resok (xdrs, &objp->GETDEVICELIST4res_u.gdlr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_newtime4 (XDR* xdrs, newtime4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->nt_timechanged))
+ {
+ return FALSE;
+ }
+ switch (objp->nt_timechanged)
+ {
+ case TRUE:
+ if (!xdr_nfstime4 (xdrs, &objp->newtime4_u.nt_time))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_newoffset4 (XDR* xdrs, newoffset4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->no_newoffset))
+ {
+ return FALSE;
+ }
+ switch (objp->no_newoffset)
+ {
+ case TRUE:
+ if (!xdr_offset4 (xdrs, &objp->newoffset4_u.no_offset))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTCOMMIT4args (XDR* xdrs, LAYOUTCOMMIT4args* objp)
+{
+ if (!xdr_offset4 (xdrs, &objp->loca_offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->loca_length))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->loca_reclaim))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->loca_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_newoffset4 (xdrs, &objp->loca_last_write_offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_newtime4 (xdrs, &objp->loca_time_modify))
+ {
+ return FALSE;
+ }
+ if (!xdr_layoutupdate4 (xdrs, &objp->loca_layoutupdate))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_newsize4 (XDR* xdrs, newsize4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->ns_sizechanged))
+ {
+ return FALSE;
+ }
+ switch (objp->ns_sizechanged)
+ {
+ case TRUE:
+ if (!xdr_length4 (xdrs, &objp->newsize4_u.ns_size))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTCOMMIT4resok (XDR* xdrs, LAYOUTCOMMIT4resok* objp)
+{
+ if (!xdr_newsize4 (xdrs, &objp->locr_newsize))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTCOMMIT4res (XDR* xdrs, LAYOUTCOMMIT4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->locr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->locr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_LAYOUTCOMMIT4resok (xdrs, &objp->LAYOUTCOMMIT4res_u.locr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTGET4args (XDR* xdrs, LAYOUTGET4args* objp)
+{
+ if (!xdr_bool (xdrs, &objp->loga_signal_layout_avail))
+ {
+ return FALSE;
+ }
+ if (!xdr_layouttype4 (xdrs, &objp->loga_layout_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_layoutiomode4 (xdrs, &objp->loga_iomode))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->loga_offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->loga_length))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->loga_minlength))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->loga_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->loga_maxcount))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTGET4resok (XDR* xdrs, LAYOUTGET4resok* objp)
+{
+ if (!xdr_bool (xdrs, &objp->logr_return_on_close))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->logr_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->logr_layout.logr_layout_val, (u_int*) &objp->logr_layout.logr_layout_len, ~0,
+ sizeof (layout4), (xdrproc_t) xdr_layout4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTGET4res (XDR* xdrs, LAYOUTGET4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->logr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->logr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_LAYOUTGET4resok (xdrs, &objp->LAYOUTGET4res_u.logr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4ERR_LAYOUTTRYLATER:
+ if (!xdr_bool (xdrs, &objp->LAYOUTGET4res_u.logr_will_signal_layout_avail))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTRETURN4args (XDR* xdrs, LAYOUTRETURN4args* objp)
+{
+ if (!xdr_bool (xdrs, &objp->lora_reclaim))
+ {
+ return FALSE;
+ }
+ if (!xdr_layouttype4 (xdrs, &objp->lora_layout_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_layoutiomode4 (xdrs, &objp->lora_iomode))
+ {
+ return FALSE;
+ }
+ if (!xdr_layoutreturn4 (xdrs, &objp->lora_layoutreturn))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layoutreturn_stateid (XDR* xdrs, layoutreturn_stateid* objp)
+{
+ if (!xdr_bool (xdrs, &objp->lrs_present))
+ {
+ return FALSE;
+ }
+ switch (objp->lrs_present)
+ {
+ case TRUE:
+ if (!xdr_stateid4 (xdrs, &objp->layoutreturn_stateid_u.lrs_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LAYOUTRETURN4res (XDR* xdrs, LAYOUTRETURN4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->lorr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->lorr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_layoutreturn_stateid (xdrs, &objp->LAYOUTRETURN4res_u.lorr_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_secinfo_style4 (XDR* xdrs, secinfo_style4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO_NO_NAME4args (XDR* xdrs, SECINFO_NO_NAME4args* objp)
+{
+ if (!xdr_secinfo_style4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO_NO_NAME4res (XDR* xdrs, SECINFO_NO_NAME4res* objp)
+{
+ if (!xdr_SECINFO4res (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SEQUENCE4args (XDR* xdrs, SEQUENCE4args* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->sa_sessionid))
+ {
+ return FALSE;
+ }
+ if (!xdr_sequenceid4 (xdrs, &objp->sa_sequenceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->sa_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->sa_highest_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->sa_cachethis))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SEQUENCE4resok (XDR* xdrs, SEQUENCE4resok* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->sr_sessionid))
+ {
+ return FALSE;
+ }
+ if (!xdr_sequenceid4 (xdrs, &objp->sr_sequenceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->sr_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->sr_highest_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->sr_target_highest_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->sr_status_flags))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SEQUENCE4res (XDR* xdrs, SEQUENCE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->sr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->sr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_SEQUENCE4resok (xdrs, &objp->SEQUENCE4res_u.sr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ssa_digest_input4 (XDR* xdrs, ssa_digest_input4* objp)
+{
+ if (!xdr_SEQUENCE4args (xdrs, &objp->sdi_seqargs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SET_SSV4args (XDR* xdrs, SET_SSV4args* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->ssa_ssv.ssa_ssv_val, (u_int*) &objp->ssa_ssv.ssa_ssv_len, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->ssa_digest.ssa_digest_val, (u_int*) &objp->ssa_digest.ssa_digest_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ssr_digest_input4 (XDR* xdrs, ssr_digest_input4* objp)
+{
+ if (!xdr_SEQUENCE4res (xdrs, &objp->sdi_seqres))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SET_SSV4resok (XDR* xdrs, SET_SSV4resok* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->ssr_digest.ssr_digest_val, (u_int*) &objp->ssr_digest.ssr_digest_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SET_SSV4res (XDR* xdrs, SET_SSV4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->ssr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->ssr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_SET_SSV4resok (xdrs, &objp->SET_SSV4res_u.ssr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_TEST_STATEID4args (XDR* xdrs, TEST_STATEID4args* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->ts_stateids.ts_stateids_val, (u_int*) &objp->ts_stateids.ts_stateids_len, ~0,
+ sizeof (stateid4), (xdrproc_t) xdr_stateid4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_TEST_STATEID4resok (XDR* xdrs, TEST_STATEID4resok* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->tsr_status_codes.tsr_status_codes_val, (u_int*) &objp->tsr_status_codes.tsr_status_codes_len, ~0,
+ sizeof (nfsstat4), (xdrproc_t) xdr_nfsstat4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_TEST_STATEID4res (XDR* xdrs, TEST_STATEID4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->tsr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->tsr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_TEST_STATEID4resok (xdrs, &objp->TEST_STATEID4res_u.tsr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_deleg_claim4 (XDR* xdrs, deleg_claim4* objp)
+{
+ if (!xdr_open_claim_type4 (xdrs, &objp->dc_claim))
+ {
+ return FALSE;
+ }
+ switch (objp->dc_claim)
+ {
+ case CLAIM_FH:
+ break;
+ case CLAIM_DELEG_PREV_FH:
+ break;
+ case CLAIM_PREVIOUS:
+ if (!xdr_open_delegation_type4 (xdrs, &objp->deleg_claim4_u.dc_delegate_type))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WANT_DELEGATION4args (XDR* xdrs, WANT_DELEGATION4args* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->wda_want))
+ {
+ return FALSE;
+ }
+ if (!xdr_deleg_claim4 (xdrs, &objp->wda_claim))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WANT_DELEGATION4res (XDR* xdrs, WANT_DELEGATION4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->wdr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->wdr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_open_delegation4 (xdrs, &objp->WANT_DELEGATION4res_u.wdr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DESTROY_CLIENTID4args (XDR* xdrs, DESTROY_CLIENTID4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->dca_clientid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DESTROY_CLIENTID4res (XDR* xdrs, DESTROY_CLIENTID4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->dcr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RECLAIM_COMPLETE4args (XDR* xdrs, RECLAIM_COMPLETE4args* objp)
+{
+ if (!xdr_bool (xdrs, &objp->rca_one_fs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RECLAIM_COMPLETE4res (XDR* xdrs, RECLAIM_COMPLETE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->rcr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* new operations for NFSv4.1 */
+
+
+bool_t
+xdr_nfs_opnum4 (XDR* xdrs, nfs_opnum4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_argop4 (XDR* xdrs, nfs_argop4* objp)
+{
+ if (!xdr_nfs_opnum4 (xdrs, &objp->argop))
+ {
+ return FALSE;
+ }
+ switch (objp->argop)
+ {
+ case OP_ACCESS:
+ if (!xdr_ACCESS4args (xdrs, &objp->nfs_argop4_u.opaccess))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CLOSE:
+ if (!xdr_CLOSE4args (xdrs, &objp->nfs_argop4_u.opclose))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_COMMIT:
+ if (!xdr_COMMIT4args (xdrs, &objp->nfs_argop4_u.opcommit))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CREATE:
+ if (!xdr_CREATE4args (xdrs, &objp->nfs_argop4_u.opcreate))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGPURGE:
+ if (!xdr_DELEGPURGE4args (xdrs, &objp->nfs_argop4_u.opdelegpurge))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGRETURN:
+ if (!xdr_DELEGRETURN4args (xdrs, &objp->nfs_argop4_u.opdelegreturn))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETATTR:
+ if (!xdr_GETATTR4args (xdrs, &objp->nfs_argop4_u.opgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETFH:
+ break;
+ case OP_LINK:
+ if (!xdr_LINK4args (xdrs, &objp->nfs_argop4_u.oplink))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCK:
+ if (!xdr_LOCK4args (xdrs, &objp->nfs_argop4_u.oplock))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKT:
+ if (!xdr_LOCKT4args (xdrs, &objp->nfs_argop4_u.oplockt))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKU:
+ if (!xdr_LOCKU4args (xdrs, &objp->nfs_argop4_u.oplocku))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUP:
+ if (!xdr_LOOKUP4args (xdrs, &objp->nfs_argop4_u.oplookup))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUPP:
+ break;
+ case OP_NVERIFY:
+ if (!xdr_NVERIFY4args (xdrs, &objp->nfs_argop4_u.opnverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN:
+ if (!xdr_OPEN4args (xdrs, &objp->nfs_argop4_u.opopen))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPENATTR:
+ if (!xdr_OPENATTR4args (xdrs, &objp->nfs_argop4_u.opopenattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_CONFIRM:
+ if (!xdr_OPEN_CONFIRM4args (xdrs, &objp->nfs_argop4_u.opopen_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_DOWNGRADE:
+ if (!xdr_OPEN_DOWNGRADE4args (xdrs, &objp->nfs_argop4_u.opopen_downgrade))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTFH:
+ if (!xdr_PUTFH4args (xdrs, &objp->nfs_argop4_u.opputfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTPUBFH:
+ break;
+ case OP_PUTROOTFH:
+ break;
+ case OP_READ:
+ if (!xdr_READ4args (xdrs, &objp->nfs_argop4_u.opread))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READDIR:
+ if (!xdr_READDIR4args (xdrs, &objp->nfs_argop4_u.opreaddir))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READLINK:
+ break;
+ case OP_REMOVE:
+ if (!xdr_REMOVE4args (xdrs, &objp->nfs_argop4_u.opremove))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENAME:
+ if (!xdr_RENAME4args (xdrs, &objp->nfs_argop4_u.oprename))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENEW:
+ if (!xdr_RENEW4args (xdrs, &objp->nfs_argop4_u.oprenew))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RESTOREFH:
+ break;
+ case OP_SAVEFH:
+ break;
+ case OP_SECINFO:
+ if (!xdr_SECINFO4args (xdrs, &objp->nfs_argop4_u.opsecinfo))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETATTR:
+ if (!xdr_SETATTR4args (xdrs, &objp->nfs_argop4_u.opsetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID:
+ if (!xdr_SETCLIENTID4args (xdrs, &objp->nfs_argop4_u.opsetclientid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID_CONFIRM:
+ if (!xdr_SETCLIENTID_CONFIRM4args (xdrs, &objp->nfs_argop4_u.opsetclientid_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_VERIFY:
+ if (!xdr_VERIFY4args (xdrs, &objp->nfs_argop4_u.opverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_WRITE:
+ if (!xdr_WRITE4args (xdrs, &objp->nfs_argop4_u.opwrite))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RELEASE_LOCKOWNER:
+ if (!xdr_RELEASE_LOCKOWNER4args (xdrs, &objp->nfs_argop4_u.oprelease_lockowner))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_BACKCHANNEL_CTL:
+ if (!xdr_BACKCHANNEL_CTL4args (xdrs, &objp->nfs_argop4_u.opbackchannel_ctl))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_BIND_CONN_TO_SESSION:
+ if (!xdr_BIND_CONN_TO_SESSION4args (xdrs, &objp->nfs_argop4_u.opbind_conn_to_session))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_EXCHANGE_ID:
+ if (!xdr_EXCHANGE_ID4args (xdrs, &objp->nfs_argop4_u.opexchange_id))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CREATE_SESSION:
+ if (!xdr_CREATE_SESSION4args (xdrs, &objp->nfs_argop4_u.opcreate_session))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DESTROY_SESSION:
+ if (!xdr_DESTROY_SESSION4args (xdrs, &objp->nfs_argop4_u.opdestroy_session))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_FREE_STATEID:
+ if (!xdr_FREE_STATEID4args (xdrs, &objp->nfs_argop4_u.opfree_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GET_DIR_DELEGATION:
+ if (!xdr_GET_DIR_DELEGATION4args (xdrs, &objp->nfs_argop4_u.opget_dir_delegation))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETDEVICEINFO:
+ if (!xdr_GETDEVICEINFO4args (xdrs, &objp->nfs_argop4_u.opgetdeviceinfo))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETDEVICELIST:
+ if (!xdr_GETDEVICELIST4args (xdrs, &objp->nfs_argop4_u.opgetdevicelist))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LAYOUTCOMMIT:
+ if (!xdr_LAYOUTCOMMIT4args (xdrs, &objp->nfs_argop4_u.oplayoutcommit))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LAYOUTGET:
+ if (!xdr_LAYOUTGET4args (xdrs, &objp->nfs_argop4_u.oplayoutget))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LAYOUTRETURN:
+ if (!xdr_LAYOUTRETURN4args (xdrs, &objp->nfs_argop4_u.oplayoutreturn))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SECINFO_NO_NAME:
+ if (!xdr_SECINFO_NO_NAME4args (xdrs, &objp->nfs_argop4_u.opsecinfo_no_name))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SEQUENCE:
+ if (!xdr_SEQUENCE4args (xdrs, &objp->nfs_argop4_u.opsequence))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SET_SSV:
+ if (!xdr_SET_SSV4args (xdrs, &objp->nfs_argop4_u.opset_ssv))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_TEST_STATEID:
+ if (!xdr_TEST_STATEID4args (xdrs, &objp->nfs_argop4_u.optest_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_WANT_DELEGATION:
+ if (!xdr_WANT_DELEGATION4args (xdrs, &objp->nfs_argop4_u.opwant_delegation))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DESTROY_CLIENTID:
+ if (!xdr_DESTROY_CLIENTID4args (xdrs, &objp->nfs_argop4_u.opdestroy_clientid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RECLAIM_COMPLETE:
+ if (!xdr_RECLAIM_COMPLETE4args (xdrs, &objp->nfs_argop4_u.opreclaim_complete))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_ILLEGAL:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_resop4 (XDR* xdrs, nfs_resop4* objp)
+{
+ if (!xdr_nfs_opnum4 (xdrs, &objp->resop))
+ {
+ return FALSE;
+ }
+ switch (objp->resop)
+ {
+ case OP_ACCESS:
+ if (!xdr_ACCESS4res (xdrs, &objp->nfs_resop4_u.opaccess))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CLOSE:
+ if (!xdr_CLOSE4res (xdrs, &objp->nfs_resop4_u.opclose))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_COMMIT:
+ if (!xdr_COMMIT4res (xdrs, &objp->nfs_resop4_u.opcommit))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CREATE:
+ if (!xdr_CREATE4res (xdrs, &objp->nfs_resop4_u.opcreate))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGPURGE:
+ if (!xdr_DELEGPURGE4res (xdrs, &objp->nfs_resop4_u.opdelegpurge))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGRETURN:
+ if (!xdr_DELEGRETURN4res (xdrs, &objp->nfs_resop4_u.opdelegreturn))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETATTR:
+ if (!xdr_GETATTR4res (xdrs, &objp->nfs_resop4_u.opgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETFH:
+ if (!xdr_GETFH4res (xdrs, &objp->nfs_resop4_u.opgetfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LINK:
+ if (!xdr_LINK4res (xdrs, &objp->nfs_resop4_u.oplink))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCK:
+ if (!xdr_LOCK4res (xdrs, &objp->nfs_resop4_u.oplock))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKT:
+ if (!xdr_LOCKT4res (xdrs, &objp->nfs_resop4_u.oplockt))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKU:
+ if (!xdr_LOCKU4res (xdrs, &objp->nfs_resop4_u.oplocku))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUP:
+ if (!xdr_LOOKUP4res (xdrs, &objp->nfs_resop4_u.oplookup))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUPP:
+ if (!xdr_LOOKUPP4res (xdrs, &objp->nfs_resop4_u.oplookupp))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_NVERIFY:
+ if (!xdr_NVERIFY4res (xdrs, &objp->nfs_resop4_u.opnverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN:
+ if (!xdr_OPEN4res (xdrs, &objp->nfs_resop4_u.opopen))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPENATTR:
+ if (!xdr_OPENATTR4res (xdrs, &objp->nfs_resop4_u.opopenattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_CONFIRM:
+ if (!xdr_OPEN_CONFIRM4res (xdrs, &objp->nfs_resop4_u.opopen_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_DOWNGRADE:
+ if (!xdr_OPEN_DOWNGRADE4res (xdrs, &objp->nfs_resop4_u.opopen_downgrade))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTFH:
+ if (!xdr_PUTFH4res (xdrs, &objp->nfs_resop4_u.opputfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTPUBFH:
+ if (!xdr_PUTPUBFH4res (xdrs, &objp->nfs_resop4_u.opputpubfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTROOTFH:
+ if (!xdr_PUTROOTFH4res (xdrs, &objp->nfs_resop4_u.opputrootfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READ:
+ if (!xdr_READ4res (xdrs, &objp->nfs_resop4_u.opread))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READDIR:
+ if (!xdr_READDIR4res (xdrs, &objp->nfs_resop4_u.opreaddir))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READLINK:
+ if (!xdr_READLINK4res (xdrs, &objp->nfs_resop4_u.opreadlink))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_REMOVE:
+ if (!xdr_REMOVE4res (xdrs, &objp->nfs_resop4_u.opremove))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENAME:
+ if (!xdr_RENAME4res (xdrs, &objp->nfs_resop4_u.oprename))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENEW:
+ if (!xdr_RENEW4res (xdrs, &objp->nfs_resop4_u.oprenew))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RESTOREFH:
+ if (!xdr_RESTOREFH4res (xdrs, &objp->nfs_resop4_u.oprestorefh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SAVEFH:
+ if (!xdr_SAVEFH4res (xdrs, &objp->nfs_resop4_u.opsavefh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SECINFO:
+ if (!xdr_SECINFO4res (xdrs, &objp->nfs_resop4_u.opsecinfo))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETATTR:
+ if (!xdr_SETATTR4res (xdrs, &objp->nfs_resop4_u.opsetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID:
+ if (!xdr_SETCLIENTID4res (xdrs, &objp->nfs_resop4_u.opsetclientid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID_CONFIRM:
+ if (!xdr_SETCLIENTID_CONFIRM4res (xdrs, &objp->nfs_resop4_u.opsetclientid_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_VERIFY:
+ if (!xdr_VERIFY4res (xdrs, &objp->nfs_resop4_u.opverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_WRITE:
+ if (!xdr_WRITE4res (xdrs, &objp->nfs_resop4_u.opwrite))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RELEASE_LOCKOWNER:
+ if (!xdr_RELEASE_LOCKOWNER4res (xdrs, &objp->nfs_resop4_u.oprelease_lockowner))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_BACKCHANNEL_CTL:
+ if (!xdr_BACKCHANNEL_CTL4res (xdrs, &objp->nfs_resop4_u.opbackchannel_ctl))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_BIND_CONN_TO_SESSION:
+ if (!xdr_BIND_CONN_TO_SESSION4res (xdrs, &objp->nfs_resop4_u.opbind_conn_to_session))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_EXCHANGE_ID:
+ if (!xdr_EXCHANGE_ID4res (xdrs, &objp->nfs_resop4_u.opexchange_id))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CREATE_SESSION:
+ if (!xdr_CREATE_SESSION4res (xdrs, &objp->nfs_resop4_u.opcreate_session))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DESTROY_SESSION:
+ if (!xdr_DESTROY_SESSION4res (xdrs, &objp->nfs_resop4_u.opdestroy_session))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_FREE_STATEID:
+ if (!xdr_FREE_STATEID4res (xdrs, &objp->nfs_resop4_u.opfree_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GET_DIR_DELEGATION:
+ if (!xdr_GET_DIR_DELEGATION4res (xdrs, &objp->nfs_resop4_u.opget_dir_delegation))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETDEVICEINFO:
+ if (!xdr_GETDEVICEINFO4res (xdrs, &objp->nfs_resop4_u.opgetdeviceinfo))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETDEVICELIST:
+ if (!xdr_GETDEVICELIST4res (xdrs, &objp->nfs_resop4_u.opgetdevicelist))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LAYOUTCOMMIT:
+ if (!xdr_LAYOUTCOMMIT4res (xdrs, &objp->nfs_resop4_u.oplayoutcommit))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LAYOUTGET:
+ if (!xdr_LAYOUTGET4res (xdrs, &objp->nfs_resop4_u.oplayoutget))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LAYOUTRETURN:
+ if (!xdr_LAYOUTRETURN4res (xdrs, &objp->nfs_resop4_u.oplayoutreturn))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SECINFO_NO_NAME:
+ if (!xdr_SECINFO_NO_NAME4res (xdrs, &objp->nfs_resop4_u.opsecinfo_no_name))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SEQUENCE:
+ if (!xdr_SEQUENCE4res (xdrs, &objp->nfs_resop4_u.opsequence))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SET_SSV:
+ if (!xdr_SET_SSV4res (xdrs, &objp->nfs_resop4_u.opset_ssv))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_TEST_STATEID:
+ if (!xdr_TEST_STATEID4res (xdrs, &objp->nfs_resop4_u.optest_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_WANT_DELEGATION:
+ if (!xdr_WANT_DELEGATION4res (xdrs, &objp->nfs_resop4_u.opwant_delegation))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DESTROY_CLIENTID:
+ if (!xdr_DESTROY_CLIENTID4res (xdrs, &objp->nfs_resop4_u.opdestroy_clientid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RECLAIM_COMPLETE:
+ if (!xdr_RECLAIM_COMPLETE4res (xdrs, &objp->nfs_resop4_u.opreclaim_complete))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_ILLEGAL:
+ if (!xdr_ILLEGAL4res (xdrs, &objp->nfs_resop4_u.opillegal))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMPOUND4args (XDR* xdrs, COMPOUND4args* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->minorversion))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->argarray.argarray_val, (u_int*) &objp->argarray.argarray_len, ~0,
+ sizeof (nfs_argop4), (xdrproc_t) xdr_nfs_argop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMPOUND4res (XDR* xdrs, COMPOUND4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->resarray.resarray_val, (u_int*) &objp->resarray.resarray_len, ~0,
+ sizeof (nfs_resop4), (xdrproc_t) xdr_nfs_resop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_GETATTR4args (XDR* xdrs, CB_GETATTR4args* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->fh))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attr_request))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_GETATTR4resok (XDR* xdrs, CB_GETATTR4resok* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_GETATTR4res (XDR* xdrs, CB_GETATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_CB_GETATTR4resok (xdrs, &objp->CB_GETATTR4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL4args (XDR* xdrs, CB_RECALL4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->truncate))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_fh4 (xdrs, &objp->fh))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL4res (XDR* xdrs, CB_RECALL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_ILLEGAL4res (XDR* xdrs, CB_ILLEGAL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layoutrecall_type4 (XDR* xdrs, layoutrecall_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layoutrecall_file4 (XDR* xdrs, layoutrecall_file4* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->lor_fh))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->lor_offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->lor_length))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->lor_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_layoutrecall4 (XDR* xdrs, layoutrecall4* objp)
+{
+ if (!xdr_layoutrecall_type4 (xdrs, &objp->lor_recalltype))
+ {
+ return FALSE;
+ }
+ switch (objp->lor_recalltype)
+ {
+ case LAYOUTRECALL4_FILE:
+ if (!xdr_layoutrecall_file4 (xdrs, &objp->layoutrecall4_u.lor_layout))
+ {
+ return FALSE;
+ }
+ break;
+ case LAYOUTRECALL4_FSID:
+ if (!xdr_fsid4 (xdrs, &objp->layoutrecall4_u.lor_fsid))
+ {
+ return FALSE;
+ }
+ break;
+ case LAYOUTRECALL4_ALL:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_LAYOUTRECALL4args (XDR* xdrs, CB_LAYOUTRECALL4args* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->clora_type))
+ {
+ return FALSE;
+ }
+ if (!xdr_layoutiomode4 (xdrs, &objp->clora_iomode))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->clora_changed))
+ {
+ return FALSE;
+ }
+ if (!xdr_layoutrecall4 (xdrs, &objp->clora_recall))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_LAYOUTRECALL4res (XDR* xdrs, CB_LAYOUTRECALL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->clorr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_type4 (XDR* xdrs, notify_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_entry4 (XDR* xdrs, notify_entry4* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->ne_file))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->ne_attrs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_prev_entry4 (XDR* xdrs, prev_entry4* objp)
+{
+ if (!xdr_notify_entry4 (xdrs, &objp->pe_prev_entry))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_cookie4 (xdrs, &objp->pe_prev_entry_cookie))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_remove4 (XDR* xdrs, notify_remove4* objp)
+{
+ if (!xdr_notify_entry4 (xdrs, &objp->nrm_old_entry))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_cookie4 (xdrs, &objp->nrm_old_entry_cookie))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_add4 (XDR* xdrs, notify_add4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->nad_old_entry.nad_old_entry_val, (u_int*) &objp->nad_old_entry.nad_old_entry_len, 1,
+ sizeof (notify_remove4), (xdrproc_t) xdr_notify_remove4))
+ {
+ return FALSE;
+ }
+ if (!xdr_notify_entry4 (xdrs, &objp->nad_new_entry))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->nad_new_entry_cookie.nad_new_entry_cookie_val, (u_int*) &objp->nad_new_entry_cookie.nad_new_entry_cookie_len, 1,
+ sizeof (nfs_cookie4), (xdrproc_t) xdr_nfs_cookie4))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->nad_prev_entry.nad_prev_entry_val, (u_int*) &objp->nad_prev_entry.nad_prev_entry_len, 1,
+ sizeof (prev_entry4), (xdrproc_t) xdr_prev_entry4))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->nad_last_entry))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_attr4 (XDR* xdrs, notify_attr4* objp)
+{
+ if (!xdr_notify_entry4 (xdrs, &objp->na_changed_entry))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_rename4 (XDR* xdrs, notify_rename4* objp)
+{
+ if (!xdr_notify_remove4 (xdrs, &objp->nrn_old_entry))
+ {
+ return FALSE;
+ }
+ if (!xdr_notify_add4 (xdrs, &objp->nrn_new_entry))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_verifier4 (XDR* xdrs, notify_verifier4* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->nv_old_cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->nv_new_cookieverf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notifylist4 (XDR* xdrs, notifylist4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->notifylist4_val, (u_int*) &objp->notifylist4_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify4 (XDR* xdrs, notify4* objp)
+{
+ if (!xdr_bitmap4 (xdrs, &objp->notify_mask))
+ {
+ return FALSE;
+ }
+ if (!xdr_notifylist4 (xdrs, &objp->notify_vals))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_NOTIFY4args (XDR* xdrs, CB_NOTIFY4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->cna_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_fh4 (xdrs, &objp->cna_fh))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->cna_changes.cna_changes_val, (u_int*) &objp->cna_changes.cna_changes_len, ~0,
+ sizeof (notify4), (xdrproc_t) xdr_notify4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_NOTIFY4res (XDR* xdrs, CB_NOTIFY4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->cnr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_PUSH_DELEG4args (XDR* xdrs, CB_PUSH_DELEG4args* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->cpda_fh))
+ {
+ return FALSE;
+ }
+ if (!xdr_open_delegation4 (xdrs, &objp->cpda_delegation))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_PUSH_DELEG4res (XDR* xdrs, CB_PUSH_DELEG4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->cpdr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL_ANY4args (XDR* xdrs, CB_RECALL_ANY4args* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->craa_objects_to_keep))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->craa_type_mask))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL_ANY4res (XDR* xdrs, CB_RECALL_ANY4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->crar_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALLABLE_OBJ_AVAIL4args (XDR* xdrs, CB_RECALLABLE_OBJ_AVAIL4args* objp)
+{
+ if (!xdr_CB_RECALL_ANY4args (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALLABLE_OBJ_AVAIL4res (XDR* xdrs, CB_RECALLABLE_OBJ_AVAIL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->croa_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL_SLOT4args (XDR* xdrs, CB_RECALL_SLOT4args* objp)
+{
+ if (!xdr_slotid4 (xdrs, &objp->rsa_target_highest_slotid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL_SLOT4res (XDR* xdrs, CB_RECALL_SLOT4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->rsr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_referring_call4 (XDR* xdrs, referring_call4* objp)
+{
+ if (!xdr_sequenceid4 (xdrs, &objp->rc_sequenceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->rc_slotid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_referring_call_list4 (XDR* xdrs, referring_call_list4* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->rcl_sessionid))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->rcl_referring_calls.rcl_referring_calls_val, (u_int*) &objp->rcl_referring_calls.rcl_referring_calls_len, ~0,
+ sizeof (referring_call4), (xdrproc_t) xdr_referring_call4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_SEQUENCE4args (XDR* xdrs, CB_SEQUENCE4args* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->csa_sessionid))
+ {
+ return FALSE;
+ }
+ if (!xdr_sequenceid4 (xdrs, &objp->csa_sequenceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->csa_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->csa_highest_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->csa_cachethis))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->csa_referring_call_lists.csa_referring_call_lists_val, (u_int*) &objp->csa_referring_call_lists.csa_referring_call_lists_len, ~0,
+ sizeof (referring_call_list4), (xdrproc_t) xdr_referring_call_list4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_SEQUENCE4resok (XDR* xdrs, CB_SEQUENCE4resok* objp)
+{
+ if (!xdr_sessionid4 (xdrs, objp->csr_sessionid))
+ {
+ return FALSE;
+ }
+ if (!xdr_sequenceid4 (xdrs, &objp->csr_sequenceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->csr_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->csr_highest_slotid))
+ {
+ return FALSE;
+ }
+ if (!xdr_slotid4 (xdrs, &objp->csr_target_highest_slotid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_SEQUENCE4res (XDR* xdrs, CB_SEQUENCE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->csr_status))
+ {
+ return FALSE;
+ }
+ switch (objp->csr_status)
+ {
+ case NFS4_OK:
+ if (!xdr_CB_SEQUENCE4resok (xdrs, &objp->CB_SEQUENCE4res_u.csr_resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_WANTS_CANCELLED4args (XDR* xdrs, CB_WANTS_CANCELLED4args* objp)
+{
+ if (!xdr_bool (xdrs, &objp->cwca_contended_wants_cancelled))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->cwca_resourced_wants_cancelled))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_WANTS_CANCELLED4res (XDR* xdrs, CB_WANTS_CANCELLED4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->cwcr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_NOTIFY_LOCK4args (XDR* xdrs, CB_NOTIFY_LOCK4args* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->cnla_fh))
+ {
+ return FALSE;
+ }
+ if (!xdr_lock_owner4 (xdrs, &objp->cnla_lock_owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_NOTIFY_LOCK4res (XDR* xdrs, CB_NOTIFY_LOCK4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->cnlr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_deviceid_type4 (XDR* xdrs, notify_deviceid_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_deviceid_delete4 (XDR* xdrs, notify_deviceid_delete4* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->ndd_layouttype))
+ {
+ return FALSE;
+ }
+ if (!xdr_deviceid4 (xdrs, objp->ndd_deviceid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notify_deviceid_change4 (XDR* xdrs, notify_deviceid_change4* objp)
+{
+ if (!xdr_layouttype4 (xdrs, &objp->ndc_layouttype))
+ {
+ return FALSE;
+ }
+ if (!xdr_deviceid4 (xdrs, objp->ndc_deviceid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->ndc_immediate))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_NOTIFY_DEVICEID4args (XDR* xdrs, CB_NOTIFY_DEVICEID4args* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->cnda_changes.cnda_changes_val, (u_int*) &objp->cnda_changes.cnda_changes_len, ~0,
+ sizeof (notify4), (xdrproc_t) xdr_notify4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_NOTIFY_DEVICEID4res (XDR* xdrs, CB_NOTIFY_DEVICEID4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->cndr_status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* Callback operations new to NFSv4.1 */
+
+bool_t
+xdr_nfs_cb_opnum4 (XDR* xdrs, nfs_cb_opnum4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_cb_argop4 (XDR* xdrs, nfs_cb_argop4* objp)
+{
+ if (!xdr_u_int (xdrs, &objp->argop))
+ {
+ return FALSE;
+ }
+ switch (objp->argop)
+ {
+ case OP_CB_GETATTR:
+ if (!xdr_CB_GETATTR4args (xdrs, &objp->nfs_cb_argop4_u.opcbgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL:
+ if (!xdr_CB_RECALL4args (xdrs, &objp->nfs_cb_argop4_u.opcbrecall))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_LAYOUTRECALL:
+ if (!xdr_CB_LAYOUTRECALL4args (xdrs, &objp->nfs_cb_argop4_u.opcblayoutrecall))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_NOTIFY:
+ if (!xdr_CB_NOTIFY4args (xdrs, &objp->nfs_cb_argop4_u.opcbnotify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_PUSH_DELEG:
+ if (!xdr_CB_PUSH_DELEG4args (xdrs, &objp->nfs_cb_argop4_u.opcbpush_deleg))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL_ANY:
+ if (!xdr_CB_RECALL_ANY4args (xdrs, &objp->nfs_cb_argop4_u.opcbrecall_any))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALLABLE_OBJ_AVAIL:
+ if (!xdr_CB_RECALLABLE_OBJ_AVAIL4args (xdrs, &objp->nfs_cb_argop4_u.opcbrecallable_obj_avail))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL_SLOT:
+ if (!xdr_CB_RECALL_SLOT4args (xdrs, &objp->nfs_cb_argop4_u.opcbrecall_slot))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_SEQUENCE:
+ if (!xdr_CB_SEQUENCE4args (xdrs, &objp->nfs_cb_argop4_u.opcbsequence))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_WANTS_CANCELLED:
+ if (!xdr_CB_WANTS_CANCELLED4args (xdrs, &objp->nfs_cb_argop4_u.opcbwants_cancelled))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_NOTIFY_LOCK:
+ if (!xdr_CB_NOTIFY_LOCK4args (xdrs, &objp->nfs_cb_argop4_u.opcbnotify_lock))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_NOTIFY_DEVICEID:
+ if (!xdr_CB_NOTIFY_DEVICEID4args (xdrs, &objp->nfs_cb_argop4_u.opcbnotify_deviceid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_ILLEGAL:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_cb_resop4 (XDR* xdrs, nfs_cb_resop4* objp)
+{
+ if (!xdr_u_int (xdrs, &objp->resop))
+ {
+ return FALSE;
+ }
+ switch (objp->resop)
+ {
+ case OP_CB_GETATTR:
+ if (!xdr_CB_GETATTR4res (xdrs, &objp->nfs_cb_resop4_u.opcbgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL:
+ if (!xdr_CB_RECALL4res (xdrs, &objp->nfs_cb_resop4_u.opcbrecall))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_LAYOUTRECALL:
+ if (!xdr_CB_LAYOUTRECALL4res (xdrs, &objp->nfs_cb_resop4_u.opcblayoutrecall))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_NOTIFY:
+ if (!xdr_CB_NOTIFY4res (xdrs, &objp->nfs_cb_resop4_u.opcbnotify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_PUSH_DELEG:
+ if (!xdr_CB_PUSH_DELEG4res (xdrs, &objp->nfs_cb_resop4_u.opcbpush_deleg))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL_ANY:
+ if (!xdr_CB_RECALL_ANY4res (xdrs, &objp->nfs_cb_resop4_u.opcbrecall_any))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALLABLE_OBJ_AVAIL:
+ if (!xdr_CB_RECALLABLE_OBJ_AVAIL4res (xdrs, &objp->nfs_cb_resop4_u.opcbrecallable_obj_avail))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL_SLOT:
+ if (!xdr_CB_RECALL_SLOT4res (xdrs, &objp->nfs_cb_resop4_u.opcbrecall_slot))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_SEQUENCE:
+ if (!xdr_CB_SEQUENCE4res (xdrs, &objp->nfs_cb_resop4_u.opcbsequence))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_WANTS_CANCELLED:
+ if (!xdr_CB_WANTS_CANCELLED4res (xdrs, &objp->nfs_cb_resop4_u.opcbwants_cancelled))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_NOTIFY_LOCK:
+ if (!xdr_CB_NOTIFY_LOCK4res (xdrs, &objp->nfs_cb_resop4_u.opcbnotify_lock))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_NOTIFY_DEVICEID:
+ if (!xdr_CB_NOTIFY_DEVICEID4res (xdrs, &objp->nfs_cb_resop4_u.opcbnotify_deviceid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_ILLEGAL:
+ if (!xdr_CB_ILLEGAL4res (xdrs, &objp->nfs_cb_resop4_u.opcbillegal))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_COMPOUND4args (XDR* xdrs, CB_COMPOUND4args* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->minorversion))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->callback_ident))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->argarray.argarray_val, (u_int*) &objp->argarray.argarray_len, ~0,
+ sizeof (nfs_cb_argop4), (xdrproc_t) xdr_nfs_cb_argop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_COMPOUND4res (XDR* xdrs, CB_COMPOUND4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->resarray.resarray_val, (u_int*) &objp->resarray.resarray_len, ~0,
+ sizeof (nfs_cb_resop4), (xdrproc_t) xdr_nfs_cb_resop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+} // namespace NFS41
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
diff --git a/src/protocols/nfs4/nfs41_utils.h b/src/protocols/nfs4/nfs41_utils.h
new file mode 100644
index 0000000..77c42ea
--- /dev/null
+++ b/src/protocols/nfs4/nfs41_utils.h
@@ -0,0 +1,629 @@
+//------------------------------------------------------------------------------
+// Author: Alexey Costroma
+// Description: Helpers for parsing NFS structures.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef NFS41_UTILS_H
+#define NFS41_UTILS_H
+//------------------------------------------------------------------------------
+#include <ostream>
+
+#include "api/nfs_types.h"
+#include "api/nfs41_types_rpcgen.h"
+#include "protocols/nfs/nfs_utils.h"
+#include "protocols/rpc/rpc_header.h"
+//------------------------------------------------------------------------------
+namespace NST
+{
+namespace protocols
+{
+namespace NFS41
+{
+
+namespace NFS41 = NST::API::NFS41;
+
+using ProcEnumNFS41 = API::ProcEnumNFS41;
+
+using Validator = rpc::RPCProgramValidator
+ <
+ 100003, // SunRPC/NFS program
+ 4, // v4
+ ProcEnumNFS41::NFS_NULL, // NFSPROC41RPCGEN_NULL (0)
+ ProcEnumNFS41::COMPOUND // NFSPROC41RPCGEN_COMPOUND (1)
+ >;
+
+bool_t xdr_nfs_ftype4 (XDR *, NFS41::nfs_ftype4*);
+bool_t xdr_nfsstat4 (XDR *, NFS41::nfsstat4*);
+bool_t xdr_attrlist4 (XDR *, NFS41::attrlist4*);
+bool_t xdr_bitmap4 (XDR *, NFS41::bitmap4*);
+bool_t xdr_changeid4 (XDR *, NFS41::changeid4*);
+bool_t xdr_clientid4 (XDR *, NFS41::clientid4*);
+bool_t xdr_count4 (XDR *, NFS41::count4*);
+bool_t xdr_length4 (XDR *, NFS41::length4*);
+bool_t xdr_mode4 (XDR *, NFS41::mode4*);
+bool_t xdr_nfs_cookie4 (XDR *, NFS41::nfs_cookie4*);
+bool_t xdr_nfs_fh4 (XDR *, NFS41::nfs_fh4*);
+bool_t xdr_offset4 (XDR *, NFS41::offset4*);
+bool_t xdr_qop4 (XDR *, NFS41::qop4*);
+bool_t xdr_sec_oid4 (XDR *, NFS41::sec_oid4*);
+bool_t xdr_sequenceid4 (XDR *, NFS41::sequenceid4*);
+bool_t xdr_seqid4 (XDR *, NFS41::seqid4*);
+bool_t xdr_sessionid4 (XDR *, NFS41::sessionid4);
+bool_t xdr_slotid4 (XDR *, NFS41::slotid4*);
+bool_t xdr_utf8string (XDR *, NFS41::utf8string*);
+bool_t xdr_utf8str_cis (XDR *, NFS41::utf8str_cis*);
+bool_t xdr_utf8str_cs (XDR *, NFS41::utf8str_cs*);
+bool_t xdr_utf8str_mixed (XDR *, NFS41::utf8str_mixed*);
+bool_t xdr_component4 (XDR *, NFS41::component4*);
+bool_t xdr_linktext4 (XDR *, NFS41::linktext4*);
+bool_t xdr_pathname4 (XDR *, NFS41::pathname4*);
+bool_t xdr_verifier4 (XDR *, NFS41::verifier4);
+bool_t xdr_nfstime4 (XDR *, NFS41::nfstime4*);
+bool_t xdr_time_how4 (XDR *, NFS41::time_how4*);
+bool_t xdr_settime4 (XDR *, NFS41::settime4*);
+bool_t xdr_nfs_lease4 (XDR *, NFS41::nfs_lease4*);
+bool_t xdr_fsid4 (XDR *, NFS41::fsid4*);
+bool_t xdr_change_policy4 (XDR *, NFS41::change_policy4*);
+bool_t xdr_fs_location4 (XDR *, NFS41::fs_location4*);
+bool_t xdr_fs_locations4 (XDR *, NFS41::fs_locations4*);
+bool_t xdr_acetype4 (XDR *, NFS41::acetype4*);
+bool_t xdr_aceflag4 (XDR *, NFS41::aceflag4*);
+bool_t xdr_acemask4 (XDR *, NFS41::acemask4*);
+bool_t xdr_nfsace4 (XDR *, NFS41::nfsace4*);
+bool_t xdr_aclflag4 (XDR *, NFS41::aclflag4*);
+bool_t xdr_nfsacl41 (XDR *, NFS41::nfsacl41*);
+bool_t xdr_mode_masked4 (XDR *, NFS41::mode_masked4*);
+bool_t xdr_specdata4 (XDR *, NFS41::specdata4*);
+bool_t xdr_netaddr4 (XDR *, NFS41::netaddr4*);
+bool_t xdr_nfs_impl_id4 (XDR *, NFS41::nfs_impl_id4*);
+bool_t xdr_stateid4 (XDR *, NFS41::stateid4*);
+bool_t xdr_layouttype4 (XDR *, NFS41::layouttype4*);
+bool_t xdr_layout_content4 (XDR *, NFS41::layout_content4*);
+bool_t xdr_layouthint4 (XDR *, NFS41::layouthint4*);
+bool_t xdr_layoutiomode4 (XDR *, NFS41::layoutiomode4*);
+bool_t xdr_layout4 (XDR *, NFS41::layout4*);
+bool_t xdr_deviceid4 (XDR *, NFS41::deviceid4);
+bool_t xdr_device_addr4 (XDR *, NFS41::device_addr4*);
+bool_t xdr_layoutupdate4 (XDR *, NFS41::layoutupdate4*);
+bool_t xdr_layoutreturn_type4 (XDR *, NFS41::layoutreturn_type4*);
+bool_t xdr_layoutreturn_file4 (XDR *, NFS41::layoutreturn_file4*);
+bool_t xdr_layoutreturn4 (XDR *, NFS41::layoutreturn4*);
+bool_t xdr_fs4_status_type (XDR *, NFS41::fs4_status_type*);
+bool_t xdr_fs4_status (XDR *, NFS41::fs4_status*);
+bool_t xdr_threshold4_read_size (XDR *, NFS41::threshold4_read_size*);
+bool_t xdr_threshold4_write_size (XDR *, NFS41::threshold4_write_size*);
+bool_t xdr_threshold4_read_iosize (XDR *, NFS41::threshold4_read_iosize*);
+bool_t xdr_threshold4_write_iosize (XDR *, NFS41::threshold4_write_iosize*);
+bool_t xdr_threshold_item4 (XDR *, NFS41::threshold_item4*);
+bool_t xdr_mdsthreshold4 (XDR *, NFS41::mdsthreshold4*);
+bool_t xdr_retention_get4 (XDR *, NFS41::retention_get4*);
+bool_t xdr_retention_set4 (XDR *, NFS41::retention_set4*);
+bool_t xdr_fs_charset_cap4 (XDR *, NFS41::fs_charset_cap4*);
+bool_t xdr_fattr4_supported_attrs (XDR *, NFS41::fattr4_supported_attrs*);
+bool_t xdr_fattr4_type (XDR *, NFS41::fattr4_type*);
+bool_t xdr_fattr4_fh_expire_type (XDR *, NFS41::fattr4_fh_expire_type*);
+bool_t xdr_fattr4_change (XDR *, NFS41::fattr4_change*);
+bool_t xdr_fattr4_size (XDR *, NFS41::fattr4_size*);
+bool_t xdr_fattr4_link_support (XDR *, NFS41::fattr4_link_support*);
+bool_t xdr_fattr4_symlink_support (XDR *, NFS41::fattr4_symlink_support*);
+bool_t xdr_fattr4_named_attr (XDR *, NFS41::fattr4_named_attr*);
+bool_t xdr_fattr4_fsid (XDR *, NFS41::fattr4_fsid*);
+bool_t xdr_fattr4_unique_handles (XDR *, NFS41::fattr4_unique_handles*);
+bool_t xdr_fattr4_lease_time (XDR *, NFS41::fattr4_lease_time*);
+bool_t xdr_fattr4_rdattr_error (XDR *, NFS41::fattr4_rdattr_error*);
+bool_t xdr_fattr4_acl (XDR *, NFS41::fattr4_acl*);
+bool_t xdr_fattr4_aclsupport (XDR *, NFS41::fattr4_aclsupport*);
+bool_t xdr_fattr4_archive (XDR *, NFS41::fattr4_archive*);
+bool_t xdr_fattr4_cansettime (XDR *, NFS41::fattr4_cansettime*);
+bool_t xdr_fattr4_case_insensitive (XDR *, NFS41::fattr4_case_insensitive*);
+bool_t xdr_fattr4_case_preserving (XDR *, NFS41::fattr4_case_preserving*);
+bool_t xdr_fattr4_chown_restricted (XDR *, NFS41::fattr4_chown_restricted*);
+bool_t xdr_fattr4_fileid (XDR *, NFS41::fattr4_fileid*);
+bool_t xdr_fattr4_files_avail (XDR *, NFS41::fattr4_files_avail*);
+bool_t xdr_fattr4_filehandle (XDR *, NFS41::fattr4_filehandle*);
+bool_t xdr_fattr4_files_free (XDR *, NFS41::fattr4_files_free*);
+bool_t xdr_fattr4_files_total (XDR *, NFS41::fattr4_files_total*);
+bool_t xdr_fattr4_fs_locations (XDR *, NFS41::fattr4_fs_locations*);
+bool_t xdr_fattr4_hidden (XDR *, NFS41::fattr4_hidden*);
+bool_t xdr_fattr4_homogeneous (XDR *, NFS41::fattr4_homogeneous*);
+bool_t xdr_fattr4_maxfilesize (XDR *, NFS41::fattr4_maxfilesize*);
+bool_t xdr_fattr4_maxlink (XDR *, NFS41::fattr4_maxlink*);
+bool_t xdr_fattr4_maxname (XDR *, NFS41::fattr4_maxname*);
+bool_t xdr_fattr4_maxread (XDR *, NFS41::fattr4_maxread*);
+bool_t xdr_fattr4_maxwrite (XDR *, NFS41::fattr4_maxwrite*);
+bool_t xdr_fattr4_mimetype (XDR *, NFS41::fattr4_mimetype*);
+bool_t xdr_fattr4_mode (XDR *, NFS41::fattr4_mode*);
+bool_t xdr_fattr4_mode_set_masked (XDR *, NFS41::fattr4_mode_set_masked*);
+bool_t xdr_fattr4_mounted_on_fileid (XDR *, NFS41::fattr4_mounted_on_fileid*);
+bool_t xdr_fattr4_no_trunc (XDR *, NFS41::fattr4_no_trunc*);
+bool_t xdr_fattr4_numlinks (XDR *, NFS41::fattr4_numlinks*);
+bool_t xdr_fattr4_owner (XDR *, NFS41::fattr4_owner*);
+bool_t xdr_fattr4_owner_group (XDR *, NFS41::fattr4_owner_group*);
+bool_t xdr_fattr4_quota_avail_hard (XDR *, NFS41::fattr4_quota_avail_hard*);
+bool_t xdr_fattr4_quota_avail_soft (XDR *, NFS41::fattr4_quota_avail_soft*);
+bool_t xdr_fattr4_quota_used (XDR *, NFS41::fattr4_quota_used*);
+bool_t xdr_fattr4_rawdev (XDR *, NFS41::fattr4_rawdev*);
+bool_t xdr_fattr4_space_avail (XDR *, NFS41::fattr4_space_avail*);
+bool_t xdr_fattr4_space_free (XDR *, NFS41::fattr4_space_free*);
+bool_t xdr_fattr4_space_total (XDR *, NFS41::fattr4_space_total*);
+bool_t xdr_fattr4_space_used (XDR *, NFS41::fattr4_space_used*);
+bool_t xdr_fattr4_system (XDR *, NFS41::fattr4_system*);
+bool_t xdr_fattr4_time_access (XDR *, NFS41::fattr4_time_access*);
+bool_t xdr_fattr4_time_access_set (XDR *, NFS41::fattr4_time_access_set*);
+bool_t xdr_fattr4_time_backup (XDR *, NFS41::fattr4_time_backup*);
+bool_t xdr_fattr4_time_create (XDR *, NFS41::fattr4_time_create*);
+bool_t xdr_fattr4_time_delta (XDR *, NFS41::fattr4_time_delta*);
+bool_t xdr_fattr4_time_metadata (XDR *, NFS41::fattr4_time_metadata*);
+bool_t xdr_fattr4_time_modify (XDR *, NFS41::fattr4_time_modify*);
+bool_t xdr_fattr4_time_modify_set (XDR *, NFS41::fattr4_time_modify_set*);
+bool_t xdr_fattr4_suppattr_exclcreat (XDR *, NFS41::fattr4_suppattr_exclcreat*);
+bool_t xdr_fattr4_dir_notif_delay (XDR *, NFS41::fattr4_dir_notif_delay*);
+bool_t xdr_fattr4_dirent_notif_delay (XDR *, NFS41::fattr4_dirent_notif_delay*);
+bool_t xdr_fattr4_fs_layout_types (XDR *, NFS41::fattr4_fs_layout_types*);
+bool_t xdr_fattr4_fs_status (XDR *, NFS41::fattr4_fs_status*);
+bool_t xdr_fattr4_fs_charset_cap (XDR *, NFS41::fattr4_fs_charset_cap*);
+bool_t xdr_fattr4_layout_alignment (XDR *, NFS41::fattr4_layout_alignment*);
+bool_t xdr_fattr4_layout_blksize (XDR *, NFS41::fattr4_layout_blksize*);
+bool_t xdr_fattr4_layout_hint (XDR *, NFS41::fattr4_layout_hint*);
+bool_t xdr_fattr4_layout_types (XDR *, NFS41::fattr4_layout_types*);
+bool_t xdr_fattr4_mdsthreshold (XDR *, NFS41::fattr4_mdsthreshold*);
+bool_t xdr_fattr4_retention_get (XDR *, NFS41::fattr4_retention_get*);
+bool_t xdr_fattr4_retention_set (XDR *, NFS41::fattr4_retention_set*);
+bool_t xdr_fattr4_retentevt_get (XDR *, NFS41::fattr4_retentevt_get*);
+bool_t xdr_fattr4_retentevt_set (XDR *, NFS41::fattr4_retentevt_set*);
+bool_t xdr_fattr4_retention_hold (XDR *, NFS41::fattr4_retention_hold*);
+bool_t xdr_fattr4_dacl (XDR *, NFS41::fattr4_dacl*);
+bool_t xdr_fattr4_sacl (XDR *, NFS41::fattr4_sacl*);
+bool_t xdr_fattr4_change_policy (XDR *, NFS41::fattr4_change_policy*);
+bool_t xdr_fattr4 (XDR *, NFS41::fattr4*);
+bool_t xdr_change_info4 (XDR *, NFS41::change_info4*);
+bool_t xdr_clientaddr4 (XDR *, NFS41::clientaddr4*);
+bool_t xdr_cb_client4 (XDR *, NFS41::cb_client4*);
+bool_t xdr_nfs_client_id4 (XDR *, NFS41::nfs_client_id4*);
+bool_t xdr_client_owner4 (XDR *, NFS41::client_owner4*);
+bool_t xdr_server_owner4 (XDR *, NFS41::server_owner4*);
+bool_t xdr_state_owner4 (XDR *, NFS41::state_owner4*);
+bool_t xdr_open_owner4 (XDR *, NFS41::open_owner4*);
+bool_t xdr_lock_owner4 (XDR *, NFS41::lock_owner4*);
+bool_t xdr_nfs_lock_type4 (XDR *, NFS41::nfs_lock_type4*);
+bool_t xdr_ssv_subkey4 (XDR *, NFS41::ssv_subkey4*);
+bool_t xdr_ssv_mic_plain_tkn4 (XDR *, NFS41::ssv_mic_plain_tkn4*);
+bool_t xdr_ssv_mic_tkn4 (XDR *, NFS41::ssv_mic_tkn4*);
+bool_t xdr_ssv_seal_plain_tkn4 (XDR *, NFS41::ssv_seal_plain_tkn4*);
+bool_t xdr_ssv_seal_cipher_tkn4 (XDR *, NFS41::ssv_seal_cipher_tkn4*);
+bool_t xdr_fs_locations_server4 (XDR *, NFS41::fs_locations_server4*);
+bool_t xdr_fs_locations_item4 (XDR *, NFS41::fs_locations_item4*);
+bool_t xdr_fs_locations_info4 (XDR *, NFS41::fs_locations_info4*);
+bool_t xdr_fattr4_fs_locations_info (XDR *, NFS41::fattr4_fs_locations_info*);
+bool_t xdr_nfl_util4 (XDR *, NFS41::nfl_util4*);
+bool_t xdr_filelayout_hint_care4 (XDR *, NFS41::filelayout_hint_care4*);
+bool_t xdr_nfsv4_1_file_layouthint4 (XDR *, NFS41::nfsv4_1_file_layouthint4*);
+bool_t xdr_multipath_list4 (XDR *, NFS41::multipath_list4*);
+bool_t xdr_nfsv4_1_file_layout_ds_addr4 (XDR *, NFS41::nfsv4_1_file_layout_ds_addr4*);
+bool_t xdr_nfsv4_1_file_layout4 (XDR *, NFS41::nfsv4_1_file_layout4*);
+bool_t xdr_NULL4args (XDR *, NFS41::NULL4args*); // for compatibility
+bool_t xdr_NULL4res (XDR *, NFS41::NULL4res*); // for compatibility
+bool_t xdr_ACCESS4args (XDR *, NFS41::ACCESS4args*);
+bool_t xdr_ACCESS4resok (XDR *, NFS41::ACCESS4resok*);
+bool_t xdr_ACCESS4res (XDR *, NFS41::ACCESS4res*);
+bool_t xdr_CLOSE4args (XDR *, NFS41::CLOSE4args*);
+bool_t xdr_CLOSE4res (XDR *, NFS41::CLOSE4res*);
+bool_t xdr_COMMIT4args (XDR *, NFS41::COMMIT4args*);
+bool_t xdr_COMMIT4resok (XDR *, NFS41::COMMIT4resok*);
+bool_t xdr_COMMIT4res (XDR *, NFS41::COMMIT4res*);
+bool_t xdr_createtype4 (XDR *, NFS41::createtype4*);
+bool_t xdr_CREATE4args (XDR *, NFS41::CREATE4args*);
+bool_t xdr_CREATE4resok (XDR *, NFS41::CREATE4resok*);
+bool_t xdr_CREATE4res (XDR *, NFS41::CREATE4res*);
+bool_t xdr_DELEGPURGE4args (XDR *, NFS41::DELEGPURGE4args*);
+bool_t xdr_DELEGPURGE4res (XDR *, NFS41::DELEGPURGE4res*);
+bool_t xdr_DELEGRETURN4args (XDR *, NFS41::DELEGRETURN4args*);
+bool_t xdr_DELEGRETURN4res (XDR *, NFS41::DELEGRETURN4res*);
+bool_t xdr_GETATTR4args (XDR *, NFS41::GETATTR4args*);
+bool_t xdr_GETATTR4resok (XDR *, NFS41::GETATTR4resok*);
+bool_t xdr_GETATTR4res (XDR *, NFS41::GETATTR4res*);
+bool_t xdr_GETFH4resok (XDR *, NFS41::GETFH4resok*);
+bool_t xdr_GETFH4res (XDR *, NFS41::GETFH4res*);
+bool_t xdr_LINK4args (XDR *, NFS41::LINK4args*);
+bool_t xdr_LINK4resok (XDR *, NFS41::LINK4resok*);
+bool_t xdr_LINK4res (XDR *, NFS41::LINK4res*);
+bool_t xdr_open_to_lock_owner4 (XDR *, NFS41::open_to_lock_owner4*);
+bool_t xdr_exist_lock_owner4 (XDR *, NFS41::exist_lock_owner4*);
+bool_t xdr_locker4 (XDR *, NFS41::locker4*);
+bool_t xdr_LOCK4args (XDR *, NFS41::LOCK4args*);
+bool_t xdr_LOCK4denied (XDR *, NFS41::LOCK4denied*);
+bool_t xdr_LOCK4resok (XDR *, NFS41::LOCK4resok*);
+bool_t xdr_LOCK4res (XDR *, NFS41::LOCK4res*);
+bool_t xdr_LOCKT4args (XDR *, NFS41::LOCKT4args*);
+bool_t xdr_LOCKT4res (XDR *, NFS41::LOCKT4res*);
+bool_t xdr_LOCKU4args (XDR *, NFS41::LOCKU4args*);
+bool_t xdr_LOCKU4res (XDR *, NFS41::LOCKU4res*);
+bool_t xdr_LOOKUP4args (XDR *, NFS41::LOOKUP4args*);
+bool_t xdr_LOOKUP4res (XDR *, NFS41::LOOKUP4res*);
+bool_t xdr_LOOKUPP4res (XDR *, NFS41::LOOKUPP4res*);
+bool_t xdr_NVERIFY4args (XDR *, NFS41::NVERIFY4args*);
+bool_t xdr_NVERIFY4res (XDR *, NFS41::NVERIFY4res*);
+bool_t xdr_createmode4 (XDR *, NFS41::createmode4*);
+bool_t xdr_creatverfattr (XDR *, NFS41::creatverfattr*);
+bool_t xdr_createhow4 (XDR *, NFS41::createhow4*);
+bool_t xdr_opentype4 (XDR *, NFS41::opentype4*);
+bool_t xdr_openflag4 (XDR *, NFS41::openflag4*);
+bool_t xdr_limit_by4 (XDR *, NFS41::limit_by4*);
+bool_t xdr_nfs_modified_limit4 (XDR *, NFS41::nfs_modified_limit4*);
+bool_t xdr_nfs_space_limit4 (XDR *, NFS41::nfs_space_limit4*);
+bool_t xdr_open_delegation_type4 (XDR *, NFS41::open_delegation_type4*);
+bool_t xdr_open_claim_type4 (XDR *, NFS41::open_claim_type4*);
+bool_t xdr_open_claim_delegate_cur4 (XDR *, NFS41::open_claim_delegate_cur4*);
+bool_t xdr_open_claim4 (XDR *, NFS41::open_claim4*);
+bool_t xdr_OPEN4args (XDR *, NFS41::OPEN4args*);
+bool_t xdr_open_read_delegation4 (XDR *, NFS41::open_read_delegation4*);
+bool_t xdr_open_write_delegation4 (XDR *, NFS41::open_write_delegation4*);
+bool_t xdr_why_no_delegation4 (XDR *, NFS41::why_no_delegation4*);
+bool_t xdr_open_none_delegation4 (XDR *, NFS41::open_none_delegation4*);
+bool_t xdr_open_delegation4 (XDR *, NFS41::open_delegation4*);
+bool_t xdr_OPEN4resok (XDR *, NFS41::OPEN4resok*);
+bool_t xdr_OPEN4res (XDR *, NFS41::OPEN4res*);
+bool_t xdr_OPENATTR4args (XDR *, NFS41::OPENATTR4args*);
+bool_t xdr_OPENATTR4res (XDR *, NFS41::OPENATTR4res*);
+bool_t xdr_OPEN_CONFIRM4args (XDR *, NFS41::OPEN_CONFIRM4args*);
+bool_t xdr_OPEN_CONFIRM4resok (XDR *, NFS41::OPEN_CONFIRM4resok*);
+bool_t xdr_OPEN_CONFIRM4res (XDR *, NFS41::OPEN_CONFIRM4res*);
+bool_t xdr_OPEN_DOWNGRADE4args (XDR *, NFS41::OPEN_DOWNGRADE4args*);
+bool_t xdr_OPEN_DOWNGRADE4resok (XDR *, NFS41::OPEN_DOWNGRADE4resok*);
+bool_t xdr_OPEN_DOWNGRADE4res (XDR *, NFS41::OPEN_DOWNGRADE4res*);
+bool_t xdr_PUTFH4args (XDR *, NFS41::PUTFH4args*);
+bool_t xdr_PUTFH4res (XDR *, NFS41::PUTFH4res*);
+bool_t xdr_PUTPUBFH4res (XDR *, NFS41::PUTPUBFH4res*);
+bool_t xdr_PUTROOTFH4res (XDR *, NFS41::PUTROOTFH4res*);
+bool_t xdr_READ4args (XDR *, NFS41::READ4args*);
+bool_t xdr_READ4resok (XDR *, NFS41::READ4resok*);
+bool_t xdr_READ4res (XDR *, NFS41::READ4res*);
+bool_t xdr_READDIR4args (XDR *, NFS41::READDIR4args*);
+bool_t xdr_entry4 (XDR *, NFS41::entry4*);
+bool_t xdr_dirlist4 (XDR *, NFS41::dirlist4*);
+bool_t xdr_READDIR4resok (XDR *, NFS41::READDIR4resok*);
+bool_t xdr_READDIR4res (XDR *, NFS41::READDIR4res*);
+bool_t xdr_READLINK4resok (XDR *, NFS41::READLINK4resok*);
+bool_t xdr_READLINK4res (XDR *, NFS41::READLINK4res*);
+bool_t xdr_REMOVE4args (XDR *, NFS41::REMOVE4args*);
+bool_t xdr_REMOVE4resok (XDR *, NFS41::REMOVE4resok*);
+bool_t xdr_REMOVE4res (XDR *, NFS41::REMOVE4res*);
+bool_t xdr_RENAME4args (XDR *, NFS41::RENAME4args*);
+bool_t xdr_RENAME4resok (XDR *, NFS41::RENAME4resok*);
+bool_t xdr_RENAME4res (XDR *, NFS41::RENAME4res*);
+bool_t xdr_RENEW4args (XDR *, NFS41::RENEW4args*);
+bool_t xdr_RENEW4res (XDR *, NFS41::RENEW4res*);
+bool_t xdr_RESTOREFH4res (XDR *, NFS41::RESTOREFH4res*);
+bool_t xdr_SAVEFH4res (XDR *, NFS41::SAVEFH4res*);
+bool_t xdr_SECINFO4args (XDR *, NFS41::SECINFO4args*);
+bool_t xdr_rpc_gss_svc_t (XDR *, NFS41::rpc_gss_svc_t*);
+bool_t xdr_rpcsec_gss_info (XDR *, NFS41::rpcsec_gss_info*);
+bool_t xdr_secinfo4 (XDR *, NFS41::secinfo4*);
+bool_t xdr_SECINFO4resok (XDR *, NFS41::SECINFO4resok*);
+bool_t xdr_SECINFO4res (XDR *, NFS41::SECINFO4res*);
+bool_t xdr_SETATTR4args (XDR *, NFS41::SETATTR4args*);
+bool_t xdr_SETATTR4res (XDR *, NFS41::SETATTR4res*);
+bool_t xdr_SETCLIENTID4args (XDR *, NFS41::SETCLIENTID4args*);
+bool_t xdr_SETCLIENTID4resok (XDR *, NFS41::SETCLIENTID4resok*);
+bool_t xdr_SETCLIENTID4res (XDR *, NFS41::SETCLIENTID4res*);
+bool_t xdr_SETCLIENTID_CONFIRM4args (XDR *, NFS41::SETCLIENTID_CONFIRM4args*);
+bool_t xdr_SETCLIENTID_CONFIRM4res (XDR *, NFS41::SETCLIENTID_CONFIRM4res*);
+bool_t xdr_VERIFY4args (XDR *, NFS41::VERIFY4args*);
+bool_t xdr_VERIFY4res (XDR *, NFS41::VERIFY4res*);
+bool_t xdr_stable_how4 (XDR *, NFS41::stable_how4*);
+bool_t xdr_WRITE4args (XDR *, NFS41::WRITE4args*);
+bool_t xdr_WRITE4resok (XDR *, NFS41::WRITE4resok*);
+bool_t xdr_WRITE4res (XDR *, NFS41::WRITE4res*);
+bool_t xdr_RELEASE_LOCKOWNER4args (XDR *, NFS41::RELEASE_LOCKOWNER4args*);
+bool_t xdr_RELEASE_LOCKOWNER4res (XDR *, NFS41::RELEASE_LOCKOWNER4res*);
+bool_t xdr_ILLEGAL4res (XDR *, NFS41::ILLEGAL4res*);
+bool_t xdr_gsshandle4_t (XDR *, NFS41::gsshandle4_t*);
+bool_t xdr_gss_cb_handles4 (XDR *, NFS41::gss_cb_handles4*);
+bool_t xdr_callback_sec_parms4 (XDR *, NFS41::callback_sec_parms4*);
+bool_t xdr_BACKCHANNEL_CTL4args (XDR *, NFS41::BACKCHANNEL_CTL4args*);
+bool_t xdr_BACKCHANNEL_CTL4res (XDR *, NFS41::BACKCHANNEL_CTL4res*);
+bool_t xdr_channel_dir_from_client4 (XDR *, NFS41::channel_dir_from_client4*);
+bool_t xdr_BIND_CONN_TO_SESSION4args (XDR *, NFS41::BIND_CONN_TO_SESSION4args*);
+bool_t xdr_channel_dir_from_server4 (XDR *, NFS41::channel_dir_from_server4*);
+bool_t xdr_BIND_CONN_TO_SESSION4resok (XDR *, NFS41::BIND_CONN_TO_SESSION4resok*);
+bool_t xdr_BIND_CONN_TO_SESSION4res (XDR *, NFS41::BIND_CONN_TO_SESSION4res*);
+bool_t xdr_state_protect_ops4 (XDR *, NFS41::state_protect_ops4*);
+bool_t xdr_ssv_sp_parms4 (XDR *, NFS41::ssv_sp_parms4*);
+bool_t xdr_state_protect_how4 (XDR *, NFS41::state_protect_how4*);
+bool_t xdr_state_protect4_a (XDR *, NFS41::state_protect4_a*);
+bool_t xdr_EXCHANGE_ID4args (XDR *, NFS41::EXCHANGE_ID4args*);
+bool_t xdr_ssv_prot_info4 (XDR *, NFS41::ssv_prot_info4*);
+bool_t xdr_state_protect4_r (XDR *, NFS41::state_protect4_r*);
+bool_t xdr_EXCHANGE_ID4resok (XDR *, NFS41::EXCHANGE_ID4resok*);
+bool_t xdr_EXCHANGE_ID4res (XDR *, NFS41::EXCHANGE_ID4res*);
+bool_t xdr_channel_attrs4 (XDR *, NFS41::channel_attrs4*);
+bool_t xdr_CREATE_SESSION4args (XDR *, NFS41::CREATE_SESSION4args*);
+bool_t xdr_CREATE_SESSION4resok (XDR *, NFS41::CREATE_SESSION4resok*);
+bool_t xdr_CREATE_SESSION4res (XDR *, NFS41::CREATE_SESSION4res*);
+bool_t xdr_DESTROY_SESSION4args (XDR *, NFS41::DESTROY_SESSION4args*);
+bool_t xdr_DESTROY_SESSION4res (XDR *, NFS41::DESTROY_SESSION4res*);
+bool_t xdr_FREE_STATEID4args (XDR *, NFS41::FREE_STATEID4args*);
+bool_t xdr_FREE_STATEID4res (XDR *, NFS41::FREE_STATEID4res*);
+bool_t xdr_attr_notice4 (XDR *, NFS41::attr_notice4*);
+bool_t xdr_GET_DIR_DELEGATION4args (XDR *, NFS41::GET_DIR_DELEGATION4args*);
+bool_t xdr_GET_DIR_DELEGATION4resok (XDR *, NFS41::GET_DIR_DELEGATION4resok*);
+bool_t xdr_gddrnf4_status (XDR *, NFS41::gddrnf4_status*);
+bool_t xdr_GET_DIR_DELEGATION4res_non_fatal (XDR *, NFS41::GET_DIR_DELEGATION4res_non_fatal*);
+bool_t xdr_GET_DIR_DELEGATION4res (XDR *, NFS41::GET_DIR_DELEGATION4res*);
+bool_t xdr_GETDEVICEINFO4args (XDR *, NFS41::GETDEVICEINFO4args*);
+bool_t xdr_GETDEVICEINFO4resok (XDR *, NFS41::GETDEVICEINFO4resok*);
+bool_t xdr_GETDEVICEINFO4res (XDR *, NFS41::GETDEVICEINFO4res*);
+bool_t xdr_GETDEVICELIST4args (XDR *, NFS41::GETDEVICELIST4args*);
+bool_t xdr_GETDEVICELIST4resok (XDR *, NFS41::GETDEVICELIST4resok*);
+bool_t xdr_GETDEVICELIST4res (XDR *, NFS41::GETDEVICELIST4res*);
+bool_t xdr_newtime4 (XDR *, NFS41::newtime4*);
+bool_t xdr_newoffset4 (XDR *, NFS41::newoffset4*);
+bool_t xdr_LAYOUTCOMMIT4args (XDR *, NFS41::LAYOUTCOMMIT4args*);
+bool_t xdr_newsize4 (XDR *, NFS41::newsize4*);
+bool_t xdr_LAYOUTCOMMIT4resok (XDR *, NFS41::LAYOUTCOMMIT4resok*);
+bool_t xdr_LAYOUTCOMMIT4res (XDR *, NFS41::LAYOUTCOMMIT4res*);
+bool_t xdr_LAYOUTGET4args (XDR *, NFS41::LAYOUTGET4args*);
+bool_t xdr_LAYOUTGET4resok (XDR *, NFS41::LAYOUTGET4resok*);
+bool_t xdr_LAYOUTGET4res (XDR *, NFS41::LAYOUTGET4res*);
+bool_t xdr_LAYOUTRETURN4args (XDR *, NFS41::LAYOUTRETURN4args*);
+bool_t xdr_layoutreturn_stateid (XDR *, NFS41::layoutreturn_stateid*);
+bool_t xdr_LAYOUTRETURN4res (XDR *, NFS41::LAYOUTRETURN4res*);
+bool_t xdr_secinfo_style4 (XDR *, NFS41::secinfo_style4*);
+bool_t xdr_SECINFO_NO_NAME4args (XDR *, NFS41::SECINFO_NO_NAME4args*);
+bool_t xdr_SECINFO_NO_NAME4res (XDR *, NFS41::SECINFO_NO_NAME4res*);
+bool_t xdr_SEQUENCE4args (XDR *, NFS41::SEQUENCE4args*);
+bool_t xdr_SEQUENCE4resok (XDR *, NFS41::SEQUENCE4resok*);
+bool_t xdr_SEQUENCE4res (XDR *, NFS41::SEQUENCE4res*);
+bool_t xdr_ssa_digest_input4 (XDR *, NFS41::ssa_digest_input4*);
+bool_t xdr_SET_SSV4args (XDR *, NFS41::SET_SSV4args*);
+bool_t xdr_ssr_digest_input4 (XDR *, NFS41::ssr_digest_input4*);
+bool_t xdr_SET_SSV4resok (XDR *, NFS41::SET_SSV4resok*);
+bool_t xdr_SET_SSV4res (XDR *, NFS41::SET_SSV4res*);
+bool_t xdr_TEST_STATEID4args (XDR *, NFS41::TEST_STATEID4args*);
+bool_t xdr_TEST_STATEID4resok (XDR *, NFS41::TEST_STATEID4resok*);
+bool_t xdr_TEST_STATEID4res (XDR *, NFS41::TEST_STATEID4res*);
+bool_t xdr_deleg_claim4 (XDR *, NFS41::deleg_claim4*);
+bool_t xdr_WANT_DELEGATION4args (XDR *, NFS41::WANT_DELEGATION4args*);
+bool_t xdr_WANT_DELEGATION4res (XDR *, NFS41::WANT_DELEGATION4res*);
+bool_t xdr_DESTROY_CLIENTID4args (XDR *, NFS41::DESTROY_CLIENTID4args*);
+bool_t xdr_DESTROY_CLIENTID4res (XDR *, NFS41::DESTROY_CLIENTID4res*);
+bool_t xdr_RECLAIM_COMPLETE4args (XDR *, NFS41::RECLAIM_COMPLETE4args*);
+bool_t xdr_RECLAIM_COMPLETE4res (XDR *, NFS41::RECLAIM_COMPLETE4res*);
+bool_t xdr_nfs_opnum4 (XDR *, NFS41::nfs_opnum4*);
+bool_t xdr_nfs_argop4 (XDR *, NFS41::nfs_argop4*);
+bool_t xdr_nfs_resop4 (XDR *, NFS41::nfs_resop4*);
+bool_t xdr_COMPOUND4args (XDR *, NFS41::COMPOUND4args*);
+bool_t xdr_COMPOUND4res (XDR *, NFS41::COMPOUND4res*);
+bool_t xdr_CB_GETATTR4args (XDR *, NFS41::CB_GETATTR4args*);
+bool_t xdr_CB_GETATTR4resok (XDR *, NFS41::CB_GETATTR4resok*);
+bool_t xdr_CB_GETATTR4res (XDR *, NFS41::CB_GETATTR4res*);
+bool_t xdr_CB_RECALL4args (XDR *, NFS41::CB_RECALL4args*);
+bool_t xdr_CB_RECALL4res (XDR *, NFS41::CB_RECALL4res*);
+bool_t xdr_CB_ILLEGAL4res (XDR *, NFS41::CB_ILLEGAL4res*);
+bool_t xdr_layoutrecall_type4 (XDR *, NFS41::layoutrecall_type4*);
+bool_t xdr_layoutrecall_file4 (XDR *, NFS41::layoutrecall_file4*);
+bool_t xdr_layoutrecall4 (XDR *, NFS41::layoutrecall4*);
+bool_t xdr_CB_LAYOUTRECALL4args (XDR *, NFS41::CB_LAYOUTRECALL4args*);
+bool_t xdr_CB_LAYOUTRECALL4res (XDR *, NFS41::CB_LAYOUTRECALL4res*);
+bool_t xdr_notify_type4 (XDR *, NFS41::notify_type4*);
+bool_t xdr_notify_entry4 (XDR *, NFS41::notify_entry4*);
+bool_t xdr_prev_entry4 (XDR *, NFS41::prev_entry4*);
+bool_t xdr_notify_remove4 (XDR *, NFS41::notify_remove4*);
+bool_t xdr_notify_add4 (XDR *, NFS41::notify_add4*);
+bool_t xdr_notify_attr4 (XDR *, NFS41::notify_attr4*);
+bool_t xdr_notify_rename4 (XDR *, NFS41::notify_rename4*);
+bool_t xdr_notify_verifier4 (XDR *, NFS41::notify_verifier4*);
+bool_t xdr_notifylist4 (XDR *, NFS41::notifylist4*);
+bool_t xdr_notify4 (XDR *, NFS41::notify4*);
+bool_t xdr_CB_NOTIFY4args (XDR *, NFS41::CB_NOTIFY4args*);
+bool_t xdr_CB_NOTIFY4res (XDR *, NFS41::CB_NOTIFY4res*);
+bool_t xdr_CB_PUSH_DELEG4args (XDR *, NFS41::CB_PUSH_DELEG4args*);
+bool_t xdr_CB_PUSH_DELEG4res (XDR *, NFS41::CB_PUSH_DELEG4res*);
+bool_t xdr_CB_RECALL_ANY4args (XDR *, NFS41::CB_RECALL_ANY4args*);
+bool_t xdr_CB_RECALL_ANY4res (XDR *, NFS41::CB_RECALL_ANY4res*);
+bool_t xdr_CB_RECALLABLE_OBJ_AVAIL4args (XDR *, NFS41::CB_RECALLABLE_OBJ_AVAIL4args*);
+bool_t xdr_CB_RECALLABLE_OBJ_AVAIL4res (XDR *, NFS41::CB_RECALLABLE_OBJ_AVAIL4res*);
+bool_t xdr_CB_RECALL_SLOT4args (XDR *, NFS41::CB_RECALL_SLOT4args*);
+bool_t xdr_CB_RECALL_SLOT4res (XDR *, NFS41::CB_RECALL_SLOT4res*);
+bool_t xdr_referring_call4 (XDR *, NFS41::referring_call4*);
+bool_t xdr_referring_call_list4 (XDR *, NFS41::referring_call_list4*);
+bool_t xdr_CB_SEQUENCE4args (XDR *, NFS41::CB_SEQUENCE4args*);
+bool_t xdr_CB_SEQUENCE4resok (XDR *, NFS41::CB_SEQUENCE4resok*);
+bool_t xdr_CB_SEQUENCE4res (XDR *, NFS41::CB_SEQUENCE4res*);
+bool_t xdr_CB_WANTS_CANCELLED4args (XDR *, NFS41::CB_WANTS_CANCELLED4args*);
+bool_t xdr_CB_WANTS_CANCELLED4res (XDR *, NFS41::CB_WANTS_CANCELLED4res*);
+bool_t xdr_CB_NOTIFY_LOCK4args (XDR *, NFS41::CB_NOTIFY_LOCK4args*);
+bool_t xdr_CB_NOTIFY_LOCK4res (XDR *, NFS41::CB_NOTIFY_LOCK4res*);
+bool_t xdr_notify_deviceid_type4 (XDR *, NFS41::notify_deviceid_type4*);
+bool_t xdr_notify_deviceid_delete4 (XDR *, NFS41::notify_deviceid_delete4*);
+bool_t xdr_notify_deviceid_change4 (XDR *, NFS41::notify_deviceid_change4*);
+bool_t xdr_CB_NOTIFY_DEVICEID4args (XDR *, NFS41::CB_NOTIFY_DEVICEID4args*);
+bool_t xdr_CB_NOTIFY_DEVICEID4res (XDR *, NFS41::CB_NOTIFY_DEVICEID4res*);
+bool_t xdr_nfs_cb_opnum4 (XDR *, NFS41::nfs_cb_opnum4*);
+bool_t xdr_nfs_cb_argop4 (XDR *, NFS41::nfs_cb_argop4*);
+bool_t xdr_nfs_cb_resop4 (XDR *, NFS41::nfs_cb_resop4*);
+bool_t xdr_CB_COMPOUND4args (XDR *, NFS41::CB_COMPOUND4args*);
+bool_t xdr_CB_COMPOUND4res (XDR *, NFS41::CB_COMPOUND4res*);
+
+// Procedure 0: NULL - Do nothing
+inline auto proc_t_of(NFS41::NULL4args&)->decltype(&xdr_NULL4args)
+{
+ return xdr_NULL4args;
+}
+
+inline auto proc_t_of(NFS41::NULL4res&)->decltype(&xdr_NULL4res)
+{
+ return &xdr_NULL4res;
+}
+
+// Procedure 1: COMPOUND
+inline auto proc_t_of(NFS41::COMPOUND4args&)->decltype(&xdr_COMPOUND4args)
+{
+ return &xdr_COMPOUND4args;
+}
+
+inline auto proc_t_of(NFS41::COMPOUND4res&)->decltype(&xdr_COMPOUND4res)
+{
+ return &xdr_COMPOUND4res;
+}
+
+#define NST_PUBLIC __attribute__ ((visibility("default")))
+
+extern"C"
+NST_PUBLIC
+const char* print_nfs41_procedures(const ProcEnumNFS41::NFSProcedure proc);
+
+std::ostream& operator<<(std::ostream& out, const ProcEnumNFS41::NFSProcedure proc);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfs_ftype4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfsstat4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::bitmap4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfs_fh4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::sec_oid4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::utf8string& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::pathname4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfstime4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::time_how4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::settime4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fsid4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fs_location4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fs_locations4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfsace4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::change_policy4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfsacl41& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::mode_masked4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::specdata4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::netaddr4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfs_impl_id4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::stateid4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layouttype4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layout_content4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layouthint4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutiomode4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layout4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::device_addr4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutupdate4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutreturn_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutreturn_file4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutreturn4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fs4_status_type& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fs4_status& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::threshold_item4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::mdsthreshold4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::retention_get4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::retention_set4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fattr4_acl& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fattr4_fs_layout_types& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fattr4_layout_types& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fattr4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::change_info4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::cb_client4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfs_client_id4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::client_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::server_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::state_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfs_lock_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssv_subkey4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssv_mic_plain_tkn4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssv_mic_tkn4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssv_seal_plain_tkn4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssv_seal_cipher_tkn4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fs_locations_server4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fs_locations_item4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::fs_locations_info4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::filelayout_hint_care4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfsv4_1_file_layouthint4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::multipath_list4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfsv4_1_file_layout_ds_addr4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfsv4_1_file_layout4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::createtype4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_to_lock_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::exist_lock_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::locker4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::createmode4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::creatverfattr& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::createhow4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::opentype4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::openflag4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::limit_by4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfs_modified_limit4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::nfs_space_limit4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_delegation_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_claim_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_claim_delegate_cur4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_claim4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_read_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_write_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::why_no_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_none_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::open_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::entry4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::dirlist4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::rpc_gss_svc_t& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::rpcsec_gss_info& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::secinfo4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::stable_how4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::gsshandle4_t& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::gss_cb_handles4& obj);
+std::ostream& operator<<(std::ostream& out, const authunix_parms& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::authsys_parms& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::callback_sec_parms4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::channel_dir_from_client4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::channel_dir_from_server4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::state_protect_ops4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssv_sp_parms4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::state_protect_how4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::state_protect4_a& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssv_prot_info4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::state_protect4_r& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::channel_attrs4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::gddrnf4_status& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::newtime4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::newoffset4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::newsize4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutreturn_stateid& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::secinfo_style4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::SEQUENCE4args& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssa_digest_input4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::ssr_digest_input4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::deleg_claim4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutrecall_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutrecall_file4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::layoutrecall4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_entry4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::prev_entry4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_remove4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_add4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_attr4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_rename4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_verifier4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notifylist4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::referring_call4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::referring_call_list4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_deviceid_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_deviceid_delete4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS41::notify_deviceid_change4& obj);
+
+} // namespace NFS41
+} // namespace protocols
+} // namespace NST
+//------------------------------------------------------------------------------
+#endif//NFS41_UTILS_H
+//------------------------------------------------------------------------------
diff --git a/src/protocols/nfs4/nfs4_rpcgen.cpp b/src/protocols/nfs4/nfs4_rpcgen.cpp
deleted file mode 100644
index 99d2b7e..0000000
--- a/src/protocols/nfs4/nfs4_rpcgen.cpp
+++ /dev/null
@@ -1,2800 +0,0 @@
-//------------------------------------------------------------------------------
-// Author: Alexey Costroma
-// Description: Definition and fill up NFSv4 procedures.
-// Copyright (c) 2014 EPAM Systems
-//------------------------------------------------------------------------------
-/*
- This file is part of Nfstrace.
-
- Nfstrace is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2 of the License.
-
- Nfstrace is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
-*/
-//------------------------------------------------------------------------------
-#include "api/nfs4_types_rpcgen.h"
-//------------------------------------------------------------------------------
-namespace rpcgen
-{
-
-bool_t
-xdr_int32_t (XDR *xdrs, int32_t *objp)
-{
- if (!xdr_int (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_uint32_t (XDR *xdrs, uint32_t *objp)
-{
- if (!xdr_u_int (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_int64_t (XDR *xdrs, int64_t *objp)
-{
- if (!xdr_longlong_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_uint64_t (XDR *xdrs, uint64_t *objp)
-{
- if (!xdr_u_longlong_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_ftype4 (XDR *xdrs, nfs_ftype4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfsstat4 (XDR *xdrs, nfsstat4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_bitmap4 (XDR *xdrs, bitmap4 *objp)
-{
- if (!xdr_array (xdrs, (char **)&objp->bitmap4_val, (u_int *) &objp->bitmap4_len, ~0,
- sizeof (uint32_t), (xdrproc_t) xdr_uint32_t))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_offset4 (XDR *xdrs, offset4 *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_count4 (XDR *xdrs, count4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_length4 (XDR *xdrs, length4 *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_clientid4 (XDR *xdrs, clientid4 *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_seqid4 (XDR *xdrs, seqid4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_utf8string (XDR *xdrs, utf8string *objp)
-{
- if (!xdr_bytes (xdrs, (char **)&objp->utf8string_val, (u_int *) &objp->utf8string_len, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_utf8str_cis (XDR *xdrs, utf8str_cis *objp)
-{
- if (!xdr_utf8string (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_utf8str_cs (XDR *xdrs, utf8str_cs *objp)
-{
- if (!xdr_utf8string (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_utf8str_mixed (XDR *xdrs, utf8str_mixed *objp)
-{
- if (!xdr_utf8string (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_component4 (XDR *xdrs, component4 *objp)
-{
- if (!xdr_utf8str_cs (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_pathname4 (XDR *xdrs, pathname4 *objp)
-{
- if (!xdr_array (xdrs, (char **)&objp->pathname4_val, (u_int *) &objp->pathname4_len, ~0,
- sizeof (component4), (xdrproc_t) xdr_component4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_lockid4 (XDR *xdrs, nfs_lockid4 *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_cookie4 (XDR *xdrs, nfs_cookie4 *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_linktext4 (XDR *xdrs, linktext4 *objp)
-{
- if (!xdr_utf8str_cs (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_sec_oid4 (XDR *xdrs, sec_oid4 *objp)
-{
- if (!xdr_bytes (xdrs, (char **)&objp->sec_oid4_val, (u_int *) &objp->sec_oid4_len, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_qop4 (XDR *xdrs, qop4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_mode4 (XDR *xdrs, mode4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_changeid4 (XDR *xdrs, changeid4 *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_verifier4 (XDR *xdrs, verifier4 objp)
-{
- if (!xdr_opaque (xdrs, objp, NFS4_VERIFIER_SIZE))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfstime4 (XDR *xdrs, nfstime4 *objp)
-{
- if (!rpcgen::xdr_int64_t (xdrs, &objp->seconds))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->nseconds))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_time_how4 (XDR *xdrs, time_how4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_settime4 (XDR *xdrs, settime4 *objp)
-{
- if (!xdr_time_how4 (xdrs, &objp->set_it))
- return FALSE;
- switch (objp->set_it) {
- case SET_TO_CLIENT_TIME4:
- if (!xdr_nfstime4 (xdrs, &objp->settime4_u.time))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_nfs_fh4 (XDR *xdrs, nfs_fh4 *objp)
-{
- if (!xdr_bytes (xdrs, (char **)&objp->nfs_fh4_val, (u_int *) &objp->nfs_fh4_len, NFS4_FHSIZE))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fsid4 (XDR *xdrs, fsid4 *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, &objp->major))
- return FALSE;
- if (!rpcgen::xdr_uint64_t (xdrs, &objp->minor))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fs_location4 (XDR *xdrs, fs_location4 *objp)
-{
- if (!xdr_array (xdrs, (char **)&objp->server.server_val, (u_int *) &objp->server.server_len, ~0,
- sizeof (utf8str_cis), (xdrproc_t) xdr_utf8str_cis))
- return FALSE;
- if (!xdr_pathname4 (xdrs, &objp->rootpath))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fs_locations4 (XDR *xdrs, fs_locations4 *objp)
-{
- if (!xdr_pathname4 (xdrs, &objp->fs_root))
- return FALSE;
- if (!xdr_array (xdrs, (char **)&objp->locations.locations_val, (u_int *) &objp->locations.locations_len, ~0,
- sizeof (fs_location4), (xdrproc_t) xdr_fs_location4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_acetype4 (XDR *xdrs, acetype4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_aceflag4 (XDR *xdrs, aceflag4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_acemask4 (XDR *xdrs, acemask4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfsace4 (XDR *xdrs, nfsace4 *objp)
-{
- if (!xdr_acetype4 (xdrs, &objp->type))
- return FALSE;
- if (!xdr_aceflag4 (xdrs, &objp->flag))
- return FALSE;
- if (!xdr_acemask4 (xdrs, &objp->access_mask))
- return FALSE;
- if (!xdr_utf8str_mixed (xdrs, &objp->who))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_specdata4 (XDR *xdrs, specdata4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->specdata1))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->specdata2))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_supported_attrs (XDR *xdrs, fattr4_supported_attrs *objp)
-{
- if (!xdr_bitmap4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_type (XDR *xdrs, fattr4_type *objp)
-{
- if (!xdr_nfs_ftype4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_fh_expire_type (XDR *xdrs, fattr4_fh_expire_type *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_change (XDR *xdrs, fattr4_change *objp)
-{
- if (!xdr_changeid4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_size (XDR *xdrs, fattr4_size *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_link_support (XDR *xdrs, fattr4_link_support *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_symlink_support (XDR *xdrs, fattr4_symlink_support *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_named_attr (XDR *xdrs, fattr4_named_attr *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_fsid (XDR *xdrs, fattr4_fsid *objp)
-{
- if (!xdr_fsid4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_unique_handles (XDR *xdrs, fattr4_unique_handles *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_lease_time (XDR *xdrs, fattr4_lease_time *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_rdattr_error (XDR *xdrs, fattr4_rdattr_error *objp)
-{
- if (!xdr_nfsstat4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_acl (XDR *xdrs, fattr4_acl *objp)
-{
- if (!xdr_array (xdrs, (char **)&objp->fattr4_acl_val, (u_int *) &objp->fattr4_acl_len, ~0,
- sizeof (nfsace4), (xdrproc_t) xdr_nfsace4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_aclsupport (XDR *xdrs, fattr4_aclsupport *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_archive (XDR *xdrs, fattr4_archive *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_cansettime (XDR *xdrs, fattr4_cansettime *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_case_insensitive (XDR *xdrs, fattr4_case_insensitive *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_case_preserving (XDR *xdrs, fattr4_case_preserving *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_chown_restricted (XDR *xdrs, fattr4_chown_restricted *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_fileid (XDR *xdrs, fattr4_fileid *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_files_avail (XDR *xdrs, fattr4_files_avail *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_filehandle (XDR *xdrs, fattr4_filehandle *objp)
-{
- if (!xdr_nfs_fh4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_files_free (XDR *xdrs, fattr4_files_free *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_files_total (XDR *xdrs, fattr4_files_total *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_fs_locations (XDR *xdrs, fattr4_fs_locations *objp)
-{
- if (!xdr_fs_locations4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_hidden (XDR *xdrs, fattr4_hidden *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_homogeneous (XDR *xdrs, fattr4_homogeneous *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_maxfilesize (XDR *xdrs, fattr4_maxfilesize *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_maxlink (XDR *xdrs, fattr4_maxlink *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_maxname (XDR *xdrs, fattr4_maxname *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_maxread (XDR *xdrs, fattr4_maxread *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_maxwrite (XDR *xdrs, fattr4_maxwrite *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_mimetype (XDR *xdrs, fattr4_mimetype *objp)
-{
- if (!xdr_utf8str_cs (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_mode (XDR *xdrs, fattr4_mode *objp)
-{
- if (!xdr_mode4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_mounted_on_fileid (XDR *xdrs, fattr4_mounted_on_fileid *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_no_trunc (XDR *xdrs, fattr4_no_trunc *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_numlinks (XDR *xdrs, fattr4_numlinks *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_owner (XDR *xdrs, fattr4_owner *objp)
-{
- if (!xdr_utf8str_mixed (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_owner_group (XDR *xdrs, fattr4_owner_group *objp)
-{
- if (!xdr_utf8str_mixed (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_quota_avail_hard (XDR *xdrs, fattr4_quota_avail_hard *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_quota_avail_soft (XDR *xdrs, fattr4_quota_avail_soft *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_quota_used (XDR *xdrs, fattr4_quota_used *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_rawdev (XDR *xdrs, fattr4_rawdev *objp)
-{
- if (!xdr_specdata4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_space_avail (XDR *xdrs, fattr4_space_avail *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_space_free (XDR *xdrs, fattr4_space_free *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_space_total (XDR *xdrs, fattr4_space_total *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_space_used (XDR *xdrs, fattr4_space_used *objp)
-{
- if (!rpcgen::xdr_uint64_t (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_system (XDR *xdrs, fattr4_system *objp)
-{
- if (!xdr_bool (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_access (XDR *xdrs, fattr4_time_access *objp)
-{
- if (!xdr_nfstime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_access_set (XDR *xdrs, fattr4_time_access_set *objp)
-{
- if (!xdr_settime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_backup (XDR *xdrs, fattr4_time_backup *objp)
-{
- if (!xdr_nfstime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_create (XDR *xdrs, fattr4_time_create *objp)
-{
- if (!xdr_nfstime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_delta (XDR *xdrs, fattr4_time_delta *objp)
-{
- if (!xdr_nfstime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_metadata (XDR *xdrs, fattr4_time_metadata *objp)
-{
- if (!xdr_nfstime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_modify (XDR *xdrs, fattr4_time_modify *objp)
-{
- if (!xdr_nfstime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4_time_modify_set (XDR *xdrs, fattr4_time_modify_set *objp)
-{
- if (!xdr_settime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_attrlist4 (XDR *xdrs, attrlist4 *objp)
-{
- if (!xdr_bytes (xdrs, (char **)&objp->attrlist4_val, (u_int *) &objp->attrlist4_len, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_fattr4 (XDR *xdrs, fattr4 *objp)
-{
- if (!xdr_bitmap4 (xdrs, &objp->attrmask))
- return FALSE;
- if (!xdr_attrlist4 (xdrs, &objp->attr_vals))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_change_info4 (XDR *xdrs, change_info4 *objp)
-{
- if (!xdr_bool (xdrs, &objp->atomic))
- return FALSE;
- if (!xdr_changeid4 (xdrs, &objp->before))
- return FALSE;
- if (!xdr_changeid4 (xdrs, &objp->after))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_clientaddr4 (XDR *xdrs, clientaddr4 *objp)
-{
- if (!xdr_string (xdrs, &objp->r_netid, ~0))
- return FALSE;
- if (!xdr_string (xdrs, &objp->r_addr, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_cb_client4 (XDR *xdrs, cb_client4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->cb_program))
- return FALSE;
- if (!xdr_clientaddr4 (xdrs, &objp->cb_location))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_stateid4 (XDR *xdrs, stateid4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->seqid))
- return FALSE;
- if (!xdr_opaque (xdrs, objp->other, 12))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_client_id4 (XDR *xdrs, nfs_client_id4 *objp)
-{
- if (!xdr_verifier4 (xdrs, objp->verifier))
- return FALSE;
- if (!xdr_bytes (xdrs, (char **)&objp->id.id_val, (u_int *) &objp->id.id_len, NFS4_OPAQUE_LIMIT))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_owner4 (XDR *xdrs, open_owner4 *objp)
-{
- if (!xdr_clientid4 (xdrs, &objp->clientid))
- return FALSE;
- if (!xdr_bytes (xdrs, (char **)&objp->owner.owner_val, (u_int *) &objp->owner.owner_len, NFS4_OPAQUE_LIMIT))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_lock_owner4 (XDR *xdrs, lock_owner4 *objp)
-{
- if (!xdr_clientid4 (xdrs, &objp->clientid))
- return FALSE;
- if (!xdr_bytes (xdrs, (char **)&objp->owner.owner_val, (u_int *) &objp->owner.owner_len, NFS4_OPAQUE_LIMIT))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_lock_type4 (XDR *xdrs, nfs_lock_type4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-//for compatibility
-bool_t
-xdr_NULL4args(XDR*, NULL4args*)
-{
- return TRUE;
-}
-
-bool_t
-xdr_NULL4res(XDR*, NULL4res*)
-{
- return TRUE;
-}
-
-bool_t
-xdr_ACCESS4args (XDR *xdrs, ACCESS4args *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->access))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ACCESS4resok (XDR *xdrs, ACCESS4resok *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->supported))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->access))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ACCESS4res (XDR *xdrs, ACCESS4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_ACCESS4resok (xdrs, &objp->ACCESS4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_CLOSE4args (XDR *xdrs, CLOSE4args *objp)
-{
- if (!xdr_seqid4 (xdrs, &objp->seqid))
- return FALSE;
- if (!xdr_stateid4 (xdrs, &objp->open_stateid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CLOSE4res (XDR *xdrs, CLOSE4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_stateid4 (xdrs, &objp->CLOSE4res_u.open_stateid))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_COMMIT4args (XDR *xdrs, COMMIT4args *objp)
-{
- if (!xdr_offset4 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_count4 (xdrs, &objp->count))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_COMMIT4resok (XDR *xdrs, COMMIT4resok *objp)
-{
- if (!xdr_verifier4 (xdrs, objp->writeverf))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_COMMIT4res (XDR *xdrs, COMMIT4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_COMMIT4resok (xdrs, &objp->COMMIT4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_createtype4 (XDR *xdrs, createtype4 *objp)
-{
- if (!xdr_nfs_ftype4 (xdrs, &objp->type))
- return FALSE;
- switch (objp->type) {
- case NF4LNK:
- if (!xdr_linktext4 (xdrs, &objp->createtype4_u.linkdata))
- return FALSE;
- break;
- case NF4BLK:
- case NF4CHR:
- if (!xdr_specdata4 (xdrs, &objp->createtype4_u.devdata))
- return FALSE;
- break;
- case NF4SOCK:
- case NF4FIFO:
- case NF4DIR:
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_CREATE4args (XDR *xdrs, CREATE4args *objp)
-{
- if (!xdr_createtype4 (xdrs, &objp->objtype))
- return FALSE;
- if (!xdr_component4 (xdrs, &objp->objname))
- return FALSE;
- if (!xdr_fattr4 (xdrs, &objp->createattrs))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CREATE4resok (XDR *xdrs, CREATE4resok *objp)
-{
- if (!xdr_change_info4 (xdrs, &objp->cinfo))
- return FALSE;
- if (!xdr_bitmap4 (xdrs, &objp->attrset))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CREATE4res (XDR *xdrs, CREATE4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_CREATE4resok (xdrs, &objp->CREATE4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_DELEGPURGE4args (XDR *xdrs, DELEGPURGE4args *objp)
-{
- if (!xdr_clientid4 (xdrs, &objp->clientid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_DELEGPURGE4res (XDR *xdrs, DELEGPURGE4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_DELEGRETURN4args (XDR *xdrs, DELEGRETURN4args *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->deleg_stateid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_DELEGRETURN4res (XDR *xdrs, DELEGRETURN4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GETATTR4args (XDR *xdrs, GETATTR4args *objp)
-{
- if (!xdr_bitmap4 (xdrs, &objp->attr_request))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GETATTR4resok (XDR *xdrs, GETATTR4resok *objp)
-{
- if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GETATTR4res (XDR *xdrs, GETATTR4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_GETATTR4resok (xdrs, &objp->GETATTR4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_notification_types4 (XDR *xdrs, notification_types4 *objp)
-{
- if (!xdr_bitmap4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_notification_delay4 (XDR *xdrs, notification_delay4 *objp)
-{
- if (!xdr_nfstime4 (xdrs, objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_dir_delegation_status4 (XDR *xdrs, dir_delegation_status4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GET_DIR_DELEGATION4args (XDR *xdrs, GET_DIR_DELEGATION4args *objp)
-{
- if (!xdr_clientid4 (xdrs, &objp->clientid))
- return FALSE;
- if (!xdr_notification_types4 (xdrs, &objp->notif_types))
- return FALSE;
- if (!xdr_notification_delay4 (xdrs, &objp->dir_notif_delay))
- return FALSE;
- if (!xdr_notification_delay4 (xdrs, &objp->dir_entry_notif_delay))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GET_DIR_DELEGATION4resok (XDR *xdrs, GET_DIR_DELEGATION4resok *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_dir_delegation_status4 (xdrs, &objp->status))
- return FALSE;
- if (!xdr_notification_types4 (xdrs, &objp->notif_types))
- return FALSE;
- if (!xdr_bitmap4 (xdrs, &objp->dir_notif_attrs))
- return FALSE;
- if (!xdr_bitmap4 (xdrs, &objp->dir_entry_notif_attrs))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GET_DIR_DELEGATION4res (XDR *xdrs, GET_DIR_DELEGATION4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_GET_DIR_DELEGATION4resok (xdrs, &objp->GET_DIR_DELEGATION4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_GETFH4resok (XDR *xdrs, GETFH4resok *objp)
-{
- if (!xdr_nfs_fh4 (xdrs, &objp->object))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_GETFH4res (XDR *xdrs, GETFH4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_GETFH4resok (xdrs, &objp->GETFH4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_LINK4args (XDR *xdrs, LINK4args *objp)
-{
- if (!xdr_component4 (xdrs, &objp->newname))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LINK4resok (XDR *xdrs, LINK4resok *objp)
-{
- if (!xdr_change_info4 (xdrs, &objp->cinfo))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LINK4res (XDR *xdrs, LINK4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_LINK4resok (xdrs, &objp->LINK4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_open_to_lock_owner4 (XDR *xdrs, open_to_lock_owner4 *objp)
-{
- if (!xdr_seqid4 (xdrs, &objp->open_seqid))
- return FALSE;
- if (!xdr_stateid4 (xdrs, &objp->open_stateid))
- return FALSE;
- if (!xdr_seqid4 (xdrs, &objp->lock_seqid))
- return FALSE;
- if (!xdr_lock_owner4 (xdrs, &objp->lock_owner))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_exist_lock_owner4 (XDR *xdrs, exist_lock_owner4 *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
- return FALSE;
- if (!xdr_seqid4 (xdrs, &objp->lock_seqid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_locker4 (XDR *xdrs, locker4 *objp)
-{
- if (!xdr_bool (xdrs, &objp->new_lock_owner))
- return FALSE;
- switch (objp->new_lock_owner) {
- case TRUE:
- if (!xdr_open_to_lock_owner4 (xdrs, &objp->locker4_u.open_owner))
- return FALSE;
- break;
- case FALSE:
- if (!xdr_exist_lock_owner4 (xdrs, &objp->locker4_u.lock_owner))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_LOCK4args (XDR *xdrs, LOCK4args *objp)
-{
- if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->reclaim))
- return FALSE;
- if (!xdr_offset4 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_length4 (xdrs, &objp->length))
- return FALSE;
- if (!xdr_locker4 (xdrs, &objp->locker))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOCK4denied (XDR *xdrs, LOCK4denied *objp)
-{
- if (!xdr_offset4 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_length4 (xdrs, &objp->length))
- return FALSE;
- if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
- return FALSE;
- if (!xdr_lock_owner4 (xdrs, &objp->owner))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOCK4resok (XDR *xdrs, LOCK4resok *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOCK4res (XDR *xdrs, LOCK4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_LOCK4resok (xdrs, &objp->LOCK4res_u.resok4))
- return FALSE;
- break;
- case NFS4ERR_DENIED:
- if (!xdr_LOCK4denied (xdrs, &objp->LOCK4res_u.denied))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_LOCKT4args (XDR *xdrs, LOCKT4args *objp)
-{
- if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
- return FALSE;
- if (!xdr_offset4 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_length4 (xdrs, &objp->length))
- return FALSE;
- if (!xdr_lock_owner4 (xdrs, &objp->owner))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOCKT4res (XDR *xdrs, LOCKT4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4ERR_DENIED:
- if (!xdr_LOCK4denied (xdrs, &objp->LOCKT4res_u.denied))
- return FALSE;
- break;
- case NFS4_OK:
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_LOCKU4args (XDR *xdrs, LOCKU4args *objp)
-{
- if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
- return FALSE;
- if (!xdr_seqid4 (xdrs, &objp->seqid))
- return FALSE;
- if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
- return FALSE;
- if (!xdr_offset4 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_length4 (xdrs, &objp->length))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOCKU4res (XDR *xdrs, LOCKU4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_stateid4 (xdrs, &objp->LOCKU4res_u.lock_stateid))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_LOOKUP4args (XDR *xdrs, LOOKUP4args *objp)
-{
- if (!xdr_component4 (xdrs, &objp->objname))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOOKUP4res (XDR *xdrs, LOOKUP4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_LOOKUPP4res (XDR *xdrs, LOOKUPP4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_NVERIFY4args (XDR *xdrs, NVERIFY4args *objp)
-{
- if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_NVERIFY4res (XDR *xdrs, NVERIFY4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_createmode4 (XDR *xdrs, createmode4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_createhow4 (XDR *xdrs, createhow4 *objp)
-{
- if (!xdr_createmode4 (xdrs, &objp->mode))
- return FALSE;
- switch (objp->mode) {
- case UNCHECKED4:
- case GUARDED4:
- if (!xdr_fattr4 (xdrs, &objp->createhow4_u.createattrs))
- return FALSE;
- break;
- case EXCLUSIVE4:
- if (!xdr_verifier4 (xdrs, objp->createhow4_u.createverf))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_opentype4 (XDR *xdrs, opentype4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_openflag4 (XDR *xdrs, openflag4 *objp)
-{
- if (!xdr_opentype4 (xdrs, &objp->opentype))
- return FALSE;
- switch (objp->opentype) {
- case OPEN4_CREATE:
- if (!xdr_createhow4 (xdrs, &objp->openflag4_u.how))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_limit_by4 (XDR *xdrs, limit_by4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_modified_limit4 (XDR *xdrs, nfs_modified_limit4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->num_blocks))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->bytes_per_block))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_space_limit4 (XDR *xdrs, nfs_space_limit4 *objp)
-{
- if (!xdr_limit_by4 (xdrs, &objp->limitby))
- return FALSE;
- switch (objp->limitby) {
- case NFS_LIMIT_SIZE:
- if (!rpcgen::xdr_uint64_t (xdrs, &objp->nfs_space_limit4_u.filesize))
- return FALSE;
- break;
- case NFS_LIMIT_BLOCKS:
- if (!xdr_nfs_modified_limit4 (xdrs, &objp->nfs_space_limit4_u.mod_blocks))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_open_delegation_type4 (XDR *xdrs, open_delegation_type4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_claim_type4 (XDR *xdrs, open_claim_type4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_claim_delegate_cur4 (XDR *xdrs, open_claim_delegate_cur4 *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->delegate_stateid))
- return FALSE;
- if (!xdr_component4 (xdrs, &objp->file))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_claim4 (XDR *xdrs, open_claim4 *objp)
-{
- if (!xdr_open_claim_type4 (xdrs, &objp->claim))
- return FALSE;
- switch (objp->claim) {
- case CLAIM_NULL:
- if (!xdr_component4 (xdrs, &objp->open_claim4_u.file))
- return FALSE;
- break;
- case CLAIM_PREVIOUS:
- if (!xdr_open_delegation_type4 (xdrs, &objp->open_claim4_u.delegate_type))
- return FALSE;
- break;
- case CLAIM_DELEGATE_CUR:
- if (!xdr_open_claim_delegate_cur4 (xdrs, &objp->open_claim4_u.delegate_cur_info))
- return FALSE;
- break;
- case CLAIM_DELEGATE_PREV:
- if (!xdr_component4 (xdrs, &objp->open_claim4_u.file_delegate_prev))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_OPEN4args (XDR *xdrs, OPEN4args *objp)
-{
- if (!xdr_seqid4 (xdrs, &objp->seqid))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->share_access))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->share_deny))
- return FALSE;
- if (!xdr_open_owner4 (xdrs, &objp->owner))
- return FALSE;
- if (!xdr_openflag4 (xdrs, &objp->openhow))
- return FALSE;
- if (!xdr_open_claim4 (xdrs, &objp->claim))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_read_delegation4 (XDR *xdrs, open_read_delegation4 *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->recall))
- return FALSE;
- if (!xdr_nfsace4 (xdrs, &objp->permissions))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_write_delegation4 (XDR *xdrs, open_write_delegation4 *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->recall))
- return FALSE;
- if (!xdr_nfs_space_limit4 (xdrs, &objp->space_limit))
- return FALSE;
- if (!xdr_nfsace4 (xdrs, &objp->permissions))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_open_delegation4 (XDR *xdrs, open_delegation4 *objp)
-{
- if (!xdr_open_delegation_type4 (xdrs, &objp->delegation_type))
- return FALSE;
- switch (objp->delegation_type) {
- case OPEN_DELEGATE_NONE:
- break;
- case OPEN_DELEGATE_READ:
- if (!xdr_open_read_delegation4 (xdrs, &objp->open_delegation4_u.read))
- return FALSE;
- break;
- case OPEN_DELEGATE_WRITE:
- if (!xdr_open_write_delegation4 (xdrs, &objp->open_delegation4_u.write))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_OPEN4resok (XDR *xdrs, OPEN4resok *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_change_info4 (xdrs, &objp->cinfo))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->rflags))
- return FALSE;
- if (!xdr_bitmap4 (xdrs, &objp->attrset))
- return FALSE;
- if (!xdr_open_delegation4 (xdrs, &objp->delegation))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_OPEN4res (XDR *xdrs, OPEN4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_OPEN4resok (xdrs, &objp->OPEN4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_OPENATTR4args (XDR *xdrs, OPENATTR4args *objp)
-{
- if (!xdr_bool (xdrs, &objp->createdir))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_OPENATTR4res (XDR *xdrs, OPENATTR4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_OPEN_CONFIRM4args (XDR *xdrs, OPEN_CONFIRM4args *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->open_stateid))
- return FALSE;
- if (!xdr_seqid4 (xdrs, &objp->seqid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_OPEN_CONFIRM4resok (XDR *xdrs, OPEN_CONFIRM4resok *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->open_stateid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_OPEN_CONFIRM4res (XDR *xdrs, OPEN_CONFIRM4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_OPEN_CONFIRM4resok (xdrs, &objp->OPEN_CONFIRM4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_OPEN_DOWNGRADE4args (XDR *xdrs, OPEN_DOWNGRADE4args *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->open_stateid))
- return FALSE;
- if (!xdr_seqid4 (xdrs, &objp->seqid))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->share_access))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->share_deny))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_OPEN_DOWNGRADE4resok (XDR *xdrs, OPEN_DOWNGRADE4resok *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->open_stateid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_OPEN_DOWNGRADE4res (XDR *xdrs, OPEN_DOWNGRADE4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_OPEN_DOWNGRADE4resok (xdrs, &objp->OPEN_DOWNGRADE4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_PUTFH4args (XDR *xdrs, PUTFH4args *objp)
-{
- if (!xdr_nfs_fh4 (xdrs, &objp->object))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_PUTFH4res (XDR *xdrs, PUTFH4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_PUTPUBFH4res (XDR *xdrs, PUTPUBFH4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_PUTROOTFH4res (XDR *xdrs, PUTROOTFH4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READ4args (XDR *xdrs, READ4args *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_offset4 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_count4 (xdrs, &objp->count))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READ4resok (XDR *xdrs, READ4resok *objp)
-{
- if (!xdr_bool (xdrs, &objp->eof))
- return FALSE;
- if (!xdr_bytes (xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READ4res (XDR *xdrs, READ4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_READ4resok (xdrs, &objp->READ4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_READDIR4args (XDR *xdrs, READDIR4args *objp)
-{
- if (!xdr_nfs_cookie4 (xdrs, &objp->cookie))
- return FALSE;
- if (!xdr_verifier4 (xdrs, objp->cookieverf))
- return FALSE;
- if (!xdr_count4 (xdrs, &objp->dircount))
- return FALSE;
- if (!xdr_count4 (xdrs, &objp->maxcount))
- return FALSE;
- if (!xdr_bitmap4 (xdrs, &objp->attr_request))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_entry4 (XDR *xdrs, entry4 *objp)
-{
- if (!xdr_nfs_cookie4 (xdrs, &objp->cookie))
- return FALSE;
- if (!xdr_component4 (xdrs, &objp->name))
- return FALSE;
- if (!xdr_fattr4 (xdrs, &objp->attrs))
- return FALSE;
- if (!xdr_pointer (xdrs, (char **)&objp->nextentry, sizeof (entry4), (xdrproc_t) xdr_entry4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_dirlist4 (XDR *xdrs, dirlist4 *objp)
-{
- if (!xdr_pointer (xdrs, (char **)&objp->entries, sizeof (entry4), (xdrproc_t) xdr_entry4))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->eof))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIR4resok (XDR *xdrs, READDIR4resok *objp)
-{
- if (!xdr_verifier4 (xdrs, objp->cookieverf))
- return FALSE;
- if (!xdr_dirlist4 (xdrs, &objp->reply))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READDIR4res (XDR *xdrs, READDIR4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_READDIR4resok (xdrs, &objp->READDIR4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_READLINK4resok (XDR *xdrs, READLINK4resok *objp)
-{
- if (!xdr_linktext4 (xdrs, &objp->link))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_READLINK4res (XDR *xdrs, READLINK4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_READLINK4resok (xdrs, &objp->READLINK4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_REMOVE4args (XDR *xdrs, REMOVE4args *objp)
-{
- if (!xdr_component4 (xdrs, &objp->target))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_REMOVE4resok (XDR *xdrs, REMOVE4resok *objp)
-{
- if (!xdr_change_info4 (xdrs, &objp->cinfo))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_REMOVE4res (XDR *xdrs, REMOVE4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_REMOVE4resok (xdrs, &objp->REMOVE4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_RENAME4args (XDR *xdrs, RENAME4args *objp)
-{
- if (!xdr_component4 (xdrs, &objp->oldname))
- return FALSE;
- if (!xdr_component4 (xdrs, &objp->newname))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RENAME4resok (XDR *xdrs, RENAME4resok *objp)
-{
- if (!xdr_change_info4 (xdrs, &objp->source_cinfo))
- return FALSE;
- if (!xdr_change_info4 (xdrs, &objp->target_cinfo))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RENAME4res (XDR *xdrs, RENAME4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_RENAME4resok (xdrs, &objp->RENAME4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_RENEW4args (XDR *xdrs, RENEW4args *objp)
-{
- if (!xdr_clientid4 (xdrs, &objp->clientid))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RENEW4res (XDR *xdrs, RENEW4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RESTOREFH4res (XDR *xdrs, RESTOREFH4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SAVEFH4res (XDR *xdrs, SAVEFH4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SECINFO4args (XDR *xdrs, SECINFO4args *objp)
-{
- if (!xdr_component4 (xdrs, &objp->name))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_rpc_gss_svc_t (XDR *xdrs, rpc_gss_svc_t *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_rpcsec_gss_info (XDR *xdrs, rpcsec_gss_info *objp)
-{
- if (!xdr_sec_oid4 (xdrs, &objp->oid))
- return FALSE;
- if (!xdr_qop4 (xdrs, &objp->qop))
- return FALSE;
- if (!xdr_rpc_gss_svc_t (xdrs, &objp->service))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_secinfo4 (XDR *xdrs, secinfo4 *objp)
-{
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->flavor))
- return FALSE;
- switch (objp->flavor) {
- case RPCSEC_GSS:
- if (!xdr_rpcsec_gss_info (xdrs, &objp->secinfo4_u.flavor_info))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_SECINFO4resok (XDR *xdrs, SECINFO4resok *objp)
-{
- if (!xdr_array (xdrs, (char **)&objp->SECINFO4resok_val, (u_int *) &objp->SECINFO4resok_len, ~0,
- sizeof (secinfo4), (xdrproc_t) xdr_secinfo4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SECINFO4res (XDR *xdrs, SECINFO4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_SECINFO4resok (xdrs, &objp->SECINFO4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_SETATTR4args (XDR *xdrs, SETATTR4args *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETATTR4res (XDR *xdrs, SETATTR4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- if (!xdr_bitmap4 (xdrs, &objp->attrsset))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETCLIENTID4args (XDR *xdrs, SETCLIENTID4args *objp)
-{
- if (!xdr_nfs_client_id4 (xdrs, &objp->client))
- return FALSE;
- if (!xdr_cb_client4 (xdrs, &objp->callback))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->callback_ident))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETCLIENTID4resok (XDR *xdrs, SETCLIENTID4resok *objp)
-{
- if (!xdr_clientid4 (xdrs, &objp->clientid))
- return FALSE;
- if (!xdr_verifier4 (xdrs, objp->setclientid_confirm))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETCLIENTID4res (XDR *xdrs, SETCLIENTID4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_SETCLIENTID4resok (xdrs, &objp->SETCLIENTID4res_u.resok4))
- return FALSE;
- break;
- case NFS4ERR_CLID_INUSE:
- if (!xdr_clientaddr4 (xdrs, &objp->SETCLIENTID4res_u.client_using))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_SETCLIENTID_CONFIRM4args (XDR *xdrs, SETCLIENTID_CONFIRM4args *objp)
-{
- if (!xdr_clientid4 (xdrs, &objp->clientid))
- return FALSE;
- if (!xdr_verifier4 (xdrs, objp->setclientid_confirm))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_SETCLIENTID_CONFIRM4res (XDR *xdrs, SETCLIENTID_CONFIRM4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_VERIFY4args (XDR *xdrs, VERIFY4args *objp)
-{
- if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_VERIFY4res (XDR *xdrs, VERIFY4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_stable_how4 (XDR *xdrs, stable_how4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_WRITE4args (XDR *xdrs, WRITE4args *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_offset4 (xdrs, &objp->offset))
- return FALSE;
- if (!xdr_stable_how4 (xdrs, &objp->stable))
- return FALSE;
- if (!xdr_bytes (xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_WRITE4resok (XDR *xdrs, WRITE4resok *objp)
-{
- if (!xdr_count4 (xdrs, &objp->count))
- return FALSE;
- if (!xdr_stable_how4 (xdrs, &objp->committed))
- return FALSE;
- if (!xdr_verifier4 (xdrs, objp->writeverf))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_WRITE4res (XDR *xdrs, WRITE4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_WRITE4resok (xdrs, &objp->WRITE4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_RELEASE_LOCKOWNER4args (XDR *xdrs, RELEASE_LOCKOWNER4args *objp)
-{
- if (!xdr_lock_owner4 (xdrs, &objp->lock_owner))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_RELEASE_LOCKOWNER4res (XDR *xdrs, RELEASE_LOCKOWNER4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_ILLEGAL4res (XDR *xdrs, ILLEGAL4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_opnum4 (XDR *xdrs, nfs_opnum4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_argop4 (XDR *xdrs, nfs_argop4 *objp)
-{
- if (!xdr_nfs_opnum4 (xdrs, &objp->argop))
- return FALSE;
- switch (objp->argop) {
- case OP_ACCESS:
- if (!xdr_ACCESS4args (xdrs, &objp->nfs_argop4_u.opaccess))
- return FALSE;
- break;
- case OP_CLOSE:
- if (!xdr_CLOSE4args (xdrs, &objp->nfs_argop4_u.opclose))
- return FALSE;
- break;
- case OP_COMMIT:
- if (!xdr_COMMIT4args (xdrs, &objp->nfs_argop4_u.opcommit))
- return FALSE;
- break;
- case OP_CREATE:
- if (!xdr_CREATE4args (xdrs, &objp->nfs_argop4_u.opcreate))
- return FALSE;
- break;
- case OP_DELEGPURGE:
- if (!xdr_DELEGPURGE4args (xdrs, &objp->nfs_argop4_u.opdelegpurge))
- return FALSE;
- break;
- case OP_DELEGRETURN:
- if (!xdr_DELEGRETURN4args (xdrs, &objp->nfs_argop4_u.opdelegreturn))
- return FALSE;
- break;
- case OP_GETATTR:
- if (!xdr_GETATTR4args (xdrs, &objp->nfs_argop4_u.opgetattr))
- return FALSE;
- break;
- case OP_GETFH:
- break;
- case OP_LINK:
- if (!xdr_LINK4args (xdrs, &objp->nfs_argop4_u.oplink))
- return FALSE;
- break;
- case OP_LOCK:
- if (!xdr_LOCK4args (xdrs, &objp->nfs_argop4_u.oplock))
- return FALSE;
- break;
- case OP_LOCKT:
- if (!xdr_LOCKT4args (xdrs, &objp->nfs_argop4_u.oplockt))
- return FALSE;
- break;
- case OP_LOCKU:
- if (!xdr_LOCKU4args (xdrs, &objp->nfs_argop4_u.oplocku))
- return FALSE;
- break;
- case OP_LOOKUP:
- if (!xdr_LOOKUP4args (xdrs, &objp->nfs_argop4_u.oplookup))
- return FALSE;
- break;
- case OP_LOOKUPP:
- break;
- case OP_NVERIFY:
- if (!xdr_NVERIFY4args (xdrs, &objp->nfs_argop4_u.opnverify))
- return FALSE;
- break;
- case OP_OPEN:
- if (!xdr_OPEN4args (xdrs, &objp->nfs_argop4_u.opopen))
- return FALSE;
- break;
- case OP_OPENATTR:
- if (!xdr_OPENATTR4args (xdrs, &objp->nfs_argop4_u.opopenattr))
- return FALSE;
- break;
- case OP_OPEN_CONFIRM:
- if (!xdr_OPEN_CONFIRM4args (xdrs, &objp->nfs_argop4_u.opopen_confirm))
- return FALSE;
- break;
- case OP_OPEN_DOWNGRADE:
- if (!xdr_OPEN_DOWNGRADE4args (xdrs, &objp->nfs_argop4_u.opopen_downgrade))
- return FALSE;
- break;
- case OP_PUTFH:
- if (!xdr_PUTFH4args (xdrs, &objp->nfs_argop4_u.opputfh))
- return FALSE;
- break;
- case OP_PUTPUBFH:
- break;
- case OP_PUTROOTFH:
- break;
- case OP_READ:
- if (!xdr_READ4args (xdrs, &objp->nfs_argop4_u.opread))
- return FALSE;
- break;
- case OP_READDIR:
- if (!xdr_READDIR4args (xdrs, &objp->nfs_argop4_u.opreaddir))
- return FALSE;
- break;
- case OP_READLINK:
- break;
- case OP_REMOVE:
- if (!xdr_REMOVE4args (xdrs, &objp->nfs_argop4_u.opremove))
- return FALSE;
- break;
- case OP_RENAME:
- if (!xdr_RENAME4args (xdrs, &objp->nfs_argop4_u.oprename))
- return FALSE;
- break;
- case OP_RENEW:
- if (!xdr_RENEW4args (xdrs, &objp->nfs_argop4_u.oprenew))
- return FALSE;
- break;
- case OP_RESTOREFH:
- break;
- case OP_SAVEFH:
- break;
- case OP_SECINFO:
- if (!xdr_SECINFO4args (xdrs, &objp->nfs_argop4_u.opsecinfo))
- return FALSE;
- break;
- case OP_SETATTR:
- if (!xdr_SETATTR4args (xdrs, &objp->nfs_argop4_u.opsetattr))
- return FALSE;
- break;
- case OP_SETCLIENTID:
- if (!xdr_SETCLIENTID4args (xdrs, &objp->nfs_argop4_u.opsetclientid))
- return FALSE;
- break;
- case OP_SETCLIENTID_CONFIRM:
- if (!xdr_SETCLIENTID_CONFIRM4args (xdrs, &objp->nfs_argop4_u.opsetclientid_confirm))
- return FALSE;
- break;
- case OP_VERIFY:
- if (!xdr_VERIFY4args (xdrs, &objp->nfs_argop4_u.opverify))
- return FALSE;
- break;
- case OP_WRITE:
- if (!xdr_WRITE4args (xdrs, &objp->nfs_argop4_u.opwrite))
- return FALSE;
- break;
- case OP_RELEASE_LOCKOWNER:
- if (!xdr_RELEASE_LOCKOWNER4args (xdrs, &objp->nfs_argop4_u.oprelease_lockowner))
- return FALSE;
- break;
- case OP_GET_DIR_DELEGATION:
- if (!xdr_GET_DIR_DELEGATION4args (xdrs, &objp->nfs_argop4_u.opget_dir_delegation))
- return FALSE;
- break;
- case OP_ILLEGAL:
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_nfs_resop4 (XDR *xdrs, nfs_resop4 *objp)
-{
- if (!xdr_nfs_opnum4 (xdrs, &objp->resop))
- return FALSE;
- switch (objp->resop) {
- case OP_ACCESS:
- if (!xdr_ACCESS4res (xdrs, &objp->nfs_resop4_u.opaccess))
- return FALSE;
- break;
- case OP_CLOSE:
- if (!xdr_CLOSE4res (xdrs, &objp->nfs_resop4_u.opclose))
- return FALSE;
- break;
- case OP_COMMIT:
- if (!xdr_COMMIT4res (xdrs, &objp->nfs_resop4_u.opcommit))
- return FALSE;
- break;
- case OP_CREATE:
- if (!xdr_CREATE4res (xdrs, &objp->nfs_resop4_u.opcreate))
- return FALSE;
- break;
- case OP_DELEGPURGE:
- if (!xdr_DELEGPURGE4res (xdrs, &objp->nfs_resop4_u.opdelegpurge))
- return FALSE;
- break;
- case OP_DELEGRETURN:
- if (!xdr_DELEGRETURN4res (xdrs, &objp->nfs_resop4_u.opdelegreturn))
- return FALSE;
- break;
- case OP_GETATTR:
- if (!xdr_GETATTR4res (xdrs, &objp->nfs_resop4_u.opgetattr))
- return FALSE;
- break;
- case OP_GETFH:
- if (!xdr_GETFH4res (xdrs, &objp->nfs_resop4_u.opgetfh))
- return FALSE;
- break;
- case OP_LINK:
- if (!xdr_LINK4res (xdrs, &objp->nfs_resop4_u.oplink))
- return FALSE;
- break;
- case OP_LOCK:
- if (!xdr_LOCK4res (xdrs, &objp->nfs_resop4_u.oplock))
- return FALSE;
- break;
- case OP_LOCKT:
- if (!xdr_LOCKT4res (xdrs, &objp->nfs_resop4_u.oplockt))
- return FALSE;
- break;
- case OP_LOCKU:
- if (!xdr_LOCKU4res (xdrs, &objp->nfs_resop4_u.oplocku))
- return FALSE;
- break;
- case OP_LOOKUP:
- if (!xdr_LOOKUP4res (xdrs, &objp->nfs_resop4_u.oplookup))
- return FALSE;
- break;
- case OP_LOOKUPP:
- if (!xdr_LOOKUPP4res (xdrs, &objp->nfs_resop4_u.oplookupp))
- return FALSE;
- break;
- case OP_NVERIFY:
- if (!xdr_NVERIFY4res (xdrs, &objp->nfs_resop4_u.opnverify))
- return FALSE;
- break;
- case OP_OPEN:
- if (!xdr_OPEN4res (xdrs, &objp->nfs_resop4_u.opopen))
- return FALSE;
- break;
- case OP_OPENATTR:
- if (!xdr_OPENATTR4res (xdrs, &objp->nfs_resop4_u.opopenattr))
- return FALSE;
- break;
- case OP_OPEN_CONFIRM:
- if (!xdr_OPEN_CONFIRM4res (xdrs, &objp->nfs_resop4_u.opopen_confirm))
- return FALSE;
- break;
- case OP_OPEN_DOWNGRADE:
- if (!xdr_OPEN_DOWNGRADE4res (xdrs, &objp->nfs_resop4_u.opopen_downgrade))
- return FALSE;
- break;
- case OP_PUTFH:
- if (!xdr_PUTFH4res (xdrs, &objp->nfs_resop4_u.opputfh))
- return FALSE;
- break;
- case OP_PUTPUBFH:
- if (!xdr_PUTPUBFH4res (xdrs, &objp->nfs_resop4_u.opputpubfh))
- return FALSE;
- break;
- case OP_PUTROOTFH:
- if (!xdr_PUTROOTFH4res (xdrs, &objp->nfs_resop4_u.opputrootfh))
- return FALSE;
- break;
- case OP_READ:
- if (!xdr_READ4res (xdrs, &objp->nfs_resop4_u.opread))
- return FALSE;
- break;
- case OP_READDIR:
- if (!xdr_READDIR4res (xdrs, &objp->nfs_resop4_u.opreaddir))
- return FALSE;
- break;
- case OP_READLINK:
- if (!xdr_READLINK4res (xdrs, &objp->nfs_resop4_u.opreadlink))
- return FALSE;
- break;
- case OP_REMOVE:
- if (!xdr_REMOVE4res (xdrs, &objp->nfs_resop4_u.opremove))
- return FALSE;
- break;
- case OP_RENAME:
- if (!xdr_RENAME4res (xdrs, &objp->nfs_resop4_u.oprename))
- return FALSE;
- break;
- case OP_RENEW:
- if (!xdr_RENEW4res (xdrs, &objp->nfs_resop4_u.oprenew))
- return FALSE;
- break;
- case OP_RESTOREFH:
- if (!xdr_RESTOREFH4res (xdrs, &objp->nfs_resop4_u.oprestorefh))
- return FALSE;
- break;
- case OP_SAVEFH:
- if (!xdr_SAVEFH4res (xdrs, &objp->nfs_resop4_u.opsavefh))
- return FALSE;
- break;
- case OP_SECINFO:
- if (!xdr_SECINFO4res (xdrs, &objp->nfs_resop4_u.opsecinfo))
- return FALSE;
- break;
- case OP_SETATTR:
- if (!xdr_SETATTR4res (xdrs, &objp->nfs_resop4_u.opsetattr))
- return FALSE;
- break;
- case OP_SETCLIENTID:
- if (!xdr_SETCLIENTID4res (xdrs, &objp->nfs_resop4_u.opsetclientid))
- return FALSE;
- break;
- case OP_SETCLIENTID_CONFIRM:
- if (!xdr_SETCLIENTID_CONFIRM4res (xdrs, &objp->nfs_resop4_u.opsetclientid_confirm))
- return FALSE;
- break;
- case OP_VERIFY:
- if (!xdr_VERIFY4res (xdrs, &objp->nfs_resop4_u.opverify))
- return FALSE;
- break;
- case OP_WRITE:
- if (!xdr_WRITE4res (xdrs, &objp->nfs_resop4_u.opwrite))
- return FALSE;
- break;
- case OP_RELEASE_LOCKOWNER:
- if (!xdr_RELEASE_LOCKOWNER4res (xdrs, &objp->nfs_resop4_u.oprelease_lockowner))
- return FALSE;
- break;
- case OP_GET_DIR_DELEGATION:
- if (!xdr_GET_DIR_DELEGATION4res (xdrs, &objp->nfs_resop4_u.opget_dir_delegation))
- return FALSE;
- break;
- case OP_ILLEGAL:
- if (!xdr_ILLEGAL4res (xdrs, &objp->nfs_resop4_u.opillegal))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_COMPOUND4args (XDR *xdrs, COMPOUND4args *objp)
-{
- if (!xdr_utf8str_cs (xdrs, &objp->tag))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->minorversion))
- return FALSE;
- if (!xdr_array (xdrs, (char **)&objp->argarray.argarray_val, (u_int *) &objp->argarray.argarray_len, ~0,
- sizeof (nfs_argop4), (xdrproc_t) xdr_nfs_argop4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_COMPOUND4res (XDR *xdrs, COMPOUND4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- if (!xdr_utf8str_cs (xdrs, &objp->tag))
- return FALSE;
- if (!xdr_array (xdrs, (char **)&objp->resarray.resarray_val, (u_int *) &objp->resarray.resarray_len, ~0,
- sizeof (nfs_resop4), (xdrproc_t) xdr_nfs_resop4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CB_GETATTR4args (XDR *xdrs, CB_GETATTR4args *objp)
-{
- if (!xdr_nfs_fh4 (xdrs, &objp->fh))
- return FALSE;
- if (!xdr_bitmap4 (xdrs, &objp->attr_request))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CB_GETATTR4resok (XDR *xdrs, CB_GETATTR4resok *objp)
-{
- if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CB_GETATTR4res (XDR *xdrs, CB_GETATTR4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- switch (objp->status) {
- case NFS4_OK:
- if (!xdr_CB_GETATTR4resok (xdrs, &objp->CB_GETATTR4res_u.resok4))
- return FALSE;
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-bool_t
-xdr_CB_RECALL4args (XDR *xdrs, CB_RECALL4args *objp)
-{
- if (!xdr_stateid4 (xdrs, &objp->stateid))
- return FALSE;
- if (!xdr_bool (xdrs, &objp->truncate))
- return FALSE;
- if (!xdr_nfs_fh4 (xdrs, &objp->fh))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CB_RECALL4res (XDR *xdrs, CB_RECALL4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CB_ILLEGAL4res (XDR *xdrs, CB_ILLEGAL4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_cb_opnum4 (XDR *xdrs, nfs_cb_opnum4 *objp)
-{
- if (!xdr_enum (xdrs, (enum_t *) objp))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_nfs_cb_argop4 (XDR *xdrs, nfs_cb_argop4 *objp)
-{
- if (!xdr_u_int (xdrs, &objp->argop))
- return FALSE;
- switch (objp->argop) {
- case OP_CB_GETATTR:
- if (!xdr_CB_GETATTR4args (xdrs, &objp->nfs_cb_argop4_u.opcbgetattr))
- return FALSE;
- break;
- case OP_CB_RECALL:
- if (!xdr_CB_RECALL4args (xdrs, &objp->nfs_cb_argop4_u.opcbrecall))
- return FALSE;
- break;
- case OP_CB_ILLEGAL:
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_nfs_cb_resop4 (XDR *xdrs, nfs_cb_resop4 *objp)
-{
- if (!xdr_u_int (xdrs, &objp->resop))
- return FALSE;
- switch (objp->resop) {
- case OP_CB_GETATTR:
- if (!xdr_CB_GETATTR4res (xdrs, &objp->nfs_cb_resop4_u.opcbgetattr))
- return FALSE;
- break;
- case OP_CB_RECALL:
- if (!xdr_CB_RECALL4res (xdrs, &objp->nfs_cb_resop4_u.opcbrecall))
- return FALSE;
- break;
- case OP_CB_ILLEGAL:
- if (!xdr_CB_ILLEGAL4res (xdrs, &objp->nfs_cb_resop4_u.opcbillegal))
- return FALSE;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-bool_t
-xdr_CB_COMPOUND4args (XDR *xdrs, CB_COMPOUND4args *objp)
-{
- if (!xdr_utf8str_cs (xdrs, &objp->tag))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->minorversion))
- return FALSE;
- if (!rpcgen::xdr_uint32_t (xdrs, &objp->callback_ident))
- return FALSE;
- if (!xdr_array (xdrs, (char **)&objp->argarray.argarray_val, (u_int *) &objp->argarray.argarray_len, ~0,
- sizeof (nfs_cb_argop4), (xdrproc_t) xdr_nfs_cb_argop4))
- return FALSE;
- return TRUE;
-}
-
-bool_t
-xdr_CB_COMPOUND4res (XDR *xdrs, CB_COMPOUND4res *objp)
-{
- if (!xdr_nfsstat4 (xdrs, &objp->status))
- return FALSE;
- if (!xdr_utf8str_cs (xdrs, &objp->tag))
- return FALSE;
- if (!xdr_array (xdrs, (char **)&objp->resarray.resarray_val, (u_int *) &objp->resarray.resarray_len, ~0,
- sizeof (nfs_cb_resop4), (xdrproc_t) xdr_nfs_cb_resop4))
- return FALSE;
- return TRUE;
-}
-
-}// namespace rpcgen
diff --git a/src/protocols/nfs4/nfs4_utils.cpp b/src/protocols/nfs4/nfs4_utils.cpp
index 2e01e7f..4e1e855 100644
--- a/src/protocols/nfs4/nfs4_utils.cpp
+++ b/src/protocols/nfs4/nfs4_utils.cpp
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// Author: Alexey Costroma
// Description: Helpers for parsing NFS structures.
-// Copyright (c) 2014 EPAM Systems
+// Copyright (c) 2014-2015 EPAM Systems
//------------------------------------------------------------------------------
/*
This file is part of Nfstrace.
@@ -24,7 +24,8 @@
#include "protocols/nfs/nfs_utils.h"
#include "protocols/nfs4/nfs4_utils.h"
//------------------------------------------------------------------------------
-using namespace rpcgen;
+using namespace NST::API::NFS4;
+using namespace NST::protocols::NFS; // NFS helpers
//------------------------------------------------------------------------------
namespace NST
{
@@ -33,8 +34,6 @@ namespace protocols
namespace NFS4
{
-using namespace NST::protocols::NFS; // NFS helpers
-
std::ostream& operator<<(std::ostream& out, const ProcEnumNFS4::NFSProcedure proc)
{
return out << print_nfs4_procedures(proc);
@@ -64,164 +63,164 @@ const char* print_nfs4_procedures(const ProcEnumNFS4::NFSProcedure proc)
return NFS4ProcedureTitles[i];
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_ftype4& obj)
+std::ostream& operator<<(std::ostream& out, const nfs_ftype4& obj)
{
switch(obj)
{
- case rpcgen::nfs_ftype4::NF4REG: return out << "REG";
- case rpcgen::nfs_ftype4::NF4DIR: return out << "DIR";
- case rpcgen::nfs_ftype4::NF4BLK: return out << "BLK";
- case rpcgen::nfs_ftype4::NF4CHR: return out << "CHR";
- case rpcgen::nfs_ftype4::NF4LNK: return out << "LNK";
- case rpcgen::nfs_ftype4::NF4SOCK: return out << "SOCK";
- case rpcgen::nfs_ftype4::NF4FIFO: return out << "FIFO";
- case rpcgen::nfs_ftype4::NF4ATTRDIR: return out << "ATTRDIR";
- case rpcgen::nfs_ftype4::NF4NAMEDATTR: return out << "NAMEDATTR";
+ case nfs_ftype4::NF4REG: return out << "REG";
+ case nfs_ftype4::NF4DIR: return out << "DIR";
+ case nfs_ftype4::NF4BLK: return out << "BLK";
+ case nfs_ftype4::NF4CHR: return out << "CHR";
+ case nfs_ftype4::NF4LNK: return out << "LNK";
+ case nfs_ftype4::NF4SOCK: return out << "SOCK";
+ case nfs_ftype4::NF4FIFO: return out << "FIFO";
+ case nfs_ftype4::NF4ATTRDIR: return out << "ATTRDIR";
+ case nfs_ftype4::NF4NAMEDATTR: return out << "NAMEDATTR";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfsstat4& obj)
+std::ostream& operator<<(std::ostream& out, const nfsstat4& obj)
{
switch(obj)
{
- case rpcgen::nfsstat4::NFS4_OK:
+ case nfsstat4::NFS4_OK:
return out << "OK";
- case rpcgen::nfsstat4::NFS4ERR_PERM:
+ case nfsstat4::NFS4ERR_PERM:
return out << "ERROR_PERM";
- case rpcgen::nfsstat4::NFS4ERR_NOENT:
+ case nfsstat4::NFS4ERR_NOENT:
return out << "ERROR_NOENT";
- case rpcgen::nfsstat4::NFS4ERR_IO:
+ case nfsstat4::NFS4ERR_IO:
return out << "ERROR_IO";
- case rpcgen::nfsstat4::NFS4ERR_NXIO:
+ case nfsstat4::NFS4ERR_NXIO:
return out << "ERROR_NXIO";
- case rpcgen::nfsstat4::NFS4ERR_ACCESS:
+ case nfsstat4::NFS4ERR_ACCESS:
return out << "ERROR_ACCESS";
- case rpcgen::nfsstat4::NFS4ERR_EXIST:
+ case nfsstat4::NFS4ERR_EXIST:
return out << "ERROR_EXIST";
- case rpcgen::nfsstat4::NFS4ERR_XDEV:
+ case nfsstat4::NFS4ERR_XDEV:
return out << "ERROR_XDEV";
- case rpcgen::nfsstat4::NFS4ERR_NOTDIR:
+ case nfsstat4::NFS4ERR_NOTDIR:
return out << "ERROR_NOTDIR";
- case rpcgen::nfsstat4::NFS4ERR_ISDIR:
+ case nfsstat4::NFS4ERR_ISDIR:
return out << "ERROR_ISDIR";
- case rpcgen::nfsstat4::NFS4ERR_INVAL:
+ case nfsstat4::NFS4ERR_INVAL:
return out << "ERROR_INVAL";
- case rpcgen::nfsstat4::NFS4ERR_FBIG:
+ case nfsstat4::NFS4ERR_FBIG:
return out << "ERROR_FBIG";
- case rpcgen::nfsstat4::NFS4ERR_NOSPC:
+ case nfsstat4::NFS4ERR_NOSPC:
return out << "ERROR_NOSPC";
- case rpcgen::nfsstat4::NFS4ERR_ROFS:
+ case nfsstat4::NFS4ERR_ROFS:
return out << "ERROR_ROFS";
- case rpcgen::nfsstat4::NFS4ERR_MLINK:
+ case nfsstat4::NFS4ERR_MLINK:
return out << "ERROR_MLINK";
- case rpcgen::nfsstat4::NFS4ERR_NAMETOOLONG:
+ case nfsstat4::NFS4ERR_NAMETOOLONG:
return out << "ERROR_NAMETOOLONG";
- case rpcgen::nfsstat4::NFS4ERR_NOTEMPTY:
+ case nfsstat4::NFS4ERR_NOTEMPTY:
return out << "ERROR_NOTEMPTY";
- case rpcgen::nfsstat4::NFS4ERR_DQUOT:
+ case nfsstat4::NFS4ERR_DQUOT:
return out << "ERROR_DQUOT";
- case rpcgen::nfsstat4::NFS4ERR_STALE:
+ case nfsstat4::NFS4ERR_STALE:
return out << "ERROR_STALE";
- case rpcgen::nfsstat4::NFS4ERR_BADHANDLE:
+ case nfsstat4::NFS4ERR_BADHANDLE:
return out << "ERROR_BADHANDLE";
- case rpcgen::nfsstat4::NFS4ERR_BAD_COOKIE:
+ case nfsstat4::NFS4ERR_BAD_COOKIE:
return out << "ERROR_BAD_COOKIE";
- case rpcgen::nfsstat4::NFS4ERR_NOTSUPP:
+ case nfsstat4::NFS4ERR_NOTSUPP:
return out << "ERROR_NOTSUPP";
- case rpcgen::nfsstat4::NFS4ERR_TOOSMALL:
+ case nfsstat4::NFS4ERR_TOOSMALL:
return out << "ERROR_TOOSMALL";
- case rpcgen::nfsstat4::NFS4ERR_SERVERFAULT:
+ case nfsstat4::NFS4ERR_SERVERFAULT:
return out << "ERROR_SERVERFAULT";
- case rpcgen::nfsstat4::NFS4ERR_BADTYPE:
+ case nfsstat4::NFS4ERR_BADTYPE:
return out << "ERROR_BADTYPE";
- case rpcgen::nfsstat4::NFS4ERR_DELAY:
+ case nfsstat4::NFS4ERR_DELAY:
return out << "ERROR_DELAY";
- case rpcgen::nfsstat4::NFS4ERR_SAME:
+ case nfsstat4::NFS4ERR_SAME:
return out << "ERROR_SAME";
- case rpcgen::nfsstat4::NFS4ERR_DENIED:
+ case nfsstat4::NFS4ERR_DENIED:
return out << "ERROR_DENIED";
- case rpcgen::nfsstat4::NFS4ERR_EXPIRED:
+ case nfsstat4::NFS4ERR_EXPIRED:
return out << "ERROR_EXPIRED";
- case rpcgen::nfsstat4::NFS4ERR_LOCKED:
+ case nfsstat4::NFS4ERR_LOCKED:
return out << "ERROR_LOCKED";
- case rpcgen::nfsstat4::NFS4ERR_GRACE:
+ case nfsstat4::NFS4ERR_GRACE:
return out << "ERROR_GRACE";
- case rpcgen::nfsstat4::NFS4ERR_FHEXPIRED:
+ case nfsstat4::NFS4ERR_FHEXPIRED:
return out << "ERROR_FHEXPIRED";
- case rpcgen::nfsstat4::NFS4ERR_SHARE_DENIED:
+ case nfsstat4::NFS4ERR_SHARE_DENIED:
return out << "ERROR_SHARE_DENIED";
- case rpcgen::nfsstat4::NFS4ERR_WRONGSEC:
+ case nfsstat4::NFS4ERR_WRONGSEC:
return out << "ERROR_WRONGSEC";
- case rpcgen::nfsstat4::NFS4ERR_CLID_INUSE:
+ case nfsstat4::NFS4ERR_CLID_INUSE:
return out << "ERROR_CLID_INUSE";
- case rpcgen::nfsstat4::NFS4ERR_RESOURCE:
+ case nfsstat4::NFS4ERR_RESOURCE:
return out << "ERROR_RESOURCE";
- case rpcgen::nfsstat4::NFS4ERR_MOVED:
+ case nfsstat4::NFS4ERR_MOVED:
return out << "ERROR_MOVED";
- case rpcgen::nfsstat4::NFS4ERR_NOFILEHANDLE:
+ case nfsstat4::NFS4ERR_NOFILEHANDLE:
return out << "ERROR_NOFILEHANDLE";
- case rpcgen::nfsstat4::NFS4ERR_MINOR_VERS_MISMATCH:
+ case nfsstat4::NFS4ERR_MINOR_VERS_MISMATCH:
return out << "ERROR_MINOR_VERS_MISMATCH";
- case rpcgen::nfsstat4::NFS4ERR_STALE_CLIENTID:
+ case nfsstat4::NFS4ERR_STALE_CLIENTID:
return out << "ERROR_STALE_CLIENTID";
- case rpcgen::nfsstat4::NFS4ERR_STALE_STATEID:
+ case nfsstat4::NFS4ERR_STALE_STATEID:
return out << "ERROR_STALE_STATEID";
- case rpcgen::nfsstat4::NFS4ERR_OLD_STATEID:
+ case nfsstat4::NFS4ERR_OLD_STATEID:
return out << "ERROR_OLD_STATEID";
- case rpcgen::nfsstat4::NFS4ERR_BAD_STATEID:
+ case nfsstat4::NFS4ERR_BAD_STATEID:
return out << "ERROR_BAD_STATEID";
- case rpcgen::nfsstat4::NFS4ERR_BAD_SEQID:
+ case nfsstat4::NFS4ERR_BAD_SEQID:
return out << "ERROR_BAD_SEQID";
- case rpcgen::nfsstat4::NFS4ERR_NOT_SAME:
+ case nfsstat4::NFS4ERR_NOT_SAME:
return out << "ERROR_NOT_SAME";
- case rpcgen::nfsstat4::NFS4ERR_LOCK_RANGE:
+ case nfsstat4::NFS4ERR_LOCK_RANGE:
return out << "ERROR_LOCK_RANGE";
- case rpcgen::nfsstat4::NFS4ERR_SYMLINK:
+ case nfsstat4::NFS4ERR_SYMLINK:
return out << "ERROR_SYMLINK";
- case rpcgen::nfsstat4::NFS4ERR_RESTOREFH:
+ case nfsstat4::NFS4ERR_RESTOREFH:
return out << "ERROR_RESTOREFH";
- case rpcgen::nfsstat4::NFS4ERR_LEASE_MOVED:
+ case nfsstat4::NFS4ERR_LEASE_MOVED:
return out << "ERROR_LEASE_MOVED";
- case rpcgen::nfsstat4::NFS4ERR_ATTRNOTSUPP:
+ case nfsstat4::NFS4ERR_ATTRNOTSUPP:
return out << "ERROR_ATTRNOTSUPP";
- case rpcgen::nfsstat4::NFS4ERR_NO_GRACE:
+ case nfsstat4::NFS4ERR_NO_GRACE:
return out << "ERROR_NO_GRACE";
- case rpcgen::nfsstat4::NFS4ERR_RECLAIM_BAD:
+ case nfsstat4::NFS4ERR_RECLAIM_BAD:
return out << "ERROR_RECLAIM_BAD";
- case rpcgen::nfsstat4::NFS4ERR_RECLAIM_CONFLICT:
+ case nfsstat4::NFS4ERR_RECLAIM_CONFLICT:
return out << "ERROR_RECLAIM_CONFLICT";
- case rpcgen::nfsstat4::NFS4ERR_BADXDR:
+ case nfsstat4::NFS4ERR_BADXDR:
return out << "ERROR_BADXDR";
- case rpcgen::nfsstat4::NFS4ERR_LOCKS_HELD:
+ case nfsstat4::NFS4ERR_LOCKS_HELD:
return out << "ERROR_LOCKS_HELD";
- case rpcgen::nfsstat4::NFS4ERR_OPENMODE:
+ case nfsstat4::NFS4ERR_OPENMODE:
return out << "ERROR_OPENMODE";
- case rpcgen::nfsstat4::NFS4ERR_BADOWNER:
+ case nfsstat4::NFS4ERR_BADOWNER:
return out << "ERROR_BADOWNER";
- case rpcgen::nfsstat4::NFS4ERR_BADCHAR:
+ case nfsstat4::NFS4ERR_BADCHAR:
return out << "ERROR_BADCHAR";
- case rpcgen::nfsstat4::NFS4ERR_BADNAME:
+ case nfsstat4::NFS4ERR_BADNAME:
return out << "ERROR_BADNAME";
- case rpcgen::nfsstat4::NFS4ERR_BAD_RANGE:
+ case nfsstat4::NFS4ERR_BAD_RANGE:
return out << "ERROR_BAD_RANGE";
- case rpcgen::nfsstat4::NFS4ERR_LOCK_NOTSUPP:
+ case nfsstat4::NFS4ERR_LOCK_NOTSUPP:
return out << "ERROR_LOCK_NOTSUPP";
- case rpcgen::nfsstat4::NFS4ERR_OP_ILLEGAL:
+ case nfsstat4::NFS4ERR_OP_ILLEGAL:
return out << "ERROR_OP_ILLEGAL";
- case rpcgen::nfsstat4::NFS4ERR_DEADLOCK:
+ case nfsstat4::NFS4ERR_DEADLOCK:
return out << "ERROR_DEADLOCK";
- case rpcgen::nfsstat4::NFS4ERR_FILE_OPEN:
+ case nfsstat4::NFS4ERR_FILE_OPEN:
return out << "ERROR_FILE_OPEN";
- case rpcgen::nfsstat4::NFS4ERR_ADMIN_REVOKED:
+ case nfsstat4::NFS4ERR_ADMIN_REVOKED:
return out << "ERROR_ADMIN_REVOKED";
- case rpcgen::nfsstat4::NFS4ERR_CB_PATH_DOWN:
+ case nfsstat4::NFS4ERR_CB_PATH_DOWN:
return out << "ERROR_CB_PATH_DOWN";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::bitmap4& obj)
+std::ostream& operator<<(std::ostream& out, const bitmap4& obj)
{
if(obj.bitmap4_len)
{
@@ -258,7 +257,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::bitmap4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::utf8string& obj)
+std::ostream& operator<<(std::ostream& out, const utf8string& obj)
{
if(obj.utf8string_len)
{
@@ -272,9 +271,9 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::utf8string& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::pathname4& obj)
+std::ostream& operator<<(std::ostream& out, const pathname4& obj)
{
- rpcgen::component4 *current_el = obj.pathname4_val;
+ component4 *current_el = obj.pathname4_val;
for(size_t i {0}; i<obj.pathname4_len; i++,current_el++)
{
out.write(current_el->utf8string_val,
@@ -284,7 +283,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::pathname4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::sec_oid4& obj)
+std::ostream& operator<<(std::ostream& out, const sec_oid4& obj)
{
print_hex(out,
obj.sec_oid4_val,
@@ -292,30 +291,30 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::sec_oid4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfstime4& obj)
+std::ostream& operator<<(std::ostream& out, const nfstime4& obj)
{
return out << "sec: " << obj.seconds
<< " nsec: " << obj.nseconds;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::time_how4& obj)
+std::ostream& operator<<(std::ostream& out, const time_how4& obj)
{
switch(obj)
{
- case rpcgen::time_how4::SET_TO_SERVER_TIME4:
+ case time_how4::SET_TO_SERVER_TIME4:
return out << "server time";
- case rpcgen::time_how4::SET_TO_CLIENT_TIME4:
+ case time_how4::SET_TO_CLIENT_TIME4:
return out << "client time";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::settime4& obj)
+std::ostream& operator<<(std::ostream& out, const settime4& obj)
{
return out << obj.set_it << ": " << obj.settime4_u.time;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_fh4& obj)
+std::ostream& operator<<(std::ostream& out, const nfs_fh4& obj)
{
NFS::print_nfs_fh(out,
obj.nfs_fh4_val,
@@ -323,16 +322,16 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_fh4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::fsid4& obj)
+std::ostream& operator<<(std::ostream& out, const fsid4& obj)
{
return out << "major: " << obj.major
<< " minor: " << obj.minor;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::fs_location4& obj)
+std::ostream& operator<<(std::ostream& out, const fs_location4& obj)
{
out << "root path: " << obj.rootpath;
- rpcgen::utf8str_cis *current_el {obj.server.server_val};
+ utf8str_cis *current_el {obj.server.server_val};
for(size_t i {0}; i<obj.server.server_len; i++,current_el++)
{
out.write(current_el->utf8string_val,
@@ -342,12 +341,12 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::fs_location4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::fs_locations4& obj)
+std::ostream& operator<<(std::ostream& out, const fs_locations4& obj)
{
out << "root: " << obj.fs_root;
if(obj.locations.locations_len)
{
- rpcgen::fs_location4* current_el {obj.locations.locations_val};
+ fs_location4* current_el {obj.locations.locations_val};
for(u_int i {0}; i<obj.locations.locations_len; i++,current_el++)
{
out << current_el;
@@ -356,7 +355,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::fs_locations4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfsace4& obj)
+std::ostream& operator<<(std::ostream& out, const nfsace4& obj)
{
return out << "type: " << obj.type
<< " flag: " << obj.flag
@@ -364,24 +363,24 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::nfsace4& obj)
<< " who: " << obj.who;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::specdata4& obj)
+std::ostream& operator<<(std::ostream& out, const specdata4& obj)
{
return out << "specdata 1: " << obj.specdata1
<< " specdata 2: " << obj.specdata2;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::fattr4_acl& obj)
+std::ostream& operator<<(std::ostream& out, const fattr4_acl& obj)
{
if(obj.fattr4_acl_len) return out << *obj.fattr4_acl_val;
else return out << "void";
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::fattr4& obj)
+std::ostream& operator<<(std::ostream& out, const fattr4& obj)
{
return out << obj.attrmask;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::change_info4& obj)
+std::ostream& operator<<(std::ostream& out, const change_info4& obj)
{
out << " atomic: ";
if(obj.atomic) out << "YES";
@@ -391,19 +390,19 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::change_info4& obj)
<< " change id after: " << obj.after;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::clientaddr4& obj)
+std::ostream& operator<<(std::ostream& out, const clientaddr4& obj)
{
return out << "netid: " << obj.r_netid
<< " addr: " << obj.r_addr;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::cb_client4& obj)
+std::ostream& operator<<(std::ostream& out, const cb_client4& obj)
{
return out << "program: " << std::hex << obj.cb_program
<< " location: " << obj.cb_location;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::stateid4& obj)
+std::ostream& operator<<(std::ostream& out, const stateid4& obj)
{
out << " seqid: " << std::hex << obj.seqid << " data: ";
print_hex(out,
@@ -412,7 +411,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::stateid4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_client_id4& obj)
+std::ostream& operator<<(std::ostream& out, const nfs_client_id4& obj)
{
out << "verifier: ";
print_hex(out,
@@ -426,7 +425,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_client_id4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_owner4& obj)
+std::ostream& operator<<(std::ostream& out, const open_owner4& obj)
{
out << "client id: " << std::hex << obj.clientid << " owner: ";
print_hex(out,
@@ -435,7 +434,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::open_owner4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::lock_owner4& obj)
+std::ostream& operator<<(std::ostream& out, const lock_owner4& obj)
{
out << "client id: " << std::hex << obj.clientid << " owner: ";
print_hex(out,
@@ -444,7 +443,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::lock_owner4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_lock_type4& obj)
+std::ostream& operator<<(std::ostream& out, const nfs_lock_type4& obj)
{
switch(obj)
{
@@ -456,22 +455,22 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_lock_type4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::createtype4& obj)
+std::ostream& operator<<(std::ostream& out, const createtype4& obj)
{
out << "type: " << obj.type;
switch(obj.type)
{
- case rpcgen::nfs_ftype4::NF4BLK:
- case rpcgen::nfs_ftype4::NF4CHR:
+ case nfs_ftype4::NF4BLK:
+ case nfs_ftype4::NF4CHR:
return out << " dev data: " << obj.createtype4_u.devdata;
- case rpcgen::nfs_ftype4::NF4LNK:
+ case nfs_ftype4::NF4LNK:
return out << " link data: " << obj.createtype4_u.linkdata;
default: break;
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::dir_delegation_status4& obj)
+std::ostream& operator<<(std::ostream& out, const dir_delegation_status4& obj)
{
switch(obj)
{
@@ -487,7 +486,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::dir_delegation_status4
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_to_lock_owner4& obj)
+std::ostream& operator<<(std::ostream& out, const open_to_lock_owner4& obj)
{
return out << "open seqid: " << obj.open_seqid
<< " open state id: " << obj.open_stateid
@@ -495,13 +494,13 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::open_to_lock_owner4& o
<< " lock owner: " << obj.lock_owner;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::exist_lock_owner4& obj)
+std::ostream& operator<<(std::ostream& out, const exist_lock_owner4& obj)
{
return out << "lock state id: " << obj.lock_stateid
<< " lock seqid: " << obj.lock_seqid;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::locker4& obj)
+std::ostream& operator<<(std::ostream& out, const locker4& obj)
{
out << "new lock owner: " << obj.new_lock_owner;
if(obj.new_lock_owner)
@@ -510,102 +509,102 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::locker4& obj)
return out << " lock owner: " << obj.locker4_u.lock_owner;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::createmode4& obj)
+std::ostream& operator<<(std::ostream& out, const createmode4& obj)
{
switch(obj)
{
- case rpcgen::createmode4::UNCHECKED4: return out << "UNCHECKED";
- case rpcgen::createmode4::GUARDED4: return out << "GUARDED";
- case rpcgen::createmode4::EXCLUSIVE4: return out << "EXCLUSIVE";
+ case createmode4::UNCHECKED4: return out << "UNCHECKED";
+ case createmode4::GUARDED4: return out << "GUARDED";
+ case createmode4::EXCLUSIVE4: return out << "EXCLUSIVE";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::opentype4& obj)
+std::ostream& operator<<(std::ostream& out, const opentype4& obj)
{
switch(obj)
{
- case rpcgen::opentype4::OPEN4_NOCREATE: return out << "NO CREATE";
- case rpcgen::opentype4::OPEN4_CREATE: return out << "CREATE";
+ case opentype4::OPEN4_NOCREATE: return out << "NO CREATE";
+ case opentype4::OPEN4_CREATE: return out << "CREATE";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::limit_by4& obj)
+std::ostream& operator<<(std::ostream& out, const limit_by4& obj)
{
switch(obj)
{
- case rpcgen::limit_by4::NFS_LIMIT_SIZE: return out << "SIZE";
- case rpcgen::limit_by4::NFS_LIMIT_BLOCKS: return out << "BLOCKS";
+ case limit_by4::NFS_LIMIT_SIZE: return out << "SIZE";
+ case limit_by4::NFS_LIMIT_BLOCKS: return out << "BLOCKS";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_delegation_type4& obj)
+std::ostream& operator<<(std::ostream& out, const open_delegation_type4& obj)
{
switch(obj)
{
- case rpcgen::open_delegation_type4::OPEN_DELEGATE_NONE:
+ case open_delegation_type4::OPEN_DELEGATE_NONE:
return out << "NONE";
- case rpcgen::open_delegation_type4::OPEN_DELEGATE_READ:
+ case open_delegation_type4::OPEN_DELEGATE_READ:
return out << "READ";
- case rpcgen::open_delegation_type4::OPEN_DELEGATE_WRITE:
+ case open_delegation_type4::OPEN_DELEGATE_WRITE:
return out << "WRITE";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_claim_type4& obj)
+std::ostream& operator<<(std::ostream& out, const open_claim_type4& obj)
{
switch(obj)
{
- case rpcgen::open_claim_type4::CLAIM_NULL:
+ case open_claim_type4::CLAIM_NULL:
return out << "NULL";
- case rpcgen::open_claim_type4::CLAIM_PREVIOUS:
+ case open_claim_type4::CLAIM_PREVIOUS:
return out << "PREVIOUS";
- case rpcgen::open_claim_type4::CLAIM_DELEGATE_CUR:
+ case open_claim_type4::CLAIM_DELEGATE_CUR:
return out << "DELEGATE CURRENT";
- case rpcgen::open_claim_type4::CLAIM_DELEGATE_PREV:
+ case open_claim_type4::CLAIM_DELEGATE_PREV:
return out << "DELEGATE PREVIOUS";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::rpc_gss_svc_t& obj)
+std::ostream& operator<<(std::ostream& out, const rpc_gss_svc_t& obj)
{
switch(obj)
{
- case rpcgen::rpc_gss_svc_t::RPC_GSS_SVC_NONE:
+ case rpc_gss_svc_t::RPC_GSS_SVC_NONE:
return out << "NONE";
- case rpcgen::rpc_gss_svc_t::RPC_GSS_SVC_INTEGRITY:
+ case rpc_gss_svc_t::RPC_GSS_SVC_INTEGRITY:
return out << "INTEGRITY";
- case rpcgen::rpc_gss_svc_t::RPC_GSS_SVC_PRIVACY:
+ case rpc_gss_svc_t::RPC_GSS_SVC_PRIVACY:
return out << "PRIVACY";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::stable_how4& obj)
+std::ostream& operator<<(std::ostream& out, const stable_how4& obj)
{
switch(obj)
{
- case rpcgen::stable_how4::UNSTABLE4: return out << "UNSTABLE";
- case rpcgen::stable_how4::DATA_SYNC4: return out << "DATA SYNC";
- case rpcgen::stable_how4::FILE_SYNC4: return out << "FILE SYNC";
+ case stable_how4::UNSTABLE4: return out << "UNSTABLE";
+ case stable_how4::DATA_SYNC4: return out << "DATA SYNC";
+ case stable_how4::FILE_SYNC4: return out << "FILE SYNC";
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::createhow4& obj)
+std::ostream& operator<<(std::ostream& out, const createhow4& obj)
{
out << " mode: " << obj.mode;
switch(obj.mode)
{
- case rpcgen::createmode4::UNCHECKED4:
- case rpcgen::createmode4::GUARDED4:
+ case createmode4::UNCHECKED4:
+ case createmode4::GUARDED4:
return out << " attributes: " << obj.createhow4_u.createattrs;
- case rpcgen::createmode4::EXCLUSIVE4:
+ case createmode4::EXCLUSIVE4:
out << " verifier: ";
print_hex(out, obj.createhow4_u.createverf, NFS4_VERIFIER_SIZE);
default: break;
@@ -613,30 +612,30 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::createhow4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::openflag4& obj)
+std::ostream& operator<<(std::ostream& out, const openflag4& obj)
{
out << "open type: " << obj.opentype;
- if(obj.opentype == rpcgen::opentype4::OPEN4_CREATE)
+ if(obj.opentype == opentype4::OPEN4_CREATE)
return out << obj.openflag4_u.how;
else
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_modified_limit4& obj)
+std::ostream& operator<<(std::ostream& out, const nfs_modified_limit4& obj)
{
return out << "blocks number: " << obj.num_blocks
<< " bytes per block: " << obj.bytes_per_block;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_space_limit4& obj)
+std::ostream& operator<<(std::ostream& out, const nfs_space_limit4& obj)
{
out << "limit by: " << obj.limitby;
switch(obj.limitby)
{
- case rpcgen::limit_by4::NFS_LIMIT_SIZE:
+ case limit_by4::NFS_LIMIT_SIZE:
return out << " filesize: "
<< obj.nfs_space_limit4_u.filesize;
- case rpcgen::limit_by4::NFS_LIMIT_BLOCKS:
+ case limit_by4::NFS_LIMIT_BLOCKS:
return out << " modified blocks: "
<< obj.nfs_space_limit4_u.mod_blocks;
default: break;
@@ -644,28 +643,28 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_space_limit4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_claim_delegate_cur4& obj)
+std::ostream& operator<<(std::ostream& out, const open_claim_delegate_cur4& obj)
{
return out << "delegate state id: " << obj.delegate_stateid
<< " file: " << obj.file;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_claim4& obj)
+std::ostream& operator<<(std::ostream& out, const open_claim4& obj)
{
out << "claim: " << obj.claim;
switch(obj.claim)
{
- case rpcgen::open_claim_type4::CLAIM_NULL:
+ case open_claim_type4::CLAIM_NULL:
out << " file: ";
return out.write(obj.open_claim4_u.file.utf8string_val,
obj.open_claim4_u.file.utf8string_len);
- case rpcgen::open_claim_type4::CLAIM_PREVIOUS:
+ case open_claim_type4::CLAIM_PREVIOUS:
return out << " delegate type: "
<< obj.open_claim4_u.delegate_type;
- case rpcgen::open_claim_type4::CLAIM_DELEGATE_CUR:
+ case open_claim_type4::CLAIM_DELEGATE_CUR:
return out << " delegate current info: "
<< obj.open_claim4_u.delegate_cur_info;
- case rpcgen::open_claim_type4::CLAIM_DELEGATE_PREV:
+ case open_claim_type4::CLAIM_DELEGATE_PREV:
return out << " file delegate previous: "
<< obj.open_claim4_u.file_delegate_prev;
default: break;
@@ -673,14 +672,14 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::open_claim4& obj)
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_read_delegation4& obj)
+std::ostream& operator<<(std::ostream& out, const open_read_delegation4& obj)
{
return out << "stateid: " << obj.stateid
<< " recall: " << obj.recall
<< " permissions: " << obj.permissions;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_write_delegation4& obj)
+std::ostream& operator<<(std::ostream& out, const open_write_delegation4& obj)
{
return out << "stateid: " << obj.stateid
<< " recall: " << obj.recall
@@ -688,23 +687,23 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::open_write_delegation4
<< " permissions: " << obj.permissions;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_delegation4& obj)
+std::ostream& operator<<(std::ostream& out, const open_delegation4& obj)
{
out << "delegation type: " << obj.delegation_type;
switch(obj.delegation_type)
{
- case rpcgen::open_delegation_type4::OPEN_DELEGATE_NONE:
+ case open_delegation_type4::OPEN_DELEGATE_NONE:
break;
- case rpcgen::open_delegation_type4::OPEN_DELEGATE_READ:
+ case open_delegation_type4::OPEN_DELEGATE_READ:
return out << ": " << obj.open_delegation4_u.read;
- case rpcgen::open_delegation_type4::OPEN_DELEGATE_WRITE:
+ case open_delegation_type4::OPEN_DELEGATE_WRITE:
return out << ": " << obj.open_delegation4_u.write;
default: break;
}
return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::entry4& obj)
+std::ostream& operator<<(std::ostream& out, const entry4& obj)
{
out << "cookie: " << obj.cookie
<< " name: " << obj.name
@@ -713,7 +712,7 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::entry4& obj)
else return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::dirlist4& obj)
+std::ostream& operator<<(std::ostream& out, const dirlist4& obj)
{
out << "eof: " << obj.eof;
if(obj.entries) return out << " entries:\n"
@@ -721,14 +720,14 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::dirlist4& obj)
else return out;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::rpcsec_gss_info& obj)
+std::ostream& operator<<(std::ostream& out, const rpcsec_gss_info& obj)
{
return out << "oid: " << obj.oid
<< " qop: " << obj.qop
<< " service: " << obj.service;
}
-std::ostream& operator<<(std::ostream& out, const rpcgen::secinfo4& obj)
+std::ostream& operator<<(std::ostream& out, const secinfo4& obj)
{
out << "flavor: " << obj.flavor;
if(obj.flavor == RPCSEC_GSS) return out << " info: "
@@ -736,6 +735,3707 @@ std::ostream& operator<<(std::ostream& out, const rpcgen::secinfo4& obj)
else return out;
}
+bool_t
+xdr_int32_t (XDR* xdrs, int32_t* objp)
+{
+ if (!xdr_int (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_ftype4 (XDR* xdrs, nfs_ftype4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfsstat4 (XDR* xdrs, nfsstat4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_bitmap4 (XDR* xdrs, bitmap4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->bitmap4_val, (u_int*) &objp->bitmap4_len, ~0,
+ sizeof (uint32_t), (xdrproc_t) xdr_uint32_t))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_offset4 (XDR* xdrs, offset4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_count4 (XDR* xdrs, count4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_length4 (XDR* xdrs, length4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_clientid4 (XDR* xdrs, clientid4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_seqid4 (XDR* xdrs, seqid4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8string (XDR* xdrs, utf8string* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->utf8string_val, (u_int*) &objp->utf8string_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8str_cis (XDR* xdrs, utf8str_cis* objp)
+{
+ if (!xdr_utf8string (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8str_cs (XDR* xdrs, utf8str_cs* objp)
+{
+ if (!xdr_utf8string (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_utf8str_mixed (XDR* xdrs, utf8str_mixed* objp)
+{
+ if (!xdr_utf8string (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_component4 (XDR* xdrs, component4* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_pathname4 (XDR* xdrs, pathname4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->pathname4_val, (u_int*) &objp->pathname4_len, ~0,
+ sizeof (component4), (xdrproc_t) xdr_component4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_lockid4 (XDR* xdrs, nfs_lockid4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_cookie4 (XDR* xdrs, nfs_cookie4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_linktext4 (XDR* xdrs, linktext4* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_sec_oid4 (XDR* xdrs, sec_oid4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->sec_oid4_val, (u_int*) &objp->sec_oid4_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_qop4 (XDR* xdrs, qop4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_mode4 (XDR* xdrs, mode4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_changeid4 (XDR* xdrs, changeid4* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_verifier4 (XDR* xdrs, verifier4 objp)
+{
+ if (!xdr_opaque (xdrs, objp, NFS4_VERIFIER_SIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfstime4 (XDR* xdrs, nfstime4* objp)
+{
+ if (!xdr_int64_t (xdrs, &objp->seconds))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->nseconds))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_time_how4 (XDR* xdrs, time_how4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_settime4 (XDR* xdrs, settime4* objp)
+{
+ if (!xdr_time_how4 (xdrs, &objp->set_it))
+ {
+ return FALSE;
+ }
+ switch (objp->set_it)
+ {
+ case SET_TO_CLIENT_TIME4:
+ if (!xdr_nfstime4 (xdrs, &objp->settime4_u.time))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_fh4 (XDR* xdrs, nfs_fh4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->nfs_fh4_val, (u_int*) &objp->nfs_fh4_len, NFS4_FHSIZE))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fsid4 (XDR* xdrs, fsid4* objp)
+{
+ if (!xdr_uint64_t (xdrs, &objp->major))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint64_t (xdrs, &objp->minor))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs_location4 (XDR* xdrs, fs_location4* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->server.server_val, (u_int*) &objp->server.server_len, ~0,
+ sizeof (utf8str_cis), (xdrproc_t) xdr_utf8str_cis))
+ {
+ return FALSE;
+ }
+ if (!xdr_pathname4 (xdrs, &objp->rootpath))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fs_locations4 (XDR* xdrs, fs_locations4* objp)
+{
+ if (!xdr_pathname4 (xdrs, &objp->fs_root))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->locations.locations_val, (u_int*) &objp->locations.locations_len, ~0,
+ sizeof (fs_location4), (xdrproc_t) xdr_fs_location4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_acetype4 (XDR* xdrs, acetype4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_aceflag4 (XDR* xdrs, aceflag4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_acemask4 (XDR* xdrs, acemask4* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfsace4 (XDR* xdrs, nfsace4* objp)
+{
+ if (!xdr_acetype4 (xdrs, &objp->type))
+ {
+ return FALSE;
+ }
+ if (!xdr_aceflag4 (xdrs, &objp->flag))
+ {
+ return FALSE;
+ }
+ if (!xdr_acemask4 (xdrs, &objp->access_mask))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_mixed (xdrs, &objp->who))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_specdata4 (XDR* xdrs, specdata4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->specdata1))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->specdata2))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_supported_attrs (XDR* xdrs, fattr4_supported_attrs* objp)
+{
+ if (!xdr_bitmap4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_type (XDR* xdrs, fattr4_type* objp)
+{
+ if (!xdr_nfs_ftype4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fh_expire_type (XDR* xdrs, fattr4_fh_expire_type* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_change (XDR* xdrs, fattr4_change* objp)
+{
+ if (!xdr_changeid4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_size (XDR* xdrs, fattr4_size* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_link_support (XDR* xdrs, fattr4_link_support* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_symlink_support (XDR* xdrs, fattr4_symlink_support* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_named_attr (XDR* xdrs, fattr4_named_attr* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fsid (XDR* xdrs, fattr4_fsid* objp)
+{
+ if (!xdr_fsid4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_unique_handles (XDR* xdrs, fattr4_unique_handles* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_lease_time (XDR* xdrs, fattr4_lease_time* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_rdattr_error (XDR* xdrs, fattr4_rdattr_error* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_acl (XDR* xdrs, fattr4_acl* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->fattr4_acl_val, (u_int*) &objp->fattr4_acl_len, ~0,
+ sizeof (nfsace4), (xdrproc_t) xdr_nfsace4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_aclsupport (XDR* xdrs, fattr4_aclsupport* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_archive (XDR* xdrs, fattr4_archive* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_cansettime (XDR* xdrs, fattr4_cansettime* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_case_insensitive (XDR* xdrs, fattr4_case_insensitive* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_case_preserving (XDR* xdrs, fattr4_case_preserving* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_chown_restricted (XDR* xdrs, fattr4_chown_restricted* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fileid (XDR* xdrs, fattr4_fileid* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_files_avail (XDR* xdrs, fattr4_files_avail* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_filehandle (XDR* xdrs, fattr4_filehandle* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_files_free (XDR* xdrs, fattr4_files_free* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_files_total (XDR* xdrs, fattr4_files_total* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_fs_locations (XDR* xdrs, fattr4_fs_locations* objp)
+{
+ if (!xdr_fs_locations4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_hidden (XDR* xdrs, fattr4_hidden* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_homogeneous (XDR* xdrs, fattr4_homogeneous* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxfilesize (XDR* xdrs, fattr4_maxfilesize* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxlink (XDR* xdrs, fattr4_maxlink* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxname (XDR* xdrs, fattr4_maxname* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxread (XDR* xdrs, fattr4_maxread* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_maxwrite (XDR* xdrs, fattr4_maxwrite* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mimetype (XDR* xdrs, fattr4_mimetype* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mode (XDR* xdrs, fattr4_mode* objp)
+{
+ if (!xdr_mode4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_mounted_on_fileid (XDR* xdrs, fattr4_mounted_on_fileid* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_no_trunc (XDR* xdrs, fattr4_no_trunc* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_numlinks (XDR* xdrs, fattr4_numlinks* objp)
+{
+ if (!xdr_uint32_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_owner (XDR* xdrs, fattr4_owner* objp)
+{
+ if (!xdr_utf8str_mixed (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_owner_group (XDR* xdrs, fattr4_owner_group* objp)
+{
+ if (!xdr_utf8str_mixed (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_quota_avail_hard (XDR* xdrs, fattr4_quota_avail_hard* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_quota_avail_soft (XDR* xdrs, fattr4_quota_avail_soft* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_quota_used (XDR* xdrs, fattr4_quota_used* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_rawdev (XDR* xdrs, fattr4_rawdev* objp)
+{
+ if (!xdr_specdata4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_avail (XDR* xdrs, fattr4_space_avail* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_free (XDR* xdrs, fattr4_space_free* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_total (XDR* xdrs, fattr4_space_total* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_space_used (XDR* xdrs, fattr4_space_used* objp)
+{
+ if (!xdr_uint64_t (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_system (XDR* xdrs, fattr4_system* objp)
+{
+ if (!xdr_bool (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_access (XDR* xdrs, fattr4_time_access* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_access_set (XDR* xdrs, fattr4_time_access_set* objp)
+{
+ if (!xdr_settime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_backup (XDR* xdrs, fattr4_time_backup* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_create (XDR* xdrs, fattr4_time_create* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_delta (XDR* xdrs, fattr4_time_delta* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_metadata (XDR* xdrs, fattr4_time_metadata* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_modify (XDR* xdrs, fattr4_time_modify* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4_time_modify_set (XDR* xdrs, fattr4_time_modify_set* objp)
+{
+ if (!xdr_settime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_attrlist4 (XDR* xdrs, attrlist4* objp)
+{
+ if (!xdr_bytes (xdrs, (char**)&objp->attrlist4_val, (u_int*) &objp->attrlist4_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_fattr4 (XDR* xdrs, fattr4* objp)
+{
+ if (!xdr_bitmap4 (xdrs, &objp->attrmask))
+ {
+ return FALSE;
+ }
+ if (!xdr_attrlist4 (xdrs, &objp->attr_vals))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_change_info4 (XDR* xdrs, change_info4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->atomic))
+ {
+ return FALSE;
+ }
+ if (!xdr_changeid4 (xdrs, &objp->before))
+ {
+ return FALSE;
+ }
+ if (!xdr_changeid4 (xdrs, &objp->after))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_clientaddr4 (XDR* xdrs, clientaddr4* objp)
+{
+ if (!xdr_string (xdrs, &objp->r_netid, ~0))
+ {
+ return FALSE;
+ }
+ if (!xdr_string (xdrs, &objp->r_addr, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_cb_client4 (XDR* xdrs, cb_client4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->cb_program))
+ {
+ return FALSE;
+ }
+ if (!xdr_clientaddr4 (xdrs, &objp->cb_location))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_stateid4 (XDR* xdrs, stateid4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_opaque (xdrs, objp->other, 12))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_client_id4 (XDR* xdrs, nfs_client_id4* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->verifier))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->id.id_val, (u_int*) &objp->id.id_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_owner4 (XDR* xdrs, open_owner4* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->owner.owner_val, (u_int*) &objp->owner.owner_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_lock_owner4 (XDR* xdrs, lock_owner4* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->owner.owner_val, (u_int*) &objp->owner.owner_len, NFS4_OPAQUE_LIMIT))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_lock_type4 (XDR* xdrs, nfs_lock_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+//for compatibility
+bool_t
+xdr_NULL4args(XDR*, NULL4args*)
+{
+ return TRUE;
+}
+
+bool_t
+xdr_NULL4res(XDR*, NULL4res*)
+{
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS4args (XDR* xdrs, ACCESS4args* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->access))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS4resok (XDR* xdrs, ACCESS4resok* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->supported))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->access))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ACCESS4res (XDR* xdrs, ACCESS4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_ACCESS4resok (xdrs, &objp->ACCESS4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CLOSE4args (XDR* xdrs, CLOSE4args* objp)
+{
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CLOSE4res (XDR* xdrs, CLOSE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_stateid4 (xdrs, &objp->CLOSE4res_u.open_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT4args (XDR* xdrs, COMMIT4args* objp)
+{
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT4resok (XDR* xdrs, COMMIT4resok* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->writeverf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMMIT4res (XDR* xdrs, COMMIT4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_COMMIT4resok (xdrs, &objp->COMMIT4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createtype4 (XDR* xdrs, createtype4* objp)
+{
+ if (!xdr_nfs_ftype4 (xdrs, &objp->type))
+ {
+ return FALSE;
+ }
+ switch (objp->type)
+ {
+ case NF4LNK:
+ if (!xdr_linktext4 (xdrs, &objp->createtype4_u.linkdata))
+ {
+ return FALSE;
+ }
+ break;
+ case NF4BLK:
+ case NF4CHR:
+ if (!xdr_specdata4 (xdrs, &objp->createtype4_u.devdata))
+ {
+ return FALSE;
+ }
+ break;
+ case NF4SOCK:
+ case NF4FIFO:
+ case NF4DIR:
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE4args (XDR* xdrs, CREATE4args* objp)
+{
+ if (!xdr_createtype4 (xdrs, &objp->objtype))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->objname))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->createattrs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE4resok (XDR* xdrs, CREATE4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attrset))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CREATE4res (XDR* xdrs, CREATE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_CREATE4resok (xdrs, &objp->CREATE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGPURGE4args (XDR* xdrs, DELEGPURGE4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGPURGE4res (XDR* xdrs, DELEGPURGE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGRETURN4args (XDR* xdrs, DELEGRETURN4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->deleg_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_DELEGRETURN4res (XDR* xdrs, DELEGRETURN4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR4args (XDR* xdrs, GETATTR4args* objp)
+{
+ if (!xdr_bitmap4 (xdrs, &objp->attr_request))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR4resok (XDR* xdrs, GETATTR4resok* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETATTR4res (XDR* xdrs, GETATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_GETATTR4resok (xdrs, &objp->GETATTR4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notification_types4 (XDR* xdrs, notification_types4* objp)
+{
+ if (!xdr_bitmap4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_notification_delay4 (XDR* xdrs, notification_delay4* objp)
+{
+ if (!xdr_nfstime4 (xdrs, objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_dir_delegation_status4 (XDR* xdrs, dir_delegation_status4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GET_DIR_DELEGATION4args (XDR* xdrs, GET_DIR_DELEGATION4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_notification_types4 (xdrs, &objp->notif_types))
+ {
+ return FALSE;
+ }
+ if (!xdr_notification_delay4 (xdrs, &objp->dir_notif_delay))
+ {
+ return FALSE;
+ }
+ if (!xdr_notification_delay4 (xdrs, &objp->dir_entry_notif_delay))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GET_DIR_DELEGATION4resok (XDR* xdrs, GET_DIR_DELEGATION4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_dir_delegation_status4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ if (!xdr_notification_types4 (xdrs, &objp->notif_types))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->dir_notif_attrs))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->dir_entry_notif_attrs))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GET_DIR_DELEGATION4res (XDR* xdrs, GET_DIR_DELEGATION4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_GET_DIR_DELEGATION4resok (xdrs, &objp->GET_DIR_DELEGATION4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETFH4resok (XDR* xdrs, GETFH4resok* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_GETFH4res (XDR* xdrs, GETFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_GETFH4resok (xdrs, &objp->GETFH4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK4args (XDR* xdrs, LINK4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->newname))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK4resok (XDR* xdrs, LINK4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LINK4res (XDR* xdrs, LINK4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_LINK4resok (xdrs, &objp->LINK4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_to_lock_owner4 (XDR* xdrs, open_to_lock_owner4* objp)
+{
+ if (!xdr_seqid4 (xdrs, &objp->open_seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->lock_seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_lock_owner4 (xdrs, &objp->lock_owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_exist_lock_owner4 (XDR* xdrs, exist_lock_owner4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->lock_seqid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_locker4 (XDR* xdrs, locker4* objp)
+{
+ if (!xdr_bool (xdrs, &objp->new_lock_owner))
+ {
+ return FALSE;
+ }
+ switch (objp->new_lock_owner)
+ {
+ case TRUE:
+ if (!xdr_open_to_lock_owner4 (xdrs, &objp->locker4_u.open_owner))
+ {
+ return FALSE;
+ }
+ break;
+ case FALSE:
+ if (!xdr_exist_lock_owner4 (xdrs, &objp->locker4_u.lock_owner))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4args (XDR* xdrs, LOCK4args* objp)
+{
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->reclaim))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ if (!xdr_locker4 (xdrs, &objp->locker))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4denied (XDR* xdrs, LOCK4denied* objp)
+{
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_lock_owner4 (xdrs, &objp->owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4resok (XDR* xdrs, LOCK4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCK4res (XDR* xdrs, LOCK4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_LOCK4resok (xdrs, &objp->LOCK4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4ERR_DENIED:
+ if (!xdr_LOCK4denied (xdrs, &objp->LOCK4res_u.denied))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKT4args (XDR* xdrs, LOCKT4args* objp)
+{
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ if (!xdr_lock_owner4 (xdrs, &objp->owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKT4res (XDR* xdrs, LOCKT4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4ERR_DENIED:
+ if (!xdr_LOCK4denied (xdrs, &objp->LOCKT4res_u.denied))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4_OK:
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKU4args (XDR* xdrs, LOCKU4args* objp)
+{
+ if (!xdr_nfs_lock_type4 (xdrs, &objp->locktype))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_stateid4 (xdrs, &objp->lock_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_length4 (xdrs, &objp->length))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOCKU4res (XDR* xdrs, LOCKU4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_stateid4 (xdrs, &objp->LOCKU4res_u.lock_stateid))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP4args (XDR* xdrs, LOOKUP4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->objname))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUP4res (XDR* xdrs, LOOKUP4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_LOOKUPP4res (XDR* xdrs, LOOKUPP4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_NVERIFY4args (XDR* xdrs, NVERIFY4args* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_NVERIFY4res (XDR* xdrs, NVERIFY4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createmode4 (XDR* xdrs, createmode4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_createhow4 (XDR* xdrs, createhow4* objp)
+{
+ if (!xdr_createmode4 (xdrs, &objp->mode))
+ {
+ return FALSE;
+ }
+ switch (objp->mode)
+ {
+ case UNCHECKED4:
+ case GUARDED4:
+ if (!xdr_fattr4 (xdrs, &objp->createhow4_u.createattrs))
+ {
+ return FALSE;
+ }
+ break;
+ case EXCLUSIVE4:
+ if (!xdr_verifier4 (xdrs, objp->createhow4_u.createverf))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_opentype4 (XDR* xdrs, opentype4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_openflag4 (XDR* xdrs, openflag4* objp)
+{
+ if (!xdr_opentype4 (xdrs, &objp->opentype))
+ {
+ return FALSE;
+ }
+ switch (objp->opentype)
+ {
+ case OPEN4_CREATE:
+ if (!xdr_createhow4 (xdrs, &objp->openflag4_u.how))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_limit_by4 (XDR* xdrs, limit_by4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_modified_limit4 (XDR* xdrs, nfs_modified_limit4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->num_blocks))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->bytes_per_block))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_space_limit4 (XDR* xdrs, nfs_space_limit4* objp)
+{
+ if (!xdr_limit_by4 (xdrs, &objp->limitby))
+ {
+ return FALSE;
+ }
+ switch (objp->limitby)
+ {
+ case NFS_LIMIT_SIZE:
+ if (!xdr_uint64_t (xdrs, &objp->nfs_space_limit4_u.filesize))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS_LIMIT_BLOCKS:
+ if (!xdr_nfs_modified_limit4 (xdrs, &objp->nfs_space_limit4_u.mod_blocks))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_delegation_type4 (XDR* xdrs, open_delegation_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_claim_type4 (XDR* xdrs, open_claim_type4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_claim_delegate_cur4 (XDR* xdrs, open_claim_delegate_cur4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->delegate_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->file))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_claim4 (XDR* xdrs, open_claim4* objp)
+{
+ if (!xdr_open_claim_type4 (xdrs, &objp->claim))
+ {
+ return FALSE;
+ }
+ switch (objp->claim)
+ {
+ case CLAIM_NULL:
+ if (!xdr_component4 (xdrs, &objp->open_claim4_u.file))
+ {
+ return FALSE;
+ }
+ break;
+ case CLAIM_PREVIOUS:
+ if (!xdr_open_delegation_type4 (xdrs, &objp->open_claim4_u.delegate_type))
+ {
+ return FALSE;
+ }
+ break;
+ case CLAIM_DELEGATE_CUR:
+ if (!xdr_open_claim_delegate_cur4 (xdrs, &objp->open_claim4_u.delegate_cur_info))
+ {
+ return FALSE;
+ }
+ break;
+ case CLAIM_DELEGATE_PREV:
+ if (!xdr_component4 (xdrs, &objp->open_claim4_u.file_delegate_prev))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN4args (XDR* xdrs, OPEN4args* objp)
+{
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_access))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_deny))
+ {
+ return FALSE;
+ }
+ if (!xdr_open_owner4 (xdrs, &objp->owner))
+ {
+ return FALSE;
+ }
+ if (!xdr_openflag4 (xdrs, &objp->openhow))
+ {
+ return FALSE;
+ }
+ if (!xdr_open_claim4 (xdrs, &objp->claim))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_read_delegation4 (XDR* xdrs, open_read_delegation4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->recall))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfsace4 (xdrs, &objp->permissions))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_write_delegation4 (XDR* xdrs, open_write_delegation4* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->recall))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_space_limit4 (xdrs, &objp->space_limit))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfsace4 (xdrs, &objp->permissions))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_open_delegation4 (XDR* xdrs, open_delegation4* objp)
+{
+ if (!xdr_open_delegation_type4 (xdrs, &objp->delegation_type))
+ {
+ return FALSE;
+ }
+ switch (objp->delegation_type)
+ {
+ case OPEN_DELEGATE_NONE:
+ break;
+ case OPEN_DELEGATE_READ:
+ if (!xdr_open_read_delegation4 (xdrs, &objp->open_delegation4_u.read))
+ {
+ return FALSE;
+ }
+ break;
+ case OPEN_DELEGATE_WRITE:
+ if (!xdr_open_write_delegation4 (xdrs, &objp->open_delegation4_u.write))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN4resok (XDR* xdrs, OPEN4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->rflags))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attrset))
+ {
+ return FALSE;
+ }
+ if (!xdr_open_delegation4 (xdrs, &objp->delegation))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN4res (XDR* xdrs, OPEN4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_OPEN4resok (xdrs, &objp->OPEN4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPENATTR4args (XDR* xdrs, OPENATTR4args* objp)
+{
+ if (!xdr_bool (xdrs, &objp->createdir))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPENATTR4res (XDR* xdrs, OPENATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_CONFIRM4args (XDR* xdrs, OPEN_CONFIRM4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_CONFIRM4resok (XDR* xdrs, OPEN_CONFIRM4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_CONFIRM4res (XDR* xdrs, OPEN_CONFIRM4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_OPEN_CONFIRM4resok (xdrs, &objp->OPEN_CONFIRM4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_DOWNGRADE4args (XDR* xdrs, OPEN_DOWNGRADE4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_seqid4 (xdrs, &objp->seqid))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_access))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->share_deny))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_DOWNGRADE4resok (XDR* xdrs, OPEN_DOWNGRADE4resok* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->open_stateid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_OPEN_DOWNGRADE4res (XDR* xdrs, OPEN_DOWNGRADE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_OPEN_DOWNGRADE4resok (xdrs, &objp->OPEN_DOWNGRADE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTFH4args (XDR* xdrs, PUTFH4args* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->object))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTFH4res (XDR* xdrs, PUTFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTPUBFH4res (XDR* xdrs, PUTPUBFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_PUTROOTFH4res (XDR* xdrs, PUTROOTFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ4args (XDR* xdrs, READ4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ4resok (XDR* xdrs, READ4resok* objp)
+{
+ if (!xdr_bool (xdrs, &objp->eof))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->data.data_val, (u_int*) &objp->data.data_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READ4res (XDR* xdrs, READ4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_READ4resok (xdrs, &objp->READ4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR4args (XDR* xdrs, READDIR4args* objp)
+{
+ if (!xdr_nfs_cookie4 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->dircount))
+ {
+ return FALSE;
+ }
+ if (!xdr_count4 (xdrs, &objp->maxcount))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attr_request))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_entry4 (XDR* xdrs, entry4* objp)
+{
+ if (!xdr_nfs_cookie4 (xdrs, &objp->cookie))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->name))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->attrs))
+ {
+ return FALSE;
+ }
+ if (!xdr_pointer (xdrs, (char**)&objp->nextentry, sizeof (entry4), (xdrproc_t) xdr_entry4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_dirlist4 (XDR* xdrs, dirlist4* objp)
+{
+ if (!xdr_pointer (xdrs, (char**)&objp->entries, sizeof (entry4), (xdrproc_t) xdr_entry4))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->eof))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR4resok (XDR* xdrs, READDIR4resok* objp)
+{
+ if (!xdr_verifier4 (xdrs, objp->cookieverf))
+ {
+ return FALSE;
+ }
+ if (!xdr_dirlist4 (xdrs, &objp->reply))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READDIR4res (XDR* xdrs, READDIR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_READDIR4resok (xdrs, &objp->READDIR4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK4resok (XDR* xdrs, READLINK4resok* objp)
+{
+ if (!xdr_linktext4 (xdrs, &objp->link))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_READLINK4res (XDR* xdrs, READLINK4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_READLINK4resok (xdrs, &objp->READLINK4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE4args (XDR* xdrs, REMOVE4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->target))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE4resok (XDR* xdrs, REMOVE4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->cinfo))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_REMOVE4res (XDR* xdrs, REMOVE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_REMOVE4resok (xdrs, &objp->REMOVE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME4args (XDR* xdrs, RENAME4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->oldname))
+ {
+ return FALSE;
+ }
+ if (!xdr_component4 (xdrs, &objp->newname))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME4resok (XDR* xdrs, RENAME4resok* objp)
+{
+ if (!xdr_change_info4 (xdrs, &objp->source_cinfo))
+ {
+ return FALSE;
+ }
+ if (!xdr_change_info4 (xdrs, &objp->target_cinfo))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENAME4res (XDR* xdrs, RENAME4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_RENAME4resok (xdrs, &objp->RENAME4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENEW4args (XDR* xdrs, RENEW4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RENEW4res (XDR* xdrs, RENEW4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RESTOREFH4res (XDR* xdrs, RESTOREFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SAVEFH4res (XDR* xdrs, SAVEFH4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO4args (XDR* xdrs, SECINFO4args* objp)
+{
+ if (!xdr_component4 (xdrs, &objp->name))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_rpc_gss_svc_t (XDR* xdrs, rpc_gss_svc_t* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_rpcsec_gss_info (XDR* xdrs, rpcsec_gss_info* objp)
+{
+ if (!xdr_sec_oid4 (xdrs, &objp->oid))
+ {
+ return FALSE;
+ }
+ if (!xdr_qop4 (xdrs, &objp->qop))
+ {
+ return FALSE;
+ }
+ if (!xdr_rpc_gss_svc_t (xdrs, &objp->service))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_secinfo4 (XDR* xdrs, secinfo4* objp)
+{
+ if (!xdr_uint32_t (xdrs, &objp->flavor))
+ {
+ return FALSE;
+ }
+ switch (objp->flavor)
+ {
+ case RPCSEC_GSS:
+ if (!xdr_rpcsec_gss_info (xdrs, &objp->secinfo4_u.flavor_info))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO4resok (XDR* xdrs, SECINFO4resok* objp)
+{
+ if (!xdr_array (xdrs, (char**)&objp->SECINFO4resok_val, (u_int*) &objp->SECINFO4resok_len, ~0,
+ sizeof (secinfo4), (xdrproc_t) xdr_secinfo4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SECINFO4res (XDR* xdrs, SECINFO4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_SECINFO4resok (xdrs, &objp->SECINFO4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR4args (XDR* xdrs, SETATTR4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETATTR4res (XDR* xdrs, SETATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attrsset))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID4args (XDR* xdrs, SETCLIENTID4args* objp)
+{
+ if (!xdr_nfs_client_id4 (xdrs, &objp->client))
+ {
+ return FALSE;
+ }
+ if (!xdr_cb_client4 (xdrs, &objp->callback))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->callback_ident))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID4resok (XDR* xdrs, SETCLIENTID4resok* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->setclientid_confirm))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID4res (XDR* xdrs, SETCLIENTID4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_SETCLIENTID4resok (xdrs, &objp->SETCLIENTID4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ case NFS4ERR_CLID_INUSE:
+ if (!xdr_clientaddr4 (xdrs, &objp->SETCLIENTID4res_u.client_using))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID_CONFIRM4args (XDR* xdrs, SETCLIENTID_CONFIRM4args* objp)
+{
+ if (!xdr_clientid4 (xdrs, &objp->clientid))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->setclientid_confirm))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_SETCLIENTID_CONFIRM4res (XDR* xdrs, SETCLIENTID_CONFIRM4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_VERIFY4args (XDR* xdrs, VERIFY4args* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_VERIFY4res (XDR* xdrs, VERIFY4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_stable_how4 (XDR* xdrs, stable_how4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE4args (XDR* xdrs, WRITE4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_offset4 (xdrs, &objp->offset))
+ {
+ return FALSE;
+ }
+ if (!xdr_stable_how4 (xdrs, &objp->stable))
+ {
+ return FALSE;
+ }
+ if (!xdr_bytes (xdrs, (char**)&objp->data.data_val, (u_int*) &objp->data.data_len, ~0))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE4resok (XDR* xdrs, WRITE4resok* objp)
+{
+ if (!xdr_count4 (xdrs, &objp->count))
+ {
+ return FALSE;
+ }
+ if (!xdr_stable_how4 (xdrs, &objp->committed))
+ {
+ return FALSE;
+ }
+ if (!xdr_verifier4 (xdrs, objp->writeverf))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_WRITE4res (XDR* xdrs, WRITE4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_WRITE4resok (xdrs, &objp->WRITE4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RELEASE_LOCKOWNER4args (XDR* xdrs, RELEASE_LOCKOWNER4args* objp)
+{
+ if (!xdr_lock_owner4 (xdrs, &objp->lock_owner))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_RELEASE_LOCKOWNER4res (XDR* xdrs, RELEASE_LOCKOWNER4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_ILLEGAL4res (XDR* xdrs, ILLEGAL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_opnum4 (XDR* xdrs, nfs_opnum4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_argop4 (XDR* xdrs, nfs_argop4* objp)
+{
+ if (!xdr_nfs_opnum4 (xdrs, &objp->argop))
+ {
+ return FALSE;
+ }
+ switch (objp->argop)
+ {
+ case OP_ACCESS:
+ if (!xdr_ACCESS4args (xdrs, &objp->nfs_argop4_u.opaccess))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CLOSE:
+ if (!xdr_CLOSE4args (xdrs, &objp->nfs_argop4_u.opclose))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_COMMIT:
+ if (!xdr_COMMIT4args (xdrs, &objp->nfs_argop4_u.opcommit))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CREATE:
+ if (!xdr_CREATE4args (xdrs, &objp->nfs_argop4_u.opcreate))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGPURGE:
+ if (!xdr_DELEGPURGE4args (xdrs, &objp->nfs_argop4_u.opdelegpurge))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGRETURN:
+ if (!xdr_DELEGRETURN4args (xdrs, &objp->nfs_argop4_u.opdelegreturn))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETATTR:
+ if (!xdr_GETATTR4args (xdrs, &objp->nfs_argop4_u.opgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETFH:
+ break;
+ case OP_LINK:
+ if (!xdr_LINK4args (xdrs, &objp->nfs_argop4_u.oplink))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCK:
+ if (!xdr_LOCK4args (xdrs, &objp->nfs_argop4_u.oplock))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKT:
+ if (!xdr_LOCKT4args (xdrs, &objp->nfs_argop4_u.oplockt))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKU:
+ if (!xdr_LOCKU4args (xdrs, &objp->nfs_argop4_u.oplocku))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUP:
+ if (!xdr_LOOKUP4args (xdrs, &objp->nfs_argop4_u.oplookup))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUPP:
+ break;
+ case OP_NVERIFY:
+ if (!xdr_NVERIFY4args (xdrs, &objp->nfs_argop4_u.opnverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN:
+ if (!xdr_OPEN4args (xdrs, &objp->nfs_argop4_u.opopen))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPENATTR:
+ if (!xdr_OPENATTR4args (xdrs, &objp->nfs_argop4_u.opopenattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_CONFIRM:
+ if (!xdr_OPEN_CONFIRM4args (xdrs, &objp->nfs_argop4_u.opopen_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_DOWNGRADE:
+ if (!xdr_OPEN_DOWNGRADE4args (xdrs, &objp->nfs_argop4_u.opopen_downgrade))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTFH:
+ if (!xdr_PUTFH4args (xdrs, &objp->nfs_argop4_u.opputfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTPUBFH:
+ break;
+ case OP_PUTROOTFH:
+ break;
+ case OP_READ:
+ if (!xdr_READ4args (xdrs, &objp->nfs_argop4_u.opread))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READDIR:
+ if (!xdr_READDIR4args (xdrs, &objp->nfs_argop4_u.opreaddir))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READLINK:
+ break;
+ case OP_REMOVE:
+ if (!xdr_REMOVE4args (xdrs, &objp->nfs_argop4_u.opremove))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENAME:
+ if (!xdr_RENAME4args (xdrs, &objp->nfs_argop4_u.oprename))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENEW:
+ if (!xdr_RENEW4args (xdrs, &objp->nfs_argop4_u.oprenew))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RESTOREFH:
+ break;
+ case OP_SAVEFH:
+ break;
+ case OP_SECINFO:
+ if (!xdr_SECINFO4args (xdrs, &objp->nfs_argop4_u.opsecinfo))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETATTR:
+ if (!xdr_SETATTR4args (xdrs, &objp->nfs_argop4_u.opsetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID:
+ if (!xdr_SETCLIENTID4args (xdrs, &objp->nfs_argop4_u.opsetclientid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID_CONFIRM:
+ if (!xdr_SETCLIENTID_CONFIRM4args (xdrs, &objp->nfs_argop4_u.opsetclientid_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_VERIFY:
+ if (!xdr_VERIFY4args (xdrs, &objp->nfs_argop4_u.opverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_WRITE:
+ if (!xdr_WRITE4args (xdrs, &objp->nfs_argop4_u.opwrite))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RELEASE_LOCKOWNER:
+ if (!xdr_RELEASE_LOCKOWNER4args (xdrs, &objp->nfs_argop4_u.oprelease_lockowner))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GET_DIR_DELEGATION:
+ if (!xdr_GET_DIR_DELEGATION4args (xdrs, &objp->nfs_argop4_u.opget_dir_delegation))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_ILLEGAL:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_resop4 (XDR* xdrs, nfs_resop4* objp)
+{
+ if (!xdr_nfs_opnum4 (xdrs, &objp->resop))
+ {
+ return FALSE;
+ }
+ switch (objp->resop)
+ {
+ case OP_ACCESS:
+ if (!xdr_ACCESS4res (xdrs, &objp->nfs_resop4_u.opaccess))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CLOSE:
+ if (!xdr_CLOSE4res (xdrs, &objp->nfs_resop4_u.opclose))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_COMMIT:
+ if (!xdr_COMMIT4res (xdrs, &objp->nfs_resop4_u.opcommit))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CREATE:
+ if (!xdr_CREATE4res (xdrs, &objp->nfs_resop4_u.opcreate))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGPURGE:
+ if (!xdr_DELEGPURGE4res (xdrs, &objp->nfs_resop4_u.opdelegpurge))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_DELEGRETURN:
+ if (!xdr_DELEGRETURN4res (xdrs, &objp->nfs_resop4_u.opdelegreturn))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETATTR:
+ if (!xdr_GETATTR4res (xdrs, &objp->nfs_resop4_u.opgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GETFH:
+ if (!xdr_GETFH4res (xdrs, &objp->nfs_resop4_u.opgetfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LINK:
+ if (!xdr_LINK4res (xdrs, &objp->nfs_resop4_u.oplink))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCK:
+ if (!xdr_LOCK4res (xdrs, &objp->nfs_resop4_u.oplock))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKT:
+ if (!xdr_LOCKT4res (xdrs, &objp->nfs_resop4_u.oplockt))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOCKU:
+ if (!xdr_LOCKU4res (xdrs, &objp->nfs_resop4_u.oplocku))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUP:
+ if (!xdr_LOOKUP4res (xdrs, &objp->nfs_resop4_u.oplookup))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_LOOKUPP:
+ if (!xdr_LOOKUPP4res (xdrs, &objp->nfs_resop4_u.oplookupp))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_NVERIFY:
+ if (!xdr_NVERIFY4res (xdrs, &objp->nfs_resop4_u.opnverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN:
+ if (!xdr_OPEN4res (xdrs, &objp->nfs_resop4_u.opopen))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPENATTR:
+ if (!xdr_OPENATTR4res (xdrs, &objp->nfs_resop4_u.opopenattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_CONFIRM:
+ if (!xdr_OPEN_CONFIRM4res (xdrs, &objp->nfs_resop4_u.opopen_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_OPEN_DOWNGRADE:
+ if (!xdr_OPEN_DOWNGRADE4res (xdrs, &objp->nfs_resop4_u.opopen_downgrade))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTFH:
+ if (!xdr_PUTFH4res (xdrs, &objp->nfs_resop4_u.opputfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTPUBFH:
+ if (!xdr_PUTPUBFH4res (xdrs, &objp->nfs_resop4_u.opputpubfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_PUTROOTFH:
+ if (!xdr_PUTROOTFH4res (xdrs, &objp->nfs_resop4_u.opputrootfh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READ:
+ if (!xdr_READ4res (xdrs, &objp->nfs_resop4_u.opread))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READDIR:
+ if (!xdr_READDIR4res (xdrs, &objp->nfs_resop4_u.opreaddir))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_READLINK:
+ if (!xdr_READLINK4res (xdrs, &objp->nfs_resop4_u.opreadlink))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_REMOVE:
+ if (!xdr_REMOVE4res (xdrs, &objp->nfs_resop4_u.opremove))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENAME:
+ if (!xdr_RENAME4res (xdrs, &objp->nfs_resop4_u.oprename))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RENEW:
+ if (!xdr_RENEW4res (xdrs, &objp->nfs_resop4_u.oprenew))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RESTOREFH:
+ if (!xdr_RESTOREFH4res (xdrs, &objp->nfs_resop4_u.oprestorefh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SAVEFH:
+ if (!xdr_SAVEFH4res (xdrs, &objp->nfs_resop4_u.opsavefh))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SECINFO:
+ if (!xdr_SECINFO4res (xdrs, &objp->nfs_resop4_u.opsecinfo))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETATTR:
+ if (!xdr_SETATTR4res (xdrs, &objp->nfs_resop4_u.opsetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID:
+ if (!xdr_SETCLIENTID4res (xdrs, &objp->nfs_resop4_u.opsetclientid))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_SETCLIENTID_CONFIRM:
+ if (!xdr_SETCLIENTID_CONFIRM4res (xdrs, &objp->nfs_resop4_u.opsetclientid_confirm))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_VERIFY:
+ if (!xdr_VERIFY4res (xdrs, &objp->nfs_resop4_u.opverify))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_WRITE:
+ if (!xdr_WRITE4res (xdrs, &objp->nfs_resop4_u.opwrite))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_RELEASE_LOCKOWNER:
+ if (!xdr_RELEASE_LOCKOWNER4res (xdrs, &objp->nfs_resop4_u.oprelease_lockowner))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_GET_DIR_DELEGATION:
+ if (!xdr_GET_DIR_DELEGATION4res (xdrs, &objp->nfs_resop4_u.opget_dir_delegation))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_ILLEGAL:
+ if (!xdr_ILLEGAL4res (xdrs, &objp->nfs_resop4_u.opillegal))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMPOUND4args (XDR* xdrs, COMPOUND4args* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->minorversion))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->argarray.argarray_val, (u_int*) &objp->argarray.argarray_len, ~0,
+ sizeof (nfs_argop4), (xdrproc_t) xdr_nfs_argop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_COMPOUND4res (XDR* xdrs, COMPOUND4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->resarray.resarray_val, (u_int*) &objp->resarray.resarray_len, ~0,
+ sizeof (nfs_resop4), (xdrproc_t) xdr_nfs_resop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_GETATTR4args (XDR* xdrs, CB_GETATTR4args* objp)
+{
+ if (!xdr_nfs_fh4 (xdrs, &objp->fh))
+ {
+ return FALSE;
+ }
+ if (!xdr_bitmap4 (xdrs, &objp->attr_request))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_GETATTR4resok (XDR* xdrs, CB_GETATTR4resok* objp)
+{
+ if (!xdr_fattr4 (xdrs, &objp->obj_attributes))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_GETATTR4res (XDR* xdrs, CB_GETATTR4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ switch (objp->status)
+ {
+ case NFS4_OK:
+ if (!xdr_CB_GETATTR4resok (xdrs, &objp->CB_GETATTR4res_u.resok4))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL4args (XDR* xdrs, CB_RECALL4args* objp)
+{
+ if (!xdr_stateid4 (xdrs, &objp->stateid))
+ {
+ return FALSE;
+ }
+ if (!xdr_bool (xdrs, &objp->truncate))
+ {
+ return FALSE;
+ }
+ if (!xdr_nfs_fh4 (xdrs, &objp->fh))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_RECALL4res (XDR* xdrs, CB_RECALL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_ILLEGAL4res (XDR* xdrs, CB_ILLEGAL4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_cb_opnum4 (XDR* xdrs, nfs_cb_opnum4* objp)
+{
+ if (!xdr_enum (xdrs, (enum_t*) objp))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_cb_argop4 (XDR* xdrs, nfs_cb_argop4* objp)
+{
+ if (!xdr_u_int (xdrs, &objp->argop))
+ {
+ return FALSE;
+ }
+ switch (objp->argop)
+ {
+ case OP_CB_GETATTR:
+ if (!xdr_CB_GETATTR4args (xdrs, &objp->nfs_cb_argop4_u.opcbgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL:
+ if (!xdr_CB_RECALL4args (xdrs, &objp->nfs_cb_argop4_u.opcbrecall))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_ILLEGAL:
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_nfs_cb_resop4 (XDR* xdrs, nfs_cb_resop4* objp)
+{
+ if (!xdr_u_int (xdrs, &objp->resop))
+ {
+ return FALSE;
+ }
+ switch (objp->resop)
+ {
+ case OP_CB_GETATTR:
+ if (!xdr_CB_GETATTR4res (xdrs, &objp->nfs_cb_resop4_u.opcbgetattr))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_RECALL:
+ if (!xdr_CB_RECALL4res (xdrs, &objp->nfs_cb_resop4_u.opcbrecall))
+ {
+ return FALSE;
+ }
+ break;
+ case OP_CB_ILLEGAL:
+ if (!xdr_CB_ILLEGAL4res (xdrs, &objp->nfs_cb_resop4_u.opcbillegal))
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_COMPOUND4args (XDR* xdrs, CB_COMPOUND4args* objp)
+{
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->minorversion))
+ {
+ return FALSE;
+ }
+ if (!xdr_uint32_t (xdrs, &objp->callback_ident))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->argarray.argarray_val, (u_int*) &objp->argarray.argarray_len, ~0,
+ sizeof (nfs_cb_argop4), (xdrproc_t) xdr_nfs_cb_argop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool_t
+xdr_CB_COMPOUND4res (XDR* xdrs, CB_COMPOUND4res* objp)
+{
+ if (!xdr_nfsstat4 (xdrs, &objp->status))
+ {
+ return FALSE;
+ }
+ if (!xdr_utf8str_cs (xdrs, &objp->tag))
+ {
+ return FALSE;
+ }
+ if (!xdr_array (xdrs, (char**)&objp->resarray.resarray_val, (u_int*) &objp->resarray.resarray_len, ~0,
+ sizeof (nfs_cb_resop4), (xdrproc_t) xdr_nfs_cb_resop4))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
} // namespace NFS4
} // namespace protocols
} // namespace NST
diff --git a/src/protocols/nfs4/nfs4_utils.h b/src/protocols/nfs4/nfs4_utils.h
index 986b366..569f23f 100644
--- a/src/protocols/nfs4/nfs4_utils.h
+++ b/src/protocols/nfs4/nfs4_utils.h
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// Author: Alexey Costroma
// Description: Helpers for parsing NFS structures.
-// Copyright (c) 2014 EPAM Systems
+// Copyright (c) 2014-2015 EPAM Systems
//------------------------------------------------------------------------------
/*
This file is part of Nfstrace.
@@ -19,7 +19,6 @@
along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
-#define NST_PUBLIC __attribute__ ((visibility("default")))
#ifndef NFS4_UTILS_H
#define NFS4_UTILS_H
//------------------------------------------------------------------------------
@@ -37,6 +36,8 @@ namespace protocols
namespace NFS4
{
+namespace NFS4 = NST::API::NFS4;
+
using ProcEnumNFS4 = API::ProcEnumNFS4;
using Validator = rpc::RPCProgramValidator
@@ -47,84 +48,323 @@ using Validator = rpc::RPCProgramValidator
ProcEnumNFS4::COMPOUND // NFSPROC4RPCGEN_COMPOUND (1)
>;
+bool_t xdr_nfs_ftype4 (XDR *, NFS4::nfs_ftype4*);
+bool_t xdr_nfsstat4 (XDR *, NFS4::nfsstat4*);
+bool_t xdr_bitmap4 (XDR *, NFS4::bitmap4*);
+bool_t xdr_offset4 (XDR *, NFS4::offset4*);
+bool_t xdr_count4 (XDR *, NFS4::count4*);
+bool_t xdr_length4 (XDR *, NFS4::length4*);
+bool_t xdr_clientid4 (XDR *, NFS4::clientid4*);
+bool_t xdr_seqid4 (XDR *, NFS4::seqid4*);
+bool_t xdr_utf8string (XDR *, NFS4::utf8string*);
+bool_t xdr_utf8str_cis (XDR *, NFS4::utf8str_cis*);
+bool_t xdr_utf8str_cs (XDR *, NFS4::utf8str_cs*);
+bool_t xdr_utf8str_mixed (XDR *, NFS4::utf8str_mixed*);
+bool_t xdr_component4 (XDR *, NFS4::component4*);
+bool_t xdr_pathname4 (XDR *, NFS4::pathname4*);
+bool_t xdr_nfs_lockid4 (XDR *, NFS4::nfs_lockid4*);
+bool_t xdr_nfs_cookie4 (XDR *, NFS4::nfs_cookie4*);
+bool_t xdr_linktext4 (XDR *, NFS4::linktext4*);
+bool_t xdr_sec_oid4 (XDR *, NFS4::sec_oid4*);
+bool_t xdr_qop4 (XDR *, NFS4::qop4*);
+bool_t xdr_mode4 (XDR *, NFS4::mode4*);
+bool_t xdr_changeid4 (XDR *, NFS4::changeid4*);
+bool_t xdr_verifier4 (XDR *, NFS4::verifier4);
+bool_t xdr_nfstime4 (XDR *, NFS4::nfstime4*);
+bool_t xdr_time_how4 (XDR *, NFS4::time_how4*);
+bool_t xdr_settime4 (XDR *, NFS4::settime4*);
+bool_t xdr_nfs_fh4 (XDR *, NFS4::nfs_fh4*);
+bool_t xdr_fsid4 (XDR *, NFS4::fsid4*);
+bool_t xdr_fs_location4 (XDR *, NFS4::fs_location4*);
+bool_t xdr_fs_locations4 (XDR *, NFS4::fs_locations4*);
+bool_t xdr_acetype4 (XDR *, NFS4::acetype4*);
+bool_t xdr_aceflag4 (XDR *, NFS4::aceflag4*);
+bool_t xdr_acemask4 (XDR *, NFS4::acemask4*);
+bool_t xdr_nfsace4 (XDR *, NFS4::nfsace4*);
+bool_t xdr_specdata4 (XDR *, NFS4::specdata4*);
+bool_t xdr_fattr4_supported_attrs (XDR *, NFS4::fattr4_supported_attrs*);
+bool_t xdr_fattr4_type (XDR *, NFS4::fattr4_type*);
+bool_t xdr_fattr4_fh_expire_type (XDR *, NFS4::fattr4_fh_expire_type*);
+bool_t xdr_fattr4_change (XDR *, NFS4::fattr4_change*);
+bool_t xdr_fattr4_size (XDR *, NFS4::fattr4_size*);
+bool_t xdr_fattr4_link_support (XDR *, NFS4::fattr4_link_support*);
+bool_t xdr_fattr4_symlink_support (XDR *, NFS4::fattr4_symlink_support*);
+bool_t xdr_fattr4_named_attr (XDR *, NFS4::fattr4_named_attr*);
+bool_t xdr_fattr4_fsid (XDR *, NFS4::fattr4_fsid*);
+bool_t xdr_fattr4_unique_handles (XDR *, NFS4::fattr4_unique_handles*);
+bool_t xdr_fattr4_lease_time (XDR *, NFS4::fattr4_lease_time*);
+bool_t xdr_fattr4_rdattr_error (XDR *, NFS4::fattr4_rdattr_error*);
+bool_t xdr_fattr4_acl (XDR *, NFS4::fattr4_acl*);
+bool_t xdr_fattr4_aclsupport (XDR *, NFS4::fattr4_aclsupport*);
+bool_t xdr_fattr4_archive (XDR *, NFS4::fattr4_archive*);
+bool_t xdr_fattr4_cansettime (XDR *, NFS4::fattr4_cansettime*);
+bool_t xdr_fattr4_case_insensitive (XDR *, NFS4::fattr4_case_insensitive*);
+bool_t xdr_fattr4_case_preserving (XDR *, NFS4::fattr4_case_preserving*);
+bool_t xdr_fattr4_chown_restricted (XDR *, NFS4::fattr4_chown_restricted*);
+bool_t xdr_fattr4_fileid (XDR *, NFS4::fattr4_fileid*);
+bool_t xdr_fattr4_files_avail (XDR *, NFS4::fattr4_files_avail*);
+bool_t xdr_fattr4_filehandle (XDR *, NFS4::fattr4_filehandle*);
+bool_t xdr_fattr4_files_free (XDR *, NFS4::fattr4_files_free*);
+bool_t xdr_fattr4_files_total (XDR *, NFS4::fattr4_files_total*);
+bool_t xdr_fattr4_fs_locations (XDR *, NFS4::fattr4_fs_locations*);
+bool_t xdr_fattr4_hidden (XDR *, NFS4::fattr4_hidden*);
+bool_t xdr_fattr4_homogeneous (XDR *, NFS4::fattr4_homogeneous*);
+bool_t xdr_fattr4_maxfilesize (XDR *, NFS4::fattr4_maxfilesize*);
+bool_t xdr_fattr4_maxlink (XDR *, NFS4::fattr4_maxlink*);
+bool_t xdr_fattr4_maxname (XDR *, NFS4::fattr4_maxname*);
+bool_t xdr_fattr4_maxread (XDR *, NFS4::fattr4_maxread*);
+bool_t xdr_fattr4_maxwrite (XDR *, NFS4::fattr4_maxwrite*);
+bool_t xdr_fattr4_mimetype (XDR *, NFS4::fattr4_mimetype*);
+bool_t xdr_fattr4_mode (XDR *, NFS4::fattr4_mode*);
+bool_t xdr_fattr4_mounted_on_fileid (XDR *, NFS4::fattr4_mounted_on_fileid*);
+bool_t xdr_fattr4_no_trunc (XDR *, NFS4::fattr4_no_trunc*);
+bool_t xdr_fattr4_numlinks (XDR *, NFS4::fattr4_numlinks*);
+bool_t xdr_fattr4_owner (XDR *, NFS4::fattr4_owner*);
+bool_t xdr_fattr4_owner_group (XDR *, NFS4::fattr4_owner_group*);
+bool_t xdr_fattr4_quota_avail_hard (XDR *, NFS4::fattr4_quota_avail_hard*);
+bool_t xdr_fattr4_quota_avail_soft (XDR *, NFS4::fattr4_quota_avail_soft*);
+bool_t xdr_fattr4_quota_used (XDR *, NFS4::fattr4_quota_used*);
+bool_t xdr_fattr4_rawdev (XDR *, NFS4::fattr4_rawdev*);
+bool_t xdr_fattr4_space_avail (XDR *, NFS4::fattr4_space_avail*);
+bool_t xdr_fattr4_space_free (XDR *, NFS4::fattr4_space_free*);
+bool_t xdr_fattr4_space_total (XDR *, NFS4::fattr4_space_total*);
+bool_t xdr_fattr4_space_used (XDR *, NFS4::fattr4_space_used*);
+bool_t xdr_fattr4_system (XDR *, NFS4::fattr4_system*);
+bool_t xdr_fattr4_time_access (XDR *, NFS4::fattr4_time_access*);
+bool_t xdr_fattr4_time_access_set (XDR *, NFS4::fattr4_time_access_set*);
+bool_t xdr_fattr4_time_backup (XDR *, NFS4::fattr4_time_backup*);
+bool_t xdr_fattr4_time_create (XDR *, NFS4::fattr4_time_create*);
+bool_t xdr_fattr4_time_delta (XDR *, NFS4::fattr4_time_delta*);
+bool_t xdr_fattr4_time_metadata (XDR *, NFS4::fattr4_time_metadata*);
+bool_t xdr_fattr4_time_modify (XDR *, NFS4::fattr4_time_modify*);
+bool_t xdr_fattr4_time_modify_set (XDR *, NFS4::fattr4_time_modify_set*);
+bool_t xdr_attrlist4 (XDR *, NFS4::attrlist4*);
+bool_t xdr_fattr4 (XDR *, NFS4::fattr4*);
+bool_t xdr_change_info4 (XDR *, NFS4::change_info4*);
+bool_t xdr_clientaddr4 (XDR *, NFS4::clientaddr4*);
+bool_t xdr_cb_client4 (XDR *, NFS4::cb_client4*);
+bool_t xdr_stateid4 (XDR *, NFS4::stateid4*);
+bool_t xdr_nfs_client_id4 (XDR *, NFS4::nfs_client_id4*);
+bool_t xdr_open_owner4 (XDR *, NFS4::open_owner4*);
+bool_t xdr_lock_owner4 (XDR *, NFS4::lock_owner4*);
+bool_t xdr_nfs_lock_type4 (XDR *, NFS4::nfs_lock_type4*);
+bool_t xdr_NULL4args (XDR *, NFS4::NULL4args*); // for compatibility
+bool_t xdr_NULL4res (XDR *, NFS4::NULL4res*); // for compatibility
+bool_t xdr_ACCESS4args (XDR *, NFS4::ACCESS4args*);
+bool_t xdr_ACCESS4resok (XDR *, NFS4::ACCESS4resok*);
+bool_t xdr_ACCESS4res (XDR *, NFS4::ACCESS4res*);
+bool_t xdr_CLOSE4args (XDR *, NFS4::CLOSE4args*);
+bool_t xdr_CLOSE4res (XDR *, NFS4::CLOSE4res*);
+bool_t xdr_COMMIT4args (XDR *, NFS4::COMMIT4args*);
+bool_t xdr_COMMIT4resok (XDR *, NFS4::COMMIT4resok*);
+bool_t xdr_COMMIT4res (XDR *, NFS4::COMMIT4res*);
+bool_t xdr_createtype4 (XDR *, NFS4::createtype4*);
+bool_t xdr_CREATE4args (XDR *, NFS4::CREATE4args*);
+bool_t xdr_CREATE4resok (XDR *, NFS4::CREATE4resok*);
+bool_t xdr_CREATE4res (XDR *, NFS4::CREATE4res*);
+bool_t xdr_DELEGPURGE4args (XDR *, NFS4::DELEGPURGE4args*);
+bool_t xdr_DELEGPURGE4res (XDR *, NFS4::DELEGPURGE4res*);
+bool_t xdr_DELEGRETURN4args (XDR *, NFS4::DELEGRETURN4args*);
+bool_t xdr_DELEGRETURN4res (XDR *, NFS4::DELEGRETURN4res*);
+bool_t xdr_GETATTR4args (XDR *, NFS4::GETATTR4args*);
+bool_t xdr_GETATTR4resok (XDR *, NFS4::GETATTR4resok*);
+bool_t xdr_GETATTR4res (XDR *, NFS4::GETATTR4res*);
+bool_t xdr_notification_types4 (XDR *, NFS4::notification_types4*);
+bool_t xdr_notification_delay4 (XDR *, NFS4::notification_delay4*);
+bool_t xdr_dir_delegation_status4 (XDR *, NFS4::dir_delegation_status4*);
+bool_t xdr_GET_DIR_DELEGATION4args (XDR *, NFS4::GET_DIR_DELEGATION4args*);
+bool_t xdr_GET_DIR_DELEGATION4resok (XDR *, NFS4::GET_DIR_DELEGATION4resok*);
+bool_t xdr_GET_DIR_DELEGATION4res (XDR *, NFS4::GET_DIR_DELEGATION4res*);
+bool_t xdr_GETFH4resok (XDR *, NFS4::GETFH4resok*);
+bool_t xdr_GETFH4res (XDR *, NFS4::GETFH4res*);
+bool_t xdr_LINK4args (XDR *, NFS4::LINK4args*);
+bool_t xdr_LINK4resok (XDR *, NFS4::LINK4resok*);
+bool_t xdr_LINK4res (XDR *, NFS4::LINK4res*);
+bool_t xdr_open_to_lock_owner4 (XDR *, NFS4::open_to_lock_owner4*);
+bool_t xdr_exist_lock_owner4 (XDR *, NFS4::exist_lock_owner4*);
+bool_t xdr_locker4 (XDR *, NFS4::locker4*);
+bool_t xdr_LOCK4args (XDR *, NFS4::LOCK4args*);
+bool_t xdr_LOCK4denied (XDR *, NFS4::LOCK4denied*);
+bool_t xdr_LOCK4resok (XDR *, NFS4::LOCK4resok*);
+bool_t xdr_LOCK4res (XDR *, NFS4::LOCK4res*);
+bool_t xdr_LOCKT4args (XDR *, NFS4::LOCKT4args*);
+bool_t xdr_LOCKT4res (XDR *, NFS4::LOCKT4res*);
+bool_t xdr_LOCKU4args (XDR *, NFS4::LOCKU4args*);
+bool_t xdr_LOCKU4res (XDR *, NFS4::LOCKU4res*);
+bool_t xdr_LOOKUP4args (XDR *, NFS4::LOOKUP4args*);
+bool_t xdr_LOOKUP4res (XDR *, NFS4::LOOKUP4res*);
+bool_t xdr_LOOKUPP4res (XDR *, NFS4::LOOKUPP4res*);
+bool_t xdr_NVERIFY4args (XDR *, NFS4::NVERIFY4args*);
+bool_t xdr_NVERIFY4res (XDR *, NFS4::NVERIFY4res*);
+bool_t xdr_createmode4 (XDR *, NFS4::createmode4*);
+bool_t xdr_createhow4 (XDR *, NFS4::createhow4*);
+bool_t xdr_opentype4 (XDR *, NFS4::opentype4*);
+bool_t xdr_openflag4 (XDR *, NFS4::openflag4*);
+bool_t xdr_limit_by4 (XDR *, NFS4::limit_by4*);
+bool_t xdr_nfs_modified_limit4 (XDR *, NFS4::nfs_modified_limit4*);
+bool_t xdr_nfs_space_limit4 (XDR *, NFS4::nfs_space_limit4*);
+bool_t xdr_open_delegation_type4 (XDR *, NFS4::open_delegation_type4*);
+bool_t xdr_open_claim_type4 (XDR *, NFS4::open_claim_type4*);
+bool_t xdr_open_claim_delegate_cur4 (XDR *, NFS4::open_claim_delegate_cur4*);
+bool_t xdr_open_claim4 (XDR *, NFS4::open_claim4*);
+bool_t xdr_OPEN4args (XDR *, NFS4::OPEN4args*);
+bool_t xdr_open_read_delegation4 (XDR *, NFS4::open_read_delegation4*);
+bool_t xdr_open_write_delegation4 (XDR *, NFS4::open_write_delegation4*);
+bool_t xdr_open_delegation4 (XDR *, NFS4::open_delegation4*);
+bool_t xdr_OPEN4resok (XDR *, NFS4::OPEN4resok*);
+bool_t xdr_OPEN4res (XDR *, NFS4::OPEN4res*);
+bool_t xdr_OPENATTR4args (XDR *, NFS4::OPENATTR4args*);
+bool_t xdr_OPENATTR4res (XDR *, NFS4::OPENATTR4res*);
+bool_t xdr_OPEN_CONFIRM4args (XDR *, NFS4::OPEN_CONFIRM4args*);
+bool_t xdr_OPEN_CONFIRM4resok (XDR *, NFS4::OPEN_CONFIRM4resok*);
+bool_t xdr_OPEN_CONFIRM4res (XDR *, NFS4::OPEN_CONFIRM4res*);
+bool_t xdr_OPEN_DOWNGRADE4args (XDR *, NFS4::OPEN_DOWNGRADE4args*);
+bool_t xdr_OPEN_DOWNGRADE4resok (XDR *, NFS4::OPEN_DOWNGRADE4resok*);
+bool_t xdr_OPEN_DOWNGRADE4res (XDR *, NFS4::OPEN_DOWNGRADE4res*);
+bool_t xdr_PUTFH4args (XDR *, NFS4::PUTFH4args*);
+bool_t xdr_PUTFH4res (XDR *, NFS4::PUTFH4res*);
+bool_t xdr_PUTPUBFH4res (XDR *, NFS4::PUTPUBFH4res*);
+bool_t xdr_PUTROOTFH4res (XDR *, NFS4::PUTROOTFH4res*);
+bool_t xdr_READ4args (XDR *, NFS4::READ4args*);
+bool_t xdr_READ4resok (XDR *, NFS4::READ4resok*);
+bool_t xdr_READ4res (XDR *, NFS4::READ4res*);
+bool_t xdr_READDIR4args (XDR *, NFS4::READDIR4args*);
+bool_t xdr_entry4 (XDR *, NFS4::entry4*);
+bool_t xdr_dirlist4 (XDR *, NFS4::dirlist4*);
+bool_t xdr_READDIR4resok (XDR *, NFS4::READDIR4resok*);
+bool_t xdr_READDIR4res (XDR *, NFS4::READDIR4res*);
+bool_t xdr_READLINK4resok (XDR *, NFS4::READLINK4resok*);
+bool_t xdr_READLINK4res (XDR *, NFS4::READLINK4res*);
+bool_t xdr_REMOVE4args (XDR *, NFS4::REMOVE4args*);
+bool_t xdr_REMOVE4resok (XDR *, NFS4::REMOVE4resok*);
+bool_t xdr_REMOVE4res (XDR *, NFS4::REMOVE4res*);
+bool_t xdr_RENAME4args (XDR *, NFS4::RENAME4args*);
+bool_t xdr_RENAME4resok (XDR *, NFS4::RENAME4resok*);
+bool_t xdr_RENAME4res (XDR *, NFS4::RENAME4res*);
+bool_t xdr_RENEW4args (XDR *, NFS4::RENEW4args*);
+bool_t xdr_RENEW4res (XDR *, NFS4::RENEW4res*);
+bool_t xdr_RESTOREFH4res (XDR *, NFS4::RESTOREFH4res*);
+bool_t xdr_SAVEFH4res (XDR *, NFS4::SAVEFH4res*);
+bool_t xdr_SECINFO4args (XDR *, NFS4::SECINFO4args*);
+bool_t xdr_rpc_gss_svc_t (XDR *, NFS4::rpc_gss_svc_t*);
+bool_t xdr_rpcsec_gss_info (XDR *, NFS4::rpcsec_gss_info*);
+bool_t xdr_secinfo4 (XDR *, NFS4::secinfo4*);
+bool_t xdr_SECINFO4resok (XDR *, NFS4::SECINFO4resok*);
+bool_t xdr_SECINFO4res (XDR *, NFS4::SECINFO4res*);
+bool_t xdr_SETATTR4args (XDR *, NFS4::SETATTR4args*);
+bool_t xdr_SETATTR4res (XDR *, NFS4::SETATTR4res*);
+bool_t xdr_SETCLIENTID4args (XDR *, NFS4::SETCLIENTID4args*);
+bool_t xdr_SETCLIENTID4resok (XDR *, NFS4::SETCLIENTID4resok*);
+bool_t xdr_SETCLIENTID4res (XDR *, NFS4::SETCLIENTID4res*);
+bool_t xdr_SETCLIENTID_CONFIRM4args (XDR *, NFS4::SETCLIENTID_CONFIRM4args*);
+bool_t xdr_SETCLIENTID_CONFIRM4res (XDR *, NFS4::SETCLIENTID_CONFIRM4res*);
+bool_t xdr_VERIFY4args (XDR *, NFS4::VERIFY4args*);
+bool_t xdr_VERIFY4res (XDR *, NFS4::VERIFY4res*);
+bool_t xdr_stable_how4 (XDR *, NFS4::stable_how4*);
+bool_t xdr_WRITE4args (XDR *, NFS4::WRITE4args*);
+bool_t xdr_WRITE4resok (XDR *, NFS4::WRITE4resok*);
+bool_t xdr_WRITE4res (XDR *, NFS4::WRITE4res*);
+bool_t xdr_RELEASE_LOCKOWNER4args (XDR *, NFS4::RELEASE_LOCKOWNER4args*);
+bool_t xdr_RELEASE_LOCKOWNER4res (XDR *, NFS4::RELEASE_LOCKOWNER4res*);
+bool_t xdr_ILLEGAL4res (XDR *, NFS4::ILLEGAL4res*);
+bool_t xdr_nfs_opnum4 (XDR *, NFS4::nfs_opnum4*);
+bool_t xdr_nfs_argop4 (XDR *, NFS4::nfs_argop4*);
+bool_t xdr_nfs_resop4 (XDR *, NFS4::nfs_resop4*);
+bool_t xdr_COMPOUND4args (XDR *, NFS4::COMPOUND4args*);
+bool_t xdr_COMPOUND4res (XDR *, NFS4::COMPOUND4res*);
+bool_t xdr_CB_GETATTR4args (XDR *, NFS4::CB_GETATTR4args*);
+bool_t xdr_CB_GETATTR4resok (XDR *, NFS4::CB_GETATTR4resok*);
+bool_t xdr_CB_GETATTR4res (XDR *, NFS4::CB_GETATTR4res*);
+bool_t xdr_CB_RECALL4args (XDR *, NFS4::CB_RECALL4args*);
+bool_t xdr_CB_RECALL4res (XDR *, NFS4::CB_RECALL4res*);
+bool_t xdr_CB_ILLEGAL4res (XDR *, NFS4::CB_ILLEGAL4res*);
+bool_t xdr_nfs_cb_opnum4 (XDR *, NFS4::nfs_cb_opnum4*);
+bool_t xdr_nfs_cb_argop4 (XDR *, NFS4::nfs_cb_argop4*);
+bool_t xdr_nfs_cb_resop4 (XDR *, NFS4::nfs_cb_resop4*);
+bool_t xdr_CB_COMPOUND4args (XDR *, NFS4::CB_COMPOUND4args*);
+bool_t xdr_CB_COMPOUND4res (XDR *, NFS4::CB_COMPOUND4res*);
+
+
// Procedure 0: NULL - Do nothing
-inline auto proc_t_of(rpcgen::NULL4args&)->decltype(&rpcgen::xdr_NULL4args)
+inline auto proc_t_of(NFS4::NULL4args&)->decltype(&xdr_NULL4args)
{
- return &rpcgen::xdr_NULL4args;
+ return &xdr_NULL4args;
}
-inline auto proc_t_of(rpcgen::NULL4res&)->decltype(&rpcgen::xdr_NULL4res)
+inline auto proc_t_of(NFS4::NULL4res&)->decltype(&xdr_NULL4res)
{
- return &rpcgen::xdr_NULL4res;
+ return &xdr_NULL4res;
}
// Procedure 1: COMPOUND
-inline auto proc_t_of(rpcgen::COMPOUND4args&)->decltype(&rpcgen::xdr_COMPOUND4args)
+inline auto proc_t_of(NFS4::COMPOUND4args&)->decltype(&xdr_COMPOUND4args)
{
- return &rpcgen::xdr_COMPOUND4args;
+ return &xdr_COMPOUND4args;
}
-inline auto proc_t_of(rpcgen::COMPOUND4res&)->decltype(&rpcgen::xdr_COMPOUND4res)
+inline auto proc_t_of(NFS4::COMPOUND4res&)->decltype(&xdr_COMPOUND4res)
{
- return &rpcgen::xdr_COMPOUND4res;
+ return &xdr_COMPOUND4res;
}
+#define NST_PUBLIC __attribute__ ((visibility("default")))
+
extern"C"
NST_PUBLIC
const char* print_nfs4_procedures(const ProcEnumNFS4::NFSProcedure proc);
std::ostream& operator<<(std::ostream& out, const ProcEnumNFS4::NFSProcedure proc);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_ftype4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfsstat4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::bitmap4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::utf8string& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::pathname4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::sec_oid4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfstime4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::time_how4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::settime4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_fh4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::fsid4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::fs_location4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::fs_locations4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfsace4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::specdata4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::fattr4_acl& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::attrlist4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::fattr4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::change_info4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::clientaddr4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::cb_client4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::stateid4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_client_id4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_owner4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::lock_owner4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_lock_type4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::createtype4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::dir_delegation_status4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_to_lock_owner4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::exist_lock_owner4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::locker4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::createmode4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::opentype4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::limit_by4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_delegation_type4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_claim_type4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::rpc_gss_svc_t& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::stable_how4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::createhow4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::openflag4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_modified_limit4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::nfs_space_limit4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_claim_delegate_cur4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_claim4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_read_delegation4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_write_delegation4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::open_delegation4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::entry4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::dirlist4& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::rpcsec_gss_info& obj);
-std::ostream& operator<<(std::ostream& out, const rpcgen::secinfo4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfs_ftype4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfsstat4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::bitmap4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::utf8string& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::pathname4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::sec_oid4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfstime4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::time_how4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::settime4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfs_fh4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::fsid4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::fs_location4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::fs_locations4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfsace4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::specdata4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::fattr4_acl& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::attrlist4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::fattr4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::change_info4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::clientaddr4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::cb_client4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::stateid4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfs_client_id4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::lock_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfs_lock_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::createtype4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::dir_delegation_status4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_to_lock_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::exist_lock_owner4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::locker4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::createmode4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::opentype4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::limit_by4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_delegation_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_claim_type4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::rpc_gss_svc_t& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::stable_how4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::createhow4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::openflag4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfs_modified_limit4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::nfs_space_limit4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_claim_delegate_cur4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_claim4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_read_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_write_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::open_delegation4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::entry4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::dirlist4& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::rpcsec_gss_info& obj);
+std::ostream& operator<<(std::ostream& out, const NFS4::secinfo4& obj);
} // namespace NFS4
} // namespace protocols
diff --git a/src/protocols/xdr/xdr_decoder.h b/src/protocols/xdr/xdr_decoder.h
index 7c2e48b..c057442 100644
--- a/src/protocols/xdr/xdr_decoder.h
+++ b/src/protocols/xdr/xdr_decoder.h
@@ -72,4 +72,3 @@ private:
//------------------------------------------------------------------------------
#endif//XDR_DECODER_H
//------------------------------------------------------------------------------
-
diff --git a/src/utils/dynamic_load.cpp b/src/utils/dynamic_load.cpp
new file mode 100644
index 0000000..5e98108
--- /dev/null
+++ b/src/utils/dynamic_load.cpp
@@ -0,0 +1,56 @@
+//------------------------------------------------------------------------------
+// Author: Pavel Karneliuk
+// Description: Wrapper for dlopen and related functions
+// Copyright (c) 2013 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <string>
+
+#include <dlfcn.h>
+
+#include "utils/dynamic_load.h"
+//------------------------------------------------------------------------------
+using namespace NST::utils;
+//------------------------------------------------------------------------------
+
+DynamicLoad::DynamicLoad(const std::string &file)
+{
+ handle = dlopen(file.c_str(), RTLD_LAZY);
+ if(handle == nullptr)
+ {
+ throw DLException{std::string{"Loading dynamic module: "} + file + " failed with error:" + dlerror()};
+ }
+}
+
+DynamicLoad::~DynamicLoad()
+{
+ dlclose(handle);
+}
+
+void* DynamicLoad::get_symbol(const std::string &name)
+{
+ void* address = (dlsym)(handle, name.c_str());
+ if(address == nullptr)
+ {
+ throw DLException{std::string{"Loading symbol "} + name + " failed with error:" + dlerror()};
+ }
+
+ return address;
+}
+
+//------------------------------------------------------------------------------
diff --git a/src/utils/dynamic_load.h b/src/utils/dynamic_load.h
index 9b5becc..8a56848 100644
--- a/src/utils/dynamic_load.h
+++ b/src/utils/dynamic_load.h
@@ -23,8 +23,6 @@
#define DYNAMIC_LOAD_H
//------------------------------------------------------------------------------
#include <stdexcept>
-
-#include <dlfcn.h>
//------------------------------------------------------------------------------
namespace NST
{
@@ -41,33 +39,28 @@ public:
};
protected:
- explicit DynamicLoad(const std::string& file)
- {
- handle = dlopen(file.c_str(), RTLD_LAZY);
- if(handle == nullptr)
- {
- throw DLException{std::string{"Loading dynamic module: "} + file + " failed with error:" + dlerror()};
- }
- }
- ~DynamicLoad()
- {
- dlclose(handle);
- }
+ explicit DynamicLoad(const std::string& file);
+ ~DynamicLoad();
template<typename SymbolPtr>
- inline void load_address_of(const std::string& name, SymbolPtr& address)
+ void load_address_of(const std::string& name, SymbolPtr& address)
{
static_assert(sizeof(void*) == sizeof(SymbolPtr), "object pointer and function pointer sizes must be equal");
// suppression warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
- using hook_dlsym_t = SymbolPtr (*)(void *, const char *);
+ using hook_dlsym_t = SymbolPtr (DynamicLoad::*)(const std::string&);
+
+ hook_dlsym_t get_symbol_func = reinterpret_cast<hook_dlsym_t>(&DynamicLoad::get_symbol);
+ address = (*this.*get_symbol_func)(name);
+ }
- address = reinterpret_cast<hook_dlsym_t>(dlsym)(handle, name.c_str());
- if(address == nullptr)
- {
- throw DLException{std::string{"Loading symbol "} + name + " failed with error:" + dlerror()};
- }
- }
+ /*!
+ * Gets symbol by name from DLL
+ * Throws exception if fails
+ * \param name - name of symbol
+ * \return pointer to valid symbol
+ */
+ void* get_symbol(const std::string& name);
private:
void* handle;
diff --git a/src/utils/log.cpp b/src/utils/log.cpp
index 07e6c82..32ca4d9 100644
--- a/src/utils/log.cpp
+++ b/src/utils/log.cpp
@@ -57,7 +57,7 @@ namespace // unnanmed
static FILE* try_open(const std::string& file_name)
{
- FILE* file = fopen(file_name.c_str(), "w");
+ FILE* file = fopen(file_name.c_str(), "a+");
if(file == nullptr)
{
throw std::system_error{errno, std::system_category(),
@@ -70,6 +70,11 @@ static FILE* try_open(const std::string& file_name)
throw std::system_error{errno, std::system_category(),
{"Log file already locked: " + file_name}};
}
+ time_t now = time(NULL);
+ fprintf(file, "--------------------------------------------------------------------------\n");
+ fprintf(file, "--------------------------------------------------------------------------\n");
+ fprintf(file, "Nfstrace log: PID = %lu %s", static_cast<unsigned long>(getpid()), ctime(&now));
+ fprintf(file, "--------------------------------------------------------------------------\n");
return file;
}
@@ -83,8 +88,6 @@ Log::Global::Global(const std::string& path)
throw std::runtime_error{"Global Logger already have been created."};
}
- const std::string default_file_name {"nfstrace.log"};
-
if(!log_file_path.empty())
{
struct stat st;
@@ -98,21 +101,15 @@ Log::Global::Global(const std::string& path)
if(exists && S_ISDIR(st.st_mode))
{
- if(log_file_path.back() == '/')
- {
- log_file_path.erase(log_file_path.find_last_not_of('/') + 1);
- }
- log_file_path = log_file_path + '/' + default_file_name;
+ throw std::system_error{errno, std::system_category(),
+ {"Incorrect log file path: " + log_file_path + " - it is a directory! Please set correct path to log."}};
}
}
else
{
- log_file_path = default_file_name;
+ log_file_path = "nfstrace.log";
}
- // Append timestamp
- log_file_path = log_file_path + "." + std::to_string(std::time(0));
-
log_file = try_open(log_file_path);
own_file = true;
diff --git a/src/utils/log.h b/src/utils/log.h
index 317763d..dd78c35 100644
--- a/src/utils/log.h
+++ b/src/utils/log.h
@@ -32,13 +32,15 @@
// TODO: DANGEROUS MACRO ! Passing custom client string as format to printf().
// May be cause of SIGSEGV
#define TRACE(...) {\
- NST::utils::Log::message("\n" __FILE__ ":" STRINGIZE(__LINE__) ": " __VA_ARGS__);\
+ NST::utils::Log::message(__FILE__ ":" STRINGIZE(__LINE__) ": " __VA_ARGS__);\
+ NST::utils::Log::message("\n");\
NST::utils::Log::flush();\
}
#endif
#define LOG(...) {\
- NST::utils::Log::message("\n" __VA_ARGS__);\
+ NST::utils::Log::message(__VA_ARGS__);\
+ NST::utils::Log::message("\n");\
}
#define LOGONCE(...) {\
diff --git a/src/utils/out.cpp b/src/utils/out.cpp
index 34936a7..9fd8b9d 100644
--- a/src/utils/out.cpp
+++ b/src/utils/out.cpp
@@ -41,6 +41,11 @@ Out::Level Out::Global::get_level()
return global;
}
+void Out::Global::set_level(Out::Level l)
+{
+ global = l;
+}
+
Out::Out(Level level)
: std::ostream{ (global >= level) ? std::cout.rdbuf() : nullptr }
{
diff --git a/src/utils/out.h b/src/utils/out.h
index f0f7447..8c12597 100644
--- a/src/utils/out.h
+++ b/src/utils/out.h
@@ -47,7 +47,8 @@ public:
Global(const Global&) = delete;
Global& operator=(const Global&) = delete;
- static Level get_level(); // return global level of verbosity
+ static Level get_level(); // return global level of verbosity
+ static void set_level(Level); // set global level of verbosity
};
explicit Out(Level level=Level::Info); // verbose level of message
diff --git a/src/utils/profiler.h b/src/utils/profiler.h
new file mode 100644
index 0000000..747821b
--- /dev/null
+++ b/src/utils/profiler.h
@@ -0,0 +1,96 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Profiler class.
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#ifndef PROFILER_H
+#define PROFILER_H
+//------------------------------------------------------------------------------
+#include <functional>
+#include <iostream>
+#include <numeric>
+#include <vector>
+
+#include <sys/time.h>
+//------------------------------------------------------------------------------
+#ifdef PROFILING
+#define PROF Profiler<__COUNTER__> p(__func__)
+#else
+#define PROF
+#endif
+//------------------------------------------------------------------------------
+/*! \class Profiler class. Just for profiling, it is not production!
+ * \param id - identificator of profiler. For different functions we have to use different id
+ * How to use? You have to insert this class in the begining of only 1 function (callback?)
+ * ...
+ * void function() {
+ * Profiler<__COUNTER__> p(__func__);
+ * // or just
+ * PROF;
+ * ...
+ */
+template<int id>
+class Profiler
+{
+ const char* name = "";//!< Name of function
+ const static size_t reservedBytes = 50 * 1000;//!< Reserved - calls count
+ struct timespec startTime;//!< Timestamp of start function
+
+ class Local
+ {
+ const char* name = "";
+ public:
+ std::vector<std::uint64_t> values;
+ Local(const char* name)
+ : name(name)
+ {
+ values.reserve(reservedBytes);
+ }
+
+ ~Local()
+ {
+ std::uint64_t sum = std::accumulate(values.begin(), values.end(), 0, std::plus<std::uint64_t>());
+ std::cout << name << "(" << id << "): calls count=" << values.size() << ", avg time=" << sum / values.size() << " nanosecs" << std::endl;
+ }
+ };
+public:
+
+ /*! Constructor
+ * \param name - name of function, which you are going to profile
+ */
+ Profiler(const char* name)
+ : name(name)
+ {
+ clock_gettime(CLOCK_REALTIME, &startTime);
+ }
+
+ ~Profiler()
+ {
+ struct timespec stopTime;
+ clock_gettime(CLOCK_REALTIME, &stopTime);
+
+ static Local local(name);// Time of vector initialization is not included into statistics
+
+ local.values.push_back(stopTime.tv_nsec - startTime.tv_nsec);// Assume, that time < 1 second!
+ }
+
+};
+//------------------------------------------------------------------------------
+#endif//PROFILER_H
+//------------------------------------------------------------------------------
diff --git a/tests/functional/CMakeLists.txt b/tests/functional/CMakeLists.txt
index d07144c..ea3802f 100644
--- a/tests/functional/CMakeLists.txt
+++ b/tests/functional/CMakeLists.txt
@@ -1,19 +1,27 @@
-set (CHECK_TRACE_SCRIPT "check-compressed-trace.sh")
-configure_file ("${CHECK_TRACE_SCRIPT}.in" "${CHECK_TRACE_SCRIPT}")
-set (CHECK_DRANE_SCRIPT "check-compressed-drane.sh")
-configure_file ("${CHECK_DRANE_SCRIPT}.in" "${CHECK_DRANE_SCRIPT}")
-set (CHECK_OUTPUT_SCRIPT "check-output.sh")
-configure_file ("${CHECK_OUTPUT_SCRIPT}.in" "${CHECK_OUTPUT_SCRIPT}")
+set (ANALYZER "breakdown")
+
+set (CHECK_TRACE_SCRIPT_BASE "check-compressed-trace")
+set (CHECK_TRACE_SCRIPT "${CHECK_TRACE_SCRIPT_BASE}-${ANALYZER}.sh")
+configure_file ("${CHECK_TRACE_SCRIPT_BASE}.sh.in" "${CHECK_TRACE_SCRIPT}")
+
+set (CHECK_DRANE_SCRIPT_BASE "check-compressed-drane")
+set (CHECK_DRANE_SCRIPT "${CHECK_DRANE_SCRIPT_BASE}-${ANALYZER}.sh")
+configure_file ("${CHECK_DRANE_SCRIPT_BASE}.sh.in" "${CHECK_DRANE_SCRIPT}")
+
+set (CHECK_OUTPUT_SCRIPT_BASE "check-output")
+set (CHECK_OUTPUT_SCRIPT "${CHECK_OUTPUT_SCRIPT_BASE}-${ANALYZER}.sh")
+configure_file ("${CHECK_OUTPUT_SCRIPT_BASE}.sh.in" "${CHECK_OUTPUT_SCRIPT}")
# Adding trace/drane/output tests for each .pcap.bz2 trace
file (GLOB traces "${CMAKE_SOURCE_DIR}/traces/*.pcap.bz2")
foreach (trace ${traces})
- get_filename_component (name ${trace} NAME)
- get_filename_component (path ${trace} PATH)
- set (result ${CMAKE_BINARY_DIR}/Testing/Temporary/${name}.res)
- set (reference ${path}/references/${name}.ref)
+ get_filename_component (name ${trace} NAME)
+ get_filename_component (path ${trace} PATH)
+ set (result ${CMAKE_BINARY_DIR}/Testing/Temporary/${name}-${ANALYZER}.res)
+ set (reference ${path}/references/${ANALYZER}/${name}.ref)
- add_test (NAME stat:${name} COMMAND sh ${CHECK_TRACE_SCRIPT} ${trace} ${result} ${reference})
- add_test (NAME drain:${name} COMMAND sh ${CHECK_DRANE_SCRIPT} ${trace} ${result} ${reference})
- add_test (NAME out:${name} COMMAND sh ${CHECK_OUTPUT_SCRIPT} ${trace})
+ add_test (NAME functional_stat:${name} COMMAND sh ${CHECK_TRACE_SCRIPT} ${trace} ${result} ${reference})
+ add_test (NAME functional_drain:${name} COMMAND sh ${CHECK_DRANE_SCRIPT} ${trace} ${result} ${reference})
+ add_test (NAME functional_out:${name} COMMAND sh ${CHECK_OUTPUT_SCRIPT} ${trace})
endforeach ()
+
diff --git a/tests/functional/check-compressed-drane.sh.in b/tests/functional/check-compressed-drane.sh.in
index 1944546..91da0dc 100644
--- a/tests/functional/check-compressed-drane.sh.in
+++ b/tests/functional/check-compressed-drane.sh.in
@@ -1,4 +1,4 @@
bzcat $1 | '${CMAKE_BINARY_DIR}/${PROJECT_NAME}' --mode=drain -I - -O - -v 0 --log=drain.logfile.log | \
- '${CMAKE_BINARY_DIR}/${PROJECT_NAME}' --mode=stat -a '${CMAKE_BINARY_DIR}/analyzers/libbreakdown.so' -I - -v 0 --log=stat.logfile.log >$2
+ '${CMAKE_BINARY_DIR}/${PROJECT_NAME}' --mode=stat -a '${CMAKE_BINARY_DIR}/analyzers/lib${ANALYZER}.so' -I - -v 0 --log=stat.logfile.log >$2
diff -uN $3 $2
exit $?
diff --git a/tests/functional/check-compressed-trace.sh.in b/tests/functional/check-compressed-trace.sh.in
index 1ce497a..b0179ff 100644
--- a/tests/functional/check-compressed-trace.sh.in
+++ b/tests/functional/check-compressed-trace.sh.in
@@ -1,3 +1,3 @@
-bzcat $1 | '${CMAKE_BINARY_DIR}/${PROJECT_NAME}' --mode=stat -a '${CMAKE_BINARY_DIR}/analyzers/libbreakdown.so' -I - -v 0 >$2
+bzcat $1 | '${CMAKE_BINARY_DIR}/${PROJECT_NAME}' --mode=stat -a '${CMAKE_BINARY_DIR}/analyzers/lib${ANALYZER}.so' -I - -v 0 >$2
diff -uN $3 $2
exit $?
diff --git a/tests/functional/check-output.sh.in b/tests/functional/check-output.sh.in
index 6cc00c7..3cc700b 100644
--- a/tests/functional/check-output.sh.in
+++ b/tests/functional/check-output.sh.in
@@ -1,2 +1,2 @@
-bzcat $1 | '${CMAKE_BINARY_DIR}/${PROJECT_NAME}' --mode=stat -v 2 -T -a '${CMAKE_BINARY_DIR}/analyzers/libbreakdown.so' -I - -O - | \
+bzcat $1 | '${CMAKE_BINARY_DIR}/${PROJECT_NAME}' --mode=stat -v 2 -T -a '${CMAKE_BINARY_DIR}/analyzers/lib${ANALYZER}.so' -I - -O - | \
grep --color='auto' -P -n '[^\x00-\x7F]' | wc -c | awk '{ if($1 != 0) exit 1 ; exit 0 }';
diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
index 6fea801..d6c41a0 100644
--- a/tests/unit/CMakeLists.txt
+++ b/tests/unit/CMakeLists.txt
@@ -1,15 +1,24 @@
if ("${GMOCK_SOURCE_DIR}" STREQUAL "")
- message ("GMOCK_SOURCE_DIR variable not set - unit-tests are not available. Use '-DGMOCK_SOURCE_DIR=<path_to_gmock_sources>' param for CMake")
+ message (WARNING "GMOCK_SOURCE_DIR variable not set - unit-tests are not available. Use '-DGMOCK_SOURCE_DIR=<path_to_gmock_sources>' param for CMake")
else ()
# Clang and GCC 4.9+ cause errors on GMock/GTest compilation, so we are adding following flags to suppress them
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-private-field")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
+ endif ()
set (gmock_force_shared_crt true CACHE INTERNAL "")
set (BUILD_SHARED_LIBS false CACHE INTERNAL "")
+ add_definitions (-DGTEST_HAS_PTHREAD=1) # It fixes BUG in GTests in BSD
add_subdirectory (${GMOCK_SOURCE_DIR} ${CMAKE_BINARY_DIR}/gmock)
- set (GMOCK_LIBRARIES gmock)
+ set (GMOCK_LIBRARIES gmock gmock_main)
set (GMOCK_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/include"
- "${GMOCK_SOURCE_DIR}/gtest/include")
- include_directories (${CMAKE_SOURCE_DIR}/src ${GMOCK_INCLUDE_DIRS} ${GMOCK_SOURCE_DIR})
+ "${GMOCK_SOURCE_DIR}/gtest/include"
+ "${GMOCK_SOURCE_DIR}")
+
+ include_directories (${CMAKE_SOURCE_DIR}/src ${GMOCK_INCLUDE_DIRS})
add_subdirectory (utils)
+ add_subdirectory (analyzers)
+ add_subdirectory (protocols)
+ add_subdirectory (filtration)
endif ()
diff --git a/tests/unit/analyzers/CMakeLists.txt b/tests/unit/analyzers/CMakeLists.txt
new file mode 100644
index 0000000..59dd1fa
--- /dev/null
+++ b/tests/unit/analyzers/CMakeLists.txt
@@ -0,0 +1,17 @@
+add_subdirectory (json)
+add_subdirectory (breakdown)
+
+project (unit_test_parse)
+aux_source_directory ("." SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/cifs SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/cifs2 SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/nfs SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/netbios SRC_TEST_LIST)
+add_executable (${PROJECT_NAME} ${SRC_TEST_LIST}
+ ${CMAKE_SOURCE_DIR}/src/analysis/cifs_parser.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/out.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/log.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/sessions.cpp
+)
+target_link_libraries (${PROJECT_NAME} ${GMOCK_LIBRARIES})
+add_test (${PROJECT_NAME} ${PROJECT_NAME})
diff --git a/tests/unit/analyzers/breakdown/CMakeLists.txt b/tests/unit/analyzers/breakdown/CMakeLists.txt
new file mode 100644
index 0000000..e5bc435
--- /dev/null
+++ b/tests/unit/analyzers/breakdown/CMakeLists.txt
@@ -0,0 +1,14 @@
+project (unit_test_breakdown)
+aux_source_directory ("." SRC_LIST)
+aux_source_directory ("${CMAKE_SOURCE_DIR}/analyzers/src/breakdown" SRC_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/cifs SRC_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/nfs SRC_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/nfs3 SRC_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/nfs4 SRC_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/utils SRC_LIST)
+
+add_executable(${PROJECT_NAME} ${SRC_LIST})
+
+include_directories ("${CMAKE_SOURCE_DIR}/analyzers/src/breakdown/")
+target_link_libraries (${PROJECT_NAME} ${GMOCK_LIBRARIES} ${CMAKE_DL_LIBS})
+add_test (${PROJECT_NAME} ${PROJECT_NAME})
diff --git a/tests/unit/analyzers/breakdown/breakdown.cpp b/tests/unit/analyzers/breakdown/breakdown.cpp
new file mode 100644
index 0000000..d9ac1c3
--- /dev/null
+++ b/tests/unit/analyzers/breakdown/breakdown.cpp
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Unit tests
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cstdlib>
+#include <iostream>
+#include <ctime>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "breakdowncounter.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+
+using ::testing::Return;
+using ::testing::AtLeast;
+using ::testing::_;
+//------------------------------------------------------------------------------
+namespace
+{
+
+class BreakdownTest : public ::testing::Test
+{
+protected:
+ size_t count;
+ timeval t;
+public:
+ void SetUp()
+ {
+ std::srand(std::time(0)); //use current time as seed for random generator
+ count = std::rand() % 100 + 3;
+ }
+
+ void TearDown()
+ {
+ }
+};
+
+}
+//------------------------------------------------------------------------------
+TEST_F(BreakdownTest, count)
+{
+
+ BreakdownCounter break_down(count);
+
+ EXPECT_EQ(0U, break_down.get_total_count());
+
+ break_down[1].add(t);
+ break_down[1].add(t);
+ break_down[0].add(t);
+
+ EXPECT_EQ(3U, break_down.get_total_count());
+
+}
+//------------------------------------------------------------------------------
diff --git a/tests/unit/analyzers/breakdown/latency.cpp b/tests/unit/analyzers/breakdown/latency.cpp
new file mode 100644
index 0000000..675281f
--- /dev/null
+++ b/tests/unit/analyzers/breakdown/latency.cpp
@@ -0,0 +1,100 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Unit tests
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cstdlib>
+#include <iostream>
+#include <ctime>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "latencies.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+
+using ::testing::Return;
+using ::testing::AtLeast;
+using ::testing::_;
+//------------------------------------------------------------------------------
+namespace
+{
+
+class LatencyTest : public ::testing::Test
+{
+protected:
+ size_t count;
+ timeval t1;
+ timeval t2;
+public:
+ void SetUp()
+ {
+ t1.tv_sec = 10;
+ t2.tv_sec = 2;
+
+ t1.tv_usec = 12;
+ t2.tv_usec = 4;
+
+ std::srand(std::time(0)); //use current time as seed for random generator
+ count = std::rand() % 100 + 3;
+ }
+
+ void TearDown()
+ {
+ }
+};
+
+}
+//------------------------------------------------------------------------------
+TEST_F(LatencyTest, max_min)
+{
+
+ Latencies latency;
+
+ EXPECT_EQ(0U, latency.get_count());
+
+ latency.add(t1);
+ latency.add(t2);
+
+ EXPECT_EQ(2U, latency.get_count());
+
+ EXPECT_EQ(t2.tv_sec, latency.get_min().tv_sec);
+ EXPECT_EQ(t2.tv_usec, latency.get_min().tv_usec);
+
+ EXPECT_EQ(t1.tv_sec, latency.get_max().tv_sec);
+ EXPECT_EQ(t1.tv_usec, latency.get_max().tv_usec);
+
+}
+
+TEST_F(LatencyTest, avg)
+{
+ Latencies latency;
+
+ EXPECT_EQ(0.0, latency.get_avg());
+
+ latency.add(t1);
+
+ EXPECT_NEAR(10.0, latency.get_avg(), 0.0001);
+
+ latency.add(t2);
+
+ EXPECT_NEAR(6.0, latency.get_avg(), 0.0001);
+}
+//------------------------------------------------------------------------------
diff --git a/tests/unit/analyzers/breakdown/statistic.cpp b/tests/unit/analyzers/breakdown/statistic.cpp
new file mode 100644
index 0000000..08f33d7
--- /dev/null
+++ b/tests/unit/analyzers/breakdown/statistic.cpp
@@ -0,0 +1,141 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Unit tests
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <cstdlib>
+#include <iostream>
+#include <ctime>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "statistics.h"
+//------------------------------------------------------------------------------
+using namespace NST::breakdown;
+
+using ::testing::Return;
+using ::testing::AtLeast;
+using ::testing::_;
+//------------------------------------------------------------------------------
+namespace
+{
+
+class StatisticTest : public ::testing::Test
+{
+protected:
+ size_t count;
+public:
+ void SetUp()
+ {
+ std::srand(std::time(0)); //use current time as seed for random generator
+ count = std::rand() % 100 + 3;
+ }
+
+ void TearDown()
+ {
+ }
+};
+
+class Mock
+{
+public:
+ MOCK_METHOD0(mock_function, void(void));
+};
+
+class Proc
+{
+public:
+ Proc()
+ : session(&_session)
+ , rtimestamp(&_rtimestamp)
+ , ctimestamp(&_ctimestamp)
+ {
+ }
+
+ Session _session;
+ timeval _rtimestamp;
+ timeval _ctimestamp;
+ const Session* session;
+ const timeval* rtimestamp;
+ const timeval* ctimestamp;
+};
+
+}
+//------------------------------------------------------------------------------
+TEST_F(StatisticTest, statistics)
+{
+
+ Statistics stats(count);
+
+ EXPECT_EQ(count, stats.proc_types_count);
+
+ Mock each_procedure_mock;
+ EXPECT_CALL(each_procedure_mock, mock_function())
+ .Times(count);
+
+ stats.for_each_procedure([&](const BreakdownCounter&, size_t)
+ {
+ each_procedure_mock.mock_function();
+ });
+}
+
+TEST_F(StatisticTest, sessions_statistics)
+{
+
+ Statistics stats(count);
+ Mock each_procedure_mock;
+ Proc proc;
+
+ EXPECT_CALL(each_procedure_mock, mock_function())
+ .Times(1);
+
+ EXPECT_FALSE(stats.has_session());
+ stats.account(&proc, 0);
+ EXPECT_TRUE(stats.has_session());
+
+ stats.for_each_session([&](const Session&)
+ {
+ each_procedure_mock.mock_function();
+ });
+}
+
+TEST_F(StatisticTest, statistics_per_session)
+{
+
+ Statistics stats(count);
+ Mock each_procedure_mock;
+ Proc proc;
+
+ EXPECT_CALL(each_procedure_mock, mock_function())
+ .Times(count);
+
+ stats.for_each_procedure_in_session(proc._session, [&](const BreakdownCounter&, size_t)
+ {
+ each_procedure_mock.mock_function();
+ });
+
+ stats.account(&proc, 1);
+
+ stats.for_each_procedure_in_session(proc._session, [&](const BreakdownCounter&, size_t)
+ {
+ each_procedure_mock.mock_function();
+ });
+}
+//------------------------------------------------------------------------------
diff --git a/tests/unit/analyzers/cifs.cpp b/tests/unit/analyzers/cifs.cpp
new file mode 100644
index 0000000..8b12add
--- /dev/null
+++ b/tests/unit/analyzers/cifs.cpp
@@ -0,0 +1,195 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Parsers tests
+// Copyright (c) 2015 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <arpa/inet.h>
+
+#include "analysis/analyzers.h"
+#include "analysis/cifs_parser.h"
+#include "api/cifs_types.h"
+#include "api/cifs_pc_to_net.h"
+#include "api/cifs2_commands.h"
+//------------------------------------------------------------------------------
+using namespace NST::filtration;
+using namespace NST::analysis;
+using namespace NST::controller;
+using namespace NST::utils;
+
+using ::testing::Return;
+using ::testing::AtLeast;
+using ::testing::_;
+//------------------------------------------------------------------------------
+
+namespace
+{
+
+class PluginMock : public IAnalyzer
+{
+public:
+ // ISMBv2 interface
+ MOCK_METHOD3(readSMBv2, void(const SMBv2::ReadCommand *, const NST::API::SMBv2::ReadRequest *, const NST::API::SMBv2::ReadResponse *));
+
+ // IAnalyzer interface
+ void flush_statistics() {}
+};
+
+
+PluginMock* pluginMock;// pointer to mock
+}
+//------------------------------------------------------------------------------
+Analyzers::Analyzers(const controller::Parameters& /*params*/)
+{
+ this->modules.push_back(pluginMock);
+}
+//------------------------------------------------------------------------------
+Parameters::Parameters(int /*argc*/, char** /*argv*/) {}
+
+Parameters::~Parameters() {}
+
+bool Parameters::show_help() const
+{
+ return false;
+}
+
+bool Parameters::show_enum() const
+{
+ return false;
+}
+
+const std::string& Parameters::program_name() const
+{
+ static std::string s("");
+ return s;
+}
+
+RunningMode Parameters::running_mode() const
+{
+ return RunningMode::Analysis;
+}
+
+std::string Parameters::input_file() const
+{
+ return "";
+}
+
+const std::string Parameters::dropuser() const
+{
+ return "";
+}
+
+const std::string Parameters::log_path() const
+{
+ return "";
+}
+
+unsigned short Parameters::queue_capacity() const
+{
+ return 0;
+}
+
+bool Parameters::trace() const
+{
+ return false;
+}
+int Parameters::verbose_level() const
+{
+ return 0;
+}
+
+const NST::filtration::pcap::CaptureReader::Params Parameters::capture_params() const
+{
+ return NST::filtration::pcap::CaptureReader::Params();
+}
+
+const NST::filtration::Dumping::Params Parameters::dumping_params() const
+{
+ return NST::filtration::Dumping::Params();
+}
+
+const std::vector<AParams>& Parameters::analysis_modules() const
+{
+ static std::vector<AParams> Parameters;
+ return Parameters;
+}
+
+unsigned short Parameters::rpcmsg_limit()
+{
+ return 0;
+}
+//------------------------------------------------------------------------------
+const std::string Plugin::usage_of(const std::string& /*path*/)
+{
+ return "";
+}
+
+DynamicLoad::DynamicLoad(const std::string &/*file*/) {}
+
+DynamicLoad::~DynamicLoad() {}
+
+template<typename plugin_get_entry_points_func>
+void load_address_of(const std::string& /*name*/, plugin_get_entry_points_func& /*address*/)
+{}
+
+Plugin::Plugin(const std::string& path) : DynamicLoad(path) {}
+
+PluginInstance::PluginInstance(const std::string& path, const std::string& /*args*/) : Plugin(path) {}
+
+PluginInstance::~PluginInstance() {}
+
+//------------------------------------------------------------------------------
+TEST(Parser, CIFSAsyncParser)
+{
+ pluginMock = new PluginMock;
+
+ NST::controller::Parameters params(0, nullptr);
+ Analyzers analyzers(params);
+
+ NST::utils::FilteredDataQueue queue(1, 1);
+ NST::utils::FilteredData* data = queue.allocate();
+ NetworkSession s;
+ data->session = &s;
+ queue.push(data);
+ NST::utils::FilteredDataQueue::List list(queue);
+ NST::utils::FilteredDataQueue::Ptr el = list.get_current();
+
+ CIFSv2::MessageHeader header;
+ header.head_code = NST::API::SMBv2::pc_to_net<uint32_t>(0x424d53fe);// Protocol's marker
+ header.cmd_code = NST::API::SMBv2::SMBv2Commands::READ;
+ header.flags = static_cast<uint32_t>(CIFSv2::Flags::ASYNC_COMMAND);
+
+ el->data = reinterpret_cast<uint8_t*>(&header);
+ el->dlen = sizeof(header);
+
+ CIFSParser parser(analyzers);
+
+ // Set conditions
+ EXPECT_CALL(*pluginMock, readSMBv2(_, _, _))
+ .Times(1);
+
+ // Do
+ parser.parse_data(el);
+
+ delete pluginMock;
+}
+//------------------------------------------------------------------------------
+
diff --git a/tests/unit/analyzers/json/CMakeLists.txt b/tests/unit/analyzers/json/CMakeLists.txt
new file mode 100644
index 0000000..24d24bf
--- /dev/null
+++ b/tests/unit/analyzers/json/CMakeLists.txt
@@ -0,0 +1,19 @@
+set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
+find_package (JSON)
+
+if (JSON_FOUND)
+ project (unit_test_json_analyzer)
+ aux_source_directory ("." SRC_LIST)
+ add_executable (${PROJECT_NAME} ${SRC_LIST}
+ ${CMAKE_SOURCE_DIR}/analyzers/src/json/json_analyzer.cpp
+ ${CMAKE_SOURCE_DIR}/analyzers/src/json/json_tcp_service.cpp
+ ${CMAKE_SOURCE_DIR}/analyzers/src/json/abstract_tcp_service.cpp
+ ${CMAKE_SOURCE_DIR}/analyzers/src/json/ip_endpoint.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/log.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/out.cpp)
+ include_directories (${JSON_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/analyzers/src/json)
+ target_link_libraries (${PROJECT_NAME} ${JSON_LIBRARIES} ${GMOCK_LIBRARIES})
+ add_test (${PROJECT_NAME} ${PROJECT_NAME})
+else ()
+ message (WARNING "JSON library not found - JSON-service unit-tests are not available!")
+endif ()
diff --git a/tests/unit/analyzers/json/ip_endpoint.cpp b/tests/unit/analyzers/json/ip_endpoint.cpp
new file mode 100644
index 0000000..a62097f
--- /dev/null
+++ b/tests/unit/analyzers/json/ip_endpoint.cpp
@@ -0,0 +1,41 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: TCP-endpoint tests
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <stdexcept>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "ip_endpoint.h"
+//------------------------------------------------------------------------------
+
+static constexpr const char* ValidHost = IpEndpoint::LoopbackAddress;
+static constexpr int ValidPort = 8888;
+static constexpr const char* InvalidHost = "invalid_host_name";
+static constexpr int InvalidPort = -1;
+
+TEST(TestTcpEndpoint, constructDestruct)
+{
+ EXPECT_NO_THROW(IpEndpoint endpoint(ValidHost, ValidPort));
+ EXPECT_THROW(IpEndpoint endpoint(ValidHost, InvalidPort), std::runtime_error);
+ EXPECT_THROW(IpEndpoint endpoint(InvalidHost, ValidPort), std::runtime_error);
+ EXPECT_THROW(IpEndpoint endpoint(InvalidHost, InvalidPort), std::runtime_error);
+}
diff --git a/tests/unit/analyzers/json/tcp_service.cpp b/tests/unit/analyzers/json/tcp_service.cpp
new file mode 100644
index 0000000..192b710
--- /dev/null
+++ b/tests/unit/analyzers/json/tcp_service.cpp
@@ -0,0 +1,165 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: TCP-service tests
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <chrono>
+#include <thread>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <sys/socket.h>
+
+#include "abstract_tcp_service.h"
+//------------------------------------------------------------------------------
+
+static constexpr std::size_t AwaitForServiceStartupMs = 250U;
+static constexpr std::size_t StartStopCyclesAmount = 5U;
+static constexpr std::size_t TransmissionTimeoutMs = 10000U;
+static constexpr const char* ListenHost = IpEndpoint::LoopbackAddress;
+static constexpr int ListenPort = 8888;
+static constexpr std::size_t WorkersAmount = 100U;
+static constexpr std::size_t ReceiveBufferSize = 4096U;
+static constexpr const char* TestRequest = "GET";
+static constexpr const char* TestResponse = "{copy:32,remove:46,getattr:154}";
+
+static std::atomic_int taskExecuteCallsCount;
+
+class TestTcpService : public AbstractTcpService
+{
+public:
+ TestTcpService() :
+ AbstractTcpService{WorkersAmount, ListenPort, ListenHost}
+ {}
+private:
+ class Task : public AbstractTask
+ {
+ public:
+ Task(TestTcpService& service, int socket) :
+ AbstractTask{socket},
+ _service(service)
+ {}
+ Task() = delete;
+
+ void execute() override final
+ {
+ ++taskExecuteCallsCount;
+ // Receiving request
+ struct timespec readTimeout;
+ readTimeout.tv_sec = TransmissionTimeoutMs / 1000;
+ readTimeout.tv_nsec = TransmissionTimeoutMs % 1000 * 1000000;
+ fd_set readDescriptiorsSet;
+ FD_ZERO(&readDescriptiorsSet);
+ FD_SET(socket(), &readDescriptiorsSet);
+ int readDescriptorsCount = pselect(socket() + 1, &readDescriptiorsSet, NULL, NULL, &readTimeout, NULL);
+ ASSERT_GT(readDescriptorsCount, 0);
+ ASSERT_TRUE(FD_ISSET(socket(), &readDescriptiorsSet));
+ char receiveBuffer[ReceiveBufferSize];
+ ssize_t bytesReceived = recv(socket(), receiveBuffer, sizeof(receiveBuffer), 0);
+ EXPECT_EQ(TestRequest, std::string(receiveBuffer, bytesReceived));
+ // Sending response
+ struct timespec writeTimeout;
+ writeTimeout.tv_sec = TransmissionTimeoutMs / 1000;
+ writeTimeout.tv_nsec = TransmissionTimeoutMs % 1000 * 1000000;
+ fd_set writeDescriptiorsSet;
+ FD_ZERO(&writeDescriptiorsSet);
+ FD_SET(socket(), &writeDescriptiorsSet);
+ int writeDescriptorsCount = pselect(socket() + 1, NULL, &writeDescriptiorsSet, NULL, &writeTimeout, NULL);
+ ASSERT_GT(writeDescriptorsCount, 0);
+ ASSERT_TRUE(FD_ISSET(socket(), &writeDescriptiorsSet));
+ ssize_t bytesSent = send(socket(), TestResponse, strlen(TestResponse), MSG_NOSIGNAL);
+ EXPECT_EQ(static_cast<ssize_t>(strlen(TestResponse)), bytesSent);
+ }
+ private:
+ TestTcpService& _service;
+ };
+
+ AbstractTask* createTask(int socket) override final
+ {
+ return new Task{*this, socket};
+ }
+};
+
+TEST(TestTcpService, constructDestruct)
+{
+ EXPECT_NO_THROW(TestTcpService service);
+}
+
+TEST(TestTcpService, requestResponse)
+{
+ taskExecuteCallsCount = 0;
+ TestTcpService service;
+ for (size_t i = 0; i < StartStopCyclesAmount; ++i) {
+ EXPECT_NO_THROW(service.start());
+ std::this_thread::sleep_for(std::chrono::milliseconds{AwaitForServiceStartupMs});
+ int s = socket(PF_INET, SOCK_STREAM, 0);
+ ASSERT_GE(s, 0);
+ IpEndpoint endpoint{ListenHost, ListenPort};
+ ASSERT_EQ(0, connect(s, endpoint.addrinfo()->ai_addr, endpoint.addrinfo()->ai_addrlen));
+ ssize_t bytesSent = send(s, TestRequest, strlen(TestRequest), MSG_NOSIGNAL);
+ EXPECT_EQ(strlen(TestRequest), static_cast<size_t>(bytesSent));
+ char receiveBuffer[ReceiveBufferSize];
+ ssize_t bytesReceived = recv(s, receiveBuffer, sizeof(receiveBuffer), 0);
+ EXPECT_EQ(TestResponse, std::string(receiveBuffer, bytesReceived));
+ EXPECT_EQ(0, close(s));
+ EXPECT_NO_THROW(service.stop());
+ }
+ EXPECT_EQ(StartStopCyclesAmount, static_cast<size_t>(taskExecuteCallsCount.load()));
+}
+
+TEST(TestTcpService, multipleRequestResponse)
+{
+ taskExecuteCallsCount = 0;
+ TestTcpService service;
+ EXPECT_NO_THROW(service.start());
+ std::this_thread::sleep_for(std::chrono::milliseconds{AwaitForServiceStartupMs});
+ std::vector<int> sockets(WorkersAmount);
+ for (auto & s : sockets)
+ {
+ s = socket(PF_INET, SOCK_STREAM, 0);
+ ASSERT_GE(s, 0);
+ }
+ IpEndpoint endpoint{ListenHost, ListenPort};
+ for (auto & s : sockets)
+ {
+ ASSERT_EQ(0, connect(s, endpoint.addrinfo()->ai_addr, endpoint.addrinfo()->ai_addrlen));
+ }
+ for (auto & s : sockets)
+ {
+ ssize_t bytesSent = send(s, TestRequest, strlen(TestRequest), MSG_NOSIGNAL);
+ EXPECT_EQ(static_cast<ssize_t>(strlen(TestRequest)), bytesSent);
+ }
+ char receiveBuffer[ReceiveBufferSize];
+ for (auto & s : sockets)
+ {
+ ssize_t bytesReceived = recv(s, receiveBuffer, sizeof(receiveBuffer), 0);
+ EXPECT_EQ(TestResponse, std::string(receiveBuffer, bytesReceived));
+ }
+ for (auto & s : sockets)
+ {
+ EXPECT_EQ(0, close(s));
+ }
+ EXPECT_EQ(sockets.size(), static_cast<size_t>(taskExecuteCallsCount.load()));
+ EXPECT_NO_THROW(service.stop());
+}
+
+// TODO
+/*TEST(TestTcpService, overload)
+{
+}*/
diff --git a/tests/unit/analyzers/json/test_json_analyzer.cpp b/tests/unit/analyzers/json/test_json_analyzer.cpp
new file mode 100644
index 0000000..d058ae1
--- /dev/null
+++ b/tests/unit/analyzers/json/test_json_analyzer.cpp
@@ -0,0 +1,1799 @@
+//------------------------------------------------------------------------------
+// Author: Ilya Storozhilov
+// Description: JSON analyzer tests executable
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <chrono>
+#include <thread>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <json.h>
+
+#include "json_analyzer.h"
+//------------------------------------------------------------------------------
+
+static constexpr std::size_t AwaitForServiceStartupMs = 250U;
+static constexpr std::size_t WorkersAmount = 100U;
+static constexpr int ListenPort = 8888;
+static constexpr const char* ListenHost = IpEndpoint::LoopbackAddress;
+static constexpr std::size_t MaxServingDurationMs = 500U;
+static constexpr int ListenBacklog = 15;
+static constexpr std::size_t ReceiveBufferSize = 4096U;
+static constexpr std::size_t SlowClientTimeoutMs = 1000U;
+
+// NFS3 procedures:
+static constexpr int NfsV3NullProcsAmount = 25;
+static constexpr int NfsV3GetattrProcsAmount = 35;
+static constexpr int NfsV3SetattrProcsAmount = 80;
+static constexpr int NfsV3LookupProcsAmount = 76;
+static constexpr int NfsV3AccessProcsAmount = 42;
+static constexpr int NfsV3ReadlinkProcsAmount = 24;
+static constexpr int NfsV3ReadProcsAmount = 56;
+static constexpr int NfsV3WriteProcsAmount = 152;
+static constexpr int NfsV3CreateProcsAmount = 31;
+static constexpr int NfsV3MkdirProcsAmount = 97;
+static constexpr int NfsV3SymlinkProcsAmount = 69;
+static constexpr int NfsV3MknodProcsAmount = 73;
+static constexpr int NfsV3RemoveProcsAmount = 36;
+static constexpr int NfsV3RmdirProcsAmount = 27;
+static constexpr int NfsV3RenameProcsAmount = 59;
+static constexpr int NfsV3LinkProcsAmount = 28;
+static constexpr int NfsV3ReaddirProcsAmount = 83;
+static constexpr int NfsV3ReaddirplusProcsAmount = 74;
+static constexpr int NfsV3FsstatProcsAmount = 95;
+static constexpr int NfsV3FsinfoProcsAmount = 57;
+static constexpr int NfsV3PathconfProcsAmount = 26;
+static constexpr int NfsV3CommitProcsAmount = 79;
+
+// NFS4.0 procedures:
+static constexpr int NfsV40NullProcsAmount = 81;
+static constexpr int NfsV40CompoundProcsAmount = 18;
+
+// NFS4.0 operations:
+static constexpr int NfsV40accessOpsAmount = 32;
+static constexpr int NfsV40closeOpsAmount = 42;
+static constexpr int NfsV40commitOpsAmount = 35;
+static constexpr int NfsV40createOpsAmount = 65;
+static constexpr int NfsV40delegpurgeOpsAmount = 98;
+static constexpr int NfsV40delegreturnOpsAmount = 76;
+static constexpr int NfsV40getattrOpsAmount = 34;
+static constexpr int NfsV40getfhOpsAmount = 76;
+static constexpr int NfsV40linkOpsAmount = 90;
+static constexpr int NfsV40lockOpsAmount = 78;
+static constexpr int NfsV40locktOpsAmount = 35;
+static constexpr int NfsV40lockuOpsAmount = 67;
+static constexpr int NfsV40lookupOpsAmount = 23;
+static constexpr int NfsV40lookuppOpsAmount = 77;
+static constexpr int NfsV40nverifyOpsAmount = 59;
+static constexpr int NfsV40openOpsAmount = 34;
+static constexpr int NfsV40openattrOpsAmount = 54;
+static constexpr int NfsV40open_confirmOpsAmount = 54;
+static constexpr int NfsV40open_downgradeOpsAmount = 36;
+static constexpr int NfsV40putfhOpsAmount = 78;
+static constexpr int NfsV40putpubfhOpsAmount = 96;
+static constexpr int NfsV40putrootfhOpsAmount = 56;
+static constexpr int NfsV40readOpsAmount = 36;
+static constexpr int NfsV40readdirOpsAmount = 59;
+static constexpr int NfsV40readlinkOpsAmount = 53;
+static constexpr int NfsV40removeOpsAmount = 88;
+static constexpr int NfsV40renameOpsAmount = 34;
+static constexpr int NfsV40renewOpsAmount = 68;
+static constexpr int NfsV40restorefhOpsAmount = 37;
+static constexpr int NfsV40savefhOpsAmount = 84;
+static constexpr int NfsV40secinfoOpsAmount = 69;
+static constexpr int NfsV40setattrOpsAmount = 33;
+static constexpr int NfsV40setclientidOpsAmount = 25;
+static constexpr int NfsV40setclientid_confirmOpsAmount = 36;
+static constexpr int NfsV40verifyOpsAmount = 76;
+static constexpr int NfsV40writeOpsAmount = 55;
+static constexpr int NfsV40release_lockownerOpsAmount = 18;
+static constexpr int NfsV40get_dir_delegationOpsAmount = 54;
+static constexpr int NfsV40illegalOpsAmount = 38;
+
+// NFS4.1 procedures:
+static constexpr int NfsV41CompoundProcsAmount = 18;
+
+// NFS4.1 operations:
+static constexpr int NfsV41accessOpsAmount = 37;
+static constexpr int NfsV41closeOpsAmount = 23;
+static constexpr int NfsV41commitOpsAmount = 19;
+static constexpr int NfsV41createOpsAmount = 37;
+static constexpr int NfsV41delegpurgeOpsAmount = 22;
+static constexpr int NfsV41delegreturnOpsAmount = 64;
+static constexpr int NfsV41getattrOpsAmount = 95;
+static constexpr int NfsV41getfhOpsAmount = 34;
+static constexpr int NfsV41linkOpsAmount = 95;
+static constexpr int NfsV41lockOpsAmount = 37;
+static constexpr int NfsV41locktOpsAmount = 96;
+static constexpr int NfsV41lockuOpsAmount = 45;
+static constexpr int NfsV41lookupOpsAmount = 52;
+static constexpr int NfsV41lookuppOpsAmount = 25;
+static constexpr int NfsV41nverifyOpsAmount = 44;
+static constexpr int NfsV41openOpsAmount = 93;
+static constexpr int NfsV41openattrOpsAmount = 77;
+static constexpr int NfsV41open_confirmOpsAmount = 56;
+static constexpr int NfsV41open_downgradeOpsAmount = 98;
+static constexpr int NfsV41putfhOpsAmount = 34;
+static constexpr int NfsV41putpubfhOpsAmount = 80;
+static constexpr int NfsV41putrootfhOpsAmount = 66;
+static constexpr int NfsV41readOpsAmount = 89;
+static constexpr int NfsV41readdirOpsAmount = 87;
+static constexpr int NfsV41readlinkOpsAmount = 65;
+static constexpr int NfsV41removeOpsAmount = 23;
+static constexpr int NfsV41renameOpsAmount = 34;
+static constexpr int NfsV41renewOpsAmount = 68;
+static constexpr int NfsV41restorefhOpsAmount = 44;
+static constexpr int NfsV41savefhOpsAmount = 67;
+static constexpr int NfsV41secinfoOpsAmount = 98;
+static constexpr int NfsV41setattrOpsAmount = 87;
+static constexpr int NfsV41setclientidOpsAmount = 65;
+static constexpr int NfsV41setclientid_confirmOpsAmount = 98;
+static constexpr int NfsV41verifyOpsAmount = 45;
+static constexpr int NfsV41writeOpsAmount = 23;
+static constexpr int NfsV41release_lockownerOpsAmount = 56;
+static constexpr int NfsV41backchannel_ctlOpsAmount = 98;
+static constexpr int NfsV41bind_conn_to_sessionOpsAmount = 67;
+static constexpr int NfsV41exchange_idOpsAmount = 34;
+static constexpr int NfsV41create_sessionOpsAmount = 15;
+static constexpr int NfsV41destroy_sessionOpsAmount = 99;
+static constexpr int NfsV41free_stateidOpsAmount = 26;
+static constexpr int NfsV41get_dir_delegationOpsAmount = 54;
+static constexpr int NfsV41getdeviceinfoOpsAmount = 59;
+static constexpr int NfsV41getdevicelistOpsAmount = 13;
+static constexpr int NfsV41layoutcommitOpsAmount = 64;
+static constexpr int NfsV41layoutgetOpsAmount = 34;
+static constexpr int NfsV41layoutreturnOpsAmount = 75;
+static constexpr int NfsV41secinfo_no_nameOpsAmount = 79;
+static constexpr int NfsV41sequenceOpsAmount = 88;
+static constexpr int NfsV41set_ssvOpsAmount = 45;
+static constexpr int NfsV41test_stateidOpsAmount = 74;
+static constexpr int NfsV41want_delegationOpsAmount = 56;
+static constexpr int NfsV41destroy_clientidOpsAmount = 72;
+static constexpr int NfsV41reclaim_completeOpsAmount = 45;
+static constexpr int NfsV41illegalOpsAmount = 43;
+
+class JsonAnalyzerCase : public ::testing::Test
+{
+protected:
+ virtual void SetUp() override final
+ {
+ // Starting service
+ analyzer.reset(new JsonAnalyzer{WorkersAmount, ListenPort, ListenHost, MaxServingDurationMs, ListenBacklog});
+ std::this_thread::sleep_for(std::chrono::milliseconds{AwaitForServiceStartupMs});
+ // Setting up analyzer (NFSv3)
+ for (int i = 0; i < NfsV3NullProcsAmount; ++i)
+ {
+ analyzer->null(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::NULL3args*>(nullptr),
+ static_cast<const struct NFS3::NULL3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3GetattrProcsAmount; ++i)
+ {
+ analyzer->getattr3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::GETATTR3args*>(nullptr),
+ static_cast<const struct NFS3::GETATTR3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3SetattrProcsAmount; ++i)
+ {
+ analyzer->setattr3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::SETATTR3args*>(nullptr),
+ static_cast<const struct NFS3::SETATTR3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3LookupProcsAmount; ++i)
+ {
+ analyzer->lookup3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::LOOKUP3args*>(nullptr),
+ static_cast<const struct NFS3::LOOKUP3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3AccessProcsAmount; ++i)
+ {
+ analyzer->access3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::ACCESS3args*>(nullptr),
+ static_cast<const struct NFS3::ACCESS3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3ReadlinkProcsAmount; ++i)
+ {
+ analyzer->readlink3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::READLINK3args*>(nullptr),
+ static_cast<const struct NFS3::READLINK3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3ReadProcsAmount; ++i)
+ {
+ analyzer->read3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::READ3args*>(nullptr),
+ static_cast<const struct NFS3::READ3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3WriteProcsAmount; ++i)
+ {
+ analyzer->write3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::WRITE3args*>(nullptr),
+ static_cast<const struct NFS3::WRITE3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3CreateProcsAmount; ++i)
+ {
+ analyzer->create3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::CREATE3args*>(nullptr),
+ static_cast<const struct NFS3::CREATE3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3MkdirProcsAmount; ++i)
+ {
+ analyzer->mkdir3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::MKDIR3args*>(nullptr),
+ static_cast<const struct NFS3::MKDIR3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3SymlinkProcsAmount; ++i)
+ {
+ analyzer->symlink3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::SYMLINK3args*>(nullptr),
+ static_cast<const struct NFS3::SYMLINK3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3MknodProcsAmount; ++i)
+ {
+ analyzer->mknod3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::MKNOD3args*>(nullptr),
+ static_cast<const struct NFS3::MKNOD3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3RemoveProcsAmount; ++i)
+ {
+ analyzer->remove3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::REMOVE3args*>(nullptr),
+ static_cast<const struct NFS3::REMOVE3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3RmdirProcsAmount; ++i)
+ {
+ analyzer->rmdir3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::RMDIR3args*>(nullptr),
+ static_cast<const struct NFS3::RMDIR3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3RenameProcsAmount; ++i)
+ {
+ analyzer->rename3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::RENAME3args*>(nullptr),
+ static_cast<const struct NFS3::RENAME3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3LinkProcsAmount; ++i)
+ {
+ analyzer->link3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::LINK3args*>(nullptr),
+ static_cast<const struct NFS3::LINK3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3ReaddirProcsAmount; ++i)
+ {
+ analyzer->readdir3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::READDIR3args*>(nullptr),
+ static_cast<const struct NFS3::READDIR3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3ReaddirplusProcsAmount; ++i)
+ {
+ analyzer->readdirplus3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::READDIRPLUS3args*>(nullptr),
+ static_cast<const struct NFS3::READDIRPLUS3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3FsstatProcsAmount; ++i)
+ {
+ analyzer->fsstat3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::FSSTAT3args*>(nullptr),
+ static_cast<const struct NFS3::FSSTAT3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3FsinfoProcsAmount; ++i)
+ {
+ analyzer->fsinfo3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::FSINFO3args*>(nullptr),
+ static_cast<const struct NFS3::FSINFO3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3PathconfProcsAmount; ++i)
+ {
+ analyzer->pathconf3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::PATHCONF3args*>(nullptr),
+ static_cast<const struct NFS3::PATHCONF3res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV3CommitProcsAmount; ++i)
+ {
+ analyzer->commit3(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS3::COMMIT3args*>(nullptr),
+ static_cast<const struct NFS3::COMMIT3res*>(nullptr));
+ }
+
+ // Setting up analyzer (NFSv4.0 procedures)
+ for (int i = 0; i < NfsV40NullProcsAmount; ++i)
+ {
+ analyzer->null4(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::NULL4args*>(nullptr),
+ static_cast<const struct NFS4::NULL4res*>(nullptr));
+ }
+ for (int i = 0; i < NfsV40CompoundProcsAmount; ++i)
+ {
+ analyzer->compound4(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::COMPOUND4args*>(nullptr),
+ static_cast<const struct NFS4::COMPOUND4res*>(nullptr));
+ }
+
+ // Setting up analyzer (NFSv4.0 operations)
+ const struct NFS4::ACCESS4res access40 {};
+ for (int i = 0; i < NfsV40accessOpsAmount; ++i)
+ {
+ analyzer->access40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::ACCESS4args*>(nullptr),
+ &access40);
+ }
+ const struct NFS4::CLOSE4res close40 {};
+ for (int i = 0; i < NfsV40closeOpsAmount; ++i)
+ {
+ analyzer->close40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::CLOSE4args*>(nullptr),
+ &close40);
+ }
+ const struct NFS4::COMMIT4res commit40 {};
+ for (int i = 0; i < NfsV40commitOpsAmount; ++i)
+ {
+ analyzer->commit40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::COMMIT4args*>(nullptr),
+ &commit40);
+ }
+ const struct NFS4::CREATE4res create40 {};
+ for (int i = 0; i < NfsV40createOpsAmount; ++i)
+ {
+ analyzer->create40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::CREATE4args*>(nullptr),
+ &create40);
+ }
+ const struct NFS4::DELEGPURGE4res delegpurge40 {};
+ for (int i = 0; i < NfsV40delegpurgeOpsAmount; ++i)
+ {
+ analyzer->delegpurge40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::DELEGPURGE4args*>(nullptr),
+ &delegpurge40);
+ }
+ const struct NFS4::DELEGRETURN4res delegreturn40 {};
+ for (int i = 0; i < NfsV40delegreturnOpsAmount; ++i)
+ {
+ analyzer->delegreturn40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::DELEGRETURN4args*>(nullptr),
+ &delegreturn40);
+ }
+ const struct NFS4::GETATTR4res getattr40 {};
+ for (int i = 0; i < NfsV40getattrOpsAmount; ++i)
+ {
+ analyzer->getattr40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::GETATTR4args*>(nullptr),
+ &getattr40);
+ }
+ const struct NFS4::GETFH4res getfh40 {};
+ for (int i = 0; i < NfsV40getfhOpsAmount; ++i)
+ {
+ analyzer->getfh40(static_cast<const RPCProcedure*>(nullptr),
+ &getfh40);
+ }
+ const struct NFS4::LINK4res link40 {};
+ for (int i = 0; i < NfsV40linkOpsAmount; ++i)
+ {
+ analyzer->link40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::LINK4args*>(nullptr),
+ &link40);
+ }
+ const struct NFS4::LOCK4res lock40 {};
+ for (int i = 0; i < NfsV40lockOpsAmount; ++i)
+ {
+ analyzer->lock40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::LOCK4args*>(nullptr),
+ &lock40);
+ }
+ const struct NFS4::LOCKT4res lockt40 {};
+ for (int i = 0; i < NfsV40locktOpsAmount; ++i)
+ {
+ analyzer->lockt40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::LOCKT4args*>(nullptr),
+ &lockt40);
+ }
+ const struct NFS4::LOCKU4res locku40 {};
+ for (int i = 0; i < NfsV40lockuOpsAmount; ++i)
+ {
+ analyzer->locku40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::LOCKU4args*>(nullptr),
+ &locku40);
+ }
+ const struct NFS4::LOOKUP4res lookup40 {};
+ for (int i = 0; i < NfsV40lookupOpsAmount; ++i)
+ {
+ analyzer->lookup40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::LOOKUP4args*>(nullptr),
+ &lookup40);
+ }
+ const struct NFS4::LOOKUPP4res lookupp40 {};
+ for (int i = 0; i < NfsV40lookuppOpsAmount; ++i)
+ {
+ analyzer->lookupp40(static_cast<const RPCProcedure*>(nullptr),
+ &lookupp40);
+ }
+ const struct NFS4::NVERIFY4res nverify40 {};
+ for (int i = 0; i < NfsV40nverifyOpsAmount; ++i)
+ {
+ analyzer->nverify40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::NVERIFY4args*>(nullptr),
+ &nverify40);
+ }
+ const struct NFS4::OPEN4res open40 {};
+ for (int i = 0; i < NfsV40openOpsAmount; ++i)
+ {
+ analyzer->open40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::OPEN4args*>(nullptr),
+ &open40);
+ }
+ const struct NFS4::OPENATTR4res openattr40 {};
+ for (int i = 0; i < NfsV40openattrOpsAmount; ++i)
+ {
+ analyzer->openattr40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::OPENATTR4args*>(nullptr),
+ &openattr40);
+ }
+ const struct NFS4::OPEN_CONFIRM4res open_confirm40 {};
+ for (int i = 0; i < NfsV40open_confirmOpsAmount; ++i)
+ {
+ analyzer->open_confirm40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::OPEN_CONFIRM4args*>(nullptr),
+ &open_confirm40);
+ }
+ const struct NFS4::OPEN_DOWNGRADE4res open_downgrade40 {};
+ for (int i = 0; i < NfsV40open_downgradeOpsAmount; ++i)
+ {
+ analyzer->open_downgrade40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::OPEN_DOWNGRADE4args*>(nullptr),
+ &open_downgrade40);
+ }
+ const struct NFS4::PUTFH4res putfh40 {};
+ for (int i = 0; i < NfsV40putfhOpsAmount; ++i)
+ {
+ analyzer->putfh40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::PUTFH4args*>(nullptr),
+ &putfh40);
+ }
+ const struct NFS4::PUTPUBFH4res putpubfh40 {};
+ for (int i = 0; i < NfsV40putpubfhOpsAmount; ++i)
+ {
+ analyzer->putpubfh40(static_cast<const RPCProcedure*>(nullptr),
+ &putpubfh40);
+ }
+ const struct NFS4::PUTROOTFH4res putrootfh40 {};
+ for (int i = 0; i < NfsV40putrootfhOpsAmount; ++i)
+ {
+ analyzer->putrootfh40(static_cast<const RPCProcedure*>(nullptr),
+ &putrootfh40);
+ }
+ const struct NFS4::READ4res read40 {};
+ for (int i = 0; i < NfsV40readOpsAmount; ++i)
+ {
+ analyzer->read40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::READ4args*>(nullptr),
+ &read40);
+ }
+ const struct NFS4::READDIR4res readdir40 {};
+ for (int i = 0; i < NfsV40readdirOpsAmount; ++i)
+ {
+ analyzer->readdir40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::READDIR4args*>(nullptr),
+ &readdir40);
+ }
+ const struct NFS4::READLINK4res readlink40 {};
+ for (int i = 0; i < NfsV40readlinkOpsAmount; ++i)
+ {
+ analyzer->readlink40(static_cast<const RPCProcedure*>(nullptr),
+ &readlink40);
+ }
+ const struct NFS4::REMOVE4res remove40 {};
+ for (int i = 0; i < NfsV40removeOpsAmount; ++i)
+ {
+ analyzer->remove40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::REMOVE4args*>(nullptr),
+ &remove40);
+ }
+ const struct NFS4::RENAME4res rename40 {};
+ for (int i = 0; i < NfsV40renameOpsAmount; ++i)
+ {
+ analyzer->rename40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::RENAME4args*>(nullptr),
+ &rename40);
+ }
+ const struct NFS4::RENEW4res renew40 {};
+ for (int i = 0; i < NfsV40renewOpsAmount; ++i)
+ {
+ analyzer->renew40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::RENEW4args*>(nullptr),
+ &renew40);
+ }
+ const struct NFS4::RESTOREFH4res restorefh40 {};
+ for (int i = 0; i < NfsV40restorefhOpsAmount; ++i)
+ {
+ analyzer->restorefh40(static_cast<const RPCProcedure*>(nullptr),
+ &restorefh40);
+ }
+ const struct NFS4::SAVEFH4res savefh40 {};
+ for (int i = 0; i < NfsV40savefhOpsAmount; ++i)
+ {
+ analyzer->savefh40(static_cast<const RPCProcedure*>(nullptr),
+ &savefh40);
+ }
+ const struct NFS4::SECINFO4res secinfo40 {};
+ for (int i = 0; i < NfsV40secinfoOpsAmount; ++i)
+ {
+ analyzer->secinfo40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::SECINFO4args*>(nullptr),
+ &secinfo40);
+ }
+ const struct NFS4::SETATTR4res setattr40 {};
+ for (int i = 0; i < NfsV40setattrOpsAmount; ++i)
+ {
+ analyzer->setattr40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::SETATTR4args*>(nullptr),
+ &setattr40);
+ }
+ const struct NFS4::SETCLIENTID4res setclientid40 {};
+ for (int i = 0; i < NfsV40setclientidOpsAmount; ++i)
+ {
+ analyzer->setclientid40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::SETCLIENTID4args*>(nullptr),
+ &setclientid40);
+ }
+ const struct NFS4::SETCLIENTID_CONFIRM4res setclientid_confirm40 {};
+ for (int i = 0; i < NfsV40setclientid_confirmOpsAmount; ++i)
+ {
+ analyzer->setclientid_confirm40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::SETCLIENTID_CONFIRM4args*>(nullptr),
+ &setclientid_confirm40);
+ }
+ const struct NFS4::VERIFY4res verify40 {};
+ for (int i = 0; i < NfsV40verifyOpsAmount; ++i)
+ {
+ analyzer->verify40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::VERIFY4args*>(nullptr),
+ &verify40);
+ }
+ const struct NFS4::WRITE4res write40 {};
+ for (int i = 0; i < NfsV40writeOpsAmount; ++i)
+ {
+ analyzer->write40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::WRITE4args*>(nullptr),
+ &write40);
+ }
+ const struct NFS4::RELEASE_LOCKOWNER4res release_lockowner40 {};
+ for (int i = 0; i < NfsV40release_lockownerOpsAmount; ++i)
+ {
+ analyzer->release_lockowner40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::RELEASE_LOCKOWNER4args*>(nullptr),
+ &release_lockowner40);
+ }
+ const struct NFS4::GET_DIR_DELEGATION4res get_dir_delegation40 {};
+ for (int i = 0; i < NfsV40get_dir_delegationOpsAmount; ++i)
+ {
+ analyzer->get_dir_delegation40(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS4::GET_DIR_DELEGATION4args*>(nullptr),
+ &get_dir_delegation40);
+ }
+ const struct NFS4::ILLEGAL4res illegal40 {};
+ for (int i = 0; i < NfsV40illegalOpsAmount; ++i)
+ {
+ analyzer->illegal40(static_cast<const RPCProcedure*>(nullptr),
+ &illegal40);
+ }
+
+ // Setting up analyzer (NFSv4.1 procedures)
+ for (int i = 0; i < NfsV41CompoundProcsAmount; ++i)
+ {
+ analyzer->compound41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::COMPOUND4args*>(nullptr),
+ static_cast<const struct NFS41::COMPOUND4res*>(nullptr));
+ }
+
+ // Setting up analyzer (NFSv4.1 operations)
+ const struct NFS41::ACCESS4res access41 {};
+ for (int i = 0; i < NfsV41accessOpsAmount; ++i)
+ {
+ analyzer->access41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::ACCESS4args*>(nullptr),
+ &access41);
+ }
+ const struct NFS41::CLOSE4res close41 {};
+ for (int i = 0; i < NfsV41closeOpsAmount; ++i)
+ {
+ analyzer->close41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::CLOSE4args*>(nullptr),
+ &close41);
+ }
+ const struct NFS41::COMMIT4res commit41 {};
+ for (int i = 0; i < NfsV41commitOpsAmount; ++i)
+ {
+ analyzer->commit41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::COMMIT4args*>(nullptr),
+ &commit41);
+ }
+ const struct NFS41::CREATE4res create41 {};
+ for (int i = 0; i < NfsV41createOpsAmount; ++i)
+ {
+ analyzer->create41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::CREATE4args*>(nullptr),
+ &create41);
+ }
+ const struct NFS41::DELEGPURGE4res delegpurge41 {};
+ for (int i = 0; i < NfsV41delegpurgeOpsAmount; ++i)
+ {
+ analyzer->delegpurge41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::DELEGPURGE4args*>(nullptr),
+ &delegpurge41);
+ }
+ const struct NFS41::DELEGRETURN4res delegreturn41 {};
+ for (int i = 0; i < NfsV41delegreturnOpsAmount; ++i)
+ {
+ analyzer->delegreturn41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::DELEGRETURN4args*>(nullptr),
+ &delegreturn41);
+ }
+ const struct NFS41::GETATTR4res getattr41 {};
+ for (int i = 0; i < NfsV41getattrOpsAmount; ++i)
+ {
+ analyzer->getattr41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::GETATTR4args*>(nullptr),
+ &getattr41);
+ }
+ const struct NFS41::GETFH4res getfh41 {};
+ for (int i = 0; i < NfsV41getfhOpsAmount; ++i)
+ {
+ analyzer->getfh41(static_cast<const RPCProcedure*>(nullptr),
+ &getfh41);
+ }
+ const struct NFS41::LINK4res link41 {};
+ for (int i = 0; i < NfsV41linkOpsAmount; ++i)
+ {
+ analyzer->link41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LINK4args*>(nullptr),
+ &link41);
+ }
+ const struct NFS41::LOCK4res lock41 {};
+ for (int i = 0; i < NfsV41lockOpsAmount; ++i)
+ {
+ analyzer->lock41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LOCK4args*>(nullptr),
+ &lock41);
+ }
+ const struct NFS41::LOCKT4res lockt41 {};
+ for (int i = 0; i < NfsV41locktOpsAmount; ++i)
+ {
+ analyzer->lockt41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LOCKT4args*>(nullptr),
+ &lockt41);
+ }
+ const struct NFS41::LOCKU4res locku41 {};
+ for (int i = 0; i < NfsV41lockuOpsAmount; ++i)
+ {
+ analyzer->locku41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LOCKU4args*>(nullptr),
+ &locku41);
+ }
+ const struct NFS41::LOOKUP4res lookup41 {};
+ for (int i = 0; i < NfsV41lookupOpsAmount; ++i)
+ {
+ analyzer->lookup41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LOOKUP4args*>(nullptr),
+ &lookup41);
+ }
+ const struct NFS41::LOOKUPP4res lookupp41 {};
+ for (int i = 0; i < NfsV41lookuppOpsAmount; ++i)
+ {
+ analyzer->lookupp41(static_cast<const RPCProcedure*>(nullptr),
+ &lookupp41);
+ }
+ const struct NFS41::NVERIFY4res nverify41 {};
+ for (int i = 0; i < NfsV41nverifyOpsAmount; ++i)
+ {
+ analyzer->nverify41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::NVERIFY4args*>(nullptr),
+ &nverify41);
+ }
+ const struct NFS41::OPEN4res open41 {};
+ for (int i = 0; i < NfsV41openOpsAmount; ++i)
+ {
+ analyzer->open41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::OPEN4args*>(nullptr),
+ &open41);
+ }
+ const struct NFS41::OPENATTR4res openattr41 {};
+ for (int i = 0; i < NfsV41openattrOpsAmount; ++i)
+ {
+ analyzer->openattr41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::OPENATTR4args*>(nullptr),
+ &openattr41);
+ }
+ const struct NFS41::OPEN_CONFIRM4res open_confirm41 {};
+ for (int i = 0; i < NfsV41open_confirmOpsAmount; ++i)
+ {
+ analyzer->open_confirm41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::OPEN_CONFIRM4args*>(nullptr),
+ &open_confirm41);
+ }
+ const struct NFS41::OPEN_DOWNGRADE4res open_downgrade41 {};
+ for (int i = 0; i < NfsV41open_downgradeOpsAmount; ++i)
+ {
+ analyzer->open_downgrade41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::OPEN_DOWNGRADE4args*>(nullptr),
+ &open_downgrade41);
+ }
+ const struct NFS41::PUTFH4res putfh41 {};
+ for (int i = 0; i < NfsV41putfhOpsAmount; ++i)
+ {
+ analyzer->putfh41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::PUTFH4args*>(nullptr),
+ &putfh41);
+ }
+ const struct NFS41::PUTPUBFH4res putpubfh41 {};
+ for (int i = 0; i < NfsV41putpubfhOpsAmount; ++i)
+ {
+ analyzer->putpubfh41(static_cast<const RPCProcedure*>(nullptr),
+ &putpubfh41);
+ }
+ const struct NFS41::PUTROOTFH4res putrootfh41 {};
+ for (int i = 0; i < NfsV41putrootfhOpsAmount; ++i)
+ {
+ analyzer->putrootfh41(static_cast<const RPCProcedure*>(nullptr),
+ &putrootfh41);
+ }
+ const struct NFS41::READ4res read41 {};
+ for (int i = 0; i < NfsV41readOpsAmount; ++i)
+ {
+ analyzer->read41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::READ4args*>(nullptr),
+ &read41);
+ }
+ const struct NFS41::READDIR4res readdir41 {};
+ for (int i = 0; i < NfsV41readdirOpsAmount; ++i)
+ {
+ analyzer->readdir41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::READDIR4args*>(nullptr),
+ &readdir41);
+ }
+ const struct NFS41::READLINK4res readlink41 {};
+ for (int i = 0; i < NfsV41readlinkOpsAmount; ++i)
+ {
+ analyzer->readlink41(static_cast<const RPCProcedure*>(nullptr),
+ &readlink41);
+ }
+ const struct NFS41::REMOVE4res remove41 {};
+ for (int i = 0; i < NfsV41removeOpsAmount; ++i)
+ {
+ analyzer->remove41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::REMOVE4args*>(nullptr),
+ &remove41);
+ }
+ const struct NFS41::RENAME4res rename41 {};
+ for (int i = 0; i < NfsV41renameOpsAmount; ++i)
+ {
+ analyzer->rename41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::RENAME4args*>(nullptr),
+ &rename41);
+ }
+ const struct NFS41::RENEW4res renew41 {};
+ for (int i = 0; i < NfsV41renewOpsAmount; ++i)
+ {
+ analyzer->renew41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::RENEW4args*>(nullptr),
+ &renew41);
+ }
+ const struct NFS41::RESTOREFH4res restorefh41 {};
+ for (int i = 0; i < NfsV41restorefhOpsAmount; ++i)
+ {
+ analyzer->restorefh41(static_cast<const RPCProcedure*>(nullptr),
+ &restorefh41);
+ }
+ const struct NFS41::SAVEFH4res savefh41 {};
+ for (int i = 0; i < NfsV41savefhOpsAmount; ++i)
+ {
+ analyzer->savefh41(static_cast<const RPCProcedure*>(nullptr),
+ &savefh41);
+ }
+ const struct NFS41::SECINFO4res secinfo41 {};
+ for (int i = 0; i < NfsV41secinfoOpsAmount; ++i)
+ {
+ analyzer->secinfo41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::SECINFO4args*>(nullptr),
+ &secinfo41);
+ }
+ const struct NFS41::SETATTR4res setattr41 {};
+ for (int i = 0; i < NfsV41setattrOpsAmount; ++i)
+ {
+ analyzer->setattr41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::SETATTR4args*>(nullptr),
+ &setattr41);
+ }
+ const struct NFS41::SETCLIENTID4res setclientid41 {};
+ for (int i = 0; i < NfsV41setclientidOpsAmount; ++i)
+ {
+ analyzer->setclientid41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::SETCLIENTID4args*>(nullptr),
+ &setclientid41);
+ }
+ const struct NFS41::SETCLIENTID_CONFIRM4res setclientid_confirm41 {};
+ for (int i = 0; i < NfsV41setclientid_confirmOpsAmount; ++i)
+ {
+ analyzer->setclientid_confirm41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::SETCLIENTID_CONFIRM4args*>(nullptr),
+ &setclientid_confirm41);
+ }
+ const struct NFS41::VERIFY4res verify41 {};
+ for (int i = 0; i < NfsV41verifyOpsAmount; ++i)
+ {
+ analyzer->verify41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::VERIFY4args*>(nullptr),
+ &verify41);
+ }
+ const struct NFS41::WRITE4res write41 {};
+ for (int i = 0; i < NfsV41writeOpsAmount; ++i)
+ {
+ analyzer->write41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::WRITE4args*>(nullptr),
+ &write41);
+ }
+ const struct NFS41::RELEASE_LOCKOWNER4res release_lockowner41 {};
+ for (int i = 0; i < NfsV41release_lockownerOpsAmount; ++i)
+ {
+ analyzer->release_lockowner41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::RELEASE_LOCKOWNER4args*>(nullptr),
+ &release_lockowner41);
+ }
+ const struct NFS41::BACKCHANNEL_CTL4res backchannel_ctl41 {};
+ for (int i = 0; i < NfsV41backchannel_ctlOpsAmount; ++i)
+ {
+ analyzer->backchannel_ctl41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::BACKCHANNEL_CTL4args*>(nullptr),
+ &backchannel_ctl41);
+ }
+ const struct NFS41::BIND_CONN_TO_SESSION4res bind_conn_to_session41 {};
+ for (int i = 0; i < NfsV41bind_conn_to_sessionOpsAmount; ++i)
+ {
+ analyzer->bind_conn_to_session41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::BIND_CONN_TO_SESSION4args*>(nullptr),
+ &bind_conn_to_session41);
+ }
+ const struct NFS41::EXCHANGE_ID4res exchange_id41 {};
+ for (int i = 0; i < NfsV41exchange_idOpsAmount; ++i)
+ {
+ analyzer->exchange_id41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::EXCHANGE_ID4args*>(nullptr),
+ &exchange_id41);
+ }
+ const struct NFS41::CREATE_SESSION4res create_session41 {};
+ for (int i = 0; i < NfsV41create_sessionOpsAmount; ++i)
+ {
+ analyzer->create_session41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::CREATE_SESSION4args*>(nullptr),
+ &create_session41);
+ }
+ const struct NFS41::DESTROY_SESSION4res destroy_session41 {};
+ for (int i = 0; i < NfsV41destroy_sessionOpsAmount; ++i)
+ {
+ analyzer->destroy_session41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::DESTROY_SESSION4args*>(nullptr),
+ &destroy_session41);
+ }
+ const struct NFS41::FREE_STATEID4res free_stateid41 {};
+ for (int i = 0; i < NfsV41free_stateidOpsAmount; ++i)
+ {
+ analyzer->free_stateid41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::FREE_STATEID4args*>(nullptr),
+ &free_stateid41);
+ }
+ const struct NFS41::GET_DIR_DELEGATION4res get_dir_delegation41 {};
+ for (int i = 0; i < NfsV41get_dir_delegationOpsAmount; ++i)
+ {
+ analyzer->get_dir_delegation41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::GET_DIR_DELEGATION4args*>(nullptr),
+ &get_dir_delegation41);
+ }
+ const struct NFS41::GETDEVICEINFO4res getdeviceinfo41 {};
+ for (int i = 0; i < NfsV41getdeviceinfoOpsAmount; ++i)
+ {
+ analyzer->getdeviceinfo41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::GETDEVICEINFO4args*>(nullptr),
+ &getdeviceinfo41);
+ }
+ const struct NFS41::GETDEVICELIST4res getdevicelist41 {};
+ for (int i = 0; i < NfsV41getdevicelistOpsAmount; ++i)
+ {
+ analyzer->getdevicelist41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::GETDEVICELIST4args*>(nullptr),
+ &getdevicelist41);
+ }
+ const struct NFS41::LAYOUTCOMMIT4res layoutcommit41 {};
+ for (int i = 0; i < NfsV41layoutcommitOpsAmount; ++i)
+ {
+ analyzer->layoutcommit41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LAYOUTCOMMIT4args*>(nullptr),
+ &layoutcommit41);
+ }
+ const struct NFS41::LAYOUTGET4res layoutget41 {};
+ for (int i = 0; i < NfsV41layoutgetOpsAmount; ++i)
+ {
+ analyzer->layoutget41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LAYOUTGET4args*>(nullptr),
+ &layoutget41);
+ }
+ const struct NFS41::LAYOUTRETURN4res layoutreturn41 {};
+ for (int i = 0; i < NfsV41layoutreturnOpsAmount; ++i)
+ {
+ analyzer->layoutreturn41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::LAYOUTRETURN4args*>(nullptr),
+ &layoutreturn41);
+ }
+ const NFS41::SECINFO_NO_NAME4res secinfo_no_name41 {};
+ for (int i = 0; i < NfsV41secinfo_no_nameOpsAmount; ++i)
+ {
+ analyzer->secinfo_no_name41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const NFS41::SECINFO_NO_NAME4args*>(nullptr),
+ &secinfo_no_name41);
+ }
+ const struct NFS41::SEQUENCE4res sequence41 {};
+ for (int i = 0; i < NfsV41sequenceOpsAmount; ++i)
+ {
+ analyzer->sequence41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::SEQUENCE4args*>(nullptr),
+ &sequence41);
+ }
+ const struct NFS41::SET_SSV4res set_ssv41 {};
+ for (int i = 0; i < NfsV41set_ssvOpsAmount; ++i)
+ {
+ analyzer->set_ssv41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::SET_SSV4args*>(nullptr),
+ &set_ssv41);
+ }
+ const struct NFS41::TEST_STATEID4res test_stateid41 {};
+ for (int i = 0; i < NfsV41test_stateidOpsAmount; ++i)
+ {
+ analyzer->test_stateid41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::TEST_STATEID4args*>(nullptr),
+ &test_stateid41);
+ }
+ const struct NFS41::WANT_DELEGATION4res want_delegation41 {};
+ for (int i = 0; i < NfsV41want_delegationOpsAmount; ++i)
+ {
+ analyzer->want_delegation41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::WANT_DELEGATION4args*>(nullptr),
+ &want_delegation41);
+ }
+ const struct NFS41::DESTROY_CLIENTID4res destroy_clientid41 {};
+ for (int i = 0; i < NfsV41destroy_clientidOpsAmount; ++i)
+ {
+ analyzer->destroy_clientid41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::DESTROY_CLIENTID4args*>(nullptr),
+ &destroy_clientid41);
+ }
+ const struct NFS41::RECLAIM_COMPLETE4res reclaim_complete41 {};
+ for (int i = 0; i < NfsV41reclaim_completeOpsAmount; ++i)
+ {
+ analyzer->reclaim_complete41(static_cast<const RPCProcedure*>(nullptr),
+ static_cast<const struct NFS41::RECLAIM_COMPLETE4args*>(nullptr),
+ &reclaim_complete41);
+ }
+ const struct NFS41::ILLEGAL4res illegal41 {};
+ for (int i = 0; i < NfsV41illegalOpsAmount; ++i)
+ {
+ analyzer->illegal41(static_cast<const RPCProcedure*>(nullptr),
+ &illegal41);
+ }
+
+
+ }
+ virtual void TearDown() override final
+ {
+ analyzer.reset();
+ }
+
+ std::unique_ptr<JsonAnalyzer> analyzer;
+};
+
+TEST_F(JsonAnalyzerCase, collectStatistics)
+{
+ // NFS3 procedures
+ EXPECT_EQ(NfsV3NullProcsAmount, analyzer->getNfsV3Stat().nullProcsAmount.load());
+ EXPECT_EQ(NfsV3GetattrProcsAmount, analyzer->getNfsV3Stat().getattrProcsAmount.load());
+ EXPECT_EQ(NfsV3SetattrProcsAmount, analyzer->getNfsV3Stat().setattrProcsAmount.load());
+ EXPECT_EQ(NfsV3AccessProcsAmount, analyzer->getNfsV3Stat().accessProcsAmount.load());
+ EXPECT_EQ(NfsV3ReadlinkProcsAmount, analyzer->getNfsV3Stat().readlinkProcsAmount.load());
+ EXPECT_EQ(NfsV3ReadProcsAmount, analyzer->getNfsV3Stat().readProcsAmount.load());
+ EXPECT_EQ(NfsV3WriteProcsAmount, analyzer->getNfsV3Stat().writeProcsAmount.load());
+ EXPECT_EQ(NfsV3CreateProcsAmount, analyzer->getNfsV3Stat().createProcsAmount.load());
+ EXPECT_EQ(NfsV3MkdirProcsAmount, analyzer->getNfsV3Stat().mkdirProcsAmount.load());
+ EXPECT_EQ(NfsV3SymlinkProcsAmount, analyzer->getNfsV3Stat().symlinkProcsAmount.load());
+ EXPECT_EQ(NfsV3MknodProcsAmount, analyzer->getNfsV3Stat().mknodProcsAmount.load());
+ EXPECT_EQ(NfsV3RemoveProcsAmount, analyzer->getNfsV3Stat().removeProcsAmount.load());
+ EXPECT_EQ(NfsV3RmdirProcsAmount, analyzer->getNfsV3Stat().rmdirProcsAmount.load());
+ EXPECT_EQ(NfsV3RenameProcsAmount, analyzer->getNfsV3Stat().renameProcsAmount.load());
+ EXPECT_EQ(NfsV3LinkProcsAmount, analyzer->getNfsV3Stat().linkProcsAmount.load());
+ EXPECT_EQ(NfsV3ReaddirProcsAmount, analyzer->getNfsV3Stat().readdirProcsAmount.load());
+ EXPECT_EQ(NfsV3ReaddirplusProcsAmount, analyzer->getNfsV3Stat().readdirplusProcsAmount.load());
+ EXPECT_EQ(NfsV3FsstatProcsAmount, analyzer->getNfsV3Stat().fsstatProcsAmount.load());
+ EXPECT_EQ(NfsV3FsinfoProcsAmount, analyzer->getNfsV3Stat().fsinfoProcsAmount.load());
+ EXPECT_EQ(NfsV3PathconfProcsAmount, analyzer->getNfsV3Stat().pathconfProcsAmount.load());
+ EXPECT_EQ(NfsV3CommitProcsAmount, analyzer->getNfsV3Stat().commitProcsAmount.load());
+
+ // NFS 4.0 procedures
+ EXPECT_EQ(NfsV40NullProcsAmount, analyzer->getNfsV40Stat().nullProcsAmount.load());
+ EXPECT_EQ(NfsV40CompoundProcsAmount, analyzer->getNfsV40Stat().compoundProcsAmount.load());
+
+ // NFS 4.0 operations
+ EXPECT_EQ(NfsV40accessOpsAmount, analyzer->getNfsV40Stat().accessOpsAmount.load());
+ EXPECT_EQ(NfsV40closeOpsAmount, analyzer->getNfsV40Stat().closeOpsAmount.load());
+ EXPECT_EQ(NfsV40commitOpsAmount, analyzer->getNfsV40Stat().commitOpsAmount.load());
+ EXPECT_EQ(NfsV40createOpsAmount, analyzer->getNfsV40Stat().createOpsAmount.load());
+ EXPECT_EQ(NfsV40delegpurgeOpsAmount, analyzer->getNfsV40Stat().delegpurgeOpsAmount.load());
+ EXPECT_EQ(NfsV40delegreturnOpsAmount, analyzer->getNfsV40Stat().delegreturnOpsAmount.load());
+ EXPECT_EQ(NfsV40getattrOpsAmount, analyzer->getNfsV40Stat().getattrOpsAmount.load());
+ EXPECT_EQ(NfsV40getfhOpsAmount, analyzer->getNfsV40Stat().getfhOpsAmount.load());
+ EXPECT_EQ(NfsV40linkOpsAmount, analyzer->getNfsV40Stat().linkOpsAmount.load());
+ EXPECT_EQ(NfsV40lockOpsAmount, analyzer->getNfsV40Stat().lockOpsAmount.load());
+ EXPECT_EQ(NfsV40locktOpsAmount, analyzer->getNfsV40Stat().locktOpsAmount.load());
+ EXPECT_EQ(NfsV40lockuOpsAmount, analyzer->getNfsV40Stat().lockuOpsAmount.load());
+ EXPECT_EQ(NfsV40lookupOpsAmount, analyzer->getNfsV40Stat().lookupOpsAmount.load());
+ EXPECT_EQ(NfsV40lookuppOpsAmount, analyzer->getNfsV40Stat().lookuppOpsAmount.load());
+ EXPECT_EQ(NfsV40nverifyOpsAmount, analyzer->getNfsV40Stat().nverifyOpsAmount.load());
+ EXPECT_EQ(NfsV40openOpsAmount, analyzer->getNfsV40Stat().openOpsAmount.load());
+ EXPECT_EQ(NfsV40openattrOpsAmount, analyzer->getNfsV40Stat().openattrOpsAmount.load());
+ EXPECT_EQ(NfsV40open_confirmOpsAmount, analyzer->getNfsV40Stat().open_confirmOpsAmount.load());
+ EXPECT_EQ(NfsV40open_downgradeOpsAmount, analyzer->getNfsV40Stat().open_downgradeOpsAmount.load());
+ EXPECT_EQ(NfsV40putfhOpsAmount, analyzer->getNfsV40Stat().putfhOpsAmount.load());
+ EXPECT_EQ(NfsV40putpubfhOpsAmount, analyzer->getNfsV40Stat().putpubfhOpsAmount.load());
+ EXPECT_EQ(NfsV40putrootfhOpsAmount, analyzer->getNfsV40Stat().putrootfhOpsAmount.load());
+ EXPECT_EQ(NfsV40readOpsAmount, analyzer->getNfsV40Stat().readOpsAmount.load());
+ EXPECT_EQ(NfsV40readdirOpsAmount, analyzer->getNfsV40Stat().readdirOpsAmount.load());
+ EXPECT_EQ(NfsV40readlinkOpsAmount, analyzer->getNfsV40Stat().readlinkOpsAmount.load());
+ EXPECT_EQ(NfsV40removeOpsAmount, analyzer->getNfsV40Stat().removeOpsAmount.load());
+ EXPECT_EQ(NfsV40renameOpsAmount, analyzer->getNfsV40Stat().renameOpsAmount.load());
+ EXPECT_EQ(NfsV40renewOpsAmount, analyzer->getNfsV40Stat().renewOpsAmount.load());
+ EXPECT_EQ(NfsV40restorefhOpsAmount, analyzer->getNfsV40Stat().restorefhOpsAmount.load());
+ EXPECT_EQ(NfsV40savefhOpsAmount, analyzer->getNfsV40Stat().savefhOpsAmount.load());
+ EXPECT_EQ(NfsV40secinfoOpsAmount, analyzer->getNfsV40Stat().secinfoOpsAmount.load());
+ EXPECT_EQ(NfsV40setattrOpsAmount, analyzer->getNfsV40Stat().setattrOpsAmount.load());
+ EXPECT_EQ(NfsV40setclientidOpsAmount, analyzer->getNfsV40Stat().setclientidOpsAmount.load());
+ EXPECT_EQ(NfsV40setclientid_confirmOpsAmount, analyzer->getNfsV40Stat().setclientid_confirmOpsAmount.load());
+ EXPECT_EQ(NfsV40verifyOpsAmount, analyzer->getNfsV40Stat().verifyOpsAmount.load());
+ EXPECT_EQ(NfsV40writeOpsAmount, analyzer->getNfsV40Stat().writeOpsAmount.load());
+ EXPECT_EQ(NfsV40release_lockownerOpsAmount, analyzer->getNfsV40Stat().release_lockownerOpsAmount.load());
+ EXPECT_EQ(NfsV40get_dir_delegationOpsAmount, analyzer->getNfsV40Stat().get_dir_delegationOpsAmount.load());
+ EXPECT_EQ(NfsV40illegalOpsAmount, analyzer->getNfsV40Stat().illegalOpsAmount.load());
+
+ // NFS 4.1 procedures
+ EXPECT_EQ(NfsV41CompoundProcsAmount, analyzer->getNfsV41Stat().compoundProcsAmount.load());
+
+ // NFS 4.1 operations
+ EXPECT_EQ(NfsV41accessOpsAmount, analyzer->getNfsV41Stat().accessOpsAmount.load());
+ EXPECT_EQ(NfsV41closeOpsAmount, analyzer->getNfsV41Stat().closeOpsAmount.load());
+ EXPECT_EQ(NfsV41commitOpsAmount, analyzer->getNfsV41Stat().commitOpsAmount.load());
+ EXPECT_EQ(NfsV41createOpsAmount, analyzer->getNfsV41Stat().createOpsAmount.load());
+ EXPECT_EQ(NfsV41delegpurgeOpsAmount, analyzer->getNfsV41Stat().delegpurgeOpsAmount.load());
+ EXPECT_EQ(NfsV41delegreturnOpsAmount, analyzer->getNfsV41Stat().delegreturnOpsAmount.load());
+ EXPECT_EQ(NfsV41getattrOpsAmount, analyzer->getNfsV41Stat().getattrOpsAmount.load());
+ EXPECT_EQ(NfsV41getfhOpsAmount, analyzer->getNfsV41Stat().getfhOpsAmount.load());
+ EXPECT_EQ(NfsV41linkOpsAmount, analyzer->getNfsV41Stat().linkOpsAmount.load());
+ EXPECT_EQ(NfsV41lockOpsAmount, analyzer->getNfsV41Stat().lockOpsAmount.load());
+ EXPECT_EQ(NfsV41locktOpsAmount, analyzer->getNfsV41Stat().locktOpsAmount.load());
+ EXPECT_EQ(NfsV41lockuOpsAmount, analyzer->getNfsV41Stat().lockuOpsAmount.load());
+ EXPECT_EQ(NfsV41lookupOpsAmount, analyzer->getNfsV41Stat().lookupOpsAmount.load());
+ EXPECT_EQ(NfsV41lookuppOpsAmount, analyzer->getNfsV41Stat().lookuppOpsAmount.load());
+ EXPECT_EQ(NfsV41nverifyOpsAmount, analyzer->getNfsV41Stat().nverifyOpsAmount.load());
+ EXPECT_EQ(NfsV41openOpsAmount, analyzer->getNfsV41Stat().openOpsAmount.load());
+ EXPECT_EQ(NfsV41openattrOpsAmount, analyzer->getNfsV41Stat().openattrOpsAmount.load());
+ EXPECT_EQ(NfsV41open_confirmOpsAmount, analyzer->getNfsV41Stat().open_confirmOpsAmount.load());
+ EXPECT_EQ(NfsV41open_downgradeOpsAmount, analyzer->getNfsV41Stat().open_downgradeOpsAmount.load());
+ EXPECT_EQ(NfsV41putfhOpsAmount, analyzer->getNfsV41Stat().putfhOpsAmount.load());
+ EXPECT_EQ(NfsV41putpubfhOpsAmount, analyzer->getNfsV41Stat().putpubfhOpsAmount.load());
+ EXPECT_EQ(NfsV41putrootfhOpsAmount, analyzer->getNfsV41Stat().putrootfhOpsAmount.load());
+ EXPECT_EQ(NfsV41readOpsAmount, analyzer->getNfsV41Stat().readOpsAmount.load());
+ EXPECT_EQ(NfsV41readdirOpsAmount, analyzer->getNfsV41Stat().readdirOpsAmount.load());
+ EXPECT_EQ(NfsV41readlinkOpsAmount, analyzer->getNfsV41Stat().readlinkOpsAmount.load());
+ EXPECT_EQ(NfsV41removeOpsAmount, analyzer->getNfsV41Stat().removeOpsAmount.load());
+ EXPECT_EQ(NfsV41renameOpsAmount, analyzer->getNfsV41Stat().renameOpsAmount.load());
+ EXPECT_EQ(NfsV41renewOpsAmount, analyzer->getNfsV41Stat().renewOpsAmount.load());
+ EXPECT_EQ(NfsV41restorefhOpsAmount, analyzer->getNfsV41Stat().restorefhOpsAmount.load());
+ EXPECT_EQ(NfsV41savefhOpsAmount, analyzer->getNfsV41Stat().savefhOpsAmount.load());
+ EXPECT_EQ(NfsV41secinfoOpsAmount, analyzer->getNfsV41Stat().secinfoOpsAmount.load());
+ EXPECT_EQ(NfsV41setattrOpsAmount, analyzer->getNfsV41Stat().setattrOpsAmount.load());
+ EXPECT_EQ(NfsV41setclientidOpsAmount, analyzer->getNfsV41Stat().setclientidOpsAmount.load());
+ EXPECT_EQ(NfsV41setclientid_confirmOpsAmount, analyzer->getNfsV41Stat().setclientid_confirmOpsAmount.load());
+ EXPECT_EQ(NfsV41verifyOpsAmount, analyzer->getNfsV41Stat().verifyOpsAmount.load());
+ EXPECT_EQ(NfsV41writeOpsAmount, analyzer->getNfsV41Stat().writeOpsAmount.load());
+ EXPECT_EQ(NfsV41release_lockownerOpsAmount, analyzer->getNfsV41Stat().release_lockownerOpsAmount.load());
+ EXPECT_EQ(NfsV41backchannel_ctlOpsAmount, analyzer->getNfsV41Stat().backchannel_ctlOpsAmount.load());
+ EXPECT_EQ(NfsV41bind_conn_to_sessionOpsAmount, analyzer->getNfsV41Stat().bind_conn_to_sessionOpsAmount.load());
+ EXPECT_EQ(NfsV41exchange_idOpsAmount, analyzer->getNfsV41Stat().exchange_idOpsAmount.load());
+ EXPECT_EQ(NfsV41create_sessionOpsAmount, analyzer->getNfsV41Stat().create_sessionOpsAmount.load());
+ EXPECT_EQ(NfsV41destroy_sessionOpsAmount, analyzer->getNfsV41Stat().destroy_sessionOpsAmount.load());
+ EXPECT_EQ(NfsV41free_stateidOpsAmount, analyzer->getNfsV41Stat().free_stateidOpsAmount.load());
+ EXPECT_EQ(NfsV41get_dir_delegationOpsAmount, analyzer->getNfsV41Stat().get_dir_delegationOpsAmount.load());
+ EXPECT_EQ(NfsV41getdeviceinfoOpsAmount, analyzer->getNfsV41Stat().getdeviceinfoOpsAmount.load());
+ EXPECT_EQ(NfsV41getdevicelistOpsAmount, analyzer->getNfsV41Stat().getdevicelistOpsAmount.load());
+ EXPECT_EQ(NfsV41layoutcommitOpsAmount, analyzer->getNfsV41Stat().layoutcommitOpsAmount.load());
+ EXPECT_EQ(NfsV41layoutgetOpsAmount, analyzer->getNfsV41Stat().layoutgetOpsAmount.load());
+ EXPECT_EQ(NfsV41layoutreturnOpsAmount, analyzer->getNfsV41Stat().layoutreturnOpsAmount.load());
+ EXPECT_EQ(NfsV41secinfo_no_nameOpsAmount, analyzer->getNfsV41Stat().secinfo_no_nameOpsAmount.load());
+ EXPECT_EQ(NfsV41sequenceOpsAmount, analyzer->getNfsV41Stat().sequenceOpsAmount.load());
+ EXPECT_EQ(NfsV41set_ssvOpsAmount, analyzer->getNfsV41Stat().set_ssvOpsAmount.load());
+ EXPECT_EQ(NfsV41test_stateidOpsAmount, analyzer->getNfsV41Stat().test_stateidOpsAmount.load());
+ EXPECT_EQ(NfsV41want_delegationOpsAmount, analyzer->getNfsV41Stat().want_delegationOpsAmount.load());
+ EXPECT_EQ(NfsV41destroy_clientidOpsAmount, analyzer->getNfsV41Stat().destroy_clientidOpsAmount.load());
+ EXPECT_EQ(NfsV41reclaim_completeOpsAmount, analyzer->getNfsV41Stat().reclaim_completeOpsAmount.load());
+ EXPECT_EQ(NfsV41illegalOpsAmount, analyzer->getNfsV41Stat().illegalOpsAmount.load());
+}
+
+TEST_F(JsonAnalyzerCase, requestResponse)
+{
+ // Connecting to service
+ int s = socket(PF_INET, SOCK_STREAM, 0);
+ ASSERT_GE(s, 0);
+ IpEndpoint endpoint{ListenHost, ListenPort};
+ ASSERT_EQ(0, connect(s, endpoint.addrinfo()->ai_addr, endpoint.addrinfo()->ai_addrlen));
+ char receiveBuffer[ReceiveBufferSize];
+ ssize_t bytesReceived = recv(s, receiveBuffer, sizeof(receiveBuffer), 0);
+ EXPECT_GT(bytesReceived, 0);
+ // Decoding and checking response
+ json_object* root = json_tokener_parse(std::string(receiveBuffer, bytesReceived).c_str());
+ EXPECT_NE(nullptr, root);
+ EXPECT_EQ(json_type_object, json_object_get_type(root));
+
+ // Checking NFSv3 statistics
+ struct json_object* nfsV3Stat;
+ EXPECT_TRUE(json_object_object_get_ex(root, "nfs_v3", &nfsV3Stat));
+ EXPECT_NE(nullptr, nfsV3Stat);
+ EXPECT_EQ(json_type_object, json_object_get_type(nfsV3Stat));
+
+ struct json_object* val;
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "null", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3NullProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "getattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3GetattrProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "setattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3SetattrProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "lookup", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3LookupProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "access", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3AccessProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "readlink", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3ReadlinkProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "read", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3ReadProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "write", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3WriteProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "create", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3CreateProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "mkdir", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3MkdirProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "symlink", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3SymlinkProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "mkdnod", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3MknodProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "remove", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3RemoveProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "rmdir", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3RmdirProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "rename", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3RenameProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "link", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3LinkProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "readdir", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3ReaddirProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "readdirplus", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3ReaddirplusProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "fsstat", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3FsstatProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "fsinfo", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3FsinfoProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "pathconf", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3PathconfProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV3Stat, "commit", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV3CommitProcsAmount, json_object_get_int64(val));
+
+ // Checking NFSv4.0 statistics
+ struct json_object* nfsV40Stat;
+ EXPECT_TRUE(json_object_object_get_ex(root, "nfs_v40", &nfsV40Stat));
+ EXPECT_NE(nullptr, nfsV40Stat);
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "null", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40NullProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "compound", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40CompoundProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "access", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40accessOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "close", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40closeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "commit", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40commitOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "create", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40createOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "delegpurge", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40delegpurgeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "delegreturn", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40delegreturnOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "getattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40getattrOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "getfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40getfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "link", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40linkOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "lock", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40lockOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "lockt", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40locktOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "locku", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40lockuOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "lookup", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40lookupOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "lookupp", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40lookuppOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "nverify", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40nverifyOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "open", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40openOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "openattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40openattrOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "open_confirm", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40open_confirmOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "open_downgrade", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40open_downgradeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "putfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40putfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "putpubfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40putpubfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "putrootfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40putrootfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "read", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40readOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "readdir", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40readdirOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "readlink", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40readlinkOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "remove", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40removeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "rename", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40renameOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "renew", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40renewOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "restorefh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40restorefhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "savefh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40savefhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "secinfo", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40secinfoOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "setattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40setattrOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "setclientid", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40setclientidOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "setclientid_confirm", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40setclientid_confirmOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "verify", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40verifyOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "write", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40writeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "release_lockowner", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40release_lockownerOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "get_dir_delegation", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40get_dir_delegationOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV40Stat, "illegal", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV40illegalOpsAmount, json_object_get_int64(val));
+
+ // Checking NFSv4.1 statistics
+ struct json_object* nfsV41Stat;
+ EXPECT_TRUE(json_object_object_get_ex(root, "nfs_v41", &nfsV41Stat));
+ EXPECT_NE(nullptr, nfsV41Stat);
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "compound", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41CompoundProcsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "access", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41accessOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "close", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41closeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "commit", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41commitOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "create", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41createOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "delegpurge", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41delegpurgeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "delegreturn", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41delegreturnOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "getattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41getattrOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "getfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41getfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "link", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41linkOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "lock", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41lockOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "lockt", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41locktOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "locku", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41lockuOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "lookup", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41lookupOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "lookupp", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41lookuppOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "nverify", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41nverifyOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "open", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41openOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "openattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41openattrOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "open_confirm", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41open_confirmOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "open_downgrade", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41open_downgradeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "putfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41putfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "putpubfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41putpubfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "putrootfh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41putrootfhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "read", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41readOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "readdir", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41readdirOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "readlink", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41readlinkOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "remove", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41removeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "rename", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41renameOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "renew", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41renewOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "restorefh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41restorefhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "savefh", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41savefhOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "secinfo", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41secinfoOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "setattr", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41setattrOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "setclientid", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41setclientidOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "setclientid_confirm", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41setclientid_confirmOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "verify", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41verifyOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "write", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41writeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "release_lockowner", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41release_lockownerOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "backchannel_ctl", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41backchannel_ctlOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "bind_conn_to_session", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41bind_conn_to_sessionOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "exchange_id", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41exchange_idOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "create_session", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41create_sessionOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "destroy_session", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41destroy_sessionOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "free_stateid", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41free_stateidOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "get_dir_delegation", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41get_dir_delegationOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "getdeviceinfo", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41getdeviceinfoOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "getdevicelist", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41getdevicelistOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "layoutcommit", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41layoutcommitOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "layoutget", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41layoutgetOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "layoutreturn", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41layoutreturnOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "secinfo_no_name", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41secinfo_no_nameOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "sequence", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41sequenceOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "set_ssv", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41set_ssvOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "test_stateid", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41test_stateidOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "want_delegation", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41want_delegationOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "destroy_clientid", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41destroy_clientidOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "reclaim_complete", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41reclaim_completeOpsAmount, json_object_get_int64(val));
+
+ EXPECT_TRUE(json_object_object_get_ex(nfsV41Stat, "illegal", &val));
+ EXPECT_NE(nullptr, val);
+ EXPECT_EQ(json_type_int, json_object_get_type(val));
+ EXPECT_EQ(NfsV41illegalOpsAmount, json_object_get_int64(val));
+
+ // Collecting garbage
+ json_object_put(root);
+ EXPECT_EQ(0, close(s));
+}
+
+TEST_F(JsonAnalyzerCase, slowClient)
+{
+ int s = socket(PF_INET, SOCK_STREAM, 0);
+ ASSERT_GE(s, 0);
+ IpEndpoint endpoint{ListenHost, ListenPort};
+ ASSERT_EQ(0, connect(s, endpoint.addrinfo()->ai_addr, endpoint.addrinfo()->ai_addrlen));
+ std::this_thread::sleep_for(std::chrono::milliseconds{SlowClientTimeoutMs});
+ char receiveBuffer[ReceiveBufferSize];
+ ssize_t bytesReceived = recv(s, receiveBuffer, sizeof(receiveBuffer), 0);
+ EXPECT_GE(bytesReceived, 0);
+ EXPECT_EQ(0, close(s));
+}
+
+int main(int argc, char** argv)
+{
+ setenv("LANG", "C", 1);
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/tests/unit/filtration/CMakeLists.txt b/tests/unit/filtration/CMakeLists.txt
new file mode 100644
index 0000000..88d665b
--- /dev/null
+++ b/tests/unit/filtration/CMakeLists.txt
@@ -0,0 +1,13 @@
+project (unit_test_filtration)
+aux_source_directory ("." SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/cifs SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/cifs2 SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/nfs SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/netbios SRC_TEST_LIST)
+add_executable (${PROJECT_NAME} ${SRC_TEST_LIST}
+ ${CMAKE_SOURCE_DIR}/src/utils/out.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/log.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/sessions.cpp
+)
+target_link_libraries (${PROJECT_NAME} ${GMOCK_LIBRARIES})
+add_test (${PROJECT_NAME} ${PROJECT_NAME})
diff --git a/tests/unit/filtration/cifsv2.cpp b/tests/unit/filtration/cifsv2.cpp
new file mode 100644
index 0000000..d28a889
--- /dev/null
+++ b/tests/unit/filtration/cifsv2.cpp
@@ -0,0 +1,232 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Composite filtrator tests
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "controller/running_status.h"
+#include "filtration/filtration_processor.h"
+#include "filtration/cifs_filtrator.h"
+#include "filtration/filtrators.h"
+#include "filtration/packet.h"
+//------------------------------------------------------------------------------
+using namespace NST::filtration;
+using ::testing::Return;
+using ::testing::AtLeast;
+using ::testing::_;
+//------------------------------------------------------------------------------
+
+namespace
+{
+
+class Writer
+{
+public:
+
+ class Collection
+ {
+ Collection* pImpl = nullptr;
+ public:
+ void set(Writer& w, NST::utils::NetworkSession* /*session_ptr*/)
+ {
+ pImpl = &w.collection;
+ }
+
+ virtual void reset()
+ {
+ if (pImpl)
+ {
+ pImpl->reset();
+ }
+ }
+
+ virtual void push(PacketInfo& info, size_t size)
+ {
+ if (pImpl)
+ {
+ pImpl->push(info, size);
+ }
+ }
+
+ virtual void skip_first(size_t size)
+ {
+ if (pImpl)
+ {
+ pImpl->skip_first(size);
+ }
+ }
+
+ virtual void complete(PacketInfo& info)
+ {
+ if (pImpl)
+ {
+ pImpl->complete(info);
+ }
+ }
+
+ operator bool()
+ {
+ return true;
+ }
+
+ virtual const uint8_t* data()
+ {
+ if (pImpl)
+ {
+ return pImpl->data();
+ }
+ return nullptr;
+ }
+
+ virtual size_t data_size()
+ {
+ if (pImpl)
+ {
+ return pImpl->data_size();
+ }
+ return 0;
+ }
+
+ virtual size_t capacity()
+ {
+ if (pImpl)
+ {
+ return pImpl->capacity();
+ }
+ return 0;
+ }
+
+ virtual void allocate()
+ {
+ if (pImpl)
+ {
+ pImpl->allocate();
+ }
+ }
+ };
+ class CollectionMock : public Collection
+ {
+ public:
+ MOCK_METHOD0(reset, void());
+ MOCK_METHOD2(push, void(PacketInfo&, size_t));
+ MOCK_METHOD0(data, const uint8_t* ());
+ MOCK_METHOD0(data_size, size_t());
+ MOCK_METHOD0(capacity, size_t());
+ MOCK_METHOD0(allocate, void());
+ MOCK_METHOD1(skip_first, void(size_t));
+ MOCK_METHOD1(complete, void(PacketInfo&));
+
+ };
+
+ CollectionMock collection;
+};
+
+}
+
+TEST(Filtration, CIFSFiltratorReset)
+{
+ // Set conditions
+ Writer mock;
+ EXPECT_CALL(mock.collection, reset())
+ .Times(1);
+
+ CIFSFiltrator<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.reset();
+}
+
+TEST(Filtration, filtratorsResets)
+{
+ // Set conditions
+ Writer mock;
+ EXPECT_CALL(mock.collection, reset())
+ .Times(2);
+
+ Filtrators<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.reset();
+}
+
+TEST(Filtration, pushRPCheader)
+{
+ // Prepare data
+ struct pcap_pkthdr header;
+ header.caplen = header.len = 16;
+ const uint8_t packet[] = {0x80, 0x00, 0x00, 0x84,
+ 0xec, 0x8a, 0x42, 0xcb,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x02
+ };
+ PacketInfo info(&header, packet, 0);
+
+ Writer mock;
+ EXPECT_CALL(mock.collection, data())
+ .WillRepeatedly(Return(packet));
+ EXPECT_CALL(mock.collection, data_size())
+ .WillOnce(Return(0))
+ .WillOnce(Return(0))
+ .WillRepeatedly(Return(sizeof(packet)));
+ EXPECT_CALL(mock.collection, capacity())
+ .WillRepeatedly(Return(1000000));
+ // Set conditions
+ EXPECT_CALL(mock.collection, push(_, _))
+ .Times(AtLeast(1));
+
+ Filtrators<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.push(info);
+}
+
+TEST(Filtration, pushCIFSheader)
+{
+ // Prepare data
+ struct pcap_pkthdr header;
+ header.caplen = header.len = 16;
+ const uint8_t packet[] = {0x00, 0x00, 0x00, 0x68,
+ 0xfe, 0x53, 0x4d, 0x42,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+ };
+ PacketInfo info(&header, packet, 0);
+
+ Writer mock;
+ EXPECT_CALL(mock.collection, data())
+ .WillRepeatedly(Return(packet));
+ EXPECT_CALL(mock.collection, data_size())
+ .WillOnce(Return(0))
+ .WillOnce(Return(0))
+ .WillRepeatedly(Return(sizeof(packet)));
+ EXPECT_CALL(mock.collection, capacity())
+ .WillRepeatedly(Return(1000000));
+ // Set conditions
+ EXPECT_CALL(mock.collection, push(_, _))
+ .Times(AtLeast(1));
+
+ Filtrators<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.push(info);
+}
+
+//------------------------------------------------------------------------------
diff --git a/tests/unit/filtration/stream.cpp b/tests/unit/filtration/stream.cpp
new file mode 100644
index 0000000..cc8c1f6
--- /dev/null
+++ b/tests/unit/filtration/stream.cpp
@@ -0,0 +1,365 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: Composite filtrator tests
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <algorithm>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "controller/running_status.h"
+#include "filtration/filtration_processor.h"
+#include "filtration/cifs_filtrator.h"
+#include "filtration/filtrators.h"
+#include "filtration/packet.h"
+//------------------------------------------------------------------------------
+using namespace NST::filtration;
+using ::testing::Return;
+using ::testing::AtLeast;
+using ::testing::_;
+//------------------------------------------------------------------------------
+namespace {
+
+class Writer
+{
+public:
+
+ class Collection
+ {
+ std::vector<uint8_t> packet;
+ Collection *pImpl = nullptr;
+ public:
+ void set(Writer& w, NST::utils::NetworkSession* /*session_ptr*/)
+ {
+ pImpl = &w.collection;
+ }
+
+ virtual void reset()
+ {
+ packet.clear();
+ }
+
+ virtual void push(PacketInfo& info, size_t size)
+ {
+ std::copy(info.data, info.data + size, std::back_inserter(packet));
+ }
+
+ virtual void skip_first(size_t)
+ {
+ }
+
+ virtual void complete(PacketInfo& info)
+ {
+ if (pImpl)
+ {
+ pImpl->complete(info);
+ }
+ }
+
+ operator bool()
+ {
+ return true;
+ }
+
+ virtual const uint8_t * data()
+ {
+ return packet.data();
+ }
+
+ virtual size_t data_size()
+ {
+ return packet.size();
+ }
+
+ virtual size_t capacity()
+ {
+ return 1000000;
+ }
+
+ virtual void allocate()
+ {
+ }
+ };
+ class CollectionMock : public Collection
+ {
+ public:
+ MOCK_METHOD0(reset, void());
+ MOCK_METHOD2(push, void(PacketInfo&, size_t));
+ MOCK_METHOD0(data, const uint8_t *());
+ MOCK_METHOD0(data_size, size_t());
+ MOCK_METHOD1(complete, void(PacketInfo&));
+
+ };
+
+ CollectionMock collection;
+};
+
+}
+
+TEST(Filtration, pushCIFSbyTCPStream)
+{
+ // Prepare data
+ struct pcap_pkthdr header;
+ header.caplen = header.len = 132;
+ const uint8_t packet[] = {0x00, 0x00, 0x00, 0x80,
+ 0xfe, 0x53, 0x4d, 0x42,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00
+ };
+ PacketInfo info(&header, packet, 0);
+ Writer mock;
+ // Set conditions
+ EXPECT_CALL(mock.collection, complete(_))
+ .Times(AtLeast(1));
+
+ Filtrators<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.push(info);
+}
+
+TEST(Filtration, pushCIFSbyTCPStreamPartByPart)
+{
+ // Prepare data
+ struct pcap_pkthdr header1;
+ header1.caplen = header1.len = 3;
+ const uint8_t packet[] = {0x00, 0x00, 0x00, 0x80,
+ 0xfe, 0x53, 0x4d, 0x42,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00
+ };
+ PacketInfo info1(&header1, packet, 0);
+
+ struct pcap_pkthdr header2;
+ header2.caplen = header2.len = sizeof(packet) - header1.len;
+ PacketInfo info2(&header2, packet + header1.len, 0);
+ Writer mock;
+
+ // Set conditions
+ EXPECT_CALL(mock.collection, complete(_))
+ .Times(AtLeast(1));
+
+ Filtrators<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.push(info1);
+ f.push(info2);
+}
+
+TEST(Filtration, pushRPCbyTCPStream)
+{
+ // Prepare data
+ struct pcap_pkthdr header;
+ header.caplen = header.len = 132;
+ const uint8_t packet[] = {0x80, 0x00, 0x00, 0x80,
+ 0xec, 0x8a, 0x42, 0xcb,
+ 0x00, 0x00, 0x00, 0x00,// msg type - call
+ 0x00, 0x00, 0x00, 0x02,// RPC version
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00
+ };
+ PacketInfo info(&header, packet, 0);
+ Writer mock;
+ // Set conditions
+ EXPECT_CALL(mock.collection, complete(_))
+ .Times(AtLeast(1));
+
+ Filtrators<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.push(info);
+}
+
+TEST(Filtration, pushRPCbyTCPStreamPartByPart)
+{
+ // Prepare data
+ struct pcap_pkthdr header1;
+ header1.caplen = header1.len = 3;
+ const uint8_t packet[] = {0x80, 0x00, 0x00, 0x80,
+ 0xec, 0x8a, 0x42, 0xcb,
+ 0x00, 0x00, 0x00, 0x00,// msg type - call
+ 0x00, 0x00, 0x00, 0x02,// RPC version
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00
+ };
+ PacketInfo info1(&header1, packet, 0);
+
+ struct pcap_pkthdr header2;
+ header2.caplen = header2.len = sizeof(packet) - header1.len;
+ PacketInfo info2(&header2, packet + header1.len, 0);
+ Writer mock;
+
+ // Set conditions
+ EXPECT_CALL(mock.collection, complete(_))
+ .Times(AtLeast(1));
+
+ Filtrators<Writer> f;
+ f.set_writer(nullptr, &mock, 0);
+ // Check
+ f.push(info1);
+ f.push(info2);
+}
+
+//------------------------------------------------------------------------------
+
diff --git a/tests/unit/protocols/CMakeLists.txt b/tests/unit/protocols/CMakeLists.txt
new file mode 100644
index 0000000..471fd7f
--- /dev/null
+++ b/tests/unit/protocols/CMakeLists.txt
@@ -0,0 +1,13 @@
+project (unit_test_protocols)
+aux_source_directory ("." SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/cifs2/ SRC_TEST_LIST)
+aux_source_directory (${CMAKE_SOURCE_DIR}/src/protocols/nfs/ SRC_TEST_LIST)
+
+add_executable (${PROJECT_NAME} ${SRC_TEST_LIST}
+ ${CMAKE_SOURCE_DIR}/src/utils/out.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/log.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/sessions.cpp
+)
+
+target_link_libraries (${PROJECT_NAME} ${GMOCK_LIBRARIES})
+add_test (${PROJECT_NAME} ${PROJECT_NAME})
diff --git a/tests/unit/protocols/cifsv2.cpp b/tests/unit/protocols/cifsv2.cpp
new file mode 100644
index 0000000..fe51209
--- /dev/null
+++ b/tests/unit/protocols/cifsv2.cpp
@@ -0,0 +1,92 @@
+//------------------------------------------------------------------------------
+// Author: Andrey Kuznetsov
+// Description: CIFS v2 tests
+// Copyright (c) 2013-2014 EPAM Systems
+//------------------------------------------------------------------------------
+/*
+ This file is part of Nfstrace.
+
+ Nfstrace is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ Nfstrace is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Nfstrace. If not, see <http://www.gnu.org/licenses/>.
+*/
+//------------------------------------------------------------------------------
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <arpa/inet.h>
+
+#include "api/cifs2_commands.h"
+#include "api/cifs_commands.h"
+#include "protocols/cifs2/cifs2.h"
+//------------------------------------------------------------------------------
+using namespace NST::API::SMBv2;
+using namespace NST::protocols::CIFSv2;
+//------------------------------------------------------------------------------
+
+TEST(CIFSv2, bodies)
+{
+ EXPECT_EQ(36u, sizeof(struct NegotiateRequest) - sizeof(Dialects));
+ EXPECT_EQ(65u, sizeof(struct NegotiateResponse));
+
+ EXPECT_EQ(25u, sizeof(struct SessionSetupRequest));
+ EXPECT_EQ(9u, sizeof(struct SessionSetupResponse));
+
+ EXPECT_EQ(4u, sizeof(struct LogOffRequest));
+ EXPECT_EQ(4u, sizeof(struct LogOffResponse));
+
+ EXPECT_EQ(4u, sizeof(struct EchoRequest));
+ EXPECT_EQ(4u, sizeof(struct EchoResponse));
+
+ EXPECT_EQ(9u, sizeof(struct TreeConnectRequest));
+ EXPECT_EQ(16u, sizeof(struct TreeConnectResponse));
+
+ EXPECT_EQ(4u, sizeof(struct TreeDisconnectRequest));
+ EXPECT_EQ(4u, sizeof(struct TreeDisconnectResponse));
+
+ EXPECT_EQ(57u, sizeof(struct CreateRequest));
+ EXPECT_EQ(89u, sizeof(struct CreateResponse));
+
+ EXPECT_EQ(24u, sizeof(struct CloseRequest));
+ EXPECT_EQ(60u, sizeof(struct CloseResponse));
+
+ EXPECT_EQ(41u, sizeof(struct QueryInfoRequest));
+ EXPECT_EQ(9u, sizeof(struct QueryInfoResponse));
+
+ EXPECT_EQ(33u, sizeof(struct QueryDirRequest));
+ EXPECT_EQ(9u, sizeof(struct QueryDirResponse));
+
+ EXPECT_EQ(24u, sizeof(struct FlushRequest));
+ EXPECT_EQ(4u, sizeof(struct FlushResponse));
+
+ EXPECT_EQ(49u, sizeof(struct ReadRequest));
+ EXPECT_EQ(17u, sizeof(struct ReadResponse));
+
+ EXPECT_EQ(24u, sizeof(struct OplockAcknowledgment));
+ EXPECT_EQ(24u, sizeof(struct OplockResponse));
+
+ EXPECT_EQ(49u, sizeof(struct WriteRequest));
+ EXPECT_EQ(16u, sizeof(struct WriteResponse));
+
+ EXPECT_EQ(48u, sizeof(struct LockRequest));
+ EXPECT_EQ(4u, sizeof(struct LockResponse));
+
+ EXPECT_EQ(4u, sizeof(struct CancelRequest));
+
+ EXPECT_EQ(32u, sizeof(struct ChangeNotifyRequest));
+ EXPECT_EQ(8u + sizeof(struct FileNotifyInformation), sizeof(struct ChangeNotifyResponse));
+
+ EXPECT_EQ(57u, sizeof(struct IoCtlRequest));
+ EXPECT_EQ(49u, sizeof(struct IoCtlResponse));
+
+ EXPECT_EQ(33u, sizeof(struct SetInfoRequest));
+ EXPECT_EQ(2u, sizeof(struct SetInfoResponse));
+}
+//------------------------------------------------------------------------------
diff --git a/tests/unit/utils/CMakeLists.txt b/tests/unit/utils/CMakeLists.txt
index ce39c44..eab7487 100644
--- a/tests/unit/utils/CMakeLists.txt
+++ b/tests/unit/utils/CMakeLists.txt
@@ -1,5 +1,5 @@
-set(UTILS_TEST_EXECUTABLE test_utils)
-aux_source_directory("." SRC_TEST_LIST)
-add_executable(${UTILS_TEST_EXECUTABLE} ${SRC_TEST_LIST})
-target_link_libraries(${UTILS_TEST_EXECUTABLE} ${GMOCK_LIBRARIES})
-add_test(test_utils ${UTILS_TEST_EXECUTABLE})
+project (unit_test_utils)
+aux_source_directory ("." SRC_TEST_LIST)
+add_executable (${PROJECT_NAME} ${SRC_TEST_LIST})
+target_link_libraries (${PROJECT_NAME} ${GMOCK_LIBRARIES})
+add_test (${PROJECT_NAME} ${PROJECT_NAME})
diff --git a/tests/unit/utils/test_utils.cpp b/tests/unit/utils/test_utils.cpp
deleted file mode 100644
index 39266a3..0000000
--- a/tests/unit/utils/test_utils.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-int main(int argc, char **argv)
-{
- setenv("LANG", "C", 1);
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/traces/eth-ipv4-tcp-cifs2.pcap.bz2 b/traces/eth-ipv4-tcp-cifs2.pcap.bz2
new file mode 100644
index 0000000..23c04d0
--- /dev/null
+++ b/traces/eth-ipv4-tcp-cifs2.pcap.bz2
Binary files differ
diff --git a/traces/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2 b/traces/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2
new file mode 100644
index 0000000..836f9b5
--- /dev/null
+++ b/traces/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2
Binary files differ
diff --git a/traces/eth-ipv4-tcp-nfsv41.pcap.bz2 b/traces/eth-ipv4-tcp-nfsv41.pcap.bz2
new file mode 100644
index 0000000..75b55ef
--- /dev/null
+++ b/traces/eth-ipv4-tcp-nfsv41.pcap.bz2
Binary files differ
diff --git a/traces/eth-ipv4-tcp-smb2-putty.pcap.bz2 b/traces/eth-ipv4-tcp-smb2-putty.pcap.bz2
new file mode 100644
index 0000000..b50034c
--- /dev/null
+++ b/traces/eth-ipv4-tcp-smb2-putty.pcap.bz2
Binary files differ
diff --git a/traces/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2 b/traces/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2
new file mode 100644
index 0000000..7cab622
--- /dev/null
+++ b/traces/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2
Binary files differ
diff --git a/traces/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2 b/traces/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2
index d7e9ebd..d7e9ebd 100755..100644
--- a/traces/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2
+++ b/traces/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2
Binary files differ
diff --git a/traces/references/1-packet.pcap.bz2.ref b/traces/references/1-packet.pcap.bz2.ref
deleted file mode 100644
index 834875a..0000000
--- a/traces/references/1-packet.pcap.bz2.ref
+++ /dev/null
@@ -1,68 +0,0 @@
-### Breakdown analyzer ###
-NFSv3 total procedures: 0. Per procedure:
-NULL 0 0.00%
-GETATTR 0 0.00%
-SETATTR 0 0.00%
-LOOKUP 0 0.00%
-ACCESS 0 0.00%
-READLINK 0 0.00%
-READ 0 0.00%
-WRITE 0 0.00%
-CREATE 0 0.00%
-MKDIR 0 0.00%
-SYMLINK 0 0.00%
-MKNOD 0 0.00%
-REMOVE 0 0.00%
-RMDIR 0 0.00%
-RENAME 0 0.00%
-LINK 0 0.00%
-READDIR 0 0.00%
-READDIRPLUS 0 0.00%
-FSSTAT 0 0.00%
-FSINFO 0 0.00%
-PATHCONF 0 0.00%
-COMMIT 0 0.00%
-
-NFSv4 total procedures: 0. Per procedure:
-NULL 0 0.00%
-COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
-ILLEGAL 0 0.00%
-ACCESS 0 0.00%
-CLOSE 0 0.00%
-COMMIT 0 0.00%
-CREATE 0 0.00%
-DELEGPURGE 0 0.00%
-DELEGRETURN 0 0.00%
-GETATTR 0 0.00%
-GETFH 0 0.00%
-LINK 0 0.00%
-LOCK 0 0.00%
-LOCKT 0 0.00%
-LOCKU 0 0.00%
-LOOKUP 0 0.00%
-LOOKUPP 0 0.00%
-NVERIFY 0 0.00%
-OPEN 0 0.00%
-OPENATTR 0 0.00%
-OPEN_CONFIRM 0 0.00%
-OPEN_DOWNGRADE 0 0.00%
-PUTFH 0 0.00%
-PUTPUBFH 0 0.00%
-PUTROOTFH 0 0.00%
-READ 0 0.00%
-READDIR 0 0.00%
-READLINK 0 0.00%
-REMOVE 0 0.00%
-RENAME 0 0.00%
-RENEW 0 0.00%
-RESTOREFH 0 0.00%
-SAVEFH 0 0.00%
-SECINFO 0 0.00%
-SETATTR 0 0.00%
-SETCLIENTID 0 0.00%
-SETCLIENTID_CONFIRM 0 0.00%
-VERIFY 0 0.00%
-WRITE 0 0.00%
-RELEASE_LOCKOWNER 0 0.00%
-GET_DIR_DELEGATION 0 0.00%
diff --git a/traces/references/breakdown/1-packet.pcap.bz2.ref b/traces/references/breakdown/1-packet.pcap.bz2.ref
new file mode 100644
index 0000000..e030f50
--- /dev/null
+++ b/traces/references/breakdown/1-packet.pcap.bz2.ref
@@ -0,0 +1,233 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
+NULL 0 0.00%
+GETATTR 0 0.00%
+SETATTR 0 0.00%
+LOOKUP 0 0.00%
+ACCESS 0 0.00%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/2sessions-tcp-wsize32k-tcp-wsize512k.pcap.bz2.ref b/traces/references/breakdown/2sessions-tcp-wsize32k-tcp-wsize512k.pcap.bz2.ref
index 3d4fe6c..3e063bb 100644
--- a/traces/references/2sessions-tcp-wsize32k-tcp-wsize512k.pcap.bz2.ref
+++ b/traces/references/breakdown/2sessions-tcp-wsize32k-tcp-wsize512k.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 413. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 413. Per operation:
NULL 4 0.97%
GETATTR 7 1.69%
SETATTR 2 0.48%
@@ -24,7 +125,7 @@ PATHCONF 2 0.48%
COMMIT 2 0.48%
Per connection info:
Session: 10.6.136.107:9316 --> 10.6.136.214:2049 [TCP]
-Total procedures: 1. Per procedure:
+Total operations: 1. Per operation:
NULL Count: 1 (100.00%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -48,7 +149,7 @@ FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
Session: 10.6.136.107:9318 --> 10.6.136.214:2049 [TCP]
-Total procedures: 365. Per procedure:
+Total operations: 365. Per operation:
NULL Count: 1 ( 0.27%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
GETATTR Count: 3 ( 0.82%) Min: 0.001 Max: 0.004 Avg: 0.002 StDev: 0.00186981
SETATTR Count: 1 ( 0.27%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
@@ -72,7 +173,7 @@ FSINFO Count: 2 ( 0.55%) Min: 0.001 Max: 0.001 Avg: 0.001 St
PATHCONF Count: 1 ( 0.27%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
COMMIT Count: 1 ( 0.27%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
Session: 10.6.136.107:9320 --> 10.6.137.24:2049 [TCP]
-Total procedures: 1. Per procedure:
+Total operations: 1. Per operation:
NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -96,7 +197,7 @@ FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
Session: 10.6.136.107:9322 --> 10.6.137.24:2049 [TCP]
-Total procedures: 46. Per procedure:
+Total operations: 46. Per operation:
NULL Count: 1 ( 2.17%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GETATTR Count: 4 ( 8.70%) Min: 0.000 Max: 0.001 Avg: 0.000 StDev: 0.00006949
SETATTR Count: 1 ( 2.17%) Min: 0.013 Max: 0.013 Avg: 0.013 StDev: 0.00000000
@@ -119,11 +220,57 @@ FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
FSINFO Count: 2 ( 4.35%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00001626
PATHCONF Count: 1 ( 2.17%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
COMMIT Count: 1 ( 2.17%) Min: 0.148 Max: 0.148 Avg: 0.148 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
NULL 0 0.00%
COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
+Total operations: 0. Per operation:
ILLEGAL 0 0.00%
ACCESS 0 0.00%
CLOSE 0 0.00%
@@ -162,4 +309,22 @@ SETCLIENTID_CONFIRM 0 0.00%
VERIFY 0 0.00%
WRITE 0 0.00%
RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv4-tcp-cifs2.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-cifs2.pcap.bz2.ref
new file mode 100644
index 0000000..ca3eba8
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv4-tcp-cifs2.pcap.bz2.ref
@@ -0,0 +1,255 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 30. Per operation:
+NEGOTIATE 1 3.33%
+SESSION SETUP 2 6.67%
+LOGOFF 0 0.00%
+TREE CONNECT 2 6.67%
+TREE DISCONNECT 1 3.33%
+CREATE 6 20.00%
+CLOSE 6 20.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 4 13.33%
+QUERY DIRECTORY 6 20.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 2 6.67%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+Per connection info:
+Session: 10.20.9.39:48207 --> 10.20.0.5:445 [TCP]
+Total operations: 30. Per operation:
+NEGOTIATE Count: 1 ( 3.33%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
+SESSION SETUP Count: 2 ( 6.67%) Min: 0.001 Max: 0.002 Avg: 0.001 StDev: 0.00077782
+LOGOFF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE CONNECT Count: 2 ( 6.67%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00009617
+TREE DISCONNECT Count: 1 ( 3.33%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
+CREATE Count: 6 ( 20.00%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00011734
+CLOSE Count: 6 ( 20.00%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00004669
+FLUSH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+IOCTL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CANCEL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ECHO Count: 4 ( 13.33%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00008427
+QUERY DIRECTORY Count: 6 ( 20.00%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00010042
+CHANGE NOTIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY INFO Count: 2 ( 6.67%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00006505
+SET INFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPLOCK BREAK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
+NULL 0 0.00%
+GETATTR 0 0.00%
+SETATTR 0 0.00%
+LOOKUP 0 0.00%
+ACCESS 0 0.00%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2.ref
new file mode 100644
index 0000000..9ba8756
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv4-tcp-nfsv3-4-41-cifs1-2.pcap.bz2.ref
@@ -0,0 +1,534 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 220. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 4 1.82%
+FLUSH 0 0.00%
+DELETE 5 2.27%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 149 67.73%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 51 23.18%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 1 0.45%
+SESSION_SETUP_ANDX 2 0.91%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 2 0.91%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 6 2.73%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+Per connection info:
+Session: 10.0.2.15:55529 --> 10.6.208.121:445 [TCP]
+Total operations: 220. Per operation:
+CREATE_DIRECTORY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELETE_DIRECTORY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CLOSE Count: 4 ( 1.82%) Min: 0.001 Max: 0.013 Avg: 0.005 StDev: 0.00551499
+FLUSH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELETE Count: 5 ( 2.27%) Min: 0.002 Max: 0.020 Avg: 0.006 StDev: 0.00774909
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY_INFORMATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SET_INFORMATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCK_BYTE_RANGE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+UNLOCK_BYTE_RANGE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE_TEMPORARY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE_NEW Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CHECK_DIRECTORY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PROCESS_EXIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SEEK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCK_AND_READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_AND_UNLOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ_RAW Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ_MPX Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ_MPX_SECONDARY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_RAW Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_MPX Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_MPX_SECONDARY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_COMPLETE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY_SERVER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SET_INFORMATION2 Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY_INFORMATION2 Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKING_ANDX Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TRANSACTION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TRANSACTION_SECONDARY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+IOCTL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+IOCTL_SECONDARY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COPY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ECHO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_AND_CLOSE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_ANDX Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ_ANDX Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_ANDX Count: 149 ( 67.73%) Min: 0.000 Max: 0.563 Avg: 0.013 StDev: 0.05730764
+NEW_FILE_SIZE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CLOSE_AND_TREE_DISC Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TRANSACTION2 Count: 51 ( 23.18%) Min: 0.000 Max: 0.029 Avg: 0.004 StDev: 0.00614999
+TRANSACTION2_SECONDARY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FIND_CLOSE2 Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FIND_NOTIFY_CLOSE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE_CONNECT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE_DISCONNECT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NEGOTIATE Count: 1 ( 0.45%) Min: 0.012 Max: 0.012 Avg: 0.012 StDev: 0.00000000
+SESSION_SETUP_ANDX Count: 2 ( 0.91%) Min: 0.010 Max: 0.020 Avg: 0.015 StDev: 0.00671964
+LOGOFF_ANDX Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE_CONNECT_ANDX Count: 2 ( 0.91%) Min: 0.001 Max: 0.002 Avg: 0.001 StDev: 0.00017395
+SECURITY_PACKAGE_ANDX Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY_INFORMATION_DISK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SEARCH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FIND Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FIND_UNIQUE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FIND_CLOSE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NT_TRANSACT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NT_TRANSACT_SECONDARY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NT_CREATE_ANDX Count: 6 ( 2.73%) Min: 0.000 Max: 0.056 Avg: 0.017 StDev: 0.02122381
+NT_CANCEL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NT_RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_PRINT_FILE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_PRINT_FILE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CLOSE_PRINT_FILE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GET_PRINT_QUEUE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ_BULK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_BULK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE_BULK_DATA Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+INVALID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NO_ANDX_COMMAND Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 86. Per operation:
+NEGOTIATE 1 1.16%
+SESSION SETUP 2 2.33%
+LOGOFF 0 0.00%
+TREE CONNECT 2 2.33%
+TREE DISCONNECT 1 1.16%
+CREATE 17 19.77%
+CLOSE 15 17.44%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 10 11.63%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 18 20.93%
+QUERY DIRECTORY 16 18.60%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 4 4.65%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+Per connection info:
+Session: 10.0.2.15:55530 --> 10.6.208.121:445 [TCP]
+Total operations: 86. Per operation:
+NEGOTIATE Count: 1 ( 1.16%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
+SESSION SETUP Count: 2 ( 2.33%) Min: 0.001 Max: 0.026 Avg: 0.013 StDev: 0.01728593
+LOGOFF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE CONNECT Count: 2 ( 2.33%) Min: 0.000 Max: 0.001 Avg: 0.001 StDev: 0.00007142
+TREE DISCONNECT Count: 1 ( 1.16%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 17 ( 19.77%) Min: 0.000 Max: 0.025 Avg: 0.003 StDev: 0.00703743
+CLOSE Count: 15 ( 17.44%) Min: 0.000 Max: 0.002 Avg: 0.001 StDev: 0.00055623
+FLUSH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 10 ( 11.63%) Min: 0.240 Max: 0.272 Avg: 0.254 StDev: 0.01043609
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+IOCTL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CANCEL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ECHO Count: 18 ( 20.93%) Min: 0.000 Max: 0.001 Avg: 0.001 StDev: 0.00010472
+QUERY DIRECTORY Count: 16 ( 18.60%) Min: 0.000 Max: 0.001 Avg: 0.000 StDev: 0.00032584
+CHANGE NOTIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY INFO Count: 4 ( 4.65%) Min: 0.000 Max: 0.001 Avg: 0.000 StDev: 0.00014229
+SET INFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPLOCK BREAK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 7123. Per operation:
+NULL 2 0.03%
+GETATTR 47 0.66%
+SETATTR 5 0.07%
+LOOKUP 4 0.06%
+ACCESS 7 0.10%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 7034 98.75%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 10 0.14%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 1 0.01%
+FSSTAT 0 0.00%
+FSINFO 2 0.03%
+PATHCONF 1 0.01%
+COMMIT 10 0.14%
+Per connection info:
+Session: 127.0.0.1:929 --> 127.0.1.1:2049 [TCP]
+Total operations: 7122. Per operation:
+NULL Count: 1 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 47 ( 0.66%) Min: 0.000 Max: 6.263 Avg: 0.305 StDev: 1.17363977
+SETATTR Count: 5 ( 0.07%) Min: 0.116 Max: 0.134 Avg: 0.120 StDev: 0.00761450
+LOOKUP Count: 4 ( 0.06%) Min: 0.000 Max: 0.048 Avg: 0.012 StDev: 0.02370697
+ACCESS Count: 7 ( 0.10%) Min: 0.000 Max: 4.560 Avg: 0.651 StDev: 1.72330521
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 7034 ( 98.76%) Min: 1.864 Max: 10.838 Avg: 6.422 StDev: 1.42340920
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 10 ( 0.14%) Min: 0.002 Max: 0.027 Avg: 0.007 StDev: 0.00724753
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 1 ( 0.01%) Min: 0.010 Max: 0.010 Avg: 0.010 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 2 ( 0.03%) Min: 0.002 Max: 0.010 Avg: 0.006 StDev: 0.00623668
+PATHCONF Count: 1 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 10 ( 0.14%) Min: 0.027 Max: 6.276 Avg: 3.537 StDev: 2.64561423
+Session: 127.0.0.1:34744 --> 127.0.1.1:2049 [TCP]
+Total operations: 1. Per operation:
+NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 3264. Per procedure:
+NULL 2 0.06%
+COMPOUND 3262 99.94%
+Total operations: 9701. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 16 0.16%
+CLOSE 5 0.05%
+COMMIT 9 0.09%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 3230 33.30%
+GETFH 10 0.10%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 7 0.07%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 6 0.06%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 1 0.01%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 3256 33.56%
+PUTPUBFH 0 0.00%
+PUTROOTFH 1 0.01%
+READ 0 0.00%
+READDIR 2 0.02%
+READLINK 0 0.00%
+REMOVE 10 0.10%
+RENAME 0 0.00%
+RENEW 1 0.01%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 1 0.01%
+SETATTR 5 0.05%
+SETCLIENTID 2 0.02%
+SETCLIENTID_CONFIRM 2 0.02%
+VERIFY 0 0.00%
+WRITE 3137 32.34%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+Per connection info:
+Session: 127.0.0.1:774 --> 127.0.1.1:2049 [TCP]
+Total procedures: 3263. Per procedure:
+NULL Count: 1 ( 0.03%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMPOUND Count: 3262 ( 99.97%) Min: 0.000 Max: 10.078 Avg: 5.419 StDev: 1.58006087
+Total operations: 9701. Per operation:
+ILLEGAL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 16 ( 0.16%) Min: 0.000 Max: 0.024 Avg: 0.002 StDev: 0.00594558
+CLOSE Count: 5 ( 0.05%) Min: 0.004 Max: 1.321 Avg: 0.268 StDev: 0.58890757
+COMMIT Count: 9 ( 0.09%) Min: 1.302 Max: 10.078 Avg: 5.996 StDev: 3.22080444
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGPURGE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGRETURN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 3230 ( 33.30%) Min: 0.000 Max: 10.039 Avg: 5.456 StDev: 1.51167879
+GETFH Count: 10 ( 0.10%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00008106
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKU Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 7 ( 0.07%) Min: 0.000 Max: 0.045 Avg: 0.007 StDev: 0.01706574
+LOOKUPP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NVERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN Count: 6 ( 0.06%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00007746
+OPENATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_CONFIRM Count: 1 ( 0.01%) Min: 0.058 Max: 0.058 Avg: 0.058 StDev: 0.00000000
+OPEN_DOWNGRADE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTFH Count: 3256 ( 33.56%) Min: 0.000 Max: 10.078 Avg: 5.429 StDev: 1.56427995
+PUTPUBFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTROOTFH Count: 1 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 2 ( 0.02%) Min: 0.000 Max: 0.019 Avg: 0.009 StDev: 0.01314087
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 10 ( 0.10%) Min: 0.003 Max: 0.047 Avg: 0.017 StDev: 0.01868040
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENEW Count: 1 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RESTOREFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SAVEFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SECINFO Count: 1 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 5 ( 0.05%) Min: 0.076 Max: 0.139 Avg: 0.114 StDev: 0.03439663
+SETCLIENTID Count: 2 ( 0.02%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000283
+SETCLIENTID_CONFIRM Count: 2 ( 0.02%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00011102
+VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 3137 ( 32.34%) Min: 4.091 Max: 10.039 Avg: 5.617 StDev: 1.20491606
+RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+Session: 127.0.0.1:854 --> 127.0.1.1:2049 [TCP]
+Total procedures: 1. Per procedure:
+NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMPOUND Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+Total operations: 0. Per operation:
+ILLEGAL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CLOSE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGPURGE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGRETURN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKU Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUPP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NVERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPENATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_DOWNGRADE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTPUBFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTROOTFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENEW Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RESTOREFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SAVEFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SECINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETCLIENTID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETCLIENTID_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 8127. Per procedure:
+NULL 0 0.00%
+COMPOUND 8127 100.00%
+Total operations: 32359. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 15 0.05%
+CLOSE 5 0.02%
+COMMIT 81 0.25%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 8021 24.79%
+GETFH 14 0.04%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 18 0.06%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 6 0.02%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 8123 25.10%
+PUTPUBFH 0 0.00%
+PUTROOTFH 2 0.01%
+READ 0 0.00%
+READDIR 1 0.00%
+READLINK 0 0.00%
+REMOVE 10 0.03%
+RENAME 2 0.01%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 2 0.01%
+SECINFO 1 0.00%
+SETATTR 5 0.02%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 7924 24.49%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 1 0.00%
+CREATE_SESSION 1 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 1 0.00%
+SEQUENCE 8125 25.11%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 1 0.00%
+Per connection info:
+Session: 127.0.0.1:854 --> 127.0.1.1:2049 [TCP]
+Total procedures: 8127. Per procedure:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMPOUND Count: 8127 (100.00%) Min: 0.000 Max: 1.611 Avg: 0.159 StDev: 0.12318248
+Total operations: 32359. Per operation:
+ILLEGAL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 15 ( 0.05%) Min: 0.000 Max: 0.056 Avg: 0.005 StDev: 0.01505007
+CLOSE Count: 5 ( 0.02%) Min: 0.000 Max: 0.104 Avg: 0.036 StDev: 0.04457220
+COMMIT Count: 81 ( 0.25%) Min: 0.031 Max: 1.099 Avg: 0.221 StDev: 0.19734124
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGPURGE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGRETURN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 8021 ( 24.79%) Min: 0.000 Max: 1.611 Avg: 0.159 StDev: 0.12194249
+GETFH Count: 14 ( 0.04%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00003984
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKU Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 18 ( 0.06%) Min: 0.000 Max: 0.001 Avg: 0.000 StDev: 0.00023266
+LOOKUPP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NVERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN Count: 6 ( 0.02%) Min: 0.000 Max: 0.056 Avg: 0.009 StDev: 0.02296709
+OPENATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_DOWNGRADE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTFH Count: 8123 ( 25.10%) Min: 0.000 Max: 1.611 Avg: 0.159 StDev: 0.12316637
+PUTPUBFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTROOTFH Count: 2 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00009192
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 1 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 10 ( 0.03%) Min: 0.000 Max: 0.002 Avg: 0.001 StDev: 0.00083136
+RENAME Count: 2 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000566
+RENEW Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RESTOREFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SAVEFH Count: 2 ( 0.01%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000566
+SECINFO Count: 1 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 5 ( 0.02%) Min: 0.076 Max: 0.139 Avg: 0.126 StDev: 0.02779151
+SETCLIENTID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETCLIENTID_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 7924 ( 24.49%) Min: 0.001 Max: 1.611 Avg: 0.161 StDev: 0.12152067
+RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+BACKCHANNEL_CTL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+BIND_CONN_TO_SESSION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+EXCHANGE_ID Count: 1 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE_SESSION Count: 1 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DESTROY_SESSION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FREE_STATEID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETDEVICEINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETDEVICELIST Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LAYOUTCOMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LAYOUTGET Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LAYOUTRETURN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SECINFO_NO_NAME Count: 1 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SEQUENCE Count: 8125 ( 25.11%) Min: 0.000 Max: 1.611 Avg: 0.159 StDev: 0.12317244
+SET_SSV Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TEST_STATEID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WANT_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DESTROY_CLIENTID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RECLAIM_COMPLETE Count: 1 ( 0.00%) Min: 0.027 Max: 0.027 Avg: 0.027 StDev: 0.00000000
diff --git a/traces/references/eth-ipv4-tcp-nfsv3-4-readdir-75k-entries.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-nfsv3-4-readdir-75k-entries.pcap.bz2.ref
index b382908..693bf37 100644
--- a/traces/references/eth-ipv4-tcp-nfsv3-4-readdir-75k-entries.pcap.bz2.ref
+++ b/traces/references/breakdown/eth-ipv4-tcp-nfsv3-4-readdir-75k-entries.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 3892. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 3892. Per operation:
NULL 2 0.05%
GETATTR 25 0.64%
SETATTR 0 0.00%
@@ -24,7 +125,7 @@ PATHCONF 1 0.03%
COMMIT 0 0.00%
Per connection info:
Session: 10.6.137.109:808 --> 10.6.137.113:2049 [TCP]
-Total procedures: 3891. Per procedure:
+Total operations: 3891. Per operation:
NULL Count: 1 ( 0.03%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GETATTR Count: 25 ( 0.64%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00003988
SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -48,7 +149,7 @@ FSINFO Count: 2 ( 0.05%) Min: 0.000 Max: 0.000 Avg: 0.000 St
PATHCONF Count: 1 ( 0.03%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
Session: 10.6.137.109:41167 --> 10.6.137.113:2049 [TCP]
-Total procedures: 1. Per procedure:
+Total operations: 1. Per operation:
NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -71,11 +172,12 @@ FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-
-NFSv4 total procedures: 4679. Per procedure:
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 4679. Per procedure:
NULL 1 0.02%
COMPOUND 4678 99.98%
-NFSv4 total operations: 9369. Per operation:
+Total operations: 9369. Per operation:
ILLEGAL 0 0.00%
ACCESS 8 0.09%
CLOSE 0 0.00%
@@ -160,3 +262,66 @@ VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv4-tcp-nfsv3.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-nfsv3.pcap.bz2.ref
new file mode 100644
index 0000000..79f508b
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv4-tcp-nfsv3.pcap.bz2.ref
@@ -0,0 +1,258 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 3331. Per operation:
+NULL 0 0.00%
+GETATTR 20 0.60%
+SETATTR 0 0.00%
+LOOKUP 20 0.60%
+ACCESS 11 0.33%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 3200 96.07%
+CREATE 10 0.30%
+MKDIR 10 0.30%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 10 0.30%
+RMDIR 10 0.30%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 30 0.90%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 10 0.30%
+Per connection info:
+Session: 10.0.2.15:860 --> 10.6.136.214:2049 [TCP]
+Total operations: 3331. Per operation:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 20 ( 0.60%) Min: 0.001 Max: 0.002 Avg: 0.001 StDev: 0.00026637
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 20 ( 0.60%) Min: 0.001 Max: 0.003 Avg: 0.001 StDev: 0.00047318
+ACCESS Count: 11 ( 0.33%) Min: 0.001 Max: 0.002 Avg: 0.002 StDev: 0.00028820
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 3200 ( 96.07%) Min: 0.005 Max: 0.114 Avg: 0.012 StDev: 0.00575373
+CREATE Count: 10 ( 0.30%) Min: 0.002 Max: 0.003 Avg: 0.002 StDev: 0.00028786
+MKDIR Count: 10 ( 0.30%) Min: 0.002 Max: 0.004 Avg: 0.003 StDev: 0.00043406
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 10 ( 0.30%) Min: 0.014 Max: 0.020 Avg: 0.017 StDev: 0.00205551
+RMDIR Count: 10 ( 0.30%) Min: 0.001 Max: 0.003 Avg: 0.002 StDev: 0.00043587
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 30 ( 0.90%) Min: 0.001 Max: 0.002 Avg: 0.001 StDev: 0.00040038
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 10 ( 0.30%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00019761
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/eth-ipv4-tcp-nfsv4-incorrect_mount.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-nfsv4-incorrect_mount.pcap.bz2.ref
index 91b645f..e949e6a 100644
--- a/traces/references/eth-ipv4-tcp-nfsv4-incorrect_mount.pcap.bz2.ref
+++ b/traces/references/breakdown/eth-ipv4-tcp-nfsv4-incorrect_mount.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 0. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
NULL 0 0.00%
GETATTR 0 0.00%
SETATTR 0 0.00%
@@ -22,11 +123,12 @@ FSSTAT 0 0.00%
FSINFO 0 0.00%
PATHCONF 0 0.00%
COMMIT 0 0.00%
-
-NFSv4 total procedures: 3. Per procedure:
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 3. Per procedure:
NULL 1 33.33%
COMPOUND 2 66.67%
-NFSv4 total operations: 0. Per operation:
+Total operations: 0. Per operation:
ILLEGAL 0 0.00%
ACCESS 0 0.00%
CLOSE 0 0.00%
@@ -111,3 +213,66 @@ VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/eth-ipv4-tcp-nfsv4-posix.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-nfsv4-posix.pcap.bz2.ref
index b2ad528..b3fe4ac 100644
--- a/traces/references/eth-ipv4-tcp-nfsv4-posix.pcap.bz2.ref
+++ b/traces/references/breakdown/eth-ipv4-tcp-nfsv4-posix.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 0. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
NULL 0 0.00%
GETATTR 0 0.00%
SETATTR 0 0.00%
@@ -22,11 +123,12 @@ FSSTAT 0 0.00%
FSINFO 0 0.00%
PATHCONF 0 0.00%
COMMIT 0 0.00%
-
-NFSv4 total procedures: 100671. Per procedure:
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 100671. Per procedure:
NULL 8 0.01%
COMPOUND 100663 99.99%
-NFSv4 total operations: 254857. Per operation:
+Total operations: 254857. Per operation:
ILLEGAL 0 0.00%
ACCESS 35637 13.98%
CLOSE 1722 0.68%
@@ -419,3 +521,66 @@ VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
WRITE Count: 32 ( 22.07%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00001498
RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/eth-ipv4-tcp-nfsv4.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-nfsv4.pcap.bz2.ref
index bc50010..87a9b5d 100644
--- a/traces/references/eth-ipv4-tcp-nfsv4.pcap.bz2.ref
+++ b/traces/references/breakdown/eth-ipv4-tcp-nfsv4.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 0. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
NULL 0 0.00%
GETATTR 0 0.00%
SETATTR 0 0.00%
@@ -22,11 +123,12 @@ FSSTAT 0 0.00%
FSINFO 0 0.00%
PATHCONF 0 0.00%
COMMIT 0 0.00%
-
-NFSv4 total procedures: 1607. Per procedure:
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 1607. Per procedure:
NULL 0 0.00%
COMPOUND 1607 100.00%
-NFSv4 total operations: 4819. Per operation:
+Total operations: 4819. Per operation:
ILLEGAL 0 0.00%
ACCESS 1 0.02%
CLOSE 1 0.02%
@@ -111,3 +213,66 @@ VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
WRITE Count: 1600 ( 33.20%) Min: 0.002 Max: 0.007 Avg: 0.005 StDev: 0.00067742
RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv4-tcp-nfsv41.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-nfsv41.pcap.bz2.ref
new file mode 100644
index 0000000..2f8c4b9
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv4-tcp-nfsv41.pcap.bz2.ref
@@ -0,0 +1,341 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
+NULL 0 0.00%
+GETATTR 0 0.00%
+SETATTR 0 0.00%
+LOOKUP 0 0.00%
+ACCESS 0 0.00%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 1. Per procedure:
+NULL 1 100.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+Per connection info:
+Session: 10.6.136.104:909 --> 10.6.137.124:2049 [TCP]
+Total procedures: 1. Per procedure:
+NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMPOUND Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+Total operations: 0. Per operation:
+ILLEGAL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CLOSE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGPURGE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGRETURN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKU Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUPP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NVERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPENATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_DOWNGRADE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTPUBFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTROOTFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENEW Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RESTOREFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SAVEFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SECINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETCLIENTID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETCLIENTID_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 525. Per procedure:
+NULL 0 0.00%
+COMPOUND 525 100.00%
+Total operations: 1740. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 51 2.93%
+CLOSE 19 1.09%
+COMMIT 0 0.00%
+CREATE 6 0.34%
+DELEGPURGE 0 0.00%
+DELEGRETURN 6 0.34%
+GETATTR 448 25.75%
+GETFH 23 1.32%
+LINK 1 0.06%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 25 1.44%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 27 1.55%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 520 29.89%
+PUTPUBFH 0 0.00%
+PUTROOTFH 2 0.11%
+READ 5 0.29%
+READDIR 23 1.32%
+READLINK 0 0.00%
+REMOVE 14 0.80%
+RENAME 2 0.11%
+RENEW 0 0.00%
+RESTOREFH 1 0.06%
+SAVEFH 3 0.17%
+SECINFO 0 0.00%
+SETATTR 27 1.55%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 10 0.57%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 1 0.06%
+CREATE_SESSION 1 0.06%
+DESTROY_SESSION 1 0.06%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 1 0.06%
+SEQUENCE 521 29.94%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 1 0.06%
+RECLAIM_COMPLETE 1 0.06%
+Per connection info:
+Session: 10.6.136.104:909 --> 10.6.137.124:2049 [TCP]
+Total procedures: 525. Per procedure:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMPOUND Count: 525 (100.00%) Min: 0.000 Max: 0.143 Avg: 0.011 StDev: 0.01371792
+Total operations: 1740. Per operation:
+ILLEGAL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 51 ( 2.93%) Min: 0.000 Max: 0.033 Avg: 0.007 StDev: 0.00688447
+CLOSE Count: 19 ( 1.09%) Min: 0.001 Max: 0.017 Avg: 0.007 StDev: 0.00537860
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 6 ( 0.34%) Min: 0.035 Max: 0.065 Avg: 0.045 StDev: 0.01083349
+DELEGPURGE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DELEGRETURN Count: 6 ( 0.34%) Min: 0.000 Max: 0.012 Avg: 0.007 StDev: 0.00526032
+GETATTR Count: 448 ( 25.75%) Min: 0.000 Max: 0.143 Avg: 0.010 StDev: 0.01314797
+GETFH Count: 23 ( 1.32%) Min: 0.000 Max: 0.065 Avg: 0.026 StDev: 0.01836938
+LINK Count: 1 ( 0.06%) Min: 0.038 Max: 0.038 Avg: 0.038 StDev: 0.00000000
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOCKU Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 25 ( 1.44%) Min: 0.000 Max: 0.018 Avg: 0.007 StDev: 0.00624230
+LOOKUPP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+NVERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN Count: 27 ( 1.55%) Min: 0.000 Max: 0.045 Avg: 0.016 StDev: 0.01329146
+OPENATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+OPEN_DOWNGRADE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTFH Count: 520 ( 29.89%) Min: 0.000 Max: 0.143 Avg: 0.011 StDev: 0.01390513
+PUTPUBFH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PUTROOTFH Count: 2 ( 0.11%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00004455
+READ Count: 5 ( 0.29%) Min: 0.010 Max: 0.037 Avg: 0.021 StDev: 0.00996781
+READDIR Count: 23 ( 1.32%) Min: 0.000 Max: 0.081 Avg: 0.014 StDev: 0.01658236
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 14 ( 0.80%) Min: 0.017 Max: 0.059 Avg: 0.035 StDev: 0.01116871
+RENAME Count: 2 ( 0.11%) Min: 0.034 Max: 0.049 Avg: 0.042 StDev: 0.01064903
+RENEW Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RESTOREFH Count: 1 ( 0.06%) Min: 0.038 Max: 0.038 Avg: 0.038 StDev: 0.00000000
+SAVEFH Count: 3 ( 0.17%) Min: 0.034 Max: 0.049 Avg: 0.040 StDev: 0.00783811
+SECINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 27 ( 1.55%) Min: 0.002 Max: 0.143 Avg: 0.037 StDev: 0.02600623
+SETCLIENTID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETCLIENTID_CONFIRM Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+VERIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 10 ( 0.57%) Min: 0.002 Max: 0.049 Avg: 0.032 StDev: 0.01712543
+RELEASE_LOCKOWNER Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+BACKCHANNEL_CTL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+BIND_CONN_TO_SESSION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+EXCHANGE_ID Count: 1 ( 0.06%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE_SESSION Count: 1 ( 0.06%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DESTROY_SESSION Count: 1 ( 0.06%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FREE_STATEID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GET_DIR_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETDEVICEINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETDEVICELIST Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LAYOUTCOMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LAYOUTGET Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LAYOUTRETURN Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SECINFO_NO_NAME Count: 1 ( 0.06%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SEQUENCE Count: 521 ( 29.94%) Min: 0.000 Max: 0.143 Avg: 0.011 StDev: 0.01372841
+SET_SSV Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TEST_STATEID Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WANT_DELEGATION Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+DESTROY_CLIENTID Count: 1 ( 0.06%) Min: 0.027 Max: 0.027 Avg: 0.027 StDev: 0.00000000
+RECLAIM_COMPLETE Count: 1 ( 0.06%) Min: 0.021 Max: 0.021 Avg: 0.021 StDev: 0.00000000
diff --git a/traces/references/breakdown/eth-ipv4-tcp-smb2-putty.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-smb2-putty.pcap.bz2.ref
new file mode 100644
index 0000000..1ad3417
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv4-tcp-smb2-putty.pcap.bz2.ref
@@ -0,0 +1,255 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 35. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 5 14.29%
+CLOSE 5 14.29%
+FLUSH 0 0.00%
+READ 8 22.86%
+WRITE 7 20.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 1 2.86%
+ECHO 0 0.00%
+QUERY DIRECTORY 1 2.86%
+CHANGE NOTIFY 2 5.71%
+QUERY INFO 3 8.57%
+SET INFO 2 5.71%
+OPLOCK BREAK 1 2.86%
+Per connection info:
+Session: 192.168.47.129:49212 --> 192.168.47.128:445 [TCP]
+Total operations: 35. Per operation:
+NEGOTIATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SESSION SETUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOGOFF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE CONNECT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE DISCONNECT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 5 ( 14.29%) Min: 0.000 Max: 0.001 Avg: 0.001 StDev: 0.00047382
+CLOSE Count: 5 ( 14.29%) Min: 0.000 Max: 0.001 Avg: 0.001 StDev: 0.00043107
+FLUSH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 8 ( 22.86%) Min: 0.000 Max: 0.022 Avg: 0.006 StDev: 0.00753719
+WRITE Count: 7 ( 20.00%) Min: 0.001 Max: 0.002 Avg: 0.002 StDev: 0.00038373
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+IOCTL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CANCEL Count: 1 ( 2.86%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ECHO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY DIRECTORY Count: 1 ( 2.86%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CHANGE NOTIFY Count: 2 ( 5.71%) Min: 0.000 Max: 0.007 Avg: 0.004 StDev: 0.00468388
+QUERY INFO Count: 3 ( 8.57%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00004424
+SET INFO Count: 2 ( 5.71%) Min: 0.000 Max: 0.001 Avg: 0.001 StDev: 0.00039244
+OPLOCK BREAK Count: 1 ( 2.86%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
+NULL 0 0.00%
+GETATTR 0 0.00%
+SETATTR 0 0.00%
+LOOKUP 0 0.00%
+ACCESS 0 0.00%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2.ref
new file mode 100644
index 0000000..62e6b3c
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv4-tcp-smb2-zero-file-rw.pcap.bz2.ref
@@ -0,0 +1,255 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 928. Per operation:
+NEGOTIATE 1 0.11%
+SESSION SETUP 2 0.22%
+LOGOFF 1 0.11%
+TREE CONNECT 1 0.11%
+TREE DISCONNECT 1 0.11%
+CREATE 101 10.88%
+CLOSE 93 10.02%
+FLUSH 0 0.00%
+READ 309 33.30%
+WRITE 305 32.87%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 46 4.96%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 62 6.68%
+SET INFO 6 0.65%
+OPLOCK BREAK 0 0.00%
+Per connection info:
+Session: 10.6.137.126:38765 --> 10.6.137.82:445 [TCP]
+Total operations: 928. Per operation:
+NEGOTIATE Count: 1 ( 0.11%) Min: 0.011 Max: 0.011 Avg: 0.011 StDev: 0.00000000
+SESSION SETUP Count: 2 ( 0.22%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000495
+LOGOFF Count: 1 ( 0.11%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+TREE CONNECT Count: 1 ( 0.11%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
+TREE DISCONNECT Count: 1 ( 0.11%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
+CREATE Count: 101 ( 10.88%) Min: 0.000 Max: 0.002 Avg: 0.001 StDev: 0.00020542
+CLOSE Count: 93 ( 10.02%) Min: 0.000 Max: 0.028 Avg: 0.001 StDev: 0.00307903
+FLUSH Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 309 ( 33.30%) Min: 0.000 Max: 0.006 Avg: 0.005 StDev: 0.00063430
+WRITE Count: 305 ( 32.87%) Min: 0.001 Max: 0.011 Avg: 0.009 StDev: 0.00101763
+LOCK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+IOCTL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CANCEL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ECHO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY DIRECTORY Count: 46 ( 4.96%) Min: 0.000 Max: 0.001 Avg: 0.001 StDev: 0.00025545
+CHANGE NOTIFY Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+QUERY INFO Count: 62 ( 6.68%) Min: 0.000 Max: 0.001 Avg: 0.001 StDev: 0.00024599
+SET INFO Count: 6 ( 0.65%) Min: 0.000 Max: 0.001 Avg: 0.000 StDev: 0.00009635
+OPLOCK BREAK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 0. Per operation:
+NULL 0 0.00%
+GETATTR 0 0.00%
+SETATTR 0 0.00%
+LOOKUP 0 0.00%
+ACCESS 0 0.00%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref
new file mode 100644
index 0000000..a0592e2
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref
@@ -0,0 +1,258 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 11. Per operation:
+NULL 0 0.00%
+GETATTR 0 0.00%
+SETATTR 0 0.00%
+LOOKUP 0 0.00%
+ACCESS 0 0.00%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 11 100.00%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+Per connection info:
+Session: 10.6.136.186:912 --> 10.6.136.105:2049 [UDP]
+Total operations: 11. Per operation:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 11 (100.00%) Min: 0.002 Max: 0.234 Avg: 0.077 StDev: 0.08314611
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2.ref
index 47e3a0d..f5e643d 100644
--- a/traces/references/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2.ref
+++ b/traces/references/breakdown/eth-ipv4-udp-nfsv3-reply-first.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 57. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 57. Per operation:
NULL 1 1.75%
GETATTR 6 10.53%
SETATTR 1 1.75%
@@ -23,32 +124,8 @@ FSINFO 1 1.75%
PATHCONF 1 1.75%
COMMIT 0 0.00%
Per connection info:
-Session: 139.25.22.2:3298 --> 139.25.22.102:2049 [UDP]
-Total procedures: 1. Per procedure:
-NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
Session: 139.25.22.2:1022 --> 139.25.22.102:2049 [UDP]
-Total procedures: 56. Per procedure:
+Total operations: 56. Per operation:
NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GETATTR Count: 6 ( 10.71%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
SETATTR Count: 1 ( 1.79%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -71,11 +148,81 @@ FSSTAT Count: 1 ( 1.79%) Min: 0.000 Max: 0.000 Avg: 0.000 St
FSINFO Count: 1 ( 1.79%) Min: 0.010 Max: 0.010 Avg: 0.010 StDev: 0.00000000
PATHCONF Count: 1 ( 1.79%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
+Session: 139.25.22.2:3298 --> 139.25.22.102:2049 [UDP]
+Total operations: 1. Per operation:
+NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
NULL 0 0.00%
COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
+Total operations: 0. Per operation:
ILLEGAL 0 0.00%
ACCESS 0 0.00%
CLOSE 0 0.00%
@@ -114,4 +261,22 @@ SETCLIENTID_CONFIRM 0 0.00%
VERIFY 0 0.00%
WRITE 0 0.00%
RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/eth-ipv4-udp-nfsv3.pcap.bz2.ref b/traces/references/breakdown/eth-ipv4-udp-nfsv3.pcap.bz2.ref
index e5bd60e..09829d2 100644
--- a/traces/references/eth-ipv4-udp-nfsv3.pcap.bz2.ref
+++ b/traces/references/breakdown/eth-ipv4-udp-nfsv3.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 58. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 58. Per operation:
NULL 1 1.72%
GETATTR 7 12.07%
SETATTR 1 1.72%
@@ -23,32 +124,8 @@ FSINFO 1 1.72%
PATHCONF 1 1.72%
COMMIT 0 0.00%
Per connection info:
-Session: 139.25.22.2:3298 --> 139.25.22.102:2049 [UDP]
-Total procedures: 1. Per procedure:
-NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
Session: 139.25.22.2:1022 --> 139.25.22.102:2049 [UDP]
-Total procedures: 57. Per procedure:
+Total operations: 57. Per operation:
NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
GETATTR Count: 7 ( 12.28%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
SETATTR Count: 1 ( 1.75%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -71,11 +148,81 @@ FSSTAT Count: 1 ( 1.75%) Min: 0.000 Max: 0.000 Avg: 0.000 St
FSINFO Count: 1 ( 1.75%) Min: 0.010 Max: 0.010 Avg: 0.010 StDev: 0.00000000
PATHCONF Count: 1 ( 1.75%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
+Session: 139.25.22.2:3298 --> 139.25.22.102:2049 [UDP]
+Total operations: 1. Per operation:
+NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
NULL 0 0.00%
COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
+Total operations: 0. Per operation:
ILLEGAL 0 0.00%
ACCESS 0 0.00%
CLOSE 0 0.00%
@@ -114,4 +261,22 @@ SETCLIENTID_CONFIRM 0 0.00%
VERIFY 0 0.00%
WRITE 0 0.00%
RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref b/traces/references/breakdown/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref
new file mode 100644
index 0000000..a9476d9
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref
@@ -0,0 +1,258 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 28179. Per operation:
+NULL 0 0.00%
+GETATTR 0 0.00%
+SETATTR 0 0.00%
+LOOKUP 0 0.00%
+ACCESS 14089 50.00%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+CREATE 0 0.00%
+MKDIR 14090 50.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+Per connection info:
+Session: fe80::a00:27ff:fe76:ce2e:731 --> fe80::223:24ff:fe02:8d08:2049 [TCP]
+Total operations: 28179. Per operation:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count:14089 ( 50.00%) Min: 0.000 Max: 0.011 Avg: 0.000 StDev: 0.00071070
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count:14090 ( 50.00%) Min: 0.000 Max: 0.239 Avg: 0.000 StDev: 0.00258307
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/eth-ipv6-tcp-nfsv3.pcap.bz2.ref b/traces/references/breakdown/eth-ipv6-tcp-nfsv3.pcap.bz2.ref
new file mode 100644
index 0000000..3063326
--- /dev/null
+++ b/traces/references/breakdown/eth-ipv6-tcp-nfsv3.pcap.bz2.ref
@@ -0,0 +1,258 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 1605. Per operation:
+NULL 0 0.00%
+GETATTR 1 0.06%
+SETATTR 1 0.06%
+LOOKUP 0 0.00%
+ACCESS 2 0.12%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 1600 99.69%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 1 0.06%
+Per connection info:
+Session: fe80::a00:27ff:fe8e:5590:1003 --> fe80::223:24ff:fe02:8d08:2049 [TCP]
+Total operations: 1605. Per operation:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 1 ( 0.06%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
+SETATTR Count: 1 ( 0.06%) Min: 0.050 Max: 0.050 Avg: 0.050 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 2 ( 0.12%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00001556
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 1600 ( 99.69%) Min: 0.009 Max: 0.742 Avg: 0.215 StDev: 0.07356623
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 1 ( 0.06%) Min: 0.854 Max: 0.854 Avg: 0.854 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/lo-ipv4-tcp-nfsv3-nfsacl.pcap.bz2.ref b/traces/references/breakdown/lo-ipv4-tcp-nfsv3-nfsacl.pcap.bz2.ref
index 8d8de45..02e6193 100644
--- a/traces/references/lo-ipv4-tcp-nfsv3-nfsacl.pcap.bz2.ref
+++ b/traces/references/breakdown/lo-ipv4-tcp-nfsv3-nfsacl.pcap.bz2.ref
@@ -1,5 +1,106 @@
### Breakdown analyzer ###
-NFSv3 total procedures: 7. Per procedure:
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 7. Per operation:
NULL 1 14.29%
GETATTR 3 42.86%
SETATTR 0 0.00%
@@ -23,10 +124,10 @@ FSINFO 2 28.57%
PATHCONF 1 14.29%
COMMIT 0 0.00%
Per connection info:
-Session: 127.0.0.1:53858 --> 127.0.0.1:2049 [TCP]
-Total procedures: 1. Per procedure:
-NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+Session: 127.0.0.1:766 --> 127.0.0.1:2049 [TCP]
+Total operations: 6. Per operation:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 3 ( 50.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00003119
SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -44,13 +145,13 @@ LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 2 ( 33.33%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00001273
+PATHCONF Count: 1 ( 16.67%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-Session: 127.0.0.1:766 --> 127.0.0.1:2049 [TCP]
-Total procedures: 6. Per procedure:
-NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 3 ( 50.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00003119
+Session: 127.0.0.1:53858 --> 127.0.0.1:2049 [TCP]
+Total operations: 1. Per operation:
+NULL Count: 1 (100.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
@@ -68,14 +169,60 @@ LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 St
READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 2 ( 33.33%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00001273
-PATHCONF Count: 1 ( 16.67%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
NULL 0 0.00%
COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
+Total operations: 0. Per operation:
ILLEGAL 0 0.00%
ACCESS 0 0.00%
CLOSE 0 0.00%
@@ -114,4 +261,22 @@ SETCLIENTID_CONFIRM 0 0.00%
VERIFY 0 0.00%
WRITE 0 0.00%
RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/breakdown/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref b/traces/references/breakdown/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref
new file mode 100644
index 0000000..703d1f7
--- /dev/null
+++ b/traces/references/breakdown/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref
@@ -0,0 +1,258 @@
+### Breakdown analyzer ###
+CIFS v1 protocol
+Total operations: 0. Per operation:
+CREATE_DIRECTORY 0 0.00%
+DELETE_DIRECTORY 0 0.00%
+OPEN 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+DELETE 0 0.00%
+RENAME 0 0.00%
+QUERY_INFORMATION 0 0.00%
+SET_INFORMATION 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK_BYTE_RANGE 0 0.00%
+UNLOCK_BYTE_RANGE 0 0.00%
+CREATE_TEMPORARY 0 0.00%
+CREATE_NEW 0 0.00%
+CHECK_DIRECTORY 0 0.00%
+PROCESS_EXIT 0 0.00%
+SEEK 0 0.00%
+LOCK_AND_READ 0 0.00%
+WRITE_AND_UNLOCK 0 0.00%
+READ_RAW 0 0.00%
+READ_MPX 0 0.00%
+READ_MPX_SECONDARY 0 0.00%
+WRITE_RAW 0 0.00%
+WRITE_MPX 0 0.00%
+WRITE_MPX_SECONDARY 0 0.00%
+WRITE_COMPLETE 0 0.00%
+QUERY_SERVER 0 0.00%
+SET_INFORMATION2 0 0.00%
+QUERY_INFORMATION2 0 0.00%
+LOCKING_ANDX 0 0.00%
+TRANSACTION 0 0.00%
+TRANSACTION_SECONDARY 0 0.00%
+IOCTL 0 0.00%
+IOCTL_SECONDARY 0 0.00%
+COPY 0 0.00%
+MOVE 0 0.00%
+ECHO 0 0.00%
+WRITE_AND_CLOSE 0 0.00%
+OPEN_ANDX 0 0.00%
+READ_ANDX 0 0.00%
+WRITE_ANDX 0 0.00%
+NEW_FILE_SIZE 0 0.00%
+CLOSE_AND_TREE_DISC 0 0.00%
+TRANSACTION2 0 0.00%
+TRANSACTION2_SECONDARY 0 0.00%
+FIND_CLOSE2 0 0.00%
+FIND_NOTIFY_CLOSE 0 0.00%
+TREE_CONNECT 0 0.00%
+TREE_DISCONNECT 0 0.00%
+NEGOTIATE 0 0.00%
+SESSION_SETUP_ANDX 0 0.00%
+LOGOFF_ANDX 0 0.00%
+TREE_CONNECT_ANDX 0 0.00%
+SECURITY_PACKAGE_ANDX 0 0.00%
+QUERY_INFORMATION_DISK 0 0.00%
+SEARCH 0 0.00%
+FIND 0 0.00%
+FIND_UNIQUE 0 0.00%
+FIND_CLOSE 0 0.00%
+NT_TRANSACT 0 0.00%
+NT_TRANSACT_SECONDARY 0 0.00%
+NT_CREATE_ANDX 0 0.00%
+NT_CANCEL 0 0.00%
+NT_RENAME 0 0.00%
+OPEN_PRINT_FILE 0 0.00%
+WRITE_PRINT_FILE 0 0.00%
+CLOSE_PRINT_FILE 0 0.00%
+GET_PRINT_QUEUE 0 0.00%
+READ_BULK 0 0.00%
+WRITE_BULK 0 0.00%
+WRITE_BULK_DATA 0 0.00%
+INVALID 0 0.00%
+NO_ANDX_COMMAND 0 0.00%
+### Breakdown analyzer ###
+CIFS v2 protocol
+Total operations: 0. Per operation:
+NEGOTIATE 0 0.00%
+SESSION SETUP 0 0.00%
+LOGOFF 0 0.00%
+TREE CONNECT 0 0.00%
+TREE DISCONNECT 0 0.00%
+CREATE 0 0.00%
+CLOSE 0 0.00%
+FLUSH 0 0.00%
+READ 0 0.00%
+WRITE 0 0.00%
+LOCK 0 0.00%
+IOCTL 0 0.00%
+CANCEL 0 0.00%
+ECHO 0 0.00%
+QUERY DIRECTORY 0 0.00%
+CHANGE NOTIFY 0 0.00%
+QUERY INFO 0 0.00%
+SET INFO 0 0.00%
+OPLOCK BREAK 0 0.00%
+### Breakdown analyzer ###
+NFS v3 protocol
+Total operations: 6171. Per operation:
+NULL 0 0.00%
+GETATTR 1 0.02%
+SETATTR 1 0.02%
+LOOKUP 0 0.00%
+ACCESS 1 0.02%
+READLINK 0 0.00%
+READ 0 0.00%
+WRITE 6168 99.95%
+CREATE 0 0.00%
+MKDIR 0 0.00%
+SYMLINK 0 0.00%
+MKNOD 0 0.00%
+REMOVE 0 0.00%
+RMDIR 0 0.00%
+RENAME 0 0.00%
+LINK 0 0.00%
+READDIR 0 0.00%
+READDIRPLUS 0 0.00%
+FSSTAT 0 0.00%
+FSINFO 0 0.00%
+PATHCONF 0 0.00%
+COMMIT 0 0.00%
+Per connection info:
+Session: 10.6.137.109:674 --> 10.6.137.113:2049 [TCP]
+Total operations: 6171. Per operation:
+NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+GETATTR Count: 1 ( 0.02%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SETATTR Count: 1 ( 0.02%) Min: 0.219 Max: 0.219 Avg: 0.219 StDev: 0.00000000
+LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+ACCESS Count: 1 ( 0.02%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+WRITE Count: 6168 ( 99.95%) Min: 0.001 Max: 0.721 Avg: 0.012 StDev: 0.07384654
+CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
+### Breakdown analyzer ###
+NFS v4.0 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+### Breakdown analyzer ###
+NFS v4.1 protocol
+Total procedures: 0. Per procedure:
+NULL 0 0.00%
+COMPOUND 0 0.00%
+Total operations: 0. Per operation:
+ILLEGAL 0 0.00%
+ACCESS 0 0.00%
+CLOSE 0 0.00%
+COMMIT 0 0.00%
+CREATE 0 0.00%
+DELEGPURGE 0 0.00%
+DELEGRETURN 0 0.00%
+GETATTR 0 0.00%
+GETFH 0 0.00%
+LINK 0 0.00%
+LOCK 0 0.00%
+LOCKT 0 0.00%
+LOCKU 0 0.00%
+LOOKUP 0 0.00%
+LOOKUPP 0 0.00%
+NVERIFY 0 0.00%
+OPEN 0 0.00%
+OPENATTR 0 0.00%
+OPEN_CONFIRM 0 0.00%
+OPEN_DOWNGRADE 0 0.00%
+PUTFH 0 0.00%
+PUTPUBFH 0 0.00%
+PUTROOTFH 0 0.00%
+READ 0 0.00%
+READDIR 0 0.00%
+READLINK 0 0.00%
+REMOVE 0 0.00%
+RENAME 0 0.00%
+RENEW 0 0.00%
+RESTOREFH 0 0.00%
+SAVEFH 0 0.00%
+SECINFO 0 0.00%
+SETATTR 0 0.00%
+SETCLIENTID 0 0.00%
+SETCLIENTID_CONFIRM 0 0.00%
+VERIFY 0 0.00%
+WRITE 0 0.00%
+RELEASE_LOCKOWNER 0 0.00%
+BACKCHANNEL_CTL 0 0.00%
+BIND_CONN_TO_SESSION 0 0.00%
+EXCHANGE_ID 0 0.00%
+CREATE_SESSION 0 0.00%
+DESTROY_SESSION 0 0.00%
+FREE_STATEID 0 0.00%
+GET_DIR_DELEGATION 0 0.00%
+GETDEVICEINFO 0 0.00%
+GETDEVICELIST 0 0.00%
+LAYOUTCOMMIT 0 0.00%
+LAYOUTGET 0 0.00%
+LAYOUTRETURN 0 0.00%
+SECINFO_NO_NAME 0 0.00%
+SEQUENCE 0 0.00%
+SET_SSV 0 0.00%
+TEST_STATEID 0 0.00%
+WANT_DELEGATION 0 0.00%
+DESTROY_CLIENTID 0 0.00%
+RECLAIM_COMPLETE 0 0.00%
diff --git a/traces/references/eth-ipv4-tcp-nfsv3.pcap.bz2.ref b/traces/references/eth-ipv4-tcp-nfsv3.pcap.bz2.ref
deleted file mode 100644
index 5f29047..0000000
--- a/traces/references/eth-ipv4-tcp-nfsv3.pcap.bz2.ref
+++ /dev/null
@@ -1,93 +0,0 @@
-### Breakdown analyzer ###
-NFSv3 total procedures: 3331. Per procedure:
-NULL 0 0.00%
-GETATTR 20 0.60%
-SETATTR 0 0.00%
-LOOKUP 20 0.60%
-ACCESS 11 0.33%
-READLINK 0 0.00%
-READ 0 0.00%
-WRITE 3200 96.07%
-CREATE 10 0.30%
-MKDIR 10 0.30%
-SYMLINK 0 0.00%
-MKNOD 0 0.00%
-REMOVE 10 0.30%
-RMDIR 10 0.30%
-RENAME 0 0.00%
-LINK 0 0.00%
-READDIR 0 0.00%
-READDIRPLUS 30 0.90%
-FSSTAT 0 0.00%
-FSINFO 0 0.00%
-PATHCONF 0 0.00%
-COMMIT 10 0.30%
-Per connection info:
-Session: 10.0.2.15:860 --> 10.6.136.214:2049 [TCP]
-Total procedures: 3331. Per procedure:
-NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 20 ( 0.60%) Min: 0.001 Max: 0.002 Avg: 0.001 StDev: 0.00026637
-SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LOOKUP Count: 20 ( 0.60%) Min: 0.001 Max: 0.003 Avg: 0.001 StDev: 0.00047318
-ACCESS Count: 11 ( 0.33%) Min: 0.001 Max: 0.002 Avg: 0.002 StDev: 0.00028820
-READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-WRITE Count: 3200 ( 96.07%) Min: 0.005 Max: 0.114 Avg: 0.012 StDev: 0.00575373
-CREATE Count: 10 ( 0.30%) Min: 0.002 Max: 0.003 Avg: 0.002 StDev: 0.00028786
-MKDIR Count: 10 ( 0.30%) Min: 0.002 Max: 0.004 Avg: 0.003 StDev: 0.00043406
-SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-REMOVE Count: 10 ( 0.30%) Min: 0.014 Max: 0.020 Avg: 0.017 StDev: 0.00205551
-RMDIR Count: 10 ( 0.30%) Min: 0.001 Max: 0.003 Avg: 0.002 StDev: 0.00043587
-RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIRPLUS Count: 30 ( 0.90%) Min: 0.001 Max: 0.002 Avg: 0.001 StDev: 0.00040038
-FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-COMMIT Count: 10 ( 0.30%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00019761
-
-NFSv4 total procedures: 0. Per procedure:
-NULL 0 0.00%
-COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
-ILLEGAL 0 0.00%
-ACCESS 0 0.00%
-CLOSE 0 0.00%
-COMMIT 0 0.00%
-CREATE 0 0.00%
-DELEGPURGE 0 0.00%
-DELEGRETURN 0 0.00%
-GETATTR 0 0.00%
-GETFH 0 0.00%
-LINK 0 0.00%
-LOCK 0 0.00%
-LOCKT 0 0.00%
-LOCKU 0 0.00%
-LOOKUP 0 0.00%
-LOOKUPP 0 0.00%
-NVERIFY 0 0.00%
-OPEN 0 0.00%
-OPENATTR 0 0.00%
-OPEN_CONFIRM 0 0.00%
-OPEN_DOWNGRADE 0 0.00%
-PUTFH 0 0.00%
-PUTPUBFH 0 0.00%
-PUTROOTFH 0 0.00%
-READ 0 0.00%
-READDIR 0 0.00%
-READLINK 0 0.00%
-REMOVE 0 0.00%
-RENAME 0 0.00%
-RENEW 0 0.00%
-RESTOREFH 0 0.00%
-SAVEFH 0 0.00%
-SECINFO 0 0.00%
-SETATTR 0 0.00%
-SETCLIENTID 0 0.00%
-SETCLIENTID_CONFIRM 0 0.00%
-VERIFY 0 0.00%
-WRITE 0 0.00%
-RELEASE_LOCKOWNER 0 0.00%
-GET_DIR_DELEGATION 0 0.00%
diff --git a/traces/references/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref b/traces/references/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref
deleted file mode 100644
index 22c6b25..0000000
--- a/traces/references/eth-ipv4-udp-nfsv3-dup-retransm.pcap.bz2.ref
+++ /dev/null
@@ -1,93 +0,0 @@
-### Breakdown analyzer ###
-NFSv3 total procedures: 11. Per procedure:
-NULL 0 0.00%
-GETATTR 0 0.00%
-SETATTR 0 0.00%
-LOOKUP 0 0.00%
-ACCESS 0 0.00%
-READLINK 0 0.00%
-READ 0 0.00%
-WRITE 11 100.00%
-CREATE 0 0.00%
-MKDIR 0 0.00%
-SYMLINK 0 0.00%
-MKNOD 0 0.00%
-REMOVE 0 0.00%
-RMDIR 0 0.00%
-RENAME 0 0.00%
-LINK 0 0.00%
-READDIR 0 0.00%
-READDIRPLUS 0 0.00%
-FSSTAT 0 0.00%
-FSINFO 0 0.00%
-PATHCONF 0 0.00%
-COMMIT 0 0.00%
-Per connection info:
-Session: 10.6.136.186:912 --> 10.6.136.105:2049 [UDP]
-Total procedures: 11. Per procedure:
-NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-ACCESS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-WRITE Count: 11 (100.00%) Min: 0.002 Max: 0.234 Avg: 0.077 StDev: 0.08314611
-CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
-NULL 0 0.00%
-COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
-ILLEGAL 0 0.00%
-ACCESS 0 0.00%
-CLOSE 0 0.00%
-COMMIT 0 0.00%
-CREATE 0 0.00%
-DELEGPURGE 0 0.00%
-DELEGRETURN 0 0.00%
-GETATTR 0 0.00%
-GETFH 0 0.00%
-LINK 0 0.00%
-LOCK 0 0.00%
-LOCKT 0 0.00%
-LOCKU 0 0.00%
-LOOKUP 0 0.00%
-LOOKUPP 0 0.00%
-NVERIFY 0 0.00%
-OPEN 0 0.00%
-OPENATTR 0 0.00%
-OPEN_CONFIRM 0 0.00%
-OPEN_DOWNGRADE 0 0.00%
-PUTFH 0 0.00%
-PUTPUBFH 0 0.00%
-PUTROOTFH 0 0.00%
-READ 0 0.00%
-READDIR 0 0.00%
-READLINK 0 0.00%
-REMOVE 0 0.00%
-RENAME 0 0.00%
-RENEW 0 0.00%
-RESTOREFH 0 0.00%
-SAVEFH 0 0.00%
-SECINFO 0 0.00%
-SETATTR 0 0.00%
-SETCLIENTID 0 0.00%
-SETCLIENTID_CONFIRM 0 0.00%
-VERIFY 0 0.00%
-WRITE 0 0.00%
-RELEASE_LOCKOWNER 0 0.00%
-GET_DIR_DELEGATION 0 0.00%
diff --git a/traces/references/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref b/traces/references/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref
deleted file mode 100644
index 76bbde5..0000000
--- a/traces/references/eth-ipv6-tcp-nfsv3-bad_alloc.pcap.bz2.ref
+++ /dev/null
@@ -1,93 +0,0 @@
-### Breakdown analyzer ###
-NFSv3 total procedures: 28179. Per procedure:
-NULL 0 0.00%
-GETATTR 0 0.00%
-SETATTR 0 0.00%
-LOOKUP 0 0.00%
-ACCESS 14089 50.00%
-READLINK 0 0.00%
-READ 0 0.00%
-WRITE 0 0.00%
-CREATE 0 0.00%
-MKDIR 14090 50.00%
-SYMLINK 0 0.00%
-MKNOD 0 0.00%
-REMOVE 0 0.00%
-RMDIR 0 0.00%
-RENAME 0 0.00%
-LINK 0 0.00%
-READDIR 0 0.00%
-READDIRPLUS 0 0.00%
-FSSTAT 0 0.00%
-FSINFO 0 0.00%
-PATHCONF 0 0.00%
-COMMIT 0 0.00%
-Per connection info:
-Session: fe80::a00:27ff:fe76:ce2e:731 --> fe80::223:24ff:fe02:8d08:2049 [TCP]
-Total procedures: 28179. Per procedure:
-NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SETATTR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-ACCESS Count:14089 ( 50.00%) Min: 0.000 Max: 0.011 Avg: 0.000 StDev: 0.00071070
-READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-WRITE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKDIR Count:14090 ( 50.00%) Min: 0.000 Max: 0.239 Avg: 0.000 StDev: 0.00258307
-SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
-NULL 0 0.00%
-COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
-ILLEGAL 0 0.00%
-ACCESS 0 0.00%
-CLOSE 0 0.00%
-COMMIT 0 0.00%
-CREATE 0 0.00%
-DELEGPURGE 0 0.00%
-DELEGRETURN 0 0.00%
-GETATTR 0 0.00%
-GETFH 0 0.00%
-LINK 0 0.00%
-LOCK 0 0.00%
-LOCKT 0 0.00%
-LOCKU 0 0.00%
-LOOKUP 0 0.00%
-LOOKUPP 0 0.00%
-NVERIFY 0 0.00%
-OPEN 0 0.00%
-OPENATTR 0 0.00%
-OPEN_CONFIRM 0 0.00%
-OPEN_DOWNGRADE 0 0.00%
-PUTFH 0 0.00%
-PUTPUBFH 0 0.00%
-PUTROOTFH 0 0.00%
-READ 0 0.00%
-READDIR 0 0.00%
-READLINK 0 0.00%
-REMOVE 0 0.00%
-RENAME 0 0.00%
-RENEW 0 0.00%
-RESTOREFH 0 0.00%
-SAVEFH 0 0.00%
-SECINFO 0 0.00%
-SETATTR 0 0.00%
-SETCLIENTID 0 0.00%
-SETCLIENTID_CONFIRM 0 0.00%
-VERIFY 0 0.00%
-WRITE 0 0.00%
-RELEASE_LOCKOWNER 0 0.00%
-GET_DIR_DELEGATION 0 0.00%
diff --git a/traces/references/eth-ipv6-tcp-nfsv3.pcap.bz2.ref b/traces/references/eth-ipv6-tcp-nfsv3.pcap.bz2.ref
deleted file mode 100644
index ee1a59b..0000000
--- a/traces/references/eth-ipv6-tcp-nfsv3.pcap.bz2.ref
+++ /dev/null
@@ -1,93 +0,0 @@
-### Breakdown analyzer ###
-NFSv3 total procedures: 1605. Per procedure:
-NULL 0 0.00%
-GETATTR 1 0.06%
-SETATTR 1 0.06%
-LOOKUP 0 0.00%
-ACCESS 2 0.12%
-READLINK 0 0.00%
-READ 0 0.00%
-WRITE 1600 99.69%
-CREATE 0 0.00%
-MKDIR 0 0.00%
-SYMLINK 0 0.00%
-MKNOD 0 0.00%
-REMOVE 0 0.00%
-RMDIR 0 0.00%
-RENAME 0 0.00%
-LINK 0 0.00%
-READDIR 0 0.00%
-READDIRPLUS 0 0.00%
-FSSTAT 0 0.00%
-FSINFO 0 0.00%
-PATHCONF 0 0.00%
-COMMIT 1 0.06%
-Per connection info:
-Session: fe80::a00:27ff:fe8e:5590:1003 --> fe80::223:24ff:fe02:8d08:2049 [TCP]
-Total procedures: 1605. Per procedure:
-NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 1 ( 0.06%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00000000
-SETATTR Count: 1 ( 0.06%) Min: 0.050 Max: 0.050 Avg: 0.050 StDev: 0.00000000
-LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-ACCESS Count: 2 ( 0.12%) Min: 0.001 Max: 0.001 Avg: 0.001 StDev: 0.00001556
-READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-WRITE Count: 1600 ( 99.69%) Min: 0.009 Max: 0.742 Avg: 0.215 StDev: 0.07356623
-CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-COMMIT Count: 1 ( 0.06%) Min: 0.854 Max: 0.854 Avg: 0.854 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
-NULL 0 0.00%
-COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
-ILLEGAL 0 0.00%
-ACCESS 0 0.00%
-CLOSE 0 0.00%
-COMMIT 0 0.00%
-CREATE 0 0.00%
-DELEGPURGE 0 0.00%
-DELEGRETURN 0 0.00%
-GETATTR 0 0.00%
-GETFH 0 0.00%
-LINK 0 0.00%
-LOCK 0 0.00%
-LOCKT 0 0.00%
-LOCKU 0 0.00%
-LOOKUP 0 0.00%
-LOOKUPP 0 0.00%
-NVERIFY 0 0.00%
-OPEN 0 0.00%
-OPENATTR 0 0.00%
-OPEN_CONFIRM 0 0.00%
-OPEN_DOWNGRADE 0 0.00%
-PUTFH 0 0.00%
-PUTPUBFH 0 0.00%
-PUTROOTFH 0 0.00%
-READ 0 0.00%
-READDIR 0 0.00%
-READLINK 0 0.00%
-REMOVE 0 0.00%
-RENAME 0 0.00%
-RENEW 0 0.00%
-RESTOREFH 0 0.00%
-SAVEFH 0 0.00%
-SECINFO 0 0.00%
-SETATTR 0 0.00%
-SETCLIENTID 0 0.00%
-SETCLIENTID_CONFIRM 0 0.00%
-VERIFY 0 0.00%
-WRITE 0 0.00%
-RELEASE_LOCKOWNER 0 0.00%
-GET_DIR_DELEGATION 0 0.00%
diff --git a/traces/references/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref b/traces/references/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref
deleted file mode 100644
index 4628cb4..0000000
--- a/traces/references/tcp-seq-overlap-in-fragment-12721.pcap.bz2.ref
+++ /dev/null
@@ -1,93 +0,0 @@
-### Breakdown analyzer ###
-NFSv3 total procedures: 6171. Per procedure:
-NULL 0 0.00%
-GETATTR 1 0.02%
-SETATTR 1 0.02%
-LOOKUP 0 0.00%
-ACCESS 1 0.02%
-READLINK 0 0.00%
-READ 0 0.00%
-WRITE 6168 99.95%
-CREATE 0 0.00%
-MKDIR 0 0.00%
-SYMLINK 0 0.00%
-MKNOD 0 0.00%
-REMOVE 0 0.00%
-RMDIR 0 0.00%
-RENAME 0 0.00%
-LINK 0 0.00%
-READDIR 0 0.00%
-READDIRPLUS 0 0.00%
-FSSTAT 0 0.00%
-FSINFO 0 0.00%
-PATHCONF 0 0.00%
-COMMIT 0 0.00%
-Per connection info:
-Session: 10.6.137.109:674 --> 10.6.137.113:2049 [TCP]
-Total procedures: 6171. Per procedure:
-NULL Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-GETATTR Count: 1 ( 0.02%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SETATTR Count: 1 ( 0.02%) Min: 0.219 Max: 0.219 Avg: 0.219 StDev: 0.00000000
-LOOKUP Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-ACCESS Count: 1 ( 0.02%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READ Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-WRITE Count: 6168 ( 99.95%) Min: 0.001 Max: 0.721 Avg: 0.012 StDev: 0.07384654
-CREATE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-SYMLINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-MKNOD Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-REMOVE Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RMDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-RENAME Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-LINK Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIR Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-READDIRPLUS Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSSTAT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-FSINFO Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-PATHCONF Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-COMMIT Count: 0 ( 0.00%) Min: 0.000 Max: 0.000 Avg: 0.000 StDev: 0.00000000
-
-NFSv4 total procedures: 0. Per procedure:
-NULL 0 0.00%
-COMPOUND 0 0.00%
-NFSv4 total operations: 0. Per operation:
-ILLEGAL 0 0.00%
-ACCESS 0 0.00%
-CLOSE 0 0.00%
-COMMIT 0 0.00%
-CREATE 0 0.00%
-DELEGPURGE 0 0.00%
-DELEGRETURN 0 0.00%
-GETATTR 0 0.00%
-GETFH 0 0.00%
-LINK 0 0.00%
-LOCK 0 0.00%
-LOCKT 0 0.00%
-LOCKU 0 0.00%
-LOOKUP 0 0.00%
-LOOKUPP 0 0.00%
-NVERIFY 0 0.00%
-OPEN 0 0.00%
-OPENATTR 0 0.00%
-OPEN_CONFIRM 0 0.00%
-OPEN_DOWNGRADE 0 0.00%
-PUTFH 0 0.00%
-PUTPUBFH 0 0.00%
-PUTROOTFH 0 0.00%
-READ 0 0.00%
-READDIR 0 0.00%
-READLINK 0 0.00%
-REMOVE 0 0.00%
-RENAME 0 0.00%
-RENEW 0 0.00%
-RESTOREFH 0 0.00%
-SAVEFH 0 0.00%
-SECINFO 0 0.00%
-SETATTR 0 0.00%
-SETCLIENTID 0 0.00%
-SETCLIENTID_CONFIRM 0 0.00%
-VERIFY 0 0.00%
-WRITE 0 0.00%
-RELEASE_LOCKOWNER 0 0.00%
-GET_DIR_DELEGATION 0 0.00%