From f7389badc62f1fdf8138a2ca04c76762aee6021b Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Fri, 1 Mar 2024 13:55:15 +0100 Subject: [PATCH] Remove depreacated bm directory (#1954) As planned as of end of 2023 this directory is being depreacated --- .gitmodules | 3 - bm/.gitignore | 100 - bm/.gitmodules | 0 bm/README.md | 19 - bm/behavioral-model | 1 - bm/build_p4_target.sh | 39 - bm/p4-sai/.gitignore | 8 - bm/p4-sai/CPPLINT.cfg | 2 - bm/p4-sai/Makefile.am | 131 - bm/p4-sai/README.md | 33 - bm/p4-sai/bm_config/Makefile.am | 1 - bm/p4-sai/bm_config/configure.ac | 271 - bm/p4-sai/compile_json.sh | 1 - bm/p4-sai/copy_to_cpu_test_commands.txt | 3 - bm/p4-sai/docs/JSON_format.md | 384 - bm/p4-sai/docs/SAI_arch.PNG | Bin 47210 -> 0 bytes bm/p4-sai/docs/p4dbg_user_guide.md | 282 - bm/p4-sai/docs/simple_switch.md | 95 - bm/p4-sai/install_sai_bm.sh | 18 - bm/p4-sai/main.cpp | 65 - bm/p4-sai/p4src/DefaultConfig.txt | 66 - bm/p4-sai/p4src/DefaultConfigMirror.txt | 1 - bm/p4-sai/p4src/actions.p4 | 173 - bm/p4-sai/p4src/defines.p4 | 55 - bm/p4-sai/p4src/field_lists.p4 | 47 - bm/p4-sai/p4src/headers.p4 | 124 - bm/p4-sai/p4src/parser.p4 | 73 - bm/p4-sai/p4src/sai.p4 | 170 - bm/p4-sai/p4src/tables.p4 | 312 - bm/p4-sai/primitives.cpp | 364 - bm/p4-sai/run_server.sh | 9 - bm/p4-sai/runtime_CLI | 1 - bm/p4-sai/sai.json | 3792 --------- bm/p4-sai/simple_switch.cpp | 531 -- bm/p4-sai/simple_switch.h | 171 - bm/p4-sai/simple_switch_CLI.in | 31 - bm/p4-sai/sswitch_CLI | 26 - bm/p4-sai/sswitch_CLI.py | 96 - bm/p4-sai/thrift/simple_switch.thrift | 40 - bm/p4-sai/thrift/src/SimpleSwitch_server.cpp | 112 - bm/p4-sai/veth_setup.sh | 43 - bm/p4-sai/veth_teardown.sh | 33 - bm/sai_adapter/README.md | 57 - bm/sai_adapter/inc/sai_adapter.h | 223 - bm/sai_adapter/inc/sai_adapter_interface.h | 109 - bm/sai_adapter/inc/spdlog/async_logger.h | 77 - bm/sai_adapter/inc/spdlog/common.h | 143 - .../inc/spdlog/details/async_log_helper.h | 378 - .../inc/spdlog/details/async_logger_impl.h | 89 - .../inc/spdlog/details/file_helper.h | 118 - bm/sai_adapter/inc/spdlog/details/log_msg.h | 46 - .../inc/spdlog/details/logger_impl.h | 298 - .../inc/spdlog/details/mpmc_bounded_q.h | 172 - .../inc/spdlog/details/null_mutex.h | 45 - bm/sai_adapter/inc/spdlog/details/os.h | 406 - .../spdlog/details/pattern_formatter_impl.h | 670 -- bm/sai_adapter/inc/spdlog/details/registry.h | 185 - .../inc/spdlog/details/spdlog_impl.h | 245 - .../inc/spdlog/fmt/bundled/format.cc | 940 --- .../inc/spdlog/fmt/bundled/format.h | 3883 ---------- .../inc/spdlog/fmt/bundled/ostream.cc | 43 - .../inc/spdlog/fmt/bundled/ostream.h | 115 - .../inc/spdlog/fmt/bundled/posix.cc | 238 - bm/sai_adapter/inc/spdlog/fmt/bundled/posix.h | 386 - bm/sai_adapter/inc/spdlog/fmt/bundled/time.h | 53 - bm/sai_adapter/inc/spdlog/fmt/fmt.h | 28 - bm/sai_adapter/inc/spdlog/fmt/ostr.h | 17 - bm/sai_adapter/inc/spdlog/formatter.h | 45 - bm/sai_adapter/inc/spdlog/logger.h | 94 - .../inc/spdlog/sinks/android_sink.h | 75 - .../inc/spdlog/sinks/ansicolor_sink.h | 116 - bm/sai_adapter/inc/spdlog/sinks/base_sink.h | 45 - bm/sai_adapter/inc/spdlog/sinks/dist_sink.h | 71 - bm/sai_adapter/inc/spdlog/sinks/file_sinks.h | 239 - bm/sai_adapter/inc/spdlog/sinks/msvc_sink.h | 50 - bm/sai_adapter/inc/spdlog/sinks/null_sink.h | 34 - .../inc/spdlog/sinks/ostream_sink.h | 47 - bm/sai_adapter/inc/spdlog/sinks/sink.h | 53 - .../inc/spdlog/sinks/stdout_sinks.h | 77 - bm/sai_adapter/inc/spdlog/sinks/syslog_sink.h | 81 - .../inc/spdlog/sinks/wincolor_sink.h | 116 - bm/sai_adapter/inc/spdlog/spdlog.h | 178 - bm/sai_adapter/inc/spdlog/tweakme.h | 108 - bm/sai_adapter/inc/switch_meta_data.h | 339 - bm/sai_adapter/inc/tun_if.h | 4 - bm/sai_adapter/src/.gitignore | 1 - bm/sai_adapter/src/logs/.gitignore | 1 - bm/sai_adapter/src/obj/.gitignore | 0 bm/sai_adapter/src/sai.c | 71 - bm/sai_adapter/src/sai_adapter.cpp | 199 - bm/sai_adapter/src/sai_adapter_interface.cpp | 266 - bm/sai_adapter/src/sai_sniffer.cpp | 158 - bm/sai_adapter/src/saibridge.cpp | 288 - bm/sai_adapter/src/saifdb.cpp | 105 - bm/sai_adapter/src/saihostif.cpp | 77 - bm/sai_adapter/src/sailag.cpp | 162 - bm/sai_adapter/src/saiport.cpp | 166 - bm/sai_adapter/src/saiswitch.cpp | 94 - bm/sai_adapter/src/saivlan.cpp | 229 - bm/sai_adapter/test/ptf_tests/port_map.ini | 8 - bm/sai_adapter/test/ptf_tests/ptf/.gitignore | 5 - bm/sai_adapter/test/ptf_tests/ptf/.travis.yml | 41 - .../ptf_tests/ptf/CI/travis/check-nnpy.py | 17 - .../test/ptf_tests/ptf/CI/travis/common.sh | 34 - .../ptf/CI/travis/install-nanomsg.sh | 22 - .../ptf_tests/ptf/CI/travis/install-nnpy.sh | 8 - .../test/ptf_tests/ptf/CI/travis/run_tests.sh | 23 - bm/sai_adapter/test/ptf_tests/ptf/LICENSE | 176 - .../test/ptf_tests/ptf/LICENSE.OFTest | 36 - bm/sai_adapter/test/ptf_tests/ptf/NOTICE | 9 - bm/sai_adapter/test/ptf_tests/ptf/README.md | 238 - .../test/ptf_tests/ptf/build/scripts-2.7/ptf | 733 -- .../test/ptf_tests/ptf/debian/changelog | 5 - .../test/ptf_tests/ptf/debian/compat | 1 - .../test/ptf_tests/ptf/debian/control | 19 - .../test/ptf_tests/ptf/debian/install | 1 - .../test/ptf_tests/ptf/debian/rules | 10 - .../test/ptf_tests/ptf/dist/ptf-0.9-py2.7.egg | Bin 80844 -> 0 bytes .../test/ptf_tests/ptf/example/run_client.sh | 5 - bm/sai_adapter/test/ptf_tests/ptf/ptf | 733 -- .../test/ptf_tests/ptf/ptf_nn/README.md | 73 - .../test/ptf_tests/ptf/ptf_nn/check-nnpy.py | 1 - .../test/ptf_tests/ptf/ptf_nn/install-nnpy.py | 1 - .../test/ptf_tests/ptf/ptf_nn/ptf_nn_agent.py | 383 - .../ptf_tests/ptf/ptf_nn/ptf_nn_test/test.py | 77 - .../ptf/ptf_nn/ptf_nn_test_bridge.py | 64 - .../ptf_tests/ptf/ptf_nn/ptf_nn_test_eth.py | 46 - .../ptf_tests/ptf/ptf_nn/ptf_nn_test_nn.py | 66 - .../ptf/ptf_nn/resources/ptf_nn.graphml | 427 -- .../ptf_tests/ptf/ptf_nn/resources/ptf_nn.png | Bin 145931 -> 0 bytes .../test/ptf_tests/ptf/ptf_nn/veth_setup.sh | 12 - bm/sai_adapter/test/ptf_tests/ptf/setup.py | 30 - .../ptf_tests/ptf/src/ptf.egg-info/PKG-INFO | 255 - .../ptf/src/ptf.egg-info/SOURCES.txt | 24 - .../ptf/src/ptf.egg-info/dependency_links.txt | 1 - .../ptf/src/ptf.egg-info/not-zip-safe | 1 - .../ptf/src/ptf.egg-info/top_level.txt | 1 - .../test/ptf_tests/ptf/src/ptf/__init__.py | 40 - .../test/ptf_tests/ptf/src/ptf/afpacket.py | 112 - .../test/ptf_tests/ptf/src/ptf/base_tests.py | 44 - .../test/ptf_tests/ptf/src/ptf/dataplane.py | 801 -- .../test/ptf_tests/ptf/src/ptf/mask.py | 72 - .../test/ptf_tests/ptf/src/ptf/netutils.py | 64 - .../test/ptf_tests/ptf/src/ptf/packet.py | 98 - .../test/ptf_tests/ptf/src/ptf/parse.py | 74 - .../test/ptf_tests/ptf/src/ptf/pcap_writer.py | 62 - .../ptf/src/ptf/platforms/__init__.py | 0 .../ptf_tests/ptf/src/ptf/platforms/eth.py | 28 - .../ptf_tests/ptf/src/ptf/platforms/local.py | 23 - .../ptf_tests/ptf/src/ptf/platforms/nn.py | 34 - .../ptf_tests/ptf/src/ptf/platforms/remote.py | 51 - .../test/ptf_tests/ptf/src/ptf/ptfutils.py | 102 - .../test/ptf_tests/ptf/src/ptf/testutils.py | 2390 ------ .../test/ptf_tests/ptf/src/ptf/thriftutils.py | 64 - bm/sai_adapter/test/ptf_tests/run_ptf.sh | 7 - .../test/ptf_tests/run_ptf_1Q_B_A2A_test.sh | 7 - bm/sai_adapter/test/ptf_tests/run_ptf_c.sh | 4 - .../test/ptf_tests/run_ptf_l2_tests.sh | 3 - .../test/ptf_tests/run_ptf_wip_test.sh | 5 - .../test/ptf_tests/tests/README.txt | 97 - .../test/ptf_tests/tests/sai_base_test.py | 111 - .../test/ptf_tests/tests/sail2_new.py | 702 -- bm/sai_adapter/test/ptf_tests/tests/switch.py | 868 --- .../ptf_tests/unopened_tests/sai_base_test.py | 105 - .../test/ptf_tests/unopened_tests/saiacl.py | 129 - .../ptf_tests/unopened_tests/saihostif.py | 603 -- .../test/ptf_tests/unopened_tests/sail2.py | 466 -- .../test/ptf_tests/unopened_tests/sail3.py | 1749 ----- .../test/ptf_tests/unopened_tests/switch.py | 763 -- .../test/ptf_tests/wip_tests/sai_base_test.py | 106 - .../test/ptf_tests/wip_tests/sai_types.py | 6645 ---------------- .../test/ptf_tests/wip_tests/sail2_wip.py | 102 - .../test/ptf_tests/wip_tests/switch.py | 853 --- .../cli_driver.py | 98 - .../sai_rpc_server.sh | 3 - .../switch_sai_server.py | 528 -- .../test/sai_thrift_server/.gitignore | 1 - .../test/sai_thrift_server/SaiCppServer.cpp | 1327 ---- .../test/sai_thrift_server/logs/.gitignore | 1 - .../test/sai_thrift_server/obj/.gitignore | 0 .../test/sai_thrift_server/run_server.sh | 3 - .../test/sai_thrift_server/saiutils.c | 328 - .../test/sai_thrift_src/saiserver.cpp | 383 - .../test/sai_thrift_src/switch_sai.thrift | 379 - .../sai_thrift_src/switch_sai_rpc_server.cpp | 2848 ------- .../sai_thrift_src/switch_sai_rpc_server.h | 3 - bm/sai_adapter/test/sai_types.py | 6801 ----------------- bm/sai_adapter/test/unittest/.gitignore | 1 - bm/sai_adapter/test/unittest/logs/.gitkeep | 0 bm/sai_adapter/test/unittest/logs/log.txt | 26 - bm/sai_adapter/test/unittest/obj/.gitignore | 0 bm/sai_adapter/test/unittest/run_test.sh | 3 - bm/sai_adapter/test/unittest/unittest.c | 71 - 193 files changed, 54053 deletions(-) delete mode 100644 bm/.gitignore delete mode 100644 bm/.gitmodules delete mode 100644 bm/README.md delete mode 160000 bm/behavioral-model delete mode 100755 bm/build_p4_target.sh delete mode 100644 bm/p4-sai/.gitignore delete mode 100644 bm/p4-sai/CPPLINT.cfg delete mode 100644 bm/p4-sai/Makefile.am delete mode 100644 bm/p4-sai/README.md delete mode 100644 bm/p4-sai/bm_config/Makefile.am delete mode 100644 bm/p4-sai/bm_config/configure.ac delete mode 100755 bm/p4-sai/compile_json.sh delete mode 100644 bm/p4-sai/copy_to_cpu_test_commands.txt delete mode 100644 bm/p4-sai/docs/JSON_format.md delete mode 100644 bm/p4-sai/docs/SAI_arch.PNG delete mode 100644 bm/p4-sai/docs/p4dbg_user_guide.md delete mode 100644 bm/p4-sai/docs/simple_switch.md delete mode 100644 bm/p4-sai/install_sai_bm.sh delete mode 100644 bm/p4-sai/main.cpp delete mode 100644 bm/p4-sai/p4src/DefaultConfig.txt delete mode 100644 bm/p4-sai/p4src/DefaultConfigMirror.txt delete mode 100644 bm/p4-sai/p4src/actions.p4 delete mode 100644 bm/p4-sai/p4src/defines.p4 delete mode 100644 bm/p4-sai/p4src/field_lists.p4 delete mode 100644 bm/p4-sai/p4src/headers.p4 delete mode 100644 bm/p4-sai/p4src/parser.p4 delete mode 100644 bm/p4-sai/p4src/sai.p4 delete mode 100644 bm/p4-sai/p4src/tables.p4 delete mode 100644 bm/p4-sai/primitives.cpp delete mode 100755 bm/p4-sai/run_server.sh delete mode 120000 bm/p4-sai/runtime_CLI delete mode 100644 bm/p4-sai/sai.json delete mode 100644 bm/p4-sai/simple_switch.cpp delete mode 100644 bm/p4-sai/simple_switch.h delete mode 100644 bm/p4-sai/simple_switch_CLI.in delete mode 100755 bm/p4-sai/sswitch_CLI delete mode 100644 bm/p4-sai/sswitch_CLI.py delete mode 100644 bm/p4-sai/thrift/simple_switch.thrift delete mode 100644 bm/p4-sai/thrift/src/SimpleSwitch_server.cpp delete mode 100755 bm/p4-sai/veth_setup.sh delete mode 100755 bm/p4-sai/veth_teardown.sh delete mode 100644 bm/sai_adapter/README.md delete mode 100644 bm/sai_adapter/inc/sai_adapter.h delete mode 100644 bm/sai_adapter/inc/sai_adapter_interface.h delete mode 100644 bm/sai_adapter/inc/spdlog/async_logger.h delete mode 100644 bm/sai_adapter/inc/spdlog/common.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/async_log_helper.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/async_logger_impl.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/file_helper.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/log_msg.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/logger_impl.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/mpmc_bounded_q.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/null_mutex.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/os.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/pattern_formatter_impl.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/registry.h delete mode 100644 bm/sai_adapter/inc/spdlog/details/spdlog_impl.h delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/bundled/format.cc delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/bundled/format.h delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.cc delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.h delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/bundled/posix.cc delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/bundled/posix.h delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/bundled/time.h delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/fmt.h delete mode 100644 bm/sai_adapter/inc/spdlog/fmt/ostr.h delete mode 100644 bm/sai_adapter/inc/spdlog/formatter.h delete mode 100644 bm/sai_adapter/inc/spdlog/logger.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/android_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/ansicolor_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/base_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/dist_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/file_sinks.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/msvc_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/null_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/ostream_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/stdout_sinks.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/syslog_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/sinks/wincolor_sink.h delete mode 100644 bm/sai_adapter/inc/spdlog/spdlog.h delete mode 100644 bm/sai_adapter/inc/spdlog/tweakme.h delete mode 100644 bm/sai_adapter/inc/switch_meta_data.h delete mode 100644 bm/sai_adapter/inc/tun_if.h delete mode 100644 bm/sai_adapter/src/.gitignore delete mode 100644 bm/sai_adapter/src/logs/.gitignore delete mode 100644 bm/sai_adapter/src/obj/.gitignore delete mode 100644 bm/sai_adapter/src/sai.c delete mode 100644 bm/sai_adapter/src/sai_adapter.cpp delete mode 100644 bm/sai_adapter/src/sai_adapter_interface.cpp delete mode 100644 bm/sai_adapter/src/sai_sniffer.cpp delete mode 100644 bm/sai_adapter/src/saibridge.cpp delete mode 100644 bm/sai_adapter/src/saifdb.cpp delete mode 100644 bm/sai_adapter/src/saihostif.cpp delete mode 100644 bm/sai_adapter/src/sailag.cpp delete mode 100644 bm/sai_adapter/src/saiport.cpp delete mode 100644 bm/sai_adapter/src/saiswitch.cpp delete mode 100644 bm/sai_adapter/src/saivlan.cpp delete mode 100644 bm/sai_adapter/test/ptf_tests/port_map.ini delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/.gitignore delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/.travis.yml delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/CI/travis/check-nnpy.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/CI/travis/common.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nanomsg.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nnpy.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/CI/travis/run_tests.sh delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/LICENSE delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/LICENSE.OFTest delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/NOTICE delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/README.md delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/build/scripts-2.7/ptf delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/debian/changelog delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/debian/compat delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/debian/control delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/debian/install delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/debian/rules delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/dist/ptf-0.9-py2.7.egg delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/example/run_client.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/ptf delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/README.md delete mode 120000 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/check-nnpy.py delete mode 120000 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/install-nnpy.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_agent.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test/test.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_bridge.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_eth.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_nn.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/resources/ptf_nn.graphml delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/resources/ptf_nn.png delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/veth_setup.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/ptf/setup.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/PKG-INFO delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/SOURCES.txt delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/dependency_links.txt delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/not-zip-safe delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/top_level.txt delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/__init__.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/afpacket.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/base_tests.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/dataplane.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/mask.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/netutils.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/packet.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/parse.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/pcap_writer.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/__init__.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/eth.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/local.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/nn.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/remote.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/ptfutils.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py delete mode 100644 bm/sai_adapter/test/ptf_tests/ptf/src/ptf/thriftutils.py delete mode 100755 bm/sai_adapter/test/ptf_tests/run_ptf.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/run_ptf_1Q_B_A2A_test.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/run_ptf_c.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/run_ptf_l2_tests.sh delete mode 100755 bm/sai_adapter/test/ptf_tests/run_ptf_wip_test.sh delete mode 100644 bm/sai_adapter/test/ptf_tests/tests/README.txt delete mode 100644 bm/sai_adapter/test/ptf_tests/tests/sai_base_test.py delete mode 100644 bm/sai_adapter/test/ptf_tests/tests/sail2_new.py delete mode 100644 bm/sai_adapter/test/ptf_tests/tests/switch.py delete mode 100644 bm/sai_adapter/test/ptf_tests/unopened_tests/sai_base_test.py delete mode 100644 bm/sai_adapter/test/ptf_tests/unopened_tests/saiacl.py delete mode 100644 bm/sai_adapter/test/ptf_tests/unopened_tests/saihostif.py delete mode 100644 bm/sai_adapter/test/ptf_tests/unopened_tests/sail2.py delete mode 100644 bm/sai_adapter/test/ptf_tests/unopened_tests/sail3.py delete mode 100644 bm/sai_adapter/test/ptf_tests/unopened_tests/switch.py delete mode 100644 bm/sai_adapter/test/ptf_tests/wip_tests/sai_base_test.py delete mode 100644 bm/sai_adapter/test/ptf_tests/wip_tests/sai_types.py delete mode 100644 bm/sai_adapter/test/ptf_tests/wip_tests/sail2_wip.py delete mode 100644 bm/sai_adapter/test/ptf_tests/wip_tests/switch.py delete mode 100755 bm/sai_adapter/test/sai_thrift_development_python_server/cli_driver.py delete mode 100755 bm/sai_adapter/test/sai_thrift_development_python_server/sai_rpc_server.sh delete mode 100644 bm/sai_adapter/test/sai_thrift_development_python_server/switch_sai_server.py delete mode 100644 bm/sai_adapter/test/sai_thrift_server/.gitignore delete mode 100644 bm/sai_adapter/test/sai_thrift_server/SaiCppServer.cpp delete mode 100644 bm/sai_adapter/test/sai_thrift_server/logs/.gitignore delete mode 100644 bm/sai_adapter/test/sai_thrift_server/obj/.gitignore delete mode 100755 bm/sai_adapter/test/sai_thrift_server/run_server.sh delete mode 100644 bm/sai_adapter/test/sai_thrift_server/saiutils.c delete mode 100644 bm/sai_adapter/test/sai_thrift_src/saiserver.cpp delete mode 100644 bm/sai_adapter/test/sai_thrift_src/switch_sai.thrift delete mode 100644 bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.cpp delete mode 100644 bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.h delete mode 100644 bm/sai_adapter/test/sai_types.py delete mode 100644 bm/sai_adapter/test/unittest/.gitignore delete mode 100644 bm/sai_adapter/test/unittest/logs/.gitkeep delete mode 100644 bm/sai_adapter/test/unittest/logs/log.txt delete mode 100644 bm/sai_adapter/test/unittest/obj/.gitignore delete mode 100755 bm/sai_adapter/test/unittest/run_test.sh delete mode 100644 bm/sai_adapter/test/unittest/unittest.c diff --git a/.gitmodules b/.gitmodules index 9e8fd47eb..00efc6e63 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "test/saithrift/ctypesgen"] path = test/saithrift/ctypesgen url = https://github.com/davidjamesca/ctypesgen -[submodule "bm/behavioral-model"] - path = bm/behavioral-model - url = https://github.com/p4lang/behavioral-model.git diff --git a/bm/.gitignore b/bm/.gitignore deleted file mode 100644 index e8c6df86c..000000000 --- a/bm/.gitignore +++ /dev/null @@ -1,100 +0,0 @@ -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -# Python byet code -*.pyc - -build/* -lib* - -# Emacs -*~ - -*.pcap - -# Tags -GPATH -GRTAGS -GSYMS -GTAGS - -tools/bm_runtime/ - -# Files generated by autotools -.deps -Makefile -Makefile.in -configure -config.log -config.h -aclocal.m4 -autom4te.cache/ -compile -config.h.in -config.status -depcomp -install-sh -missing -stamp-h1 -targets/simple_router/simple_router -test-driver -.dirstamp -tests/test_* -!tests/test_*.cpp -!tests/testdata/*.pcap -*.log -*.trs -config.guess -config.sub -ltmain.sh -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -py-compile -.libs - -*.ts - -# gcov -*.gcno -*.gcda -*.gcov - -# doxygen -doxygen-out - -# thrift -gen-cpp -gen-py - -VERSION-build - -# dist archives -*.tar.gz diff --git a/bm/.gitmodules b/bm/.gitmodules deleted file mode 100644 index e69de29bb..000000000 diff --git a/bm/README.md b/bm/README.md deleted file mode 100644 index a09cc8261..000000000 --- a/bm/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# ** WARNING ** THIS DIRECTORY IS DEPRECATED AND WILL BE REMOVED END OF 2023 -# ** WARNING ** USE tests/saithriftv2 and sonic-net/DASH repo for bmv2/p4 model - -# SAI BEHAVIORAL MODEL -This repository clearly defines widely accepted network switch behaviour. -The switch behavioral model provides a commom framework for all network vendors and users. -It meant to describe the standard ethernet switch features and flows. -The model enables for both users and vendors to experiance the SAI switch model using SAI API over P4 soft switch. - -## Repository Structure -The repository consist of: - -### [P4 soft-switch](p4-sai/) -P4_14 source files to be complied by the p4c complier -Can be independently configured via the CLI interface. -### [SAI adapter](sai_adapter/) -C source files implementation for the SAI API build for P4 soft switch model. -SAI lib -Tests frameworks: PTF, unittests. diff --git a/bm/behavioral-model b/bm/behavioral-model deleted file mode 160000 index 55b2b04fb..000000000 --- a/bm/behavioral-model +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 55b2b04fb3dbeb2762142db73627f3918f7bf7f2 diff --git a/bm/build_p4_target.sh b/bm/build_p4_target.sh deleted file mode 100755 index a9dfb33c3..000000000 --- a/bm/build_p4_target.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -echo -echo "** WARNING ** THIS DIRECTORY IS DEPRECATED AND WILL BE REMOVED END OF 2023" -echo "** WARNING ** USE tests/saithriftv2 and sonic-net/DASH repo for bmv2/p4 model" -echo - -sleep 10 - -# backup behavioral-model original configs -mv -f behavioral-model/configure.ac configure_bak.ac -mv -f behavioral-model/targets/Makefile.am Makefile_bak.am -cp -f p4-sai/bm_config/configure.ac behavioral-model/configure.ac -cp -f p4-sai/bm_config/Makefile.am behavioral-model/targets/Makefile.am - -rm -rf behavioral-model/targets/p4-sai -mv p4-sai behavioral-model/targets/. -# make behavioral model, p4-sai target. - -cd behavioral-model/ -./autogen.sh -./configure -make - -# return original config files -cd - -mv -f Makefile_bak.am behavioral-model/targets/Makefile.am -mv -f configure_bak.ac behavioral-model/configure.ac - -# return compiled target -mv behavioral-model/targets/p4-sai . - -# edit relative paths -# cp simple_switch simple_switch_bak -sed -i 's/P4\/SAI\/bm\/behavioral-model\/targets\/p4-sai/p4-sai/g' simple_switch -sed -i 's/\.\.\/\.\.\/src\/bm_runtime\/\.libs\/libbmruntime\.a/\.\.\/behavioral-model\/src\/bm_runtime\/\.libs\/libbmruntime\.a/g' simple_switch -sed -i 's/\.\.\/\.\.\/thrift_src\/\.libs/\.\.\/behavioral-model\/thrift_src\/\.libs/g' simple_switch -rm runtime_CLI -ln -s ../behavioral-model/tools/runtime_CLI.py runtime_CLI diff --git a/bm/p4-sai/.gitignore b/bm/p4-sai/.gitignore deleted file mode 100644 index 1a844457c..000000000 --- a/bm/p4-sai/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/build -/simple_switch -/*.pcap -sswitch_runtime -simple_switch_CLI -log.txt -tests/CLI_tests/run_one_test.py -log* \ No newline at end of file diff --git a/bm/p4-sai/CPPLINT.cfg b/bm/p4-sai/CPPLINT.cfg deleted file mode 100644 index 0499afd8c..000000000 --- a/bm/p4-sai/CPPLINT.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# in case the src dir is used as the build dir -exclude_files=gen-cpp diff --git a/bm/p4-sai/Makefile.am b/bm/p4-sai/Makefile.am deleted file mode 100644 index 95db5615e..000000000 --- a/bm/p4-sai/Makefile.am +++ /dev/null @@ -1,131 +0,0 @@ -SUBDIRS = . - -simple_switch_thrift_py_files = \ -gen-py/sswitch_runtime/constants.py \ -gen-py/sswitch_runtime/__init__.py \ -gen-py/sswitch_runtime/SimpleSwitch.py \ -gen-py/sswitch_runtime/ttypes.py -simple_switch_thrift_files = \ -gen-cpp/bm/simple_switch_constants.cpp \ -gen-cpp/bm/simple_switch_constants.h \ -gen-cpp/bm/SimpleSwitch.cpp \ -gen-cpp/bm/SimpleSwitch.h \ -gen-cpp/bm/simple_switch_types.cpp \ -gen-cpp/bm/simple_switch_types.h - -BUILT_SOURCES = $(simple_switch_thrift_files) $(simple_switch_thrift_py_files) - -sswitchpydir = $(pythondir)/sswitch_runtime -nodist_sswitchpy_PYTHON = $(simple_switch_thrift_py_files) - -python_PYTHON = sswitch_CLI.py - -# See -# http://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Installation-Directory-Variables.html -edit = sed \ - -e 's|@pythondir[@]|$(pythondir)|g' - -simple_switch_CLI: Makefile - rm -f $@ $@.tmp - $(edit) $(srcdir)/$@.in >$@.tmp - chmod +x $@.tmp - chmod a-w $@.tmp - mv $@.tmp $@ - -simple_switch_CLI: simple_switch_CLI.in - -EXTRA_DIST = \ -simple_switch_CLI.in \ -sswitch_CLI - -bin_SCRIPTS = \ -simple_switch_CLI - -AM_CPPFLAGS += \ --I$(srcdir)/thrift/src/ \ --I$(builddir)/gen-cpp - -libsimpleswitch_la_LIBADD = \ -$(top_builddir)/src/bm_sim/libbmsim.la \ -$(top_builddir)/src/bf_lpm_trie/libbflpmtrie.la \ -$(top_builddir)/src/BMI/libbmi.la \ -$(top_builddir)/third_party/jsoncpp/libjson.la \ --lboost_system $(THRIFT_LIB) -lboost_program_options - -noinst_LTLIBRARIES = libsimpleswitch.la - -libsimpleswitch_la_SOURCES = \ -simple_switch.cpp simple_switch.h primitives.cpp \ -thrift/src/SimpleSwitch_server.cpp - -bin_PROGRAMS = simple_switch - -simple_switch_LDADD = \ -$(top_builddir)/src/bm_runtime/libbmruntime.la \ -$(top_builddir)/thrift_src/libruntimestubs.la \ -libsimpleswitch.la \ -libsimpleswitch_thrift.la - -simple_switch_SOURCES = main.cpp - -lib_LTLIBRARIES = libsimpleswitch_thrift.la - -nodist_libsimpleswitch_thrift_la_SOURCES = \ -$(simple_switch_thrift_files) - -# See http://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html - -THRIFT_IDL = $(srcdir)/thrift/simple_switch.thrift - -EXTRA_DIST += $(THRIFT_IDL) - -# We copy the generated Python code to srcdir/ if we have permissions (i.e. not -# for 'make distcheck'). This is to ensure we can run the CLI easily. Maybe I -# will think of a better solution later. -thrift_files.ts: $(THRIFT_IDL) - @rm -f thrift_files.tmp - @touch thrift_files.tmp - @mkdir -p $(builddir)/gen-cpp/bm - $(THRIFT) -out $(builddir)/gen-cpp/bm --gen cpp -r $(THRIFT_IDL) - $(THRIFT) -o $(builddir) --gen py -r $(THRIFT_IDL) - if mkdir $(srcdir)/sswitch_runtime.test 2>/dev/null; then \ - rm -rf $(srcdir)/sswitch_runtime/; \ - cp -r $(builddir)/gen-py/sswitch_runtime/ $(srcdir)/; \ - rm -rf $(srcdir)/sswitch_runtime.test; else :; \ - fi - @mv -f thrift_files.tmp $@ - -$(BUILT_SOURCES): thrift_files.ts -## Recover from the removal of $@ - @if test -f $@; then :; else \ - trap 'rm -rf thrift_files.lock thrift_files.ts' 1 2 13 15; \ -## mkdir is a portable test-and-set - if mkdir thrift_files.lock 2>/dev/null; then \ -## This code is being executed by the first process. - rm -f thrift_files.ts; \ - $(MAKE) $(AM_MAKEFLAGS) thrift_files.ts; \ - result=$$?; rm -rf thrift_files.lock; exit $$result; \ - else \ -## This code is being executed by the follower processes. -## Wait until the first process is done. - while test -d thrift_files.lock; do sleep 1; done; \ -## Succeed if and only if the first process succeeded. - test -f thrift_files.ts; \ - fi; \ - fi - -nodist_pkginclude_HEADERS = \ -gen-cpp/bm/simple_switch_constants.h \ -gen-cpp/bm/SimpleSwitch.h \ -gen-cpp/bm/simple_switch_types.h - - -CLEANFILES = $(BUILT_SOURCES) \ -thrift_files.ts \ -gen-cpp/bm/SimpleSwitch_server.skeleton.cpp \ -$(bin_SCRIPTS) - -# I used to do a rm on gen-cpp, but it was removing a .deps directory, instead I -# am adding the skeleton file to CLEANFILES -clean-local: - rm -rf gen-py diff --git a/bm/p4-sai/README.md b/bm/p4-sai/README.md deleted file mode 100644 index 5f9168a12..000000000 --- a/bm/p4-sai/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# P4 SOFT SWITCH MODEL -This repository contains P4 implementation of SAI behavioural model, forked from [p4lang/behavioural_model](https://github.com/p4lang/behavioral-model/). - - -The Model is meant to provide a conformal behavioural SAI(https://github.com/opencomputeproject/SAI) model. -It implements SAI 1.0 on top of soft switch coded via P4. - -## Compiling P4 Behavioural model -For list of dependencies and build instructions: -[p4lang/behavioural_model](https://github.com/p4lang/behavioral-model/). - -### Compiling P4 target -Due to current behavioral-model implemntation, targets can only be complied in the bm/behavioral-model/targets/ dir. - First time/every target (cpp) change, use: - `bm/build_target.sh` - -### Create virtual interfaces -To create the virtual interfaces and hosts. ```veth_setup.sh``` and remove them by ```veth_teardown.sh``` - -### Compiling P4 code -If any editing to the P4 program was made, before running it you first need to transform the P4 code into a json representation which can be consumed by the software switch. This -representation will tell bmv2 which tables to initialize, how to configure the -parser, ... It is produced by the [p4c-bm](https://github.com/p4lang/p4c-bm) -tool. Please take a look at the -[README](https://github.com/p4lang/p4c-bm/blob/master/README.rst) for this repo -to find out how to install it. Once this is done, -use the script that is found inside the P4-SAI target directory as follows: - - ./compile_json.sh - -### Running P4 program -running the switch can be done with the following command: ```run_server.sh``` found in P4-SAI target directory. -This script also implements some default configurations found in: p4src/DefaultConfig.txt diff --git a/bm/p4-sai/bm_config/Makefile.am b/bm/p4-sai/bm_config/Makefile.am deleted file mode 100644 index 1b3565b86..000000000 --- a/bm/p4-sai/bm_config/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = $(MAYBE_SECONDARY_TARGETS) p4-sai diff --git a/bm/p4-sai/bm_config/configure.ac b/bm/p4-sai/bm_config/configure.ac deleted file mode 100644 index 5d92243b4..000000000 --- a/bm/p4-sai/bm_config/configure.ac +++ /dev/null @@ -1,271 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.68]) -AC_INIT([bm], [m4_esyscmd(tools/get_version.sh)], - [antonin@barefootnetworks.com]) -AM_INIT_AUTOMAKE([foreign subdir-objects]) -AC_CONFIG_SRCDIR([src/bm_sim/checksums.cpp]) -AC_CONFIG_HEADERS([config.h]) - -AC_SUBST([BM_VERSION], [AC_PACKAGE_VERSION]) - -# Pyhton is optional to the package -AM_PATH_PYTHON([2.7],, [:]) - -coverage_enabled=no -AC_ARG_ENABLE([coverage], - AS_HELP_STRING([--enable-coverage], [Enable code coverage tracking])) -AS_IF([test "x$enable_coverage" = "xyes"], [ - coverage_enabled=yes - AC_DEFINE([COVERAGE], [], ["Link with gcov."]) - COVERAGE_FLAGS="-coverage" -]) - -AC_SUBST([COVERAGE_FLAGS]) - -AC_ARG_WITH([targets], - AS_HELP_STRING([--without-targets], [Do not build targets]), - [], [want_targets=yes]) - -AM_CONDITIONAL([COND_TARGETS], [test "$want_targets" = yes]) - -want_stress_tests=no -AC_ARG_WITH([stress_tests], - AS_HELP_STRING([--with-stress-tests], [Include stress tests]), - [want_stress_tests=yes], []) - -AM_CONDITIONAL([COND_STRESS_TESTS], [test "$want_stress_tests" = yes]) - -want_pdfixed=no -AC_ARG_WITH([pdfixed], - AS_HELP_STRING([--with-pdfixed], [Build pdfixed for bmv2]), - [want_pdfixed=yes], []) - -AM_CONDITIONAL([COND_PDFIXED], [test "$want_pdfixed" = yes]) - -MY_CPPFLAGS="" - -AC_ARG_WITH([nanomsg], - AS_HELP_STRING([--with-nanomsg], [Build Nanomsg RPC service, if disabled then you must have some other way of controlling the switch]), - [want_nanomsg="$withval"], [want_nanomsg=yes]) - -AM_CONDITIONAL([COND_NANOMSG], [test "$want_nanomsg" = yes]) - -debugger_enabled=no -AC_ARG_ENABLE([debugger], - AS_HELP_STRING([--enable-debugger], [Enable bmv2 remote debugger])) -AS_IF([test "x$enable_debugger" = "xyes"], [ - AS_IF([test "$want_nanomsg" = "yes"], [ - debugger_enabled=yes - MY_CPPFLAGS="$MY_CPPFLAGS -DBMDEBUG_ON" - ], [ - AC_MSG_ERROR([Cannot use debugger without nanomsg]) - ]) -]) - -logging_macros_enabled=no -AC_ARG_ENABLE([logging_macros], - AS_HELP_STRING([--disable-logging-macros], - [Disable compile time debug and trace logging macros])) -AS_IF([test "x$enable_logging_macros" != "xno"], [ - logging_macros_enabled=yes - MY_CPPFLAGS="$MY_CPPFLAGS -DBMLOG_DEBUG_ON -DBMLOG_TRACE_ON" -]) - -# BMELOG_ON is defined by default, since it is required for some tests -elogger_enabled=no -AC_ARG_ENABLE([elogger], - AS_HELP_STRING([--disable-elogger], - [Disable nanomsg event logger (some unit tests may fail)])) - -AS_IF([test "x$enable_elogger" != "xno"], [ - AS_IF([test "$want_nanomsg" = "yes"], [ - elogger_enabled=yes - MY_CPPFLAGS="$MY_CPPFLAGS -DBMELOG_ON" - ], [ - AC_MSG_WARN([Cannot use elogger without nanomsg]) - ]) -]) - -AC_ARG_ENABLE([undeterministic_tests], - AS_HELP_STRING([--disable-undeterministic-tests], - [Skip undeterministic tests (e.g. queueing) when running "make check"])) -AM_CONDITIONAL([SKIP_UNDETERMINISTIC_TESTS], - [test "x$enable_undeterministic_tests" = "xno"]) - -AC_ARG_WITH([thrift], - AS_HELP_STRING([--with-thrift], [Build Thrift RPC service, if disabled then you must have some other way of controlling the switch]), - [want_thrift="$withval"], [want_thrift=yes]) - -AM_CONDITIONAL([COND_THRIFT], [test "$want_thrift" = yes]) - -want_pi=no -AC_ARG_WITH([pi], - AS_HELP_STRING([--with-pi], [Build PI implementation for bmv2, this implementation is not the one included in the PI repository (which is the recommended one)]), - [want_pi=yes], []) - -AM_CONDITIONAL([COND_PI], [test "$want_pi" = yes]) - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -LT_INIT - -AC_CONFIG_MACRO_DIR([m4]) - -# enforce -std=c++11 -AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) - -# Checks for header files. -AC_LANG_PUSH(C) -AC_LANG_PUSH(C++) - -# Thrift -want_p4thrift=no -AC_ARG_WITH([p4thrift], - AS_HELP_STRING([--with-p4thrift], [Use p4lang version of Thrift]), - [want_p4thrift=yes], []) - -AS_IF([test "$want_thrift" = no && test "$want_p4thrift" = yes], - [AC_MSG_ERROR(cannot use --with-p4thrift if Thrift is disabled)]) - -AS_IF([test "$want_thrift" = no && test "$want_pdfixed" = yes], - [AC_MSG_ERROR(cannot use --with-pdfixed if Thrift is disabled)]) - -AS_IF([test "$want_thrift" = yes], [ - AS_IF([test "$want_p4thrift" = yes], [ - AC_PATH_PROG([THRIFT], [p4thrift], []) - AC_SUBST([THRIFT_LIB], ["-lp4thrift"]) - MY_CPPFLAGS="$MY_CPPFLAGS -DP4THRIFT" - AC_CHECK_HEADER([p4thrift/P4Thrift.h], [], [AC_MSG_ERROR([P4Thrift headers not found. Install P4Thrift from http://github.com/p4lang/thrift/])]) - ], [ - AC_PATH_PROG([THRIFT], [thrift], []) - AC_SUBST([THRIFT_LIB], ["-lthrift"]) - AC_CHECK_HEADER([thrift/Thrift.h], [], [AC_MSG_ERROR([Thrift headers not found. Install Thrift from http://thrift.apache.org/docs/install/])]) - ]) - AS_IF([test x"$THRIFT" = x], [AC_MSG_ERROR([cannot find thrift])]) - MY_CPPFLAGS="$MY_CPPFLAGS -DBMTHRIFT_ON" -]) - -AS_IF([test "$want_pi" = yes], [ - PI_url=https://github.com/p4lang/PI/ - AC_CHECK_HEADERS([PI/pi.h PI/target/pi_imp.h PI/p4info.h], [], - [AC_MSG_ERROR([Cannot find PI headers, did you install $PI_url])]) -]) - -AM_CONDITIONAL([P4THRIFT], [test "$want_p4thrift" = yes]) - -AC_CHECK_HEADERS([algorithm array cassert cmath queue \ -cstdio string sys/stat.h sys/types.h ctime tuple unistd.h unordered_map \ -utility vector], [], [AC_MSG_ERROR([Missing header file])]) - -AS_IF([test "$want_nanomsg" = yes], [ - AC_CHECK_LIB([nanomsg], [nn_errno], [], [AC_MSG_ERROR([Missing libnanomsg])]) - MY_CPPFLAGS="$MY_CPPFLAGS -DBMNANOMSG_ON" -]) - -# Check for pthread, libjudy, libgmp, libpcap -AX_PTHREAD([], [AC_MSG_ERROR([Missing pthread library])]) -AC_CHECK_LIB([Judy], [Judy1Next], [], [AC_MSG_ERROR([Missing libJudy])]) -AC_CHECK_LIB([gmp], [__gmpz_init], [], [AC_MSG_ERROR([Missing libgmp])]) -AC_CHECK_LIB([pcap], [pcap_create], [], [AC_MSG_ERROR([Missing libpcap])]) -AC_CHECK_LIB([pcap], [pcap_set_immediate_mode], [pcap_fix=yes], [pcap_fix=no]) -if test -n "$COVERAGE_FLAGS"; then - AC_CHECK_LIB([gcov], [__gcov_init], [], [AC_MSG_ERROR([Missing gcov library])]) -fi - -AC_MSG_CHECKING(for compiler atomic support) -AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [[#include - int main() { - struct C { int x; int y; }; - std::atomic c; - C c1 = c.load(); - C c2; - do { c2.x = c1.x + 1; c2.y = c1.y + 1; } - while (!c.compare_exchange_weak(c1, c2)); - return 0; - } - ]])], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - AC_MSG_NOTICE([using -latomic]) - AX_CXX_CHECK_LIB([atomic], [__atomic_load_4], [], AC_MSG_ERROR([Missing latomic])) - ]) - -AM_CONDITIONAL([WITH_PCAP_FIX], [test "$pcap_fix" = "yes"]) - -# C++ libraries are harder (http://nerdland.net/2009/07/detecting-c-libraries-with-autotools/), -# so use headers to check -AC_CHECK_HEADER([boost/thread.hpp], [], [AC_MSG_ERROR([Boost threading headers not found])]) -# need to check at least for the libboost_thread since it is -mt.so -AX_CXX_CHECK_LIB([boost_thread], [boost::thread], [], - [AX_CXX_CHECK_LIB([boost_thread-mt], [boost::thread], - [LIBS="-lboost_thread-mt $LIBS"], - [AC_MSG_ERROR([Missing boost thread library])])]) -AC_CHECK_HEADER([boost/multiprecision/gmp.hpp], [], [AC_MSG_ERROR([Missing boost Multiprecision headers])]) -AC_CHECK_HEADER([boost/program_options.hpp], [], [AC_MSG_ERROR([Missing boost program options header])]) -AC_CHECK_HEADER([boost/functional/hash.hpp], [], [AC_MSG_ERROR([Missing boost functional hash header])]) -AC_CHECK_HEADER([boost/filesystem.hpp], [], [AC_MSG_ERROR([Missing boost filesystem header])]) - -AC_SUBST([AM_CPPFLAGS], ["$MY_CPPFLAGS \ - -I\$(top_srcdir)/include \ - -isystem\$(top_srcdir)/third_party/jsoncpp/include \ - -isystem\$(top_srcdir)/third_party/spdlog"]) - -AC_SUBST([AM_CXXFLAGS], ["$PTHREAD_CFLAGS -Wall -Werror -Wextra"]) -AC_SUBST([AM_CFLAGS], ["$PTHREAD_CFLAGS"]) - -# Checks for typedefs, structures, and compiler characteristics. -# not supported by autoconf 2.68, add to m4/ ? -# AC_CHECK_HEADER_STDBOOL -AC_TYPE_SIZE_T -AC_TYPE_UINT64_T -AC_LANG_POP(C++) - -# Generate makefiles -AC_CONFIG_FILES([Makefile - thrift_src/Makefile - third_party/Makefile - third_party/gtest/Makefile - third_party/jsoncpp/Makefile - third_party/spdlog/Makefile - include/Makefile - src/Makefile - src/bf_lpm_trie/Makefile - src/bm_sim/Makefile - src/bm_runtime/Makefile - src/BMI/Makefile - src/bm_apps/Makefile - src/bm_apps/examples/Makefile - targets/Makefile - targets/p4-sai/Makefile - tests/Makefile - tests/stress_tests/Makefile - tools/Makefile - pdfixed/Makefile - pdfixed/include/Makefile - PI/Makefile]) - -# Generate other files -AC_CONFIG_FILES([tests/utils.cpp - src/bm_sim/version.cpp - mininet/stress_test_ipv4.py]) - -AC_OUTPUT - -AS_ECHO("") -AS_ECHO("Features recap ......................") -AS_ECHO("Coverage enabled .............. : $coverage_enabled") -AS_ECHO("Logging macros enabled ........ : $logging_macros_enabled") -AS_ECHO("With Nanomsg .................. : $want_nanomsg") -AS_ECHO("Event logger enabled .......... : $elogger_enabled") -AS_ECHO("Debugger enabled .............. : $debugger_enabled") -AS_ECHO("With Thrift ................... : $want_thrift") -AS_IF([test "$want_thrift" = yes], [ -AS_ECHO(" With p4Thrift ............... : $want_p4thrift") -]) -AS_ECHO("With pdfixed .................. : $want_pdfixed") -AS_ECHO("With PI ....................... : $want_pi") diff --git a/bm/p4-sai/compile_json.sh b/bm/p4-sai/compile_json.sh deleted file mode 100755 index c1923ac9d..000000000 --- a/bm/p4-sai/compile_json.sh +++ /dev/null @@ -1 +0,0 @@ -p4c-bmv2 --p4-v1.1 --json sai.json p4src/sai.p4 \ No newline at end of file diff --git a/bm/p4-sai/copy_to_cpu_test_commands.txt b/bm/p4-sai/copy_to_cpu_test_commands.txt deleted file mode 100644 index 980c0702b..000000000 --- a/bm/p4-sai/copy_to_cpu_test_commands.txt +++ /dev/null @@ -1,3 +0,0 @@ -table_add table_l2_trap action_set_trap_id 00:00:00:00:01:00 => 5 -table_add table_trap_id action_copy_to_cpu 5 => -table_add table_fdb action_set_egress_br_port 00:00:00:00:01:00 1 => 3 diff --git a/bm/p4-sai/docs/JSON_format.md b/bm/p4-sai/docs/JSON_format.md deleted file mode 100644 index 2bda54068..000000000 --- a/bm/p4-sai/docs/JSON_format.md +++ /dev/null @@ -1,384 +0,0 @@ -# BMv2 JSON input format - -All bmv2 target switches take as input a JSON file, whose format is essentially -target independent. The format is very simple and several examples can be found -in this repository, including [here] -(../targets/simple_router/simple_router.json). - -This documents attempt to describe the expected JSON schema and the constraints -on each attribute. There is some ongoing work to write a formal JSON schema as -per [this specification] (http://json-schema.org/). - -## General information - -Tentative support for signed fields (with a 2 complement representation) has -been added to bmv2, although they are not supported in P4 1.0 or by the [p4c-bm -compiler] (https://github.com/p4lang/p4c-bm). However, signed constants (in -expressions, or as primitive arguments) are always supported. -Arithmetic is done with infinite precision, but when a value is copied into a -field, it is truncated based on the field's bitwidth. - -## Format - -### The type value object - -You will see many places where a JSON object with 2 attributes, `type` and -`value`, is expected (for example, action primitive arguments). This is the -convention we follow: -- if `type` is `field`, `value` is a JSON 2-tuple, where the first item is the -header instance name and the second is the field member name. -- if `type` is `hexstr`, `value` is a bitstring written in hexadecimal (big -endian order); it can be prefixed with a negative sign, for negative values. -- if `type` is `bool`, `value` is either `true` or `false`. -- if `type` is a named P4 type (`header`, `header_stack`, `calculation`, -`register_array`, `meter_array`, `counter_array`), `value` is a string -corresponding to the name of the designated object. -- if `type` is `lookahead` (parser only), `value` is a JSON 2-tuple, where the -first item is the bit offset for the lookahead and the second item is the -bitwidth. -- if `type` is `expression`, `value` is a JSON object with 3 attributes: - - `op`: the operation performed (`+`, `-`, `*`, `<<`, `>>`, `==`, `!=`, `>`, - `>=`, `<`, `<=`, `and`, `or`, `not`, `&`, `|`, `^`, `~`, `valid`) - - `left`: the left side of the operation, or `null` if unary operation - - `right`: the right side of the operation - -For an expression, `left` and `right` will themselves be JSON objects, where the -`value` attribute can be one of `field`, `hexstr`, `header`, `expression`, -`bool`. - -bmv2 also supports these recently-added operations: - - data-to-bool conversion (`op` is `d2b`): unary operation which can be used -to explicitly convert a data value (i.e. a value that can be read from / -written to a field, or a value obtained from runtime action data, or a value -obtained from a JSON `hexstr`) to a boolean value. Note that implicit -conversions are not supported. - - bool-to-data conversion (`op` is `b2d`): unary operation which can be used -to explicitly convert a boolean value to a data value. Note that implicit -conversions are not supported. - - 2-complement modulo (`op` is `two_comp_mod`): given a source data value and -a width data value, produces a third data value which is the signed value of the -source given a 2-complement representation with that width. For example, -`two_comp_mod(257, 8) == 1` and `two_comp_mod(-129, 8) == 127`. - - ternary operator (`op` is `?`): in addition to `left` and `right`, the JSON -object has a fourth attribute, `cond` (condition), which is itself an -expression. For example, in `(hA.f1 == 9) ? 3 : 4`, `cond` would be the JSON -representation of `(hA.f1 == 9)`, `left` would be the JSON representation of `3` -and `right` would be the JSON representation of `4`. - -For field references, some special values are allowed. They are called "hidden -fields". For now, we only support one kind of hidden fields: `
.$valid$`. This field is a 1-bit field which encodes the validity of the -corresponding header. It is a read-only field. It can be used just like any -other field; in particular as part of a match-table key or in a control-flow -condition. In the long run, this field will completely replace the valid match -type and the `valid()` built-in (in expressions), but we are not there yet. - - -The attributes of the root JSON dictionary are: - -### `header_types` - -It is a JSON array of all the header types defined in the P4 program. Each array -item has the following attributes: -- `name`: fully qualified P4 name of the header type -- `id`: a unique integer (unique with respect to other header types) -- `fields`: a JSON array of JSON 2-tuples (field member name, field width in -bits). Note that the JSON 2-tuples can optionally be JSON 3-tuples if you want -to experiment with signed fields support. In this case, the third element of the -tuples is a boolean value, which is `true` iff the field is signed. A signed -field needs to have a bitwidth of at least 2! - -### `headers` - -It is a JSON array of all the header instances (including metadata) declared in -the P4 program. Each array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other header instances) -- `header_type`: the `name` of the header type for this header instance -- `metadata`: a boolean value, `true` iff the instance is a metadata instance - -### `header_stacks` - -It is a JSON array of all the header stacks declared in the P4 program. Each -array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other header stacks) -- `header_type`: the `name` of the header type for this stack -- `header_ids`: a JSON array of integers; each integer being the unique `id` of -a header instance included in the stack. These ids have to be in the correct -order: stack[0], stack[1], ... - -### `parsers` - -It is a JSON array of all the parsers declared in the P4 program. Each array -item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other parsers) -- `init_state`: the name of the start state for the parser -- `parse_states`: a JSON array of JSON objects. Each of these objects stores the -information for a given parse state in the program, which is used by the current -parser. The attributes for these objects are: - - `name` - - `id`: a unique integer; note that it has to be unique with respect to *all* - parse states in the JSON file, not just the parse states included in this - parser object - - `parser_ops`: a JSON array of the operations (set or extract) performed in - this parse state, in the correct order. Each parser operation is represented - by a JSON object, whose attributes are: - - `op`: the type of operation, either `extract` or `set` - - `parameters`: a JSON array of objects encoding the parameters to the - parser operation. Each parameter object has 2 string attributes: `type` for - the parameter type and `value` for its value. Depending on the type of - operation, the constraints are different. An extract operation only takes - one parameter, of type `regular` (extraction to a regular header instance) - or `stack` (extraction to the end of a header stack). `value` is then the - name of the header instance or stack. On the other hand, a set operation - takes exactly 2 parameters. The first one needs to be of type `field` with - the appropriate value. The second one can be of type `field`, `hexstr`, - `lookahead` or `expression`, with the appropriate value (see [here] - (#the-type-value-object)). - - `transition_key`: a JSON array (in the correct order) of objects which - describe the different fields of the parse state transition key. Each object - has 2 attributes, `type` and `value`, where `type` can be either - `field`, `stack_field` (for a field of the last extracted instance in a - stack) or `lookahead` (see [here] (#the-type-value-object)). - - `transitions`: a JSON array of objects encoding each parse state - transition. The different attributes for these objects are: - - `type`: either `default` (for the default transition), `hexstr` (for a - regular hexstring value-based transition) or `parse_vset` (for a parse - value-set). - - `value`: only relevant if the `type` attribute is `hexstr`, in which case - it is the hexstring value for the transition, or `parse_vset`, in which case - it is the name of the corresponding parse value-set. Set to `null` if `type` - is `hexstr`. - - `mask`: only relevant if the `type` attribute is `hexstr` or `parse_vset` - (`null` if `type` is `default`). It can either be a hexstring (to be used as - a mask and ANDed with the key and the value) or `null`. For a parse - value-set, the mask will be ANDed with each value in the set when checking - for a match. - - `next_state`: the name of the next parse state, or `null` if this is the - last state in the parser. - -For values and masks, make sure that you use the correct format. They need to be -the concatenation (in the right order) of all byte padded fields (padded with -`0` bits). For example, if the transition key consists of a 12-bit field and a -2-bit field, each value will need to have 3 bytes (2 for the first field, 1 for -the second one). If the transition value is `0xaba`, `0x3`, the `value` -attribute will be set to `0x0aba03`. - -### `parse_vsets` - -It is a JSON array of all the parse value-sets declared in the P4 program. Each -array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other parse value-sets) -- `compressed_bitwidth`: the bitwidth of the values which can be added to the -set. Note that this bitwidth does not include any padding. - -### `deparsers` - -It is a JSON array of all the deparsers declared in the P4 program (or inferred -from P4 parsers). Each array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other deparsers) -- `order`: a JSON array of sorted header instance names. When the target switch -invokes a deparser, the headers will be serialized in this order, and non-valid -headers will be skipped. - -### `meter_arrays` - -It is a JSON array of all the meter arrays declared in the P4 program. Each -array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other meter arrays) -- `type`: either `bytes` or `packets` -- `rate_count`: the number of rates for the meters. By default P4 uses 2-rate -3-color meters -- `size`: the number of meter instances in the array -- `is_direct`: a boolean indicating whether this is a direct meter array -- `binding`: if the meter array is direct, the name of the table it is attached -to -- `result_target`: a 2-tuple representing the field where the meter result -(color) will be stored; only taken into account if `is_direct` is `true`. - -### `counter_arrays` - -It is a JSON array of all the counter arrays declared in the P4 program. Each -array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other counter arrays) -- `size`: the number of counter instances in the array -- `is_direct`: a boolean indicating whether this is a direct counter array -- `binding`: if the counter array is direct, the name of the table it is -attached to - -Unlike for meter arrays, there is no `type` attribute because bmv2 counters -always count both bytes and packets. - -### `register_arrays` - -It is a JSON array of all the register arrays declared in the P4 program. Each -array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other register arrays) -- `size`: the number of register instances in the array -- `bitwidth`: the width in bits of each register cell - -### `actions` - -It is a JSON array of all the actions declared in the P4 program. Each array -item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other actions) -- `runtime_data`: a JSON array of objects, each one representing a named -parameter of the action. Each object has exactly 2 attributes: - - `name`: the P4 name of the parameter - - `bitwidth`: the integral width, in bits, of the parameter -- `primitives`: a JSON array of objects, each one representing a primitive -call, with the following attributes: - - `op`: the primitive name. This primitive has to be supported by the target. - - `parameters`: a JSON array of the arguments passed to the primitive (has to - match the target primitive definition). Each argument is represented by a JSON - object with the following attributes: - - `type`: one of `hexstr`, `runtime_data`, `header`, `field`, `calculation`, - `meter_array`, `counter_array`, `register_array`, `header_stack`, - `expression`, `extern` - - `value`: the appropriate parameter value. If `type` is `runtime_data`, - this is an integer representing an index into the `runtime_data` (attribute - of action) array. If `type` is `extern`, this is the name of the extern - instance. See [here] (#the-type-value-object) for other types. - -*Important note about extern instance methods*: even though in P4 these are -invoked using object-oriented style, bmv2 treats them as regular primitives for -which the first parameter is the extern instance. For example, if the P4 call is -`extern1.methodA(x, y)`, where `extern1` is an extern instance of type -`my_extern_type`, the bmv2 compiler needs to translate this into a call to -primitive `_my_extern_type_methodA`, with the first parameter being `{"type": -"extern", "value": "extern1"}` and the second parameter being the appropriate -representation for `x` and `y`. - -### `pipelines` - -It is a JSON array of all the top control flows (ingress, egress) in the P4 -program. Each array item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other pipelines) -- `init_table`: the name of the first table of the pipeline -- `tables`: a JSON array of JSON objects. Each of these objects stores the -information for a given P4 table, which is used by the current pipeline. The -attributes for these objects are: - - `name` - - `id`: a unique integer; note that it has to be unique with respect to *all* - tables in the JSON file, not just the tables included in this parser object - - `match_type`: one of `exact`, `lpm` or `ternary` - - `type`: the implementation for the table, one of `simple`, `indirect` - (action profiles), `indirect_ws` (action profiles with dynamic selector) - - `max_size`: an integer representing the size of the table - - `with_counters`: a boolean, `true` iff the match table has direct counters - - `support_timeout`: a boolean, `true` iff the match table supports ageing - - `key`: the lookup key format, represented by a JSON array. Each member of - the array is a JSON object with the following attributes: - - `match_type`: one of `valid`, `exact`, `lpm`, `ternary` - - `target`: the field reference as a 2-tuple (or header as a string if - `match_type` if `valid`) - - `mask`: the static mask to be applied to the field, or null. Just like for - the parser transition key, make sure that this mask is byte-padded and has - the same width (in bytes) as the corresponding field (1 byte if `match_type` - is `valid`). - - `actions`: the list of actions (order does not matter) supporyed by this - table - - `next_tables`: maps each action tp a next table name. Alternatively, maps - special string `__HIT__` and `__MISS__` to a next table name. - - `direct_meters`: the name of the associated direct meter array, or null if - the match table has no associated meter array - - `default_entry`: an optional JSON item which can force the default entry for - the table to be set when loading the JSON, without intervention from the - control plane. It has the following attributes: - - `action_id`: the id of the default action - - `action_const`: an optional boolean value which is `true` iff the control - plane is not allowed to change the default action function. Default value is - `false`. - - `action_data`: an optional JSON array where each entry is the hexstring - value for an action argument. The size of the array needs to match the - number of parameters expected by the action function with id `action_id`. - - `action_entry_const`: an optional boolean value which is `true` iff the - control plane is not allowed to modify the action entry (action function + - action data). Default value is `false`. This attribute is ignored if the - `action_data` attribute it missing. -- `conditionals`: a JSON array of JSON objects. Each of these objects stores the -information for a given P4 condition, which is used by the current pipeline. The -attributes for these objects are: - - `name` - - `id`: a unique integer; note that it has to be unique with respect to *all* - conditions in the JSON file, not just the conditions included in this parser - object - - `expression`: the expression for the condition. See [here] - (#the-type-value-object) for more information on expressions format. - -If the table `type` is `indirect_ws`, the `selector` attribute is also -required for the table. It needs to be a JSON object with these attributes: - - `algo`: the hash algorithm used for group member selection (has to be - supported by target switch) - - `input`: a JSON array of objects with the following attributes: - - `type`: has to be `field` - - `value`: the field reference - -The `match_type` for the table needs to follow the following rules: -- If one match field is `ternary`, the table `match_type` has to be `ternary` -- If one match field is `lpm`, the table `match_type` is either `ternary` or -`lpm` -Note that it is not correct to have more than one `lpm` match field in the same -table. - -### `calculations` - -It is a JSON array of all the named calculations in the P4 program. In -particular, they are used for checksums. Each array item has the following -attributes: -- `name` -- `id`: a unique integer (unique with respect to other calculations) -- `algo`: the hash algorithm used (has to be supported by target switch) -- `input`: a JSON array of objects with the following attributes: - - `type`: one of `field`, `hexstr`, `header`, `payload` - - `value`: the appropriate value or reference (see [here] - (#the-type-value-object)) - -If `type` is `payload`, all the headers present after the last included header -(or after the enclosing header of the last included field) will be included in -the input, as well as the packet payload. This is necessary for TCP checksum -computation. - -If a header is not valid when the calculation is evaluated, it will be skipped. - -### `checksums` - -It is a JSON array of all the checksums in the P4 program. Each array item has -the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other checksums) -- `target`: the field where the checksum result is written -- `type`: always set to `generic` -- `calculation`: the name of the calculation to use to compute the checksum -- `if_cond`: null if the checksum needs to be updated unconditionally, otherwise -a boolean expression, which will determine whether or not the checksum gets -updated. See [here] - (#the-type-value-object) for more information on expressions format. - -### `learn_lists` - -Not documented yet, use empty JSON array. - -### `extern_instances` - -It is a JSON array of all the extern instances in the P4 program. Each array -item has the following attributes: -- `name` -- `id`: a unique integer (unique with respect to other extern instances) -- `type`: the name of the extern type, the target switch needs to support this -type -- `attribute_values`: a JSON array with the initial values for the attributes of -this extern instance. Each array item has the following attributes: - - `name`: the name of the attribute - - `type`: the type of the attribute, only `hexstr` (integral values), `string` - (for character sequences) and `expression` are supported for now - - `value`: the initial value for the attribute diff --git a/bm/p4-sai/docs/SAI_arch.PNG b/bm/p4-sai/docs/SAI_arch.PNG deleted file mode 100644 index 8d06f645e7440de412e7249696e4c6785c2b165e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 47210 zcmeFZcT|(v_cw|cJ}$~ zefCc5*)vv~#pJ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l?#|vVV5I zf9@A>vwbAv#r){E0nRRWB4*~0!mPA$&v9RGxr6H{VZ74vkOge3X5e->uV?MvKeW&j zMtfZTL4CA4*BkZrfvsolIiui-x#7MN^kl>F5ii=*8TUfr_zRtIqPagO?+0r+Ju^Mj z`mCl1l_WMW{+f#$Z%F7`XzFj0Z*7;xi_@TVs*8Cct7v%Rqe~5`BY?&~W*uQT_oLcB zoN=x&>(cJkHW9r4Ti2*y_bV=&7V>z{gY%udTy%!zSk(J^QfqryCm|P?U4{O>!n`*o z-03!Juy;PvT0V`xPqz$n(LSgBW~i&LJsAb_Zt9$DuX~CY2bvrLF8{lgR|$85D}>LE zIYd>y9i~tVfy_*iwyGqA6rFSo$IlmfJ)8=$@^03c+pZO`kT7#zclpbzBcE1IVGpM? z`l|p98q|s*tz37n{mV(Aym zk3!seN3(G5!l<0Alj?0wgO>mKvAb8%M##NjmryS(z3gf&N7S<2M>oYT6bGk!XN_f; z|62cbv0s8A(tTazd&9#lsiG%$ll9clw%vbg9oR(*+9O=J?t|PuQkLY4TzKm_kbYDv zJ>Jw1y)#L?VEu<~^9O(ScQP_&bT@&}QWtDU<9w%d)L-#BP}P3dSY&>2ZfJIcy`YTG z$O7kY@J{n z-#kr|YdyUMyx@MV<;AYDg2(GNv}x0fYw9M#5!A|1+!n}6T;eA}@W - -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - -- [P4 Debugger (p4dbg) user guide](#p4-debugger-p4dbg-user-guide) - - [List of commands](#list-of-commands) - - [General information about the debugger](#general-information-about-the-debugger) - - [The packet id](#the-packet-id) - - [Special field names](#special-field-names) - - [A more detailed list of commands](#a-more-detailed-list-of-commands) - - [`set_wp (w)`](#set_wp-w) - - [`unset_wp`](#unset_wp) - - [`show_wps`](#show_wps) - - [`break (b)`](#break-b) - - [`delete (d)`](#delete-d) - - [`show_bps`](#show_bps) - - [`continue (c)`](#continue-c) - - [`next (n)`](#next-n) - - [`print (p)`](#print-p) - - [`backtrace (bt)`](#backtrace-bt) - - [`break_packet_in`](#break_packet_in) - - [`remove_packet_in`](#remove_packet_in) - - [`stop_packet_in`](#stop_packet_in) - - [`resume_packet_in`](#resume_packet_in) - - [`filter_notifications`](#filter_notifications) - - [`reset`](#reset) - - [`skip` -- experimental](#skip----experimental) - - [`skip_all` -- experimental](#skip_all----experimental) - - [`CLI` -- experimental](#cli----experimental) - - [Future extensions](#future-extensions) - - - -# P4 Debugger (p4dbg) user guide - -## List of commands - -Here is a full list of commands with a short description. More details will be -found for each command later in this document. The last 3 commands (`skip`, -`skip_all` and `CLI`) are still experimental. - -| Command name | Short | Description | -| ---------------------- | ----- | ----------- | -| `set_wp` | `w` | Sets a watchpoint on a field | -| `unset_wp` | `N/A` | Unsets watchpoint | -| `show_wps` | `N/A` | Lists active watchpoints | -| `break` | `b` | Breaks at a specific "P4 object" | -| `delete` | `d` | Deletes breakpoint | -| `show_bps` | `N/A` | Lists active breakpoints | -| `continue` | `c` | Starts / resumes packet processing at the switch | -| `next` | `n` | Go to next update (field or “P4 context”) | -| `print` | `p` | Prints the value of a field | -| `backtrace` | `bt` | Prints a backtrace of “P4 contexts” entered by the packet | -| `break_packet_in` | `N/A` | Breaks every time a packet enters the switch | -| `remove_packet_in` | `N/A` | Undoes the break_packet_in command | -| `stop_packet_in` | `N/A` | Prevents the switch from accepting any more packets | -| `resume_packet_in` | `N/A` | Undoes the stop_packet_in command | -| `filter_notifications` | `N/A` | Restricts the received notifications to a subset of packets | -| `reset` | `N/A` | Resets all the debugger’s state | -| `skip` (exp) | `N/A` | Skips all future notifications for the current packet | -| `skip_all` (exp) | `N/A` | Skips all future notifications for the current packet and its descendants | -| `CLI` (exp) | `N/A` | Connects to the switch using the Runtime CLI and issues a command | - -## General information about the debugger - -### The packet id - -Each packet going through the switch can be identified using its "full packet -id", which is of the form `.`. Note that every time you receive an -event notification in the debugger, the packet id will be included in the -displayed message. The `` is incremented by one every time a new packet is -received by the switch. The `` is incremented by one every time a new -packet is generated by the switch in response to the same incoming packet. The -first packet received by the switch on any ingress port will have id `0.0`. The -second packet will have id `1.0`, and so on… So when is the `` ever used? -Let’s assume your target switch supports multicast and that packet `3.0` is -replicated 3 times (i.e. out of 3 different ports). Each one of these 3 copies -will receive a different ``, but the `` will remain the same. In our -case, the three full packet ids will be `3.1`, `3.2` and `3.3`. The same goes -for mirroring. - -The debugger keeps track of the "current packet id", which is the id of the last -packet for which an event notification was received by the debugger. For several -commands (e.g. `print`), the packet id can be omitted from the parameters which -will cause the debugger to use the stored "current packet id". - -### Special field names - -The debugger lets you access some special fields which are not part of the -headers or metadata. All these special names start with character `$`. We only -support one for now, `$cond`, which holds the result of the last P4 condition -evaluated by the switch. In the future, we plan on adding other such special -fields (e.g. `$action`, for the last action selected by a table lookup). Note -that all these special fields have a 32-bit width. - -## A more detailed list of commands - -### `set_wp (w)` -Usage: `set_wp ` -For example, -``` -set_wp ipv4.srcAddr -w ipv4.srcAddr -``` - -Sets a watchpoint on the provided field. For every packet, the switch will stop -running every time the field is written to, and the debugger will be -notified. Of course this does not apply to packets for which notifications are -being filtered out (see the `filter_notifications` command) or are being skipped -(see `skip` and `skip_all`). Note that a notification is generated every time a -write is done on the field, even if the field actually keeps the same value. -The field name can take the special value `$cond`, which holds the result of the -last condition evaluated. - -### `unset_wp` -Usage: `unset_wp ` -For example, -``` -unset_wp ipv4.srcAddr -``` - -Unsets a watchpoint which was previously set with the `set_wp` command. The -debugger will stop notifying the user when a write operation is performed on the -field. - -### `show_wps` -Usage: `show_wps` - -Prints a list of all the currently active watchpoints. - -### `break (b)` -Usage: `break ` -For example, -``` -break parser start -break pipeline ingress -b table ipv4_lpm -``` - -Sets a breakpoint on a given P4 object. Every time a packet is about to "enter" -this object, the switch will pause and the debugger will be notified. The valid -"p4 object types" are: parser, parse_state, pipeline, table, condition, action, -deparser. - -### `delete (d)` -Usage: `delete ` -For example, -``` -delete parser start -d pipeline ingress -``` - -Removes a breakpoint which was previously set with the break command. See -`break` command description for more details and the list of valid "p4 object -types". - -### `show_bps` -Usage: `show_bps` - -Prints a list of all the currently active breakpoints. - -### `continue (c)` -Usage: `continue` - -Starts or resumes packet processing. The switch will continue processing packet -until the next watchpoint or breakpoint event, at which point it will once again -stop all packet processing. If you forgot to set a watchpoint or breakpoint -before issuing the `continue` command you can still pause the switch by sending -an Interrupt (`Ctrl-C`) to the debugger process; you will then be able to set a -watchpoint. - -### `next (n)` -Usage: `next` - -Resumes packet processing until the next event. An event is either a field -modification or a packet entering a P4 object (e.g. a table). Unlike the -`continue` command, which will only stop the switch for watchpoints and -breakpoints set by the user, `next` will stop for all events, unless the packet -triggering this event has been explicitly excluded using the -`filter_notifications` or `skip(_all)` commands. - -### `print (p)` -Usage: `print ` - -Prints the value of a field for a given packet. The packet id needs to follow -the format `.`. If the packet id is omitted, the debugger will use the -"current packet id", which is the id of the last packet for which a notification -was received. - -### `backtrace (bt)` -Usage: `backtrace ` - -Returns the list of P4 objects that the packet is currently traversing, in -descending order. The packet id can be omitted and the "current packet id" will -be used. - -Here are examples of possible outputs: - - `parser 'parser' -> parse state 'parse_ethernet'` - - `pipeline 'ingress' -> table 'ipv4_lpm' -> action 'set_nhop'` - -### `break_packet_in` -Usage: `break_packet_in` - -When using this command, the switch will break every time a new packet is -created, unless the corresponding packet id was excluded (see -`filter_notifications`). This new packet can either be a new incoming packet -(i.e. with a new ``) or a new "copy" of the same incoming packet (i.e. same -`` but new ``). - -### `remove_packet_in` -Usage: `remove_packet_in` - -Cancels `break_packet_in`. No effect if `break_packet_in` was not previously -called. - -### `stop_packet_in` -Usage: `stop_packet_in` - -Prevents the switch from accepting any more incoming packets. Note that this -does not apply to new "copies" of a packet already being processed by the -switch. - -### `resume_packet_in` -Usage: `resume_packet_in` - -Cancels `stop_packet_in`. No effect if `stop_packet_in` was not previously -called. - -### `filter_notifications` -Usage: `filter_notifications *` -For example, -``` -filter_notifications 7.0 -filter_notifications 8.1 8.2 10.0 -filter_notifications 8 -filter_notifications 8 11.0 13 -filter_notifications -``` - -Limit the event notifications displayed by the debugger to those concerning one -of these packet ids. A packet id in the list can either be a regular full packet -id of the form `.` or simply a ``, in which case all -notifications for packets with this `` will be taken into account -(independently of the value of the ``). When `filter_notifications` is -used without any arguments (i.e. no packet ids specified), the notifications -filter will be reset and all notifications will once again be displayed by the -debugger. - -### `reset` -Usage: `reset` - -Resets all the debugger's state (e.g. watchpoints, breakpoints, notification -filters...). - -### `skip` -- experimental -Usage: `skip` - -Skips all future notifications for the "current packet id". Cannot be undone. - -### `skip_all` -- experimental -Usage: `skip_all` - -Skips all future notifications for the "current packet id" and all the packets -sharing the same ``. Cannot be undone. - -### `CLI` -- experimental -Usage: `CLI ` -For example, -``` -CLI table_dump ipv4_lpm -``` - -Opens a Thrift connection to the switch and issues a standard runtime CLI -command. Only "standard" commands are supported (no multicast PRE support). - -## Future extensions - -We are planning on supporting the following features in the future: - - support for stateful objects (meters, counters, registers) - - better P4 code integration: display current P4 code, line breakpoints - - conditional watchpoints / breakpoints (e.g. iff packet has IPv4 address - 10.0.0.1) diff --git a/bm/p4-sai/docs/simple_switch.md b/bm/p4-sai/docs/simple_switch.md deleted file mode 100644 index 521e21d16..000000000 --- a/bm/p4-sai/docs/simple_switch.md +++ /dev/null @@ -1,95 +0,0 @@ -# The BMv2 Simple Switch target - -The bmv2 framework lets developpers implement their own P4-programmable -architecture as a software switch. The simple_switch architecture is the -de-facto architecture for most users, as it is roughly equivalent to the -"abstract switch model" described in the P4_14 spec. - -This document aims at providing P4 programmers with important information -regarding the simple_switch architecture. - -## Intrinsic metadata - -Each architecture usually defines its own intrinsic metadata fields, which are -used in addition to the standard metadata fields to offer more advanced -features. In the case of simple_switch, we have two separate intrinsic metadata -headers. These headers are not strictly required by the architecture as it is -possible to write a P4 program and run it through simple_switch without them -being defined. However, their presence is required to enable some features of -simple_switch. For most of these fields, there is no strict requirement as to -the bitwidth, but we recommend that you follow our suggestions below. Some of -these intrinsic metadata fields can be accessed (read and / or write) directly, -others should only be accessed through primitive actions. - -### `intrinsic_metadata` header - -We recommend that you define and instantiate this metadata header for every P4 -program that you write for the simple_switch architecture, with the following -P4-14 code: -``` -header_type intrinsic_metadata_t { - fields { - ingress_global_timestamp : 48; - lf_field_list : 8; - mcast_grp : 16; - egress_rid : 16; - resubmit_flag : 8; - recirculate_flag : 8; - } -} -metadata intrinsic_metadata_t intrinsic_metadata; -``` -- `ingress_global_timestamp`: a timestamp, in microseconds, set when the packet -shows up on ingress. The clock is set to 0 every time the switch starts. This -field can be read directly from either pipeline (ingress and egress) but should -not be written to. -- `lf_field_list`: used to store the learn id when calling `generate_digest`; do -not access directly. -- `mcast_grp`: needed for the multicast feature. This field needs to be written -in the ingress pipeline when you wish the packet to be multicast. A value of 0 -means no multicast. This value must be one of a valid multicast group configured -through bmv2 runtime interfaces. -- `egress_rid`: needed for the multicast feature. This field is only valid in -the egress pipeline and can only be read from. It is used to uniquely identify -multicast copies of the same ingress packet. -- `resubmit_flag`: should not be accessed directly. It is set by the `resubmit` -action primitive and is required for the resubmit feature. As a remainder, -`resubmit` needs to be called in the ingress pipeline. -- `recirculate_flag`: should not be accessed directly. It is set by the -`recirculate` action primitive and is required for the recirculate feature. As a -remainder, `recirculate` needs to be called from the egress pipeline. - -### `queueing_metadata` header - -You only need to define this P4 header if you want to access queueing -information - as a remainder, the packet is queued between the ingress and -egress pipelines. Note that this header is "all or nothing". Either you do not -define it or you define it with all its fields (there are 4 of them). We -recommend that you use the following P4_14 code: -``` -header_type queueing_metadata_t { - fields { - enq_timestamp : 48; - enq_qdepth : 16; - deq_timedelta : 32; - deq_qdepth : 16; - } -} -metadata queueing_metadata_t queueing_metadata; -``` -Of course, all of these fields can only be accessed from the egress pipeline and -they are read-only. -- `enq_timestamp`: a timestamp, in microseconds, set when the packet is first -enqueued. -- `enq_qdepth`: the depth of the queue when the packet was first enqueued. -- `deq_timedelta`: the time, in microseconds, that the packet spent in the -queue. -- `deq_qdepth`: the depth of queue when the packet was dequeued. - -## Supported primitive actions - -We mostly support the standard P4_14 primitive actions. One difference is that -optional parameters are not supported in bmv2, so all parameters are always -required (see `resubmit` for example). -The full list of primitives can be seen in this [C++ source file] -(../targets/simple_switch/primitives.cpp). diff --git a/bm/p4-sai/install_sai_bm.sh b/bm/p4-sai/install_sai_bm.sh deleted file mode 100644 index c7f2ffcf4..000000000 --- a/bm/p4-sai/install_sai_bm.sh +++ /dev/null @@ -1,18 +0,0 @@ -# backup behavioral-model original configs -mv -f behavioral-model/configure.ac configure_bak.ac -mv -f behavioral-model/targets/Makefile.am Makefile_bak.am -cp -f p4-sai/bm_config/configure.ac behavioral-model/configure.ac -cp -f p4-sai/bm_config/Makefile.am behavioral-model/targets/Makefile.am - -cp -rf p4-sai behavioral-model/targets/. -# make behavioral model, p4-sai target. - -cd behavioral-model/ -./autogen.sh -./configure -make - -# return original config files -cd - -mv -f p4-sai/bm_config/Makefile_bak.am behavioral-model/targets/Makefile.am -mv -f p4-sai/bm_config/configure_bak.ac behavioral-model/configure.ac \ No newline at end of file diff --git a/bm/p4-sai/main.cpp b/bm/p4-sai/main.cpp deleted file mode 100644 index a8ca095fe..000000000 --- a/bm/p4-sai/main.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2013-present Barefoot Networks, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Antonin Bas (antonin@barefootnetworks.com) - * - */ - -/* Switch instance */ - -#include -#include -#include - -#include "simple_switch.h" - -namespace { -SimpleSwitch *simple_switch; -bm::TargetParserBasic *simple_switch_parser; -} // namespace - -namespace sswitch_runtime { -shared_ptr get_handler(SimpleSwitch *sw); -} // namespace sswitch_runtime - -int -main(int argc, char* argv[]) { - simple_switch = new SimpleSwitch(); - simple_switch_parser = new bm::TargetParserBasic(); - simple_switch_parser->add_flag_option("enable-swap", - "enable JSON swapping at runtime"); - int status = simple_switch->init_from_command_line_options( - argc, argv, simple_switch_parser); - if (status != 0) std::exit(status); - - bool enable_swap_flag = false; - if (simple_switch_parser->get_flag_option("enable-swap", &enable_swap_flag) - != bm::TargetParserBasic::ReturnCode::SUCCESS) - std::exit(1); - if (enable_swap_flag) simple_switch->enable_config_swap(); - - int thrift_port = simple_switch->get_runtime_port(); - bm_runtime::start_server(simple_switch, thrift_port); - using ::sswitch_runtime::SimpleSwitchIf; - using ::sswitch_runtime::SimpleSwitchProcessor; - bm_runtime::add_service( - "simple_switch", sswitch_runtime::get_handler(simple_switch)); - simple_switch->start_and_return(); - - while (true) std::this_thread::sleep_for(std::chrono::seconds(100)); - - return 0; -} diff --git a/bm/p4-sai/p4src/DefaultConfig.txt b/bm/p4-sai/p4src/DefaultConfig.txt deleted file mode 100644 index f3132b9d0..000000000 --- a/bm/p4-sai/p4src/DefaultConfig.txt +++ /dev/null @@ -1,66 +0,0 @@ -table_set_default table_ingress_lag action_set_l2if -// table_set_default table_port_PVID action_set_pvid 1 -// table_set_default table_port_mode table action_set_port_mode 0 -table_set_default table_port_configurations action_set_port_configurations 1 0 1514 0 0 -table_set_default table_port_ingress_l2_interface_type _drop -table_set_default table_subport_ingress_l2_interface_type _drop -table_set_default table_bridge_id_1q action_set_bridge_id_vid -table_set_default table_ingress_vlan_filtering _drop -table_set_default table_port_set_packet_vid_internal action_set_packet_vid -table_set_default table_learn_fdb action_learn_mac - -table_set_default table_drop_tagged_internal _nop -table_set_default table_drop_untagged_internal _nop -table_add table_drop_tagged_internal _drop 1 => -table_add table_drop_untagged_internal _drop 1 => - -table_set_default table_l2_trap action_set_trap_id 0xff -table_set_default table_trap_id _nop -table_set_default table_egress_clone_internal _nop -table_add table_egress_clone_internal action_cpu_encap 1 => - -table_add table_port_ingress_interface_type action_set_l2_if_type 0 => 3 0 -table_add table_port_ingress_interface_type action_set_l2_if_type 1 => 3 1 -table_add table_port_ingress_interface_type action_set_l2_if_type 2 => 3 2 -table_add table_port_ingress_interface_type action_set_l2_if_type 3 => 3 3 -table_add table_port_ingress_interface_type action_set_l2_if_type 4 => 3 4 -table_add table_port_ingress_interface_type action_set_l2_if_type 5 => 3 5 -table_add table_port_ingress_interface_type action_set_l2_if_type 6 => 3 6 -table_add table_port_ingress_interface_type action_set_l2_if_type 7 => 3 7 - -table_add table_egress_br_port_to_if action_forward_set_outIfType 0 => 0 0 -table_add table_egress_br_port_to_if action_forward_set_outIfType 1 => 1 0 -table_add table_egress_br_port_to_if action_forward_set_outIfType 2 => 2 0 -table_add table_egress_br_port_to_if action_forward_set_outIfType 3 => 3 0 -table_add table_egress_br_port_to_if action_forward_set_outIfType 4 => 4 0 -table_add table_egress_br_port_to_if action_forward_set_outIfType 5 => 5 0 -table_add table_egress_br_port_to_if action_forward_set_outIfType 6 => 6 0 -table_add table_egress_br_port_to_if action_forward_set_outIfType 7 => 7 0 - -table_add table_port_set_packet_vid_internal action_set_packet_vid 1 => -table_add table_ingress_vlan_filtering _nop 0 1 => -table_add table_ingress_vlan_filtering _nop 1 1 => -table_add table_ingress_vlan_filtering _nop 2 1 => -table_add table_ingress_vlan_filtering _nop 3 1 => -table_add table_ingress_vlan_filtering _nop 4 1 => -table_add table_ingress_vlan_filtering _nop 5 1 => -table_add table_ingress_vlan_filtering _nop 6 1 => -table_add table_ingress_vlan_filtering _nop 7 1 => - -table_set_default table_egress_vlan_filtering _drop -table_add table_egress_vlan_filtering _nop 0 1 => - -table_set_default table_xSTP_instance action_set_stp_id 1 - -table_set_default table_mc_lookup_mode action_set_mcast_lookup_mode 0 -table_set_default table_mc_fdb action_set_mc_fdb_miss -table_set_default table_mc_l2_sg_g action_set_mc_fdb_miss - - -table_set_default table_fdb action_set_unknown_unicast 1 -table_set_default table_broadcast action_forward_mc_set_if_list 1 0 -table_set_default table_flood action_forward_mc_set_if_list 1 0 - -mc_node_create 0 0 1 2 3 4 5 6 7 -mc_mgrp_create 1 -mc_node_associate 1 0 \ No newline at end of file diff --git a/bm/p4-sai/p4src/DefaultConfigMirror.txt b/bm/p4-sai/p4src/DefaultConfigMirror.txt deleted file mode 100644 index 81bf2971c..000000000 --- a/bm/p4-sai/p4src/DefaultConfigMirror.txt +++ /dev/null @@ -1 +0,0 @@ -mirroring_add 8 8 \ No newline at end of file diff --git a/bm/p4-sai/p4src/actions.p4 b/bm/p4-sai/p4src/actions.p4 deleted file mode 100644 index 546babce3..000000000 --- a/bm/p4-sai/p4src/actions.p4 +++ /dev/null @@ -1,173 +0,0 @@ -#include "defines.p4" -// primitives -action _drop() { - drop(); -} - -action _nop() { - no_op(); -} - -// ingres L2 -action action_set_lag_l2if(in bit is_lag, in bit<6> l2_if) { // , in bit<16> lag_id - ingress_metadata.is_lag = is_lag; - // ingress_metadata.lag_id = lag_id; - ingress_metadata.l2_if = l2_if; -} - -action action_set_trap_id(in bit<11> trap_id) { - ingress_metadata.trap_id = trap_id; -} - -action action_copy_to_cpu() { - clone_ingress_pkt_to_egress(COPY_TO_CPU_MIRROR_ID, redirect_FL); -} - -action action_trap_to_cpu() { - clone_ingress_pkt_to_egress(COPY_TO_CPU_MIRROR_ID, redirect_FL); - drop(); -} - -// ingres L2 -action action_set_l2if() { - ingress_metadata.l2_if =standard_metadata.ingress_port; -} - -action action_set_packet_vid(){ - ingress_metadata.vid = vlan.vid; -} - -action action_set_port_configurations(in bit<12> pvid, in bit bind_mode, in bit<32> mtu, in bit drop_tagged, in bit drop_untagged) { - ingress_metadata.vid = pvid; - ingress_metadata.bind_mode = bind_mode; - ingress_metadata.mtu = mtu; - ingress_metadata.drop_tagged = drop_tagged; - ingress_metadata.drop_untagged = drop_untagged; -} - -action action_set_l2_if_type(in bit<2> l2_if_type, in bit<8> bridge_port){ - // L2_BRIDGE_PORT_WDT - ingress_metadata.l2_if_type = l2_if_type; - ingress_metadata.bridge_port = bridge_port; -} - -action action_set_bridge_id(in bit<12> bridge_id){ - ingress_metadata.bridge_id = bridge_id; -} - - -action action_set_bridge_id_vid(){ - ingress_metadata.bridge_id =ingress_metadata.vid; -} - -action action_set_bridge_id_with_vid() { - ingress_metadata.bridge_id = ingress_metadata.vid; -} - -action action_set_mcast_lookup_mode(in bit<2> mcast_mode){ - ingress_metadata.mcast_mode =mcast_mode; -} - -action action_set_stp_state(in bit<3> stp_state){//need to enforce STP state - ingress_metadata.stp_state = stp_state; -} - -action action_set_stp_id(in bit<3> stp_id){ - ingress_metadata.stp_id = stp_id; -} - -action action_go_to_in_l3_if_table(){ - no_op(); -} -//action action_go_to_fdb_table(){ -// no_op(); -//} - -//modify_field (ingress_metadata.,); - -// L2 -action action_learn_mac() { - ingress_metadata.trap_id = MAC_LEARN_RECEIVER; //TODO, should this be configurable to support hostif interface(?) - clone_ingress_pkt_to_egress(COPY_TO_CPU_MIRROR_ID, redirect_FL); -} - -action action_set_egress_br_port(in bit<8> br_port){ - egress_metadata.bridge_port = br_port; -} - -action action_set_vlan(in bit<12> vid) { - ingress_metadata.vid = vid; -} - -action action_forward_set_outIfType(in bit<6> out_if,in bit<1> out_if_type){ - egress_metadata.out_if = out_if; - egress_metadata.out_if_type = out_if_type; - standard_metadata.egress_spec = out_if; -} - -action action_set_unknown_unicast(in bit<1> unknown_unicast) { - ingress_metadata.unknown_unicast = unknown_unicast; -} - -//action action_ste_fdb_miss(in bit mc_fdb_miss){ -// ingress_metadata.mc_fdb_miss = mc_fdb_miss; -//} - -action action_forward(in bit<6> br_port) { - // standard_metadata.egress_spec = port; //need to map bride port to interface - egress_metadata.bridge_port = br_port; -} - -action action_forward_mc_set_if_list(in bit<16> mcast_grp, in bit<1> go_to_router){ - // TODO add set egress if list - modify_field(intrinsic_metadata.mcast_grp, mcast_grp); - modify_field(ingress_metadata.go_to_router, go_to_router); -} - -action action_set_egress_stp_state(in bit<2> stp_state){ - egress_metadata.stp_state = stp_state; -} - -action action_forward_vlan_untag(){ - ethernet.etherType = vlan.etherType; - remove_header(vlan); -} - -action action_forward_vlan_tag(in bit<3> pcp, in bit cfi, in bit<12> vid){ - add_header(vlan); - vlan.pcp = pcp; - vlan.cfi = cfi; - vlan.vid = vid; - vlan.etherType = ethernet.etherType; - ethernet.etherType = VLAN_TYPE; - // egress_metadata.tag_mode = tag_mode; -} - -action action_set_lag_hash_size(in bit<6> lag_size) { - modify_field_with_hash_based_offset(egress_metadata.hash_val, 0, lag_hash, lag_size); -} - -action action_set_out_port(in bit<6> port){ - standard_metadata.egress_spec = port; -} - -//action broadcast() { -// modify_field(egress_metadata.mcast_grp, 1); -//} - -action set_egr(in bit<6> egress_spec) { - modify_field(standard_metadata.egress_spec, egress_spec); -} - -// mc -action action_set_mc_fdb_miss() { - ingress_metadata.mc_fdb_miss=1; -} - -action action_cpu_encap() { - add_header(cpu_header); - cpu_header.ingress_port = standard_metadata.ingress_port; - cpu_header.trap_id = ingress_metadata.trap_id; - cpu_header.bridge_id = ingress_metadata.bridge_id; - cpu_header.bridge_port = ingress_metadata.bridge_port; -} \ No newline at end of file diff --git a/bm/p4-sai/p4src/defines.p4 b/bm/p4-sai/p4src/defines.p4 deleted file mode 100644 index d37744b0a..000000000 --- a/bm/p4-sai/p4src/defines.p4 +++ /dev/null @@ -1,55 +0,0 @@ -// defines - -// genreal -#define TRUE 1 -#define FALSE 0 -#define MAC_LEARN_RECEIVER 512 - -// Mirroring and traps -#define COPY_TO_CPU_MIRROR_ID 8 - -// header/metadata fields width -#define LAG_WDT 16 -#define L2_BRIDGE_NUM_WDT 3 // TODO -#define L2_BRIDGE_PORT_WDT 8 // TODO -#define VID_WDT 12 -#define PACKET_TYPE_WDT 2 // TODO - -// table size -#define FDB_TABLE_SIZE 512 // TODO - -//phy -#define PHY_PORT_NUM 64 // TODO -#define PHY_PORT_NUM_WDT 6 // TODO - - -//port -#define PORT_MODE_SUBPORT 0x1 -#define PORT_MODE_PORT 0x0 - -//bridge ports -//#define 1Q_BRIDGE_PORT_ROUTER 100 - -// L2 -// L2_IF_TYPE -#define L2_ROUTER_TYPE 0x1 -#define L2_1D_BRIDGE 0x2 -#define L2_1Q_BRIDGE 0x3 - - -// STP STATE -#define STP_FORWARDING 1 // TODO -#define STP_DISCARDING 0 // TODO -#define TAG - - -#define MAC_BASE_MC_LOOKUP 0 -#define SG_IP_BASE_MC_LOOKUP 2 -#define G_IP_BASE_MC_LOOKUP 1 //need to add - - -// OUT_IF TYPE -#define OUT_IF_IS_PORT 0 -#define OUT_IF_IS_LAG 1 // TODO -#define OUT_IF_IS_ROUTER 2 // TODO - diff --git a/bm/p4-sai/p4src/field_lists.p4 b/bm/p4-sai/p4src/field_lists.p4 deleted file mode 100644 index c906d1cdc..000000000 --- a/bm/p4-sai/p4src/field_lists.p4 +++ /dev/null @@ -1,47 +0,0 @@ -field_list mac_learn_digest { - ethernet.srcAddr; - ingress_metadata.bridge_id; // TODO - standard_metadata.ingress_port; // TODO -} - -field_list_calculation ipv4_checksum { - input { - ipv4_checksum_list; - } - algorithm : csum16; - output_width : 16; -} - -field_list ipv4_checksum_list { - ipv4.version; - ipv4.ihl; - ipv4.diffserv; - ipv4.ipv4_length; - ipv4.id; - ipv4.flags; - ipv4.offset; - ipv4.ttl; - ipv4.protocol; - ipv4.srcAddr; - ipv4.dstAddr; -} - -field_list lag_hash_fieldlist { - ethernet.srcAddr; - ipv4.id; -} - -field_list_calculation lag_hash { - input { - lag_hash_fieldlist; - } - algorithm : xor8; //TODO: change to lag_hash - output_width : 1; //TODO: LOG2(NUM_OF_PORTS) -} - -field_list redirect_FL { - standard_metadata; - ingress_metadata.trap_id; - ingress_metadata.bridge_id; - ingress_metadata.bridge_port; -} \ No newline at end of file diff --git a/bm/p4-sai/p4src/headers.p4 b/bm/p4-sai/p4src/headers.p4 deleted file mode 100644 index 75a62b0cb..000000000 --- a/bm/p4-sai/p4src/headers.p4 +++ /dev/null @@ -1,124 +0,0 @@ -#include "defines.p4" - -header_type ethernet_t { - fields { - bit<48> dstAddr; - bit<48> srcAddr; - bit<16> etherType; - } -} -header_type vlan_t { - fields { - bit<3> pcp; - bit cfi; - bit<12> vid; - bit<16> etherType; - } - //length 4; - //max_length 4; -} -header_type ipv4_t { - fields { - bit<4> version; - bit<4> ihl; - bit<8> diffserv; - bit<16> ipv4_length; - bit<16> id; - bit<3> flags; - bit<13> offset; - bit<8> ttl; - bit<8> protocol; - bit<16> checksum; - bit<32> srcAddr; - bit<32> dstAddr; - } - //length ihl * 4; - //max_length 32; -} -header_type tcp_t { - fields { - bit<16> srcPort; - bit<16> dstPort; - bit<32> seqNo; - bit<32> ackNo; - bit<4> dataOffset; - bit<4> res; - bit<8> flags; - bit<16> window; - bit<16> checksum; - bit<16> urgentPtr; - } -} - -header_type udp_t { - fields { - bit<16> srcPort; - bit<16> dstPort; - bit<16> length_; - bit<16> checksum; - } -} - - -header_type ingress_metadata_t { - fields { - bit<6> port; //PHY_PORT_NUM_WDT - bit<6> l2_if; //PHY_PORT_NUM_WDT - bit is_tagged; - bit is_lag; - bit<16> lag_id; // LAG_WDT - bit bind_mode; - bit<2> l2_if_type; - bit<8> bridge_port; //L2_BRIDGE_PORT_WDT - bit<12> bridge_id; //L2_BRIDGE_NUM_WDT - bit<2> stp_state; - bit<3> stp_id; // TODO size? - bit<12> vid; - bit<1> unknown_unicast; - bit<2> mcast_mode; - bit<1> mc_fdb_miss; - bit ipmc; - bit isip; - bit go_to_router; - bit<32> mtu; - bit drop_tagged; - bit drop_untagged; - bit<11> trap_id; - } -} - - - -header_type egress_metadata_t { - fields { - bit out_if_type; - bit<6> out_if; // PHY_PORT_NUM_WDT TODO remove? same as standard_metadata.egress_spec? - bit<2> stp_state; // same as ingress? duplication? - bit tag_mode; - bit<6> hash_val;// TODO for egress lag table, when it is set? - bit<4> mcast_grp; - bit<8> bridge_port; //L2_BRIDGE_PORT_WDT - } -} - -header_type intrinsic_metadata_t { - fields { - bit <48> ingress_global_timestamp; - bit <8> lf_field_list; - bit <16> mcast_grp; - bit <16> egress_rid; - bit <8> resubmit_flag; - bit <8> recirculate_flag; - } -} - -metadata intrinsic_metadata_t intrinsic_metadata; - -header_type cpu_header_t { - fields { - bit<16> trap_id; - bit<16> bridge_id; - bit<8> ingress_port; - bit<8> bridge_port; - } -} \ No newline at end of file diff --git a/bm/p4-sai/p4src/parser.p4 b/bm/p4-sai/p4src/parser.p4 deleted file mode 100644 index c78de8e64..000000000 --- a/bm/p4-sai/p4src/parser.p4 +++ /dev/null @@ -1,73 +0,0 @@ -// Parser Defintion file. -// Defines how stream of bytes -// that enters the switch, -// get parsed into meaningfull packets. - -#define TCP_PROTOCOL_NUM 0x06 -#define UDP_PROTOCOL_NUM 0x11 -#define VLAN_TYPE 0x8100 -#define IPV4_TYPE 0x0800 - - -// parser starts here -// check if needs to add clone_to_cpu encapsulation -parser start { - return select(current(0, 64)) { - 0 : parse_cpu_header; - default: parse_ethernet; - } -} - - -parser parse_cpu_header { - extract(cpu_header); - return parse_ethernet; -} - -// ethernet parser - decide next layer according the ethertype -parser parse_ethernet { - extract(ethernet); - set_metadata(ingress_metadata.is_tagged,0); - return select(latest.etherType) { - VLAN_TYPE : parse_vlan; - IPV4_TYPE : parse_ipv4; - default: ingress; - } -} - -parser parse_vlan { - extract(vlan); - set_metadata(ingress_metadata.is_tagged, (bit)(vlan.vid >> 11) | (bit)(vlan.vid >> 10) | (bit)(vlan.vid >> 9) | (bit)(vlan.vid >> 8) | (bit)(vlan.vid >> 7) | (bit)(vlan.vid >> 6) | (bit)(vlan.vid >> 5) | (bit)(vlan.vid >> 4) | (bit)(vlan.vid >> 3) | (bit)(vlan.vid >> 2) | (bit)(vlan.vid >> 1) | (bit)(vlan.vid)); //if vid==0 not tagged. TODO: need to do this better (maybe add parser support for casting boolean) - return select(latest.etherType) { - IPV4_TYPE : parse_ipv4; - default: ingress; - } -} - -// IPv4 parser, decide next layer according to protocol field -parser parse_ipv4 { - extract(ipv4); - set_metadata(ingress_metadata.isip,1); - return post_parse_ipv4 ; -} - -parser post_parse_ipv4 { - return select(ipv4.protocol) { - TCP_PROTOCOL_NUM : parse_tcp; - UDP_PROTOCOL_NUM : parse_udp; - default : ingress; - } -} - - -// TCP parser, next layer are irrelvant for us, thus not included -// (cosidered payload data). -parser parse_udp { - extract(udp); - return ingress; -} - -parser parse_tcp { - extract(tcp); - return ingress; -} diff --git a/bm/p4-sai/p4src/sai.p4 b/bm/p4-sai/p4src/sai.p4 deleted file mode 100644 index 1c2400ff7..000000000 --- a/bm/p4-sai/p4src/sai.p4 +++ /dev/null @@ -1,170 +0,0 @@ -// This is P4 sample source for sai -// Fill in these files with your P4 code - - -// includes -#include "headers.p4" -#include "parser.p4" -#include "tables.p4" -#include "actions.p4" -#include "defines.p4" -#include "field_lists.p4" - -// headers -header ethernet_t ethernet; -header vlan_t vlan; -header ipv4_t ipv4; -header tcp_t tcp; -header udp_t udp; -header cpu_header_t cpu_header; - -// metadata -metadata ingress_metadata_t ingress_metadata; -metadata egress_metadata_t egress_metadata; - -control ingress { - // phy - control_ingress_port(); //bridging - if((ingress_metadata.l2_if_type == L2_1Q_BRIDGE) or (ingress_metadata.l2_if_type == L2_1D_BRIDGE)) { - control_bridge(); - } - - // router - if ((ingress_metadata.l2_if_type == L2_ROUTER_TYPE) or (ingress_metadata.go_to_router == 1)) { - control_router_flow(); - } - - //todo: bridge after router -} - -control control_bridge { - if(ingress_metadata.l2_if_type == L2_1D_BRIDGE){ - control_1d_bridge_flow(); - } else{ - control_1q_bridge_flow(); - } - - // control_learn_fdb(); - if((ethernet.dstAddr&0x010000000000)==0x0){ //unicast - control_unicast_fdb(); - } else if(ethernet.dstAddr==0xffffffffffff){ //broadcast - control_bc_fdb(); - } else { //multicast - control_mc_fdb(); - } -} - -control control_ingress_port{ - apply(table_ingress_lag); //TODO: rename table? - apply(table_port_configurations); - // apply(table_accepted_frame_type); - if (ingress_metadata.is_tagged==1) { - // apply(table_port_PVID); - // } else { - apply(table_port_set_packet_vid_internal); - apply(table_drop_tagged_internal); - } else { - apply(table_drop_untagged_internal); - } - // apply(table_port_mode); - apply(table_l2_trap); - apply(table_trap_id); //TODO: move this - // apply(table_check_port_mtu; //TODO - //apply(table_ingress_acl); // TODO - if(ingress_metadata.bind_mode == PORT_MODE_PORT) - apply(table_port_ingress_interface_type); - else - apply(table_subport_ingress_interface_type); -} - -control control_1d_bridge_flow{ - apply(table_bridge_id_1d); - apply(table_vbridge_STP); -} - -control control_1q_bridge_flow{ - apply(table_bridge_id_1q); - apply(table_ingress_vlan_filtering); - apply(table_xSTP_instance); - apply(table_xSTP); -} - -control control_router_flow{ - // TODO -} - -// control control_learn_fdb{ -// apply(table_learn_fdb); -// } - -control control_unicast_fdb{ - apply(table_learn_fdb); //TODO: is this only relevant for unicast? - apply(table_l3_interface){//should be for unicast only TDB - miss{ - apply(table_fdb) { - miss { - apply(table_flood); - } - } - } - } -} - -control control_bc_fdb{ - apply(table_broadcast); -} - -control control_mc_fdb{ - apply(table_mc_lookup_mode); - //non ip multicast - if((ingress_metadata.isip==0) or (ingress_metadata.mcast_mode==MAC_BASE_MC_LOOKUP))//non ip or multicast mode == FDB - apply(table_mc_fdb); - else if((ingress_metadata.isip==1) and (ingress_metadata.mcast_mode==SG_IP_BASE_MC_LOOKUP)) - apply(table_mc_l2_sg_g); - //TBD add * G table - //FDB miss flow - if(ingress_metadata.mc_fdb_miss==1) - { - //non ip - if(ingress_metadata.isip==1) - apply(table_unknown_multicast_ipv4); - else - apply(table_unknown_multicast_nonip); - - } -} - - -control egress{ - if(ingress_metadata.l2_if_type == L2_1D_BRIDGE){ - apply(table_egress_vbridge_STP); - } - if(ingress_metadata.l2_if_type == L2_1Q_BRIDGE){ - apply(table_egress_xSTP); - apply(table_egress_vlan_filtering); - } - - apply(table_egress_br_port_to_if); - if(ingress_metadata.l2_if_type == L2_1D_BRIDGE){ - apply(table_egress_set_vlan); - } - apply(table_egress_vlan_tag); - - if (egress_metadata.out_if_type == OUT_IF_IS_LAG) { - apply(table_lag_hash); - apply(table_egress_lag); - } - else if(egress_metadata.out_if == OUT_IF_IS_ROUTER){ - control_1q_egress_uni_router(); - } - //apply(egress_acl); // TODO - //if((egress_metadata.stp_state == STP_FORWARDING) and (egress_metadata.tag_mode == TAG) ){ - // TODO: go to egress - //} - apply(table_egress_clone_internal); -} - -control control_1q_egress_uni_router { - -} - diff --git a/bm/p4-sai/p4src/tables.p4 b/bm/p4-sai/p4src/tables.p4 deleted file mode 100644 index 65a9be5f9..000000000 --- a/bm/p4-sai/p4src/tables.p4 +++ /dev/null @@ -1,312 +0,0 @@ -#include "defines.p4" - -// PORT -table table_ingress_lag { - reads { - standard_metadata.ingress_port : exact; - } - actions {action_set_lag_l2if;action_set_l2if;}//mattyk update - size : PHY_PORT_NUM; -} - -table table_drop_tagged_internal { - reads { - ingress_metadata.drop_tagged : exact; - } - actions {_drop;_nop;} - size: 1; -} -table table_drop_untagged_internal { - reads { - ingress_metadata.drop_untagged : exact; - } - actions {_drop;_nop;} - size: 1; -} - -table table_l2_trap { - reads { - ethernet.dstAddr : exact; - } - actions {action_set_trap_id;} -} - -table table_trap_id { //TODO: move this? - reads { - ingress_metadata.trap_id : exact; - } - actions {_drop;_nop;action_copy_to_cpu;action_trap_to_cpu;} -} - -table table_port_configurations { - reads { - ingress_metadata.l2_if : exact; - } - actions {action_set_port_configurations;} -} - -table table_port_set_packet_vid_internal { - reads { - ingress_metadata.is_tagged : exact; - } - actions {action_set_packet_vid;} - size : 1; -} - - -table table_port_ingress_interface_type {// should be - reads { - ingress_metadata.l2_if: exact; - } - actions {action_set_l2_if_type; _drop;} -} - -table table_subport_ingress_interface_type { - reads { - ingress_metadata.l2_if : exact; - ingress_metadata.vid : exact; - } - actions {action_set_l2_if_type; _drop;} -} - - -//----------- -// ingress 1d bridge -//----------- -table table_bridge_id_1d { - reads { - ingress_metadata.bridge_port : exact; - } - actions {action_set_bridge_id; _drop;} -} - -table table_vbridge_STP { - reads { - ingress_metadata.bridge_port : exact; - } - actions {action_set_stp_state;} - //size : 1; TODO -} -//----------- -// ingress 1q bridge -//----------- -table table_bridge_id_1q { - reads { - ingress_metadata.vid : exact; - } - actions {action_set_bridge_id;action_set_bridge_id_vid;}//why drop -} - -table table_ingress_vlan_filtering{ - reads{ - ingress_metadata.bridge_port : exact; - ingress_metadata.vid : exact; - } - actions{_drop;_nop;} -} - -table table_mc_lookup_mode{ - reads{ - ingress_metadata.vid : exact; - } - actions{action_set_mcast_lookup_mode;} -} - -table table_xSTP_instance{ - reads{ - ingress_metadata.vid : exact; - } - actions{action_set_stp_id;} -} - -table table_xSTP { - reads { - ingress_metadata.bridge_port : exact; - ingress_metadata.stp_id : exact; - } - actions {action_set_stp_state;_drop;} - //size : 1; TODO -} - -//----------- -// fdb -//----------- - -table table_learn_fdb { - reads { - ethernet.srcAddr : exact; - ingress_metadata.bridge_id : exact; - } - actions {_nop;action_learn_mac;} - //size : 1; TODO -} - -table table_l3_interface { - reads { - ethernet.dstAddr : exact; - ingress_metadata.bridge_id : exact; - } - actions {action_set_egress_br_port;}//action_go_to_fdb_table;} - //size : 1; TODO -} - -//--------- -// unicast: -//--------- -table table_fdb { // TODO ask if can be melded into l3 interface table... - reads { - ethernet.dstAddr : exact; - ingress_metadata.bridge_id : exact; - } - actions {action_set_egress_br_port;action_set_unknown_unicast;} - size : FDB_TABLE_SIZE; -} - -//table table_l3_if{ // TODO - definition -// reads{ -// ethernet.dstAddr : exact; -// ingress_metadata.bridge_id : exact; -// } -// actions{action_forward;}//action_go_to_fdb_table;} -//} - -//--------- -// multicast: -//--------- -table table_mc_fdb{ - reads{ - ethernet.dstAddr : exact; - ingress_metadata.bridge_id : exact; - } - actions{action_forward_mc_set_if_list;action_set_mc_fdb_miss;} -} - -table table_mc_l2_sg_g{// IP MC - reads{ - ingress_metadata.bridge_id : exact; - ipv4.srcAddr : exact; - ipv4.dstAddr : exact; - } - actions{action_forward_mc_set_if_list;action_set_mc_fdb_miss;} -} - -table table_unknown_multicast_nonip{ - reads{ - ingress_metadata.bridge_id : exact; - } - actions{action_forward_mc_set_if_list;} -} - -table table_unknown_multicast_ipv4{ - reads{ - ingress_metadata.bridge_id : exact; - } - actions{action_forward_mc_set_if_list;} -} - -//table table_unknown_multicast_ipv6{ -// reads{ -// ingress_metadata.bridge_id : exact; -// } -// actions{action_forward_mc_set_if_list;} -//} - -table table_broadcast{ - reads{ - ingress_metadata.bridge_id : exact; - } - actions{action_forward_mc_set_if_list;} -} - -table table_flood { - reads { - ingress_metadata.bridge_id : exact; - } - actions{action_forward_mc_set_if_list;} -} - -//----------- -// egress 1d bridge -//----------- - -table table_egress_vbridge_STP { - reads { - egress_metadata.bridge_port : exact; - } - actions {action_set_egress_stp_state; _drop;} - //size : 1; // TODO -} - -table table_egress_vlan_tag { - reads { - egress_metadata.out_if : exact; - ingress_metadata.vid : exact; - vlan : valid; - } - actions {action_forward_vlan_tag; action_forward_vlan_untag; _drop;_nop;} - //size : 1; // TODO -} - -//----------- -// egress 1q bridge -//----------- - -table table_egress_xSTP{ - reads{ - egress_metadata.bridge_port : exact; - ingress_metadata.stp_id : exact; - } - actions {action_set_egress_stp_state; _drop;} -} - -table table_egress_vlan_filtering { - reads{ - egress_metadata.bridge_port : exact; - ingress_metadata.vid : exact; - } - actions{_drop; _nop; } -} - -// -------------- -// egress bridge -// -------------- -table table_egress_br_port_to_if { - reads { - egress_metadata.bridge_port : exact; - } - actions {action_forward_set_outIfType; _drop;} -} - -table table_egress_set_vlan { - reads { - egress_metadata.bridge_port : exact; - } - actions {action_set_vlan;} -} - -//----------- -// egress lag/phy -//----------- -table table_lag_hash { //TODO: FW flow to add ports as lag, should edit this table with lag size - reads { - egress_metadata.out_if : exact; - } - actions {action_set_lag_hash_size;} -} - -table table_egress_lag { - reads { - egress_metadata.out_if : exact; - egress_metadata.hash_val : exact; - } - actions {action_set_out_port; _drop;} - //size : 1; // TODO -} - -table table_egress_clone_internal { - reads { - standard_metadata.instance_type : exact; - } - actions {_nop; action_cpu_encap;} - // size: 16; -} \ No newline at end of file diff --git a/bm/p4-sai/primitives.cpp b/bm/p4-sai/primitives.cpp deleted file mode 100644 index 63280332a..000000000 --- a/bm/p4-sai/primitives.cpp +++ /dev/null @@ -1,364 +0,0 @@ -/* Copyright 2013-present Barefoot Networks, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Antonin Bas (antonin@barefootnetworks.com) - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -template -using ActionPrimitive = bm::ActionPrimitive; - -using bm::Data; -using bm::Field; -using bm::Header; -using bm::MeterArray; -using bm::CounterArray; -using bm::RegisterArray; -using bm::NamedCalculation; -using bm::HeaderStack; - -class modify_field : public ActionPrimitive { - void operator ()(Data &dst, const Data &src) { - bm::core::assign()(dst, src); - } -}; - -REGISTER_PRIMITIVE(modify_field); - -class modify_field_rng_uniform - : public ActionPrimitive { - void operator ()(Data &f, const Data &b, const Data &e) { - // TODO(antonin): a little hacky, fix later if there is a need using GMP - // random fns - using engine = std::default_random_engine; - using hash = std::hash; - static thread_local engine generator(hash()(std::this_thread::get_id())); - using distrib64 = std::uniform_int_distribution; - distrib64 distribution(b.get_uint64(), e.get_uint64()); - f.set(distribution(generator)); - } -}; - -REGISTER_PRIMITIVE(modify_field_rng_uniform); - -class add_to_field : public ActionPrimitive { - void operator ()(Field &f, const Data &d) { - f.add(f, d); - } -}; - -REGISTER_PRIMITIVE(add_to_field); - -class subtract_from_field : public ActionPrimitive { - void operator ()(Field &f, const Data &d) { - f.sub(f, d); - } -}; - -REGISTER_PRIMITIVE(subtract_from_field); - -class add : public ActionPrimitive { - void operator ()(Data &f, const Data &d1, const Data &d2) { - f.add(d1, d2); - } -}; - -REGISTER_PRIMITIVE(add); - -class subtract : public ActionPrimitive { - void operator ()(Data &f, const Data &d1, const Data &d2) { - f.sub(d1, d2); - } -}; - -REGISTER_PRIMITIVE(subtract); - -class bit_xor : public ActionPrimitive { - void operator ()(Data &f, const Data &d1, const Data &d2) { - f.bit_xor(d1, d2); - } -}; - -REGISTER_PRIMITIVE(bit_xor); - -class bit_or : public ActionPrimitive { - void operator ()(Data &f, const Data &d1, const Data &d2) { - f.bit_or(d1, d2); - } -}; - -REGISTER_PRIMITIVE(bit_or); - -class bit_and : public ActionPrimitive { - void operator ()(Data &f, const Data &d1, const Data &d2) { - f.bit_and(d1, d2); - } -}; - -REGISTER_PRIMITIVE(bit_and); - -class shift_left : - public ActionPrimitive { - void operator ()(Data &f, const Data &d1, const Data &d2) { - f.shift_left(d1, d2); - } -}; - -REGISTER_PRIMITIVE(shift_left); - -class shift_right : - public ActionPrimitive { - void operator ()(Data &f, const Data &d1, const Data &d2) { - f.shift_right(d1, d2); - } -}; - -REGISTER_PRIMITIVE(shift_right); - -class drop : public ActionPrimitive<> { - void operator ()() { - get_field("standard_metadata.egress_spec").set(511); - if (get_phv().has_field("intrinsic_metadata.mcast_grp")) { - get_field("intrinsic_metadata.mcast_grp").set(0); - } - } -}; - -REGISTER_PRIMITIVE(drop); - -class exit_ : public ActionPrimitive<> { - void operator ()() { - get_packet().mark_for_exit(); - } -}; - -REGISTER_PRIMITIVE_W_NAME("exit", exit_); - -class generate_digest : public ActionPrimitive { - void operator ()(const Data &receiver, const Data &learn_id) { - // discared receiver for now - (void) receiver; - get_field("intrinsic_metadata.lf_field_list").set(learn_id); - } -}; - -REGISTER_PRIMITIVE(generate_digest); - -class add_header : public ActionPrimitive

{ - void operator ()(Header &hdr) { - // TODO(antonin): reset header to 0? - if (!hdr.is_valid()) { - hdr.reset(); - hdr.mark_valid(); - // updated the length packet register (register 0) - auto &packet = get_packet(); - packet.set_register(0, packet.get_register(0) + hdr.get_nbytes_packet()); - } - } -}; - -REGISTER_PRIMITIVE(add_header); - -class add_header_fast : public ActionPrimitive
{ - void operator ()(Header &hdr) { - hdr.mark_valid(); - } -}; - -REGISTER_PRIMITIVE(add_header_fast); - -class remove_header : public ActionPrimitive
{ - void operator ()(Header &hdr) { - if (hdr.is_valid()) { - // updated the length packet register (register 0) - auto &packet = get_packet(); - packet.set_register(0, packet.get_register(0) - hdr.get_nbytes_packet()); - hdr.mark_invalid(); - } - } -}; - -REGISTER_PRIMITIVE(remove_header); - -class copy_header : public ActionPrimitive
{ - void operator ()(Header &dst, const Header &src) { - bm::core::assign_header()(dst, src); - } -}; - -REGISTER_PRIMITIVE(copy_header); - -/* standard_metadata.clone_spec will contain the mirror id (16 LSB) and the - field list id to copy (16 MSB) */ -class clone_ingress_pkt_to_egress - : public ActionPrimitive { - void operator ()(const Data &clone_spec, const Data &field_list_id) { - Field &f_clone_spec = get_field("standard_metadata.clone_spec"); - f_clone_spec.shift_left(field_list_id, 16); - f_clone_spec.add(f_clone_spec, clone_spec); - } -}; - -REGISTER_PRIMITIVE(clone_ingress_pkt_to_egress); - -class clone_egress_pkt_to_egress - : public ActionPrimitive { - void operator ()(const Data &clone_spec, const Data &field_list_id) { - Field &f_clone_spec = get_field("standard_metadata.clone_spec"); - f_clone_spec.shift_left(field_list_id, 16); - f_clone_spec.add(f_clone_spec, clone_spec); - } -}; - -REGISTER_PRIMITIVE(clone_egress_pkt_to_egress); - -class resubmit : public ActionPrimitive { - void operator ()(const Data &field_list_id) { - if (get_phv().has_field("intrinsic_metadata.resubmit_flag")) { - get_phv().get_field("intrinsic_metadata.resubmit_flag") - .set(field_list_id); - } - } -}; - -REGISTER_PRIMITIVE(resubmit); - -class recirculate : public ActionPrimitive { - void operator ()(const Data &field_list_id) { - if (get_phv().has_field("intrinsic_metadata.recirculate_flag")) { - get_phv().get_field("intrinsic_metadata.recirculate_flag") - .set(field_list_id); - } - } -}; - -REGISTER_PRIMITIVE(recirculate); - -class modify_field_with_hash_based_offset - : public ActionPrimitive { - void operator ()(Data &dst, const Data &base, - const NamedCalculation &hash, const Data &size) { - uint64_t v = - (hash.output(get_packet()) % size.get()) + base.get(); - dst.set(v); - } -}; - -REGISTER_PRIMITIVE(modify_field_with_hash_based_offset); - -class no_op : public ActionPrimitive<> { - void operator ()() { - // nothing - } -}; - -REGISTER_PRIMITIVE(no_op); - -class execute_meter - : public ActionPrimitive { - void operator ()(MeterArray &meter_array, const Data &idx, Field &dst) { - dst.set(meter_array.execute_meter(get_packet(), idx.get_uint())); - } -}; - -REGISTER_PRIMITIVE(execute_meter); - -class count : public ActionPrimitive { - void operator ()(CounterArray &counter_array, const Data &idx) { - counter_array.get_counter(idx.get_uint()).increment_counter(get_packet()); - } -}; - -REGISTER_PRIMITIVE(count); - -class register_read - : public ActionPrimitive { - void operator ()(Field &dst, const RegisterArray &src, const Data &idx) { - dst.set(src[idx.get_uint()]); - } -}; - -REGISTER_PRIMITIVE(register_read); - -class register_write - : public ActionPrimitive { - void operator ()(RegisterArray &dst, const Data &idx, const Data &src) { - dst[idx.get_uint()].set(src); - } -}; - -REGISTER_PRIMITIVE(register_write); - -class push : public ActionPrimitive { - void operator ()(HeaderStack &stack, const Data &num) { - stack.push_front(num.get_uint()); - } -}; - -REGISTER_PRIMITIVE(push); - -class pop : public ActionPrimitive { - void operator ()(HeaderStack &stack, const Data &num) { - stack.pop_front(num.get_uint()); - } -}; - -REGISTER_PRIMITIVE(pop); - -// I cannot name this "truncate" and register it with the usual -// REGISTER_PRIMITIVE macro, because of a name conflict: -// -// In file included from /usr/include/boost/config/stdlib/libstdcpp3.hpp:77:0, -// from /usr/include/boost/config.hpp:44, -// from /usr/include/boost/cstdint.hpp:36, -// from /usr/include/boost/multiprecision/number.hpp:9, -// from /usr/include/boost/multiprecision/gmp.hpp:9, -// from ../../src/bm_sim/include/bm_sim/bignum.h:25, -// from ../../src/bm_sim/include/bm_sim/data.h:32, -// from ../../src/bm_sim/include/bm_sim/fields.h:28, -// from ../../src/bm_sim/include/bm_sim/phv.h:34, -// from ../../src/bm_sim/include/bm_sim/actions.h:34, -// from primitives.cpp:21: -// /usr/include/unistd.h:993:12: note: declared here -// extern int truncate (const char *__file, __off_t __length) -class truncate_ : public ActionPrimitive { - void operator ()(const Data &truncated_length) { - get_packet().truncate(truncated_length.get()); - } -}; - -REGISTER_PRIMITIVE_W_NAME("truncate", truncate_); - -// dummy function, which ensures that this unit is not discarded by the linker -// it is being called by the constructor of SimpleSwitch -// the previous alternative was to have all the primitives in a header file (the -// primitives could also be placed in simple_switch.cpp directly), but I need -// this dummy function if I want to keep the primitives in their own file -int import_primitives() { - return 0; -} diff --git a/bm/p4-sai/run_server.sh b/bm/p4-sai/run_server.sh deleted file mode 100755 index 35ad83ec0..000000000 --- a/bm/p4-sai/run_server.sh +++ /dev/null @@ -1,9 +0,0 @@ -set -m -rm -rf log.txt -sudo -v -# sudo ./simple_switch -i 0@sw_port0 -i 1@sw_port1 -i 2@sw_port2 -i 3@sw_port3 -i 4@sw_port4 -i 5@sw_port5 -i 6@sw_port6 -i 7@sw_port7 -i 8@cpu_port --log-file log --log-flush sai.json & -sudo ./simple_switch -i 0@sw_port0 -i 1@sw_port1 -i 2@sw_port2 -i 3@sw_port3 -i 4@sw_port4 -i 5@sw_port5 -i 6@sw_port6 -i 7@sw_port7 -i 8@cpu_port --log-file log --log-flush --pcap sai.json & -sleep 2 -./runtime_CLI --pre SimplePreLAG < p4src/DefaultConfig.txt -./sswitch_CLI < p4src/DefaultConfigMirror.txt -fg \ No newline at end of file diff --git a/bm/p4-sai/runtime_CLI b/bm/p4-sai/runtime_CLI deleted file mode 120000 index ecc87a5c4..000000000 --- a/bm/p4-sai/runtime_CLI +++ /dev/null @@ -1 +0,0 @@ -../behavioral-model/tools/runtime_CLI.py \ No newline at end of file diff --git a/bm/p4-sai/sai.json b/bm/p4-sai/sai.json deleted file mode 100644 index 5fc4ea0df..000000000 --- a/bm/p4-sai/sai.json +++ /dev/null @@ -1,3792 +0,0 @@ -{ - "header_types": [ - { - "name": "standard_metadata_t", - "id": 0, - "fields": [ - [ - "ingress_port", - 9 - ], - [ - "packet_length", - 32 - ], - [ - "egress_spec", - 9 - ], - [ - "egress_port", - 9 - ], - [ - "egress_instance", - 32 - ], - [ - "instance_type", - 32 - ], - [ - "clone_spec", - 32 - ], - [ - "_padding", - 5 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "ethernet_t", - "id": 1, - "fields": [ - [ - "dstAddr", - 48 - ], - [ - "srcAddr", - 48 - ], - [ - "etherType", - 16 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "vlan_t", - "id": 2, - "fields": [ - [ - "pcp", - 3 - ], - [ - "cfi", - 1 - ], - [ - "vid", - 12 - ], - [ - "etherType", - 16 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "ipv4_t", - "id": 3, - "fields": [ - [ - "version", - 4 - ], - [ - "ihl", - 4 - ], - [ - "diffserv", - 8 - ], - [ - "ipv4_length", - 16 - ], - [ - "id", - 16 - ], - [ - "flags", - 3 - ], - [ - "offset", - 13 - ], - [ - "ttl", - 8 - ], - [ - "protocol", - 8 - ], - [ - "checksum", - 16 - ], - [ - "srcAddr", - 32 - ], - [ - "dstAddr", - 32 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "tcp_t", - "id": 4, - "fields": [ - [ - "srcPort", - 16 - ], - [ - "dstPort", - 16 - ], - [ - "seqNo", - 32 - ], - [ - "ackNo", - 32 - ], - [ - "dataOffset", - 4 - ], - [ - "res", - 4 - ], - [ - "flags", - 8 - ], - [ - "window", - 16 - ], - [ - "checksum", - 16 - ], - [ - "urgentPtr", - 16 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "udp_t", - "id": 5, - "fields": [ - [ - "srcPort", - 16 - ], - [ - "dstPort", - 16 - ], - [ - "length_", - 16 - ], - [ - "checksum", - 16 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "ingress_metadata_t", - "id": 6, - "fields": [ - [ - "port", - 6 - ], - [ - "l2_if", - 6 - ], - [ - "is_tagged", - 1 - ], - [ - "is_lag", - 1 - ], - [ - "lag_id", - 16 - ], - [ - "bind_mode", - 1 - ], - [ - "l2_if_type", - 2 - ], - [ - "bridge_port", - 8 - ], - [ - "bridge_id", - 12 - ], - [ - "stp_state", - 2 - ], - [ - "stp_id", - 3 - ], - [ - "vid", - 12 - ], - [ - "unknown_unicast", - 1 - ], - [ - "mcast_mode", - 2 - ], - [ - "mc_fdb_miss", - 1 - ], - [ - "ipmc", - 1 - ], - [ - "isip", - 1 - ], - [ - "go_to_router", - 1 - ], - [ - "mtu", - 32 - ], - [ - "drop_tagged", - 1 - ], - [ - "drop_untagged", - 1 - ], - [ - "trap_id", - 11 - ], - [ - "_padding", - 6 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "egress_metadata_t", - "id": 7, - "fields": [ - [ - "out_if_type", - 1 - ], - [ - "out_if", - 6 - ], - [ - "stp_state", - 2 - ], - [ - "tag_mode", - 1 - ], - [ - "hash_val", - 6 - ], - [ - "mcast_grp", - 4 - ], - [ - "bridge_port", - 8 - ], - [ - "_padding", - 4 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "intrinsic_metadata_t", - "id": 8, - "fields": [ - [ - "ingress_global_timestamp", - 48 - ], - [ - "lf_field_list", - 8 - ], - [ - "mcast_grp", - 16 - ], - [ - "egress_rid", - 16 - ], - [ - "resubmit_flag", - 8 - ], - [ - "recirculate_flag", - 8 - ] - ], - "length_exp": null, - "max_length": null - }, - { - "name": "cpu_header_t", - "id": 9, - "fields": [ - [ - "trap_id", - 16 - ], - [ - "bridge_id", - 16 - ], - [ - "ingress_port", - 8 - ], - [ - "bridge_port", - 8 - ] - ], - "length_exp": null, - "max_length": null - } - ], - "headers": [ - { - "name": "standard_metadata", - "id": 0, - "header_type": "standard_metadata_t", - "metadata": true - }, - { - "name": "intrinsic_metadata", - "id": 1, - "header_type": "intrinsic_metadata_t", - "metadata": true - }, - { - "name": "ethernet", - "id": 2, - "header_type": "ethernet_t", - "metadata": false - }, - { - "name": "vlan", - "id": 3, - "header_type": "vlan_t", - "metadata": false - }, - { - "name": "ipv4", - "id": 4, - "header_type": "ipv4_t", - "metadata": false - }, - { - "name": "tcp", - "id": 5, - "header_type": "tcp_t", - "metadata": false - }, - { - "name": "udp", - "id": 6, - "header_type": "udp_t", - "metadata": false - }, - { - "name": "cpu_header", - "id": 7, - "header_type": "cpu_header_t", - "metadata": false - }, - { - "name": "ingress_metadata", - "id": 8, - "header_type": "ingress_metadata_t", - "metadata": true - }, - { - "name": "egress_metadata", - "id": 9, - "header_type": "egress_metadata_t", - "metadata": true - } - ], - "header_stacks": [], - "parsers": [ - { - "name": "parser", - "id": 0, - "init_state": "start", - "parse_states": [ - { - "name": "parse_udp", - "id": 0, - "parser_ops": [ - { - "op": "extract", - "parameters": [ - { - "type": "regular", - "value": "udp" - } - ] - } - ], - "transition_key": [], - "transitions": [ - { - "type": "default", - "value": null, - "mask": null, - "next_state": null - } - ] - }, - { - "name": "parse_vlan", - "id": 1, - "parser_ops": [ - { - "op": "extract", - "parameters": [ - { - "type": "regular", - "value": "vlan" - } - ] - }, - { - "op": "set", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "is_tagged" - ] - }, - { - "type": "expression", - "value": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": "|", - "left": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0xb" - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0xa" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x9" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x8" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x7" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x6" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x5" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x4" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x3" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x2" - } - } - } - } - }, - "right": { - "type": "expression", - "value": { - "op": ">>", - "left": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - "right": { - "type": "hexstr", - "value": "0x1" - } - } - } - } - }, - "right": { - "type": "field", - "value": [ - "vlan", - "vid" - ] - } - } - } - } - ] - } - ], - "transition_key": [ - { - "type": "field", - "value": [ - "vlan", - "etherType" - ] - } - ], - "transitions": [ - { - "type": "hexstr", - "value": "0x0800", - "mask": null, - "next_state": "parse_ipv4" - }, - { - "type": "default", - "value": null, - "mask": null, - "next_state": null - } - ] - }, - { - "name": "start", - "id": 2, - "parser_ops": [], - "transition_key": [ - { - "type": "lookahead", - "value": [ - 0, - 64 - ] - } - ], - "transitions": [ - { - "type": "hexstr", - "value": "0x0000000000000000", - "mask": null, - "next_state": "parse_cpu_header" - }, - { - "type": "default", - "value": null, - "mask": null, - "next_state": "parse_ethernet" - } - ] - }, - { - "name": "parse_ipv4", - "id": 3, - "parser_ops": [ - { - "op": "extract", - "parameters": [ - { - "type": "regular", - "value": "ipv4" - } - ] - }, - { - "op": "set", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "isip" - ] - }, - { - "type": "hexstr", - "value": "0x1" - } - ] - } - ], - "transition_key": [], - "transitions": [ - { - "type": "default", - "value": null, - "mask": null, - "next_state": "post_parse_ipv4" - } - ] - }, - { - "name": "parse_tcp", - "id": 4, - "parser_ops": [ - { - "op": "extract", - "parameters": [ - { - "type": "regular", - "value": "tcp" - } - ] - } - ], - "transition_key": [], - "transitions": [ - { - "type": "default", - "value": null, - "mask": null, - "next_state": null - } - ] - }, - { - "name": "parse_cpu_header", - "id": 5, - "parser_ops": [ - { - "op": "extract", - "parameters": [ - { - "type": "regular", - "value": "cpu_header" - } - ] - } - ], - "transition_key": [], - "transitions": [ - { - "type": "default", - "value": null, - "mask": null, - "next_state": "parse_ethernet" - } - ] - }, - { - "name": "parse_ethernet", - "id": 6, - "parser_ops": [ - { - "op": "extract", - "parameters": [ - { - "type": "regular", - "value": "ethernet" - } - ] - }, - { - "op": "set", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "is_tagged" - ] - }, - { - "type": "hexstr", - "value": "0x0" - } - ] - } - ], - "transition_key": [ - { - "type": "field", - "value": [ - "ethernet", - "etherType" - ] - } - ], - "transitions": [ - { - "type": "hexstr", - "value": "0x8100", - "mask": null, - "next_state": "parse_vlan" - }, - { - "type": "hexstr", - "value": "0x0800", - "mask": null, - "next_state": "parse_ipv4" - }, - { - "type": "default", - "value": null, - "mask": null, - "next_state": null - } - ] - }, - { - "name": "post_parse_ipv4", - "id": 7, - "parser_ops": [], - "transition_key": [ - { - "type": "field", - "value": [ - "ipv4", - "protocol" - ] - } - ], - "transitions": [ - { - "type": "hexstr", - "value": "0x06", - "mask": null, - "next_state": "parse_tcp" - }, - { - "type": "hexstr", - "value": "0x11", - "mask": null, - "next_state": "parse_udp" - }, - { - "type": "default", - "value": null, - "mask": null, - "next_state": null - } - ] - } - ] - } - ], - "parse_vsets": [], - "deparsers": [ - { - "name": "deparser", - "id": 0, - "order": [ - "cpu_header", - "ethernet", - "vlan", - "ipv4", - "tcp", - "udp" - ] - } - ], - "meter_arrays": [], - "actions": [ - { - "name": "action_set_l2if", - "id": 0, - "runtime_data": [], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "ingress_port" - ] - } - ] - } - ] - }, - { - "name": "action_set_egress_stp_state", - "id": 1, - "runtime_data": [ - { - "name": "stp_state", - "bitwidth": 2 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "egress_metadata", - "stp_state" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_forward_vlan_untag", - "id": 2, - "runtime_data": [], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ethernet", - "etherType" - ] - }, - { - "type": "field", - "value": [ - "vlan", - "etherType" - ] - } - ] - }, - { - "op": "remove_header", - "parameters": [ - { - "type": "header", - "value": "vlan" - } - ] - } - ] - }, - { - "name": "action_set_port_configurations", - "id": 3, - "runtime_data": [ - { - "name": "pvid", - "bitwidth": 12 - }, - { - "name": "bind_mode", - "bitwidth": 1 - }, - { - "name": "mtu", - "bitwidth": 32 - }, - { - "name": "drop_tagged", - "bitwidth": 1 - }, - { - "name": "drop_untagged", - "bitwidth": 1 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "vid" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "bind_mode" - ] - }, - { - "type": "runtime_data", - "value": 1 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "mtu" - ] - }, - { - "type": "runtime_data", - "value": 2 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "drop_tagged" - ] - }, - { - "type": "runtime_data", - "value": 3 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "drop_untagged" - ] - }, - { - "type": "runtime_data", - "value": 4 - } - ] - } - ] - }, - { - "name": "action_forward_vlan_tag", - "id": 4, - "runtime_data": [ - { - "name": "pcp", - "bitwidth": 3 - }, - { - "name": "cfi", - "bitwidth": 1 - }, - { - "name": "vid", - "bitwidth": 12 - } - ], - "primitives": [ - { - "op": "add_header", - "parameters": [ - { - "type": "header", - "value": "vlan" - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "vlan", - "pcp" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "vlan", - "cfi" - ] - }, - { - "type": "runtime_data", - "value": 1 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "vlan", - "vid" - ] - }, - { - "type": "runtime_data", - "value": 2 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "vlan", - "etherType" - ] - }, - { - "type": "field", - "value": [ - "ethernet", - "etherType" - ] - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ethernet", - "etherType" - ] - }, - { - "type": "hexstr", - "value": "0x8100" - } - ] - } - ] - }, - { - "name": "action_set_l2_if_type", - "id": 5, - "runtime_data": [ - { - "name": "l2_if_type", - "bitwidth": 2 - }, - { - "name": "bridge_port", - "bitwidth": 8 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if_type" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "bridge_port" - ] - }, - { - "type": "runtime_data", - "value": 1 - } - ] - } - ] - }, - { - "name": "action_set_out_port", - "id": 6, - "runtime_data": [ - { - "name": "port", - "bitwidth": 6 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "standard_metadata", - "egress_spec" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_set_packet_vid", - "id": 7, - "runtime_data": [], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "vid" - ] - }, - { - "type": "field", - "value": [ - "vlan", - "vid" - ] - } - ] - } - ] - }, - { - "name": "action_set_mc_fdb_miss", - "id": 8, - "runtime_data": [], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "mc_fdb_miss" - ] - }, - { - "type": "hexstr", - "value": "0x1" - } - ] - } - ] - }, - { - "name": "action_set_bridge_id", - "id": 9, - "runtime_data": [ - { - "name": "bridge_id", - "bitwidth": 12 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "bridge_id" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_set_bridge_id_vid", - "id": 10, - "runtime_data": [], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "bridge_id" - ] - }, - { - "type": "field", - "value": [ - "ingress_metadata", - "vid" - ] - } - ] - } - ] - }, - { - "name": "action_set_mcast_lookup_mode", - "id": 11, - "runtime_data": [ - { - "name": "mcast_mode", - "bitwidth": 2 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "mcast_mode" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_set_stp_state", - "id": 12, - "runtime_data": [ - { - "name": "stp_state", - "bitwidth": 3 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "stp_state" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_set_vlan", - "id": 13, - "runtime_data": [ - { - "name": "vid", - "bitwidth": 12 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "vid" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_set_stp_id", - "id": 14, - "runtime_data": [ - { - "name": "stp_id", - "bitwidth": 3 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "stp_id" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_learn_mac", - "id": 15, - "runtime_data": [], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "trap_id" - ] - }, - { - "type": "hexstr", - "value": "0x200" - } - ] - }, - { - "op": "clone_ingress_pkt_to_egress", - "parameters": [ - { - "type": "hexstr", - "value": "0x8" - }, - { - "type": "hexstr", - "value": "0x1" - } - ] - } - ] - }, - { - "name": "action_set_egress_br_port", - "id": 16, - "runtime_data": [ - { - "name": "br_port", - "bitwidth": 8 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "egress_metadata", - "bridge_port" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "_drop", - "id": 17, - "runtime_data": [], - "primitives": [ - { - "op": "drop", - "parameters": [] - } - ] - }, - { - "name": "action_cpu_encap", - "id": 18, - "runtime_data": [], - "primitives": [ - { - "op": "add_header", - "parameters": [ - { - "type": "header", - "value": "cpu_header" - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "cpu_header", - "ingress_port" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "ingress_port" - ] - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "cpu_header", - "trap_id" - ] - }, - { - "type": "field", - "value": [ - "ingress_metadata", - "trap_id" - ] - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "cpu_header", - "bridge_id" - ] - }, - { - "type": "field", - "value": [ - "ingress_metadata", - "bridge_id" - ] - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "cpu_header", - "bridge_port" - ] - }, - { - "type": "field", - "value": [ - "ingress_metadata", - "bridge_port" - ] - } - ] - } - ] - }, - { - "name": "_nop", - "id": 19, - "runtime_data": [], - "primitives": [ - { - "op": "no_op", - "parameters": [] - } - ] - }, - { - "name": "action_set_lag_l2if", - "id": 20, - "runtime_data": [ - { - "name": "is_lag", - "bitwidth": 1 - }, - { - "name": "l2_if", - "bitwidth": 6 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "is_lag" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if" - ] - }, - { - "type": "runtime_data", - "value": 1 - } - ] - } - ] - }, - { - "name": "action_set_trap_id", - "id": 21, - "runtime_data": [ - { - "name": "trap_id", - "bitwidth": 11 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "trap_id" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_trap_to_cpu", - "id": 22, - "runtime_data": [], - "primitives": [ - { - "op": "clone_ingress_pkt_to_egress", - "parameters": [ - { - "type": "hexstr", - "value": "0x8" - }, - { - "type": "hexstr", - "value": "0x1" - } - ] - }, - { - "op": "drop", - "parameters": [] - } - ] - }, - { - "name": "action_set_unknown_unicast", - "id": 23, - "runtime_data": [ - { - "name": "unknown_unicast", - "bitwidth": 1 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "unknown_unicast" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_copy_to_cpu", - "id": 24, - "runtime_data": [], - "primitives": [ - { - "op": "clone_ingress_pkt_to_egress", - "parameters": [ - { - "type": "hexstr", - "value": "0x8" - }, - { - "type": "hexstr", - "value": "0x1" - } - ] - } - ] - }, - { - "name": "action_forward_set_outIfType", - "id": 25, - "runtime_data": [ - { - "name": "out_if", - "bitwidth": 6 - }, - { - "name": "out_if_type", - "bitwidth": 1 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "egress_metadata", - "out_if" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "egress_metadata", - "out_if_type" - ] - }, - { - "type": "runtime_data", - "value": 1 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "standard_metadata", - "egress_spec" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - }, - { - "name": "action_forward_mc_set_if_list", - "id": 26, - "runtime_data": [ - { - "name": "mcast_grp", - "bitwidth": 16 - }, - { - "name": "go_to_router", - "bitwidth": 1 - } - ], - "primitives": [ - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "intrinsic_metadata", - "mcast_grp" - ] - }, - { - "type": "runtime_data", - "value": 0 - } - ] - }, - { - "op": "modify_field", - "parameters": [ - { - "type": "field", - "value": [ - "ingress_metadata", - "go_to_router" - ] - }, - { - "type": "runtime_data", - "value": 1 - } - ] - } - ] - }, - { - "name": "action_set_lag_hash_size", - "id": 27, - "runtime_data": [ - { - "name": "lag_size", - "bitwidth": 6 - } - ], - "primitives": [ - { - "op": "modify_field_with_hash_based_offset", - "parameters": [ - { - "type": "field", - "value": [ - "egress_metadata", - "hash_val" - ] - }, - { - "type": "hexstr", - "value": "0x0" - }, - { - "type": "calculation", - "value": "lag_hash" - }, - { - "type": "runtime_data", - "value": 0 - } - ] - } - ] - } - ], - "pipelines": [ - { - "name": "ingress", - "id": 0, - "init_table": "table_ingress_lag", - "tables": [ - { - "name": "table_ingress_lag", - "id": 0, - "match_type": "exact", - "type": "simple", - "max_size": 64, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "standard_metadata", - "ingress_port" - ], - "mask": null - } - ], - "actions": [ - "action_set_lag_l2if", - "action_set_l2if" - ], - "next_tables": { - "action_set_lag_l2if": "table_port_configurations", - "action_set_l2if": "table_port_configurations" - }, - "base_default_next": "table_port_configurations" - }, - { - "name": "table_drop_tagged_internal", - "id": 1, - "match_type": "exact", - "type": "simple", - "max_size": 1, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "drop_tagged" - ], - "mask": null - } - ], - "actions": [ - "_drop", - "_nop" - ], - "next_tables": { - "_drop": "table_l2_trap", - "_nop": "table_l2_trap" - }, - "base_default_next": "table_l2_trap" - }, - { - "name": "table_drop_untagged_internal", - "id": 2, - "match_type": "exact", - "type": "simple", - "max_size": 1, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "drop_untagged" - ], - "mask": null - } - ], - "actions": [ - "_drop", - "_nop" - ], - "next_tables": { - "_drop": "table_l2_trap", - "_nop": "table_l2_trap" - }, - "base_default_next": "table_l2_trap" - }, - { - "name": "table_l2_trap", - "id": 3, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ethernet", - "dstAddr" - ], - "mask": null - } - ], - "actions": [ - "action_set_trap_id" - ], - "next_tables": { - "action_set_trap_id": "table_trap_id" - }, - "base_default_next": "table_trap_id" - }, - { - "name": "table_trap_id", - "id": 4, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "trap_id" - ], - "mask": null - } - ], - "actions": [ - "_drop", - "_nop", - "action_copy_to_cpu", - "action_trap_to_cpu" - ], - "next_tables": { - "_drop": "_condition_1", - "_nop": "_condition_1", - "action_copy_to_cpu": "_condition_1", - "action_trap_to_cpu": "_condition_1" - }, - "base_default_next": "_condition_1" - }, - { - "name": "table_port_configurations", - "id": 5, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "l2_if" - ], - "mask": null - } - ], - "actions": [ - "action_set_port_configurations" - ], - "next_tables": { - "action_set_port_configurations": "_condition_0" - }, - "base_default_next": "_condition_0" - }, - { - "name": "table_port_set_packet_vid_internal", - "id": 6, - "match_type": "exact", - "type": "simple", - "max_size": 1, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "is_tagged" - ], - "mask": null - } - ], - "actions": [ - "action_set_packet_vid" - ], - "next_tables": { - "action_set_packet_vid": "table_drop_tagged_internal" - }, - "base_default_next": "table_drop_tagged_internal" - }, - { - "name": "table_port_ingress_interface_type", - "id": 7, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "l2_if" - ], - "mask": null - } - ], - "actions": [ - "action_set_l2_if_type", - "_drop" - ], - "next_tables": { - "action_set_l2_if_type": "_condition_2", - "_drop": "_condition_2" - }, - "base_default_next": "_condition_2" - }, - { - "name": "table_subport_ingress_interface_type", - "id": 8, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "l2_if" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "vid" - ], - "mask": null - } - ], - "actions": [ - "action_set_l2_if_type", - "_drop" - ], - "next_tables": { - "action_set_l2_if_type": "_condition_2", - "_drop": "_condition_2" - }, - "base_default_next": "_condition_2" - }, - { - "name": "table_bridge_id_1d", - "id": 9, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_port" - ], - "mask": null - } - ], - "actions": [ - "action_set_bridge_id", - "_drop" - ], - "next_tables": { - "action_set_bridge_id": "table_vbridge_STP", - "_drop": "table_vbridge_STP" - }, - "base_default_next": "table_vbridge_STP" - }, - { - "name": "table_vbridge_STP", - "id": 10, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_port" - ], - "mask": null - } - ], - "actions": [ - "action_set_stp_state" - ], - "next_tables": { - "action_set_stp_state": "_condition_4" - }, - "base_default_next": "_condition_4" - }, - { - "name": "table_bridge_id_1q", - "id": 11, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "vid" - ], - "mask": null - } - ], - "actions": [ - "action_set_bridge_id", - "action_set_bridge_id_vid" - ], - "next_tables": { - "action_set_bridge_id": "table_ingress_vlan_filtering", - "action_set_bridge_id_vid": "table_ingress_vlan_filtering" - }, - "base_default_next": "table_ingress_vlan_filtering" - }, - { - "name": "table_ingress_vlan_filtering", - "id": 12, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_port" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "vid" - ], - "mask": null - } - ], - "actions": [ - "_drop", - "_nop" - ], - "next_tables": { - "_drop": "table_xSTP_instance", - "_nop": "table_xSTP_instance" - }, - "base_default_next": "table_xSTP_instance" - }, - { - "name": "table_mc_lookup_mode", - "id": 13, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "vid" - ], - "mask": null - } - ], - "actions": [ - "action_set_mcast_lookup_mode" - ], - "next_tables": { - "action_set_mcast_lookup_mode": "_condition_6" - }, - "base_default_next": "_condition_6" - }, - { - "name": "table_xSTP_instance", - "id": 14, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "vid" - ], - "mask": null - } - ], - "actions": [ - "action_set_stp_id" - ], - "next_tables": { - "action_set_stp_id": "table_xSTP" - }, - "base_default_next": "table_xSTP" - }, - { - "name": "table_xSTP", - "id": 15, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_port" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "stp_id" - ], - "mask": null - } - ], - "actions": [ - "action_set_stp_state", - "_drop" - ], - "next_tables": { - "action_set_stp_state": "_condition_4", - "_drop": "_condition_4" - }, - "base_default_next": "_condition_4" - }, - { - "name": "table_learn_fdb", - "id": 16, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ethernet", - "srcAddr" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "_nop", - "action_learn_mac" - ], - "next_tables": { - "_nop": "table_l3_interface", - "action_learn_mac": "table_l3_interface" - }, - "base_default_next": "table_l3_interface" - }, - { - "name": "table_l3_interface", - "id": 17, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ethernet", - "dstAddr" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "action_set_egress_br_port" - ], - "next_tables": { - "__HIT__": null, - "__MISS__": "table_fdb" - }, - "base_default_next": null - }, - { - "name": "table_fdb", - "id": 18, - "match_type": "exact", - "type": "simple", - "max_size": 512, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ethernet", - "dstAddr" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "action_set_egress_br_port", - "action_set_unknown_unicast" - ], - "next_tables": { - "__HIT__": null, - "__MISS__": "table_flood" - }, - "base_default_next": null - }, - { - "name": "table_mc_fdb", - "id": 19, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ethernet", - "dstAddr" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "action_forward_mc_set_if_list", - "action_set_mc_fdb_miss" - ], - "next_tables": { - "action_forward_mc_set_if_list": "_condition_8", - "action_set_mc_fdb_miss": "_condition_8" - }, - "base_default_next": "_condition_8" - }, - { - "name": "table_mc_l2_sg_g", - "id": 20, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ipv4", - "srcAddr" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ipv4", - "dstAddr" - ], - "mask": null - } - ], - "actions": [ - "action_forward_mc_set_if_list", - "action_set_mc_fdb_miss" - ], - "next_tables": { - "action_forward_mc_set_if_list": "_condition_8", - "action_set_mc_fdb_miss": "_condition_8" - }, - "base_default_next": "_condition_8" - }, - { - "name": "table_unknown_multicast_nonip", - "id": 21, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "action_forward_mc_set_if_list" - ], - "next_tables": { - "action_forward_mc_set_if_list": null - }, - "base_default_next": null - }, - { - "name": "table_unknown_multicast_ipv4", - "id": 22, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "action_forward_mc_set_if_list" - ], - "next_tables": { - "action_forward_mc_set_if_list": null - }, - "base_default_next": null - }, - { - "name": "table_broadcast", - "id": 23, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "action_forward_mc_set_if_list" - ], - "next_tables": { - "action_forward_mc_set_if_list": null - }, - "base_default_next": null - }, - { - "name": "table_flood", - "id": 24, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "bridge_id" - ], - "mask": null - } - ], - "actions": [ - "action_forward_mc_set_if_list" - ], - "next_tables": { - "action_forward_mc_set_if_list": null - }, - "base_default_next": null - } - ], - "conditionals": [ - { - "name": "_condition_0", - "id": 0, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "is_tagged" - ] - }, - "right": { - "type": "hexstr", - "value": "0x1" - } - } - }, - "true_next": "table_port_set_packet_vid_internal", - "false_next": "table_drop_untagged_internal" - }, - { - "name": "_condition_1", - "id": 1, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "bind_mode" - ] - }, - "right": { - "type": "hexstr", - "value": "0x0" - } - } - }, - "true_next": "table_port_ingress_interface_type", - "false_next": "table_subport_ingress_interface_type" - }, - { - "name": "_condition_2", - "id": 2, - "expression": { - "type": "expression", - "value": { - "op": "or", - "left": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if_type" - ] - }, - "right": { - "type": "hexstr", - "value": "0x3" - } - } - }, - "right": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if_type" - ] - }, - "right": { - "type": "hexstr", - "value": "0x2" - } - } - } - } - }, - "true_next": "_condition_3", - "false_next": null - }, - { - "name": "_condition_3", - "id": 3, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if_type" - ] - }, - "right": { - "type": "hexstr", - "value": "0x2" - } - } - }, - "true_next": "table_bridge_id_1d", - "false_next": "table_bridge_id_1q" - }, - { - "name": "_condition_4", - "id": 4, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "expression", - "value": { - "op": "&", - "left": { - "type": "field", - "value": [ - "ethernet", - "dstAddr" - ] - }, - "right": { - "type": "hexstr", - "value": "0x10000000000" - } - } - }, - "right": { - "type": "hexstr", - "value": "0x0" - } - } - }, - "true_next": "table_learn_fdb", - "false_next": "_condition_5" - }, - { - "name": "_condition_5", - "id": 5, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ethernet", - "dstAddr" - ] - }, - "right": { - "type": "hexstr", - "value": "0xffffffffffff" - } - } - }, - "true_next": "table_broadcast", - "false_next": "table_mc_lookup_mode" - }, - { - "name": "_condition_6", - "id": 6, - "expression": { - "type": "expression", - "value": { - "op": "or", - "left": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "isip" - ] - }, - "right": { - "type": "hexstr", - "value": "0x0" - } - } - }, - "right": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "mcast_mode" - ] - }, - "right": { - "type": "hexstr", - "value": "0x0" - } - } - } - } - }, - "true_next": "table_mc_fdb", - "false_next": "_condition_7" - }, - { - "name": "_condition_7", - "id": 7, - "expression": { - "type": "expression", - "value": { - "op": "and", - "left": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "isip" - ] - }, - "right": { - "type": "hexstr", - "value": "0x1" - } - } - }, - "right": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "mcast_mode" - ] - }, - "right": { - "type": "hexstr", - "value": "0x2" - } - } - } - } - }, - "true_next": "table_mc_l2_sg_g", - "false_next": "_condition_8" - }, - { - "name": "_condition_8", - "id": 8, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "mc_fdb_miss" - ] - }, - "right": { - "type": "hexstr", - "value": "0x1" - } - } - }, - "true_next": "_condition_9", - "false_next": null - }, - { - "name": "_condition_9", - "id": 9, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "isip" - ] - }, - "right": { - "type": "hexstr", - "value": "0x1" - } - } - }, - "true_next": "table_unknown_multicast_ipv4", - "false_next": "table_unknown_multicast_nonip" - } - ] - }, - { - "name": "egress", - "id": 1, - "init_table": "_condition_11", - "tables": [ - { - "name": "table_egress_vbridge_STP", - "id": 25, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "bridge_port" - ], - "mask": null - } - ], - "actions": [ - "action_set_egress_stp_state", - "_drop" - ], - "next_tables": { - "action_set_egress_stp_state": "_condition_12", - "_drop": "_condition_12" - }, - "base_default_next": "_condition_12" - }, - { - "name": "table_egress_vlan_tag", - "id": 26, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "out_if" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "vid" - ], - "mask": null - }, - { - "match_type": "valid", - "target": "vlan", - "mask": null - } - ], - "actions": [ - "action_forward_vlan_tag", - "action_forward_vlan_untag", - "_drop", - "_nop" - ], - "next_tables": { - "action_forward_vlan_tag": "_condition_14", - "action_forward_vlan_untag": "_condition_14", - "_drop": "_condition_14", - "_nop": "_condition_14" - }, - "base_default_next": "_condition_14" - }, - { - "name": "table_egress_xSTP", - "id": 27, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "bridge_port" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "stp_id" - ], - "mask": null - } - ], - "actions": [ - "action_set_egress_stp_state", - "_drop" - ], - "next_tables": { - "action_set_egress_stp_state": "table_egress_vlan_filtering", - "_drop": "table_egress_vlan_filtering" - }, - "base_default_next": "table_egress_vlan_filtering" - }, - { - "name": "table_egress_vlan_filtering", - "id": 28, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "bridge_port" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "ingress_metadata", - "vid" - ], - "mask": null - } - ], - "actions": [ - "_drop", - "_nop" - ], - "next_tables": { - "_drop": "table_egress_br_port_to_if", - "_nop": "table_egress_br_port_to_if" - }, - "base_default_next": "table_egress_br_port_to_if" - }, - { - "name": "table_egress_br_port_to_if", - "id": 29, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "bridge_port" - ], - "mask": null - } - ], - "actions": [ - "action_forward_set_outIfType", - "_drop" - ], - "next_tables": { - "action_forward_set_outIfType": "_condition_13", - "_drop": "_condition_13" - }, - "base_default_next": "_condition_13" - }, - { - "name": "table_egress_set_vlan", - "id": 30, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "bridge_port" - ], - "mask": null - } - ], - "actions": [ - "action_set_vlan" - ], - "next_tables": { - "action_set_vlan": "table_egress_vlan_tag" - }, - "base_default_next": "table_egress_vlan_tag" - }, - { - "name": "table_lag_hash", - "id": 31, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "out_if" - ], - "mask": null - } - ], - "actions": [ - "action_set_lag_hash_size" - ], - "next_tables": { - "action_set_lag_hash_size": "table_egress_lag" - }, - "base_default_next": "table_egress_lag" - }, - { - "name": "table_egress_lag", - "id": 32, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "egress_metadata", - "out_if" - ], - "mask": null - }, - { - "match_type": "exact", - "target": [ - "egress_metadata", - "hash_val" - ], - "mask": null - } - ], - "actions": [ - "action_set_out_port", - "_drop" - ], - "next_tables": { - "action_set_out_port": "table_egress_clone_internal", - "_drop": "table_egress_clone_internal" - }, - "base_default_next": "table_egress_clone_internal" - }, - { - "name": "table_egress_clone_internal", - "id": 33, - "match_type": "exact", - "type": "simple", - "max_size": 16384, - "with_counters": false, - "direct_meters": null, - "support_timeout": false, - "key": [ - { - "match_type": "exact", - "target": [ - "standard_metadata", - "instance_type" - ], - "mask": null - } - ], - "actions": [ - "_nop", - "action_cpu_encap" - ], - "next_tables": { - "_nop": null, - "action_cpu_encap": null - }, - "base_default_next": null - } - ], - "conditionals": [ - { - "name": "_condition_11", - "id": 10, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if_type" - ] - }, - "right": { - "type": "hexstr", - "value": "0x2" - } - } - }, - "true_next": "table_egress_vbridge_STP", - "false_next": "_condition_12" - }, - { - "name": "_condition_12", - "id": 11, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if_type" - ] - }, - "right": { - "type": "hexstr", - "value": "0x3" - } - } - }, - "true_next": "table_egress_xSTP", - "false_next": "table_egress_br_port_to_if" - }, - { - "name": "_condition_13", - "id": 12, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "ingress_metadata", - "l2_if_type" - ] - }, - "right": { - "type": "hexstr", - "value": "0x2" - } - } - }, - "true_next": "table_egress_set_vlan", - "false_next": "table_egress_vlan_tag" - }, - { - "name": "_condition_14", - "id": 13, - "expression": { - "type": "expression", - "value": { - "op": "==", - "left": { - "type": "field", - "value": [ - "egress_metadata", - "out_if_type" - ] - }, - "right": { - "type": "hexstr", - "value": "0x1" - } - } - }, - "true_next": "table_lag_hash", - "false_next": "table_egress_clone_internal" - } - ] - } - ], - "calculations": [ - { - "name": "lag_hash", - "id": 0, - "input": [ - { - "type": "field", - "value": [ - "ethernet", - "srcAddr" - ] - }, - { - "type": "field", - "value": [ - "ipv4", - "id" - ] - } - ], - "algo": "xor8" - } - ], - "checksums": [], - "learn_lists": [], - "field_lists": [ - { - "id": 1, - "name": "redirect_FL", - "elements": [ - { - "type": "field", - "value": [ - "standard_metadata", - "ingress_port" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "packet_length" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "egress_spec" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "egress_port" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "egress_instance" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "instance_type" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "clone_spec" - ] - }, - { - "type": "field", - "value": [ - "standard_metadata", - "_padding" - ] - }, - { - "type": "field", - "value": [ - "ingress_metadata", - "trap_id" - ] - }, - { - "type": "field", - "value": [ - "ingress_metadata", - "bridge_id" - ] - }, - { - "type": "field", - "value": [ - "ingress_metadata", - "bridge_port" - ] - } - ] - } - ], - "counter_arrays": [], - "register_arrays": [], - "force_arith": [ - [ - "standard_metadata", - "ingress_port" - ], - [ - "standard_metadata", - "packet_length" - ], - [ - "standard_metadata", - "egress_spec" - ], - [ - "standard_metadata", - "egress_port" - ], - [ - "standard_metadata", - "egress_instance" - ], - [ - "standard_metadata", - "instance_type" - ], - [ - "standard_metadata", - "clone_spec" - ], - [ - "standard_metadata", - "_padding" - ], - [ - "intrinsic_metadata", - "ingress_global_timestamp" - ], - [ - "intrinsic_metadata", - "lf_field_list" - ], - [ - "intrinsic_metadata", - "mcast_grp" - ], - [ - "intrinsic_metadata", - "egress_rid" - ], - [ - "intrinsic_metadata", - "resubmit_flag" - ], - [ - "intrinsic_metadata", - "recirculate_flag" - ] - ] -} \ No newline at end of file diff --git a/bm/p4-sai/simple_switch.cpp b/bm/p4-sai/simple_switch.cpp deleted file mode 100644 index d73bbe9f4..000000000 --- a/bm/p4-sai/simple_switch.cpp +++ /dev/null @@ -1,531 +0,0 @@ -/* Copyright 2013-present Barefoot Networks, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Antonin Bas (antonin@barefootnetworks.com) - * - */ - -#include -#include -#include - -#include - -#include -#include -#include - -#include "simple_switch.h" - -namespace { - -struct hash_ex { - uint32_t operator()(const char *buf, size_t s) const { - const int p = 16777619; - int hash = 2166136261; - - for (size_t i = 0; i < s; i++) - hash = (hash ^ buf[i]) * p; - - hash += hash << 13; - hash ^= hash >> 7; - hash += hash << 3; - hash ^= hash >> 17; - hash += hash << 5; - return static_cast(hash); - } -}; - -struct bmv2_hash { - uint64_t operator()(const char *buf, size_t s) const { - return bm::hash::xxh64(buf, s); - } -}; - -struct xor8 { - uint32_t operator()(const char *buf, size_t s) const { - int result = 0; - for (size_t i = 0; i(pre); - - add_required_field("standard_metadata", "ingress_port"); - add_required_field("standard_metadata", "packet_length"); - add_required_field("standard_metadata", "instance_type"); - add_required_field("standard_metadata", "egress_spec"); - add_required_field("standard_metadata", "clone_spec"); - add_required_field("standard_metadata", "egress_port"); - - force_arith_field("standard_metadata", "ingress_port"); - force_arith_field("standard_metadata", "packet_length"); - force_arith_field("standard_metadata", "instance_type"); - force_arith_field("standard_metadata", "egress_spec"); - force_arith_field("standard_metadata", "clone_spec"); - - force_arith_field("queueing_metadata", "enq_timestamp"); - force_arith_field("queueing_metadata", "enq_qdepth"); - force_arith_field("queueing_metadata", "deq_timedelta"); - force_arith_field("queueing_metadata", "deq_qdepth"); - - force_arith_field("intrinsic_metadata", "ingress_global_timestamp"); - force_arith_field("intrinsic_metadata", "lf_field_list"); - force_arith_field("intrinsic_metadata", "mcast_grp"); - force_arith_field("intrinsic_metadata", "resubmit_flag"); - force_arith_field("intrinsic_metadata", "egress_rid"); - force_arith_field("intrinsic_metadata", "recirculate_flag"); - - import_primitives(); -} - -#define PACKET_LENGTH_REG_IDX 0 - -int -SimpleSwitch::receive_(int port_num, const char *buffer, int len) { - static int pkt_id = 0; - - // this is a good place to call this, because blocking this thread will not - // block the processing of existing packet instances, which is a requirement - if (do_swap() == 0) { - check_queueing_metadata(); - } - - // we limit the packet buffer to original size + 512 bytes, which means we - // cannot add more than 512 bytes of header data to the packet, which should - // be more than enough - auto packet = new_packet_ptr(port_num, pkt_id++, len, - bm::PacketBuffer(len + 512, buffer, len)); - - BMELOG(packet_in, *packet); - - PHV *phv = packet->get_phv(); - // many current P4 programs assume this - // it is also part of the original P4 spec - phv->reset_metadata(); - - // setting standard metadata - - phv->get_field("standard_metadata.ingress_port").set(port_num); - // using packet register 0 to store length, this register will be updated for - // each add_header / remove_header primitive call - packet->set_register(PACKET_LENGTH_REG_IDX, len); - phv->get_field("standard_metadata.packet_length").set(len); - Field &f_instance_type = phv->get_field("standard_metadata.instance_type"); - f_instance_type.set(PKT_INSTANCE_TYPE_NORMAL); - - if (phv->has_field("intrinsic_metadata.ingress_global_timestamp")) { - phv->get_field("intrinsic_metadata.ingress_global_timestamp") - .set(get_ts().count()); - } - - input_buffer.push_front(std::move(packet)); - return 0; -} - -void -SimpleSwitch::start_and_return_() { - check_queueing_metadata(); - - std::thread t1(&SimpleSwitch::ingress_thread, this); - t1.detach(); - for (size_t i = 0; i < nb_egress_threads; i++) { - std::thread t2(&SimpleSwitch::egress_thread, this, i); - t2.detach(); - } - std::thread t3(&SimpleSwitch::transmit_thread, this); - t3.detach(); -} - -void -SimpleSwitch::reset_target_state_() { - bm::Logger::get()->debug("Resetting simple_switch target-specific state"); - get_component()->reset_state(); -} - -int -SimpleSwitch::set_egress_queue_depth(int port, const size_t depth_pkts) { - egress_buffers.set_capacity(port, depth_pkts); - return 0; -} - -int -SimpleSwitch::set_all_egress_queue_depths(const size_t depth_pkts) { - for (int i = 0; i < max_port; i++) { - set_egress_queue_depth(i, depth_pkts); - } - return 0; -} - -int -SimpleSwitch::set_egress_queue_rate(int port, const uint64_t rate_pps) { - egress_buffers.set_rate(port, rate_pps); - return 0; -} - -int -SimpleSwitch::set_all_egress_queue_rates(const uint64_t rate_pps) { - for (int i = 0; i < max_port; i++) { - set_egress_queue_rate(i, rate_pps); - } - return 0; -} - -uint64_t -SimpleSwitch::get_time_elapsed_us() const { - return get_ts().count(); -} - -uint64_t -SimpleSwitch::get_time_since_epoch_us() const { - auto tp = clock::now(); - return duration_cast(tp.time_since_epoch()).count(); -} - -void -SimpleSwitch::transmit_thread() { - while (1) { - std::unique_ptr packet; - output_buffer.pop_back(&packet); - BMELOG(packet_out, *packet); - BMLOG_DEBUG_PKT(*packet, "Transmitting packet of size {} out of port {}", - packet->get_data_size(), packet->get_egress_port()); - transmit_fn(packet->get_egress_port(), - packet->data(), packet->get_data_size()); - } -} - -ts_res -SimpleSwitch::get_ts() const { - return duration_cast(clock::now() - start); -} - -void -SimpleSwitch::enqueue(int egress_port, std::unique_ptr &&packet) { - packet->set_egress_port(egress_port); - - PHV *phv = packet->get_phv(); - - if (with_queueing_metadata) { - phv->get_field("queueing_metadata.enq_timestamp").set(get_ts().count()); - phv->get_field("queueing_metadata.enq_qdepth") - .set(egress_buffers.size(egress_port)); - } - -#ifdef SSWITCH_PRIORITY_QUEUEING_ON - size_t priority = - phv->get_field(SSWITCH_PRIORITY_QUEUEING_SRC).get(); - if (priority >= SSWITCH_PRIORITY_QUEUEING_NB_QUEUES) { - bm::Logger::get()->error("Priority out of range, dropping packet"); - return; - } - egress_buffers.push_front( - egress_port, SSWITCH_PRIORITY_QUEUEING_NB_QUEUES - 1 - priority, - std::move(packet)); -#else - egress_buffers.push_front(egress_port, std::move(packet)); -#endif -} - -// used for ingress cloning, resubmit -std::unique_ptr -SimpleSwitch::copy_ingress_pkt( - const std::unique_ptr &packet, - PktInstanceType copy_type, p4object_id_t field_list_id) { - std::unique_ptr packet_copy = packet->clone_no_phv_ptr(); - PHV *phv_copy = packet_copy->get_phv(); - phv_copy->reset_metadata(); - FieldList *field_list = this->get_field_list(field_list_id); - field_list->copy_fields_between_phvs(phv_copy, packet->get_phv()); - phv_copy->get_field("standard_metadata.instance_type").set(copy_type); - return packet_copy; -} - -void -SimpleSwitch::check_queueing_metadata() { - bool enq_timestamp_e = field_exists("queueing_metadata", "enq_timestamp"); - bool enq_qdepth_e = field_exists("queueing_metadata", "enq_qdepth"); - bool deq_timedelta_e = field_exists("queueing_metadata", "deq_timedelta"); - bool deq_qdepth_e = field_exists("queueing_metadata", "deq_qdepth"); - if (enq_timestamp_e || enq_qdepth_e || deq_timedelta_e || deq_qdepth_e) { - if (enq_timestamp_e && enq_qdepth_e && deq_timedelta_e && deq_qdepth_e) - with_queueing_metadata = true; - else - bm::Logger::get()->warn( - "Your JSON input defines some but not all queueing metadata fields"); - } -} - -void -SimpleSwitch::ingress_thread() { - PHV *phv; - - while (1) { - std::unique_ptr packet; - input_buffer.pop_back(&packet); - - // TODO(antonin): only update these if swapping actually happened? - Parser *parser = this->get_parser("parser"); - Pipeline *ingress_mau = this->get_pipeline("ingress"); - - phv = packet->get_phv(); - - int ingress_port = packet->get_ingress_port(); - (void) ingress_port; - BMLOG_DEBUG_PKT(*packet, "Processing packet received on port {}", - ingress_port); - - /* This looks like it comes out of the blue. However this is needed for - ingress cloning. The parser updates the buffer state (pops the parsed - headers) to make the deparser's job easier (the same buffer is - re-used). But for ingress cloning, the original packet is needed. This - kind of looks hacky though. Maybe a better solution would be to have the - parser leave the buffer unchanged, and move the pop logic to the - deparser. TODO? */ - const Packet::buffer_state_t packet_in_state = packet->save_buffer_state(); - parser->parse(packet.get()); - - ingress_mau->apply(packet.get()); - - packet->reset_exit(); - - Field &f_egress_spec = phv->get_field("standard_metadata.egress_spec"); - int egress_spec = f_egress_spec.get_int(); - - Field &f_clone_spec = phv->get_field("standard_metadata.clone_spec"); - unsigned int clone_spec = f_clone_spec.get_uint(); - - int learn_id = 0; - unsigned int mgid = 0u; - - if (phv->has_field("intrinsic_metadata.lf_field_list")) { - Field &f_learn_id = phv->get_field("intrinsic_metadata.lf_field_list"); - learn_id = f_learn_id.get_int(); - } - - // detect mcast support, if this is true we assume that other fields needed - // for mcast are also defined - if (phv->has_field("intrinsic_metadata.mcast_grp")) { - Field &f_mgid = phv->get_field("intrinsic_metadata.mcast_grp"); - mgid = f_mgid.get_uint(); - } - - int egress_port; - - // INGRESS CLONING - if (clone_spec) { - BMLOG_DEBUG_PKT(*packet, "Cloning packet at ingress"); - egress_port = get_mirroring_mapping(clone_spec & 0xFFFF); - f_clone_spec.set(0); - if (egress_port >= 0) { - const Packet::buffer_state_t packet_out_state = - packet->save_buffer_state(); - packet->restore_buffer_state(packet_in_state); - p4object_id_t field_list_id = clone_spec >> 16; - auto packet_copy = copy_ingress_pkt( - packet, PKT_INSTANCE_TYPE_INGRESS_CLONE, field_list_id); - // we need to parse again - // the alternative would be to pay the (huge) price of PHV copy for - // every ingress packet - parser->parse(packet_copy.get()); - enqueue(egress_port, std::move(packet_copy)); - packet->restore_buffer_state(packet_out_state); - } - } - // LEARNING - if (learn_id > 0) { - get_learn_engine()->learn(learn_id, *packet.get()); - } - - // RESUBMIT - if (phv->has_field("intrinsic_metadata.resubmit_flag")) { - Field &f_resubmit = phv->get_field("intrinsic_metadata.resubmit_flag"); - if (f_resubmit.get_int()) { - BMLOG_DEBUG_PKT(*packet, "Resubmitting packet"); - // get the packet ready for being parsed again at the beginning of - // ingress - packet->restore_buffer_state(packet_in_state); - p4object_id_t field_list_id = f_resubmit.get_int(); - f_resubmit.set(0); - // TODO(antonin): a copy is not needed here, but I don't yet have an - // optimized way of doing this - auto packet_copy = copy_ingress_pkt( - packet, PKT_INSTANCE_TYPE_RESUBMIT, field_list_id); - input_buffer.push_front(std::move(packet_copy)); - continue; - } - } - - Field &f_instance_type = phv->get_field("standard_metadata.instance_type"); - - // MULTICAST - int instance_type = f_instance_type.get_int(); - if (mgid != 0) { - BMLOG_DEBUG_PKT(*packet, "Multicast requested for packet"); - Field &f_rid = phv->get_field("intrinsic_metadata.egress_rid"); - const auto pre_out = pre->replicate({mgid}); - auto packet_size = packet->get_register(PACKET_LENGTH_REG_IDX); - for (const auto &out : pre_out) { - egress_port = out.egress_port; - // if (ingress_port == egress_port) continue; // pruning - phv->get_field("egress_metadata.bridge_port").set(egress_port); - BMLOG_DEBUG_PKT(*packet, "Replicating packet on bridge port {}", egress_port); - f_rid.set(out.rid); - f_instance_type.set(PKT_INSTANCE_TYPE_REPLICATION); - std::unique_ptr packet_copy = packet->clone_with_phv_ptr(); - packet_copy->set_register(PACKET_LENGTH_REG_IDX, packet_size); - enqueue(egress_port, std::move(packet_copy)); - } - f_instance_type.set(instance_type); - - // when doing multicast, we discard the original packet - continue; - } - - egress_port = egress_spec; - BMLOG_DEBUG_PKT(*packet, "Egress port is {}", egress_port); - - if (egress_port == 511) { // drop packet - BMLOG_DEBUG_PKT(*packet, "Dropping packet at the end of ingress"); - continue; - } - - enqueue(egress_port, std::move(packet)); - } -} - -void -SimpleSwitch::egress_thread(size_t worker_id) { - PHV *phv; - - while (1) { - std::unique_ptr packet; - size_t port; - egress_buffers.pop_back(worker_id, &port, &packet); - - Deparser *deparser = this->get_deparser("deparser"); - Pipeline *egress_mau = this->get_pipeline("egress"); - - phv = packet->get_phv(); - - if (with_queueing_metadata) { - auto enq_timestamp = - phv->get_field("queueing_metadata.enq_timestamp").get(); - phv->get_field("queueing_metadata.deq_timedelta").set( - get_ts().count() - enq_timestamp); - phv->get_field("queueing_metadata.deq_qdepth").set( - egress_buffers.size(port)); - } - - phv->get_field("standard_metadata.egress_port").set(port); - - Field &f_egress_spec = phv->get_field("standard_metadata.egress_spec"); - - phv->get_field("standard_metadata.packet_length").set( - packet->get_register(PACKET_LENGTH_REG_IDX)); - - egress_mau->apply(packet.get()); - - Field &f_clone_spec = phv->get_field("standard_metadata.clone_spec"); - unsigned int clone_spec = f_clone_spec.get_uint(); - - // EGRESS CLONING - if (clone_spec) { - BMLOG_DEBUG_PKT(*packet, "Cloning packet at egress"); - int egress_port = get_mirroring_mapping(clone_spec & 0xFFFF); - if (egress_port >= 0) { - f_clone_spec.set(0); - p4object_id_t field_list_id = clone_spec >> 16; - std::unique_ptr packet_copy = - packet->clone_with_phv_reset_metadata_ptr(); - PHV *phv_copy = packet_copy->get_phv(); - FieldList *field_list = this->get_field_list(field_list_id); - field_list->copy_fields_between_phvs(phv_copy, phv); - phv_copy->get_field("standard_metadata.instance_type") - .set(PKT_INSTANCE_TYPE_EGRESS_CLONE); - enqueue(egress_port, std::move(packet_copy)); - } - } - - // TODO(antonin): should not be done like this in egress pipeline - int egress_spec = f_egress_spec.get_int(); - if (egress_spec == 511) { // drop packet - BMLOG_DEBUG_PKT(*packet, "Dropping packet at the end of egress"); - continue; - } - - // yonatanp. since cloned packet get passed egress_spec, they will update their egress_spec. in order to bypass it and allow I2E clonnig, I've added a - // P4 flag, to know if this is a cloned packet or not. There probably exists a better solution, Hopefully after changing to P4_16 this won't be needed. - if (phv->get_field("standard_metadata.instance_type").get_int() != PKT_INSTANCE_TYPE_INGRESS_CLONE) { - packet->set_egress_port(egress_spec); - BMLOG_DEBUG_PKT(*packet, "Changed egress port at egress pipeline to {}", egress_spec); - } - - deparser->deparse(packet.get()); - - // RECIRCULATE - if (phv->has_field("intrinsic_metadata.recirculate_flag")) { - Field &f_recirc = phv->get_field("intrinsic_metadata.recirculate_flag"); - if (f_recirc.get_int()) { - BMLOG_DEBUG_PKT(*packet, "Recirculating packet"); - p4object_id_t field_list_id = f_recirc.get_int(); - f_recirc.set(0); - FieldList *field_list = this->get_field_list(field_list_id); - // TODO(antonin): just like for resubmit, there is no need for a copy - // here, but it is more convenient for this first prototype - std::unique_ptr packet_copy = packet->clone_no_phv_ptr(); - PHV *phv_copy = packet_copy->get_phv(); - phv_copy->reset_metadata(); - field_list->copy_fields_between_phvs(phv_copy, phv); - phv_copy->get_field("standard_metadata.instance_type") - .set(PKT_INSTANCE_TYPE_RECIRC); - size_t packet_size = packet_copy->get_data_size(); - packet_copy->set_register(PACKET_LENGTH_REG_IDX, packet_size); - phv_copy->get_field("standard_metadata.packet_length").set(packet_size); - input_buffer.push_front(std::move(packet_copy)); - continue; - } - } - - output_buffer.push_front(std::move(packet)); - } -} diff --git a/bm/p4-sai/simple_switch.h b/bm/p4-sai/simple_switch.h deleted file mode 100644 index 915137bb4..000000000 --- a/bm/p4-sai/simple_switch.h +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright 2013-present Barefoot Networks, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Antonin Bas (antonin@barefootnetworks.com) - * - */ - -#ifndef SIMPLE_SWITCH_SIMPLE_SWITCH_H_ -#define SIMPLE_SWITCH_SIMPLE_SWITCH_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -// TODO(antonin) -// experimental support for priority queueing -// to enable it, uncomment this flag -// you can also choose the field from which the priority value will be read, as -// well as the number of priority queues per port -// PRIORITY 0 IS THE LOWEST PRIORITY -// #define SSWITCH_PRIORITY_QUEUEING_ON - -#ifdef SSWITCH_PRIORITY_QUEUEING_ON -#define SSWITCH_PRIORITY_QUEUEING_NB_QUEUES 8 -#define SSWITCH_PRIORITY_QUEUEING_SRC "intrinsic_metadata.priority" -#endif - -using ts_res = std::chrono::microseconds; -using std::chrono::duration_cast; -using ticks = std::chrono::nanoseconds; - -using bm::Switch; -using bm::Queue; -using bm::Packet; -using bm::PHV; -using bm::Parser; -using bm::Deparser; -using bm::Pipeline; -using bm::McSimplePreLAG; -using bm::Field; -using bm::FieldList; -using bm::packet_id_t; -using bm::p4object_id_t; - - -class SimpleSwitch : public Switch { - public: - using mirror_id_t = int; - - private: - using clock = std::chrono::high_resolution_clock; - - public: - // by default, swapping is off - explicit SimpleSwitch(int max_port = 256, bool enable_swap = false); - - int receive_(int port_num, const char *buffer, int len) override; - - void start_and_return_() override; - - void reset_target_state_() override; - - int mirroring_mapping_add(mirror_id_t mirror_id, int egress_port) { - mirroring_map[mirror_id] = egress_port; - return 0; - } - - int mirroring_mapping_delete(mirror_id_t mirror_id) { - return mirroring_map.erase(mirror_id); - } - - int mirroring_mapping_get(mirror_id_t mirror_id) const { - return get_mirroring_mapping(mirror_id); - } - - int set_egress_queue_depth(int port, const size_t depth_pkts); - int set_all_egress_queue_depths(const size_t depth_pkts); - - int set_egress_queue_rate(int port, const uint64_t rate_pps); - int set_all_egress_queue_rates(const uint64_t rate_pps); - - // returns the number of microseconds elapsed since the switch started - uint64_t get_time_elapsed_us() const; - - // returns the number of microseconds elasped since the clock's epoch - uint64_t get_time_since_epoch_us() const; - - private: - static constexpr size_t nb_egress_threads = 4u; - - enum PktInstanceType { - PKT_INSTANCE_TYPE_NORMAL, - PKT_INSTANCE_TYPE_INGRESS_CLONE, - PKT_INSTANCE_TYPE_EGRESS_CLONE, - PKT_INSTANCE_TYPE_COALESCED, - PKT_INSTANCE_TYPE_RECIRC, - PKT_INSTANCE_TYPE_REPLICATION, - PKT_INSTANCE_TYPE_RESUBMIT, - }; - - struct EgressThreadMapper { - explicit EgressThreadMapper(size_t nb_threads) - : nb_threads(nb_threads) { } - - size_t operator()(size_t egress_port) const { - return egress_port % nb_threads; - } - - size_t nb_threads; - }; - - private: - void ingress_thread(); - void egress_thread(size_t worker_id); - void transmit_thread(); - - int get_mirroring_mapping(mirror_id_t mirror_id) const { - const auto it = mirroring_map.find(mirror_id); - if (it == mirroring_map.end()) return -1; - return it->second; - } - - ts_res get_ts() const; - - // TODO(antonin): switch to pass by value? - void enqueue(int egress_port, std::unique_ptr &&pkt); - - std::unique_ptr copy_ingress_pkt( - const std::unique_ptr &pkt, - PktInstanceType copy_type, p4object_id_t field_list_id); - - void check_queueing_metadata(); - - private: - int max_port; - Queue > input_buffer; -#ifdef SSWITCH_PRIORITY_QUEUEING_ON - bm::QueueingLogicPriRL, EgressThreadMapper> -#else - bm::QueueingLogicRL, EgressThreadMapper> -#endif - egress_buffers; - Queue > output_buffer; - std::shared_ptr pre; - clock::time_point start; - std::unordered_map mirroring_map; - bool with_queueing_metadata{false}; -}; - -#endif // SIMPLE_SWITCH_SIMPLE_SWITCH_H_ diff --git a/bm/p4-sai/simple_switch_CLI.in b/bm/p4-sai/simple_switch_CLI.in deleted file mode 100644 index 88a56ce3f..000000000 --- a/bm/p4-sai/simple_switch_CLI.in +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python2 - -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Antonin Bas (antonin@barefootnetworks.com) -# -# - -# This is just a wrapper script around sswitch_CLI.py -# It makes sure that the script works correctly no matter where Python -# dependencies are installed - -import sys -sys.path.append("@pythondir@") - -import sswitch_CLI -sswitch_CLI.main() diff --git a/bm/p4-sai/sswitch_CLI b/bm/p4-sai/sswitch_CLI deleted file mode 100755 index 7ac78afb6..000000000 --- a/bm/p4-sai/sswitch_CLI +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -json="" -if [ $# -eq 1 ]; then - echo "Using JSON input $1" - json="--json $1" -fi -port="" -if [ $# -eq 2 ]; then - echo "Using Thrift port $2" - port="--thrift-port $2" -else - echo "No Thrift port specified, using CLI default" -fi -if [ $# -gt 2 ]; then - echo "Invalid number of arguments" - echo "Usage: $0 [ []]" - exit 1 -fi - -CLI=$THIS_DIR/sswitch_CLI.py -TOOLS_DIR=$THIS_DIR/../../tools/ - -PYTHONPATH=$PYTHONPATH:$TOOLS_DIR python $CLI $json $port diff --git a/bm/p4-sai/sswitch_CLI.py b/bm/p4-sai/sswitch_CLI.py deleted file mode 100644 index c0965804e..000000000 --- a/bm/p4-sai/sswitch_CLI.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python2 - -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Antonin Bas (antonin@barefootnetworks.com) -# -# - -import runtime_CLI - -import sys -import os - -from sswitch_runtime import SimpleSwitch - -class SimpleSwitchAPI(runtime_CLI.RuntimeAPI): - @staticmethod - def get_thrift_services(): - return [("simple_switch", SimpleSwitch.Client)] - - def __init__(self, pre_type, standard_client, mc_client, sswitch_client): - runtime_CLI.RuntimeAPI.__init__(self, pre_type, - standard_client, mc_client) - self.sswitch_client = sswitch_client - - def do_set_queue_depth(self, line): - "Set depth of one / all egress queue(s): set_queue_depth []" - args = line.split() - depth = int(args[0]) - if len(args) > 1: - port = int(args[1]) - self.sswitch_client.set_egress_queue_depth(port, depth) - else: - self.sswitch_client.set_all_egress_queue_depths(depth) - - def do_set_queue_rate(self, line): - "Set rate of one / all egress queue(s): set_queue_rate []" - args = line.split() - rate = int(args[0]) - if len(args) > 1: - port = int(args[1]) - self.sswitch_client.set_egress_queue_rate(port, rate) - else: - self.sswitch_client.set_all_egress_queue_rates(rate) - - def do_mirroring_add(self, line): - "Add mirroring mapping: mirroring_add " - args = line.split() - mirror_id, egress_port = int(args[0]), int(args[1]) - self.sswitch_client.mirroring_mapping_add(mirror_id, egress_port) - - def do_mirroring_delete(self, line): - "Delete mirroring mapping: mirroring_delete " - mirror_id = int(line) - self.sswitch_client.mirroring_mapping_delete(mirror_id) - - def do_get_time_elapsed(self, line): - "Get time elapsed (in microseconds) since the switch started: get_time_elapsed" - print self.sswitch_client.get_time_elapsed_us() - - def do_get_time_since_epoch(self, line): - "Get time elapsed (in microseconds) since the switch clock's epoch: get_time_since_epoch" - print self.sswitch_client.get_time_since_epoch_us() - -def main(): - args = runtime_CLI.get_parser().parse_args() - - args.pre = runtime_CLI.PreType.SimplePreLAG - - services = runtime_CLI.RuntimeAPI.get_thrift_services(args.pre) - services.extend(SimpleSwitchAPI.get_thrift_services()) - - standard_client, mc_client, sswitch_client = runtime_CLI.thrift_connect( - args.thrift_ip, args.thrift_port, services - ) - - runtime_CLI.load_json_config(standard_client, args.json) - - SimpleSwitchAPI(args.pre, standard_client, mc_client, sswitch_client).cmdloop() - -if __name__ == '__main__': - main() diff --git a/bm/p4-sai/thrift/simple_switch.thrift b/bm/p4-sai/thrift/simple_switch.thrift deleted file mode 100644 index 1242b7a85..000000000 --- a/bm/p4-sai/thrift/simple_switch.thrift +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2013-present Barefoot Networks, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Antonin Bas (antonin@barefootnetworks.com) - * - */ - -namespace cpp sswitch_runtime -namespace py sswitch_runtime - -service SimpleSwitch { - - i32 mirroring_mapping_add(1:i32 mirror_id, 2:i32 egress_port); - i32 mirroring_mapping_delete(1:i32 mirror_id); - i32 mirroring_mapping_get_egress_port(1:i32 mirror_id); - - i32 set_egress_queue_depth(1:i32 port_num, 2:i32 depth_pkts); - i32 set_all_egress_queue_depths(1:i32 depth_pkts); - i32 set_egress_queue_rate(1:i32 port_num, 2:i64 rate_pps); - i32 set_all_egress_queue_rates(1:i64 rate_pps); - - // these methods are here as an experiment, prefer get_time_elapsed_us() when - // possible - i64 get_time_elapsed_us(); - i64 get_time_since_epoch_us(); - -} diff --git a/bm/p4-sai/thrift/src/SimpleSwitch_server.cpp b/bm/p4-sai/thrift/src/SimpleSwitch_server.cpp deleted file mode 100644 index a3be4649d..000000000 --- a/bm/p4-sai/thrift/src/SimpleSwitch_server.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* Copyright 2013-present Barefoot Networks, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Antonin Bas (antonin@barefootnetworks.com) - * - */ - -#include - -#ifdef P4THRIFT -#include -#include -#include -#include - -namespace thrift_provider = p4::thrift; -#else -#include -#include -#include -#include - -namespace thrift_provider = apache::thrift; -#endif - -#include -#include - -#include "simple_switch.h" - -namespace sswitch_runtime { - -class SimpleSwitchHandler : virtual public SimpleSwitchIf { - public: - explicit SimpleSwitchHandler(SimpleSwitch *sw) - : switch_(sw) { } - - int32_t mirroring_mapping_add(const int32_t mirror_id, - const int32_t egress_port) { - bm::Logger::get()->trace("mirroring_mapping_add"); - return switch_->mirroring_mapping_add(mirror_id, egress_port); - } - - int32_t mirroring_mapping_delete(const int32_t mirror_id) { - bm::Logger::get()->trace("mirroring_mapping_delete"); - return switch_->mirroring_mapping_delete(mirror_id); - } - - int32_t mirroring_mapping_get_egress_port(const int32_t mirror_id) { - bm::Logger::get()->trace("mirroring_mapping_get_egress_port"); - return switch_->mirroring_mapping_get(mirror_id); - } - - int32_t set_egress_queue_depth(const int32_t port_num, - const int32_t depth_pkts) { - bm::Logger::get()->trace("set_egress_queue_depth"); - return switch_->set_egress_queue_depth(port_num, - static_cast(depth_pkts)); - } - - int32_t set_all_egress_queue_depths(const int32_t depth_pkts) { - bm::Logger::get()->trace("set_all_egress_queue_depths"); - return switch_->set_all_egress_queue_depths( - static_cast(depth_pkts)); - } - - int32_t set_egress_queue_rate(const int32_t port_num, - const int64_t rate_pps) { - bm::Logger::get()->trace("set_egress_queue_rate"); - return switch_->set_egress_queue_rate(port_num, - static_cast(rate_pps)); - } - - int32_t set_all_egress_queue_rates(const int64_t rate_pps) { - bm::Logger::get()->trace("set_all_egress_queue_rates"); - return switch_->set_all_egress_queue_rates(static_cast(rate_pps)); - } - - int64_t get_time_elapsed_us() { - bm::Logger::get()->trace("get_time_elapsed_us"); - // cast from unsigned to signed - return static_cast(switch_->get_time_elapsed_us()); - } - - int64_t get_time_since_epoch_us() { - bm::Logger::get()->trace("get_time_since_epoch_us"); - // cast from unsigned to signed - return static_cast(switch_->get_time_since_epoch_us()); - } - - private: - SimpleSwitch *switch_; -}; - -boost::shared_ptr get_handler(SimpleSwitch *sw) { - return boost::shared_ptr(new SimpleSwitchHandler(sw)); -} - -} // namespace sswitch_runtime diff --git a/bm/p4-sai/veth_setup.sh b/bm/p4-sai/veth_setup.sh deleted file mode 100755 index ca73da0a4..000000000 --- a/bm/p4-sai/veth_setup.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -sudo -v -for idx in 0 1 2 3 4; do - intf0="sw_port$(($idx))" - intf1="host_port0" - net="host$(($idx))" - ip="10.0.0.$(($idx))/24" - if ! ip link show $intf0 &> /dev/null; then - sudo ip link add name $intf0 type veth peer name $intf1 - sudo ip link set dev $intf0 up - sudo ip netns add $net - sudo ip link set dev $intf1 netns $net - sudo ip netns exec $net ip link set dev $intf1 up - sudo ip netns exec $net ip address add $ip dev $intf1 - fi -done - -# Last host will have 3 ports, to enable LACP and lag -net="host5" -sudo ip netns add $net -for port_idx in 0 1 2; do - idx=port_idx+5 - intf0="sw_port$(($idx))" - intf1="host_port$(($port_idx))" - ip="10.0.0.$(($idx))/24" - if ! ip link show $intf0 &> /dev/null; then - sudo ip link add name $intf0 type veth peer name $intf1 - sudo ip link set dev $intf0 up - sudo ip link set dev $intf1 netns $net - sudo ip netns exec $net ip link set dev $intf1 up - sudo ip netns exec $net ip address add $ip dev $intf1 - fi -done - -intf0="cpu_port" -intf1="host_port" -net="hostif_net" -sudo ip link add name $intf0 type veth peer name $intf1 -sudo ip link set dev $intf0 up -sudo ip netns add $net -sudo ip link set dev $intf1 netns $net -sudo ip netns exec $net ip link set dev $intf1 up - diff --git a/bm/p4-sai/veth_teardown.sh b/bm/p4-sai/veth_teardown.sh deleted file mode 100755 index 4fd7bfb09..000000000 --- a/bm/p4-sai/veth_teardown.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -sudo -v - -for idx in 0 1 2 3 4 5; do - intf0="sw_port$(($idx))" - net="host$(($idx))" - if sudo ip link show $intf0 &> /dev/null; then - sudo ip link delete $intf0 type veth - fi - if sudo ip netns show $net &> /dev/null; then - sudo ip netns delete $net - fi -done - -for idx in 6 7; do - intf0="sw_port$(($idx))" - if sudo ip link show $intf0 &> /dev/null; then - sudo ip link delete $intf0 type veth - fi -done - -intf0="cpu_port" -intf1="host_port" -net="hostif_net" -if sudo ip link show $intf0 &> /dev/null; then - sudo ip link delete $intf0 type veth -fi -if sudo ip link show $intf1 &> /dev/null; then - sudo ip link delete $intf1 type veth -fi -if sudo ip netns show $net &> /dev/null; then - sudo ip netns delete $net -fi \ No newline at end of file diff --git a/bm/sai_adapter/README.md b/bm/sai_adapter/README.md deleted file mode 100644 index 50a66091b..000000000 --- a/bm/sai_adapter/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# SAI API -The sai lib (C lib) uses P4 thrift to configure the soft switch as described below: - -## Including the SAI lib -The sai_api lib is currently under development. -In the meantime, please include sai.h, check the [unit test](test/unittest) folder for example. -Please build it from the src folder using "make". - -## PTF tests -SAI Tests were written using the [ptf](https://github.com/p4lang/ptf) framework. -The directory is divided to tests (ready and passing tests), wip_tests for work in progress. - -### Runing the tests -First, run make from this location. This will build the sai library, generate the needed thrift and ctypesgen files, and will build the C thrift server, needed to run the tests. \\ -ctypesgen will be needed for this (python wrapper for the C header files used by ptf), and can be easily installed with pip: -```shell -pip install ctypesgen -``` -or from source: [ctypesgen](https://github.com/davidjamesca/ctypesgen). - -Now, follow these steps to run the PTF tests: -1. In SAI-P4-BM/tree/master/p4-softswitch/targets/P4-SAI/ run: - 1. veth_setup.sh - to configure virtual ports. - 2. run_server.sh - to start the P4 BM server. - -2. Start new terminal and run the sai thrift server: - SAI-P4-BM/sai_adapter/test/sai_thrift_server/run_server.sh - -3. Start another new terminal and run the [PTF tests](test/ptf_tests/) directly, or by one the test shell scripts found in the ptf test folder: tests/ptf_tests/run_ptf.sh - -### LOGS -During the tests, the following logs are outputted: -1) BM server log can be found under SAI-P4-BM/p4-softswitch/targets/P4-SAI/log.txt -2) thrift server log is outputted to SAI-P4-BM/sai_adapter/test/sai_thrift_server/logs/log.txt -3) PTF log is stdout. - -# SAI BM Contribution Guide -## Adding BM functionaity -For new Soft Switch features ("HW" flows), please follow the [SAI-P4-BM/p4-softswitch](../SAI-P4-BM/p4-softswitch/) readme. -### Python development server -For P4 new features testing, it is possible to bypass implementing new SAI C implementations, and just update the thirft implementation in python. -use the [python thrift server](test/sai_thrift_development_python_server/) found in test/sai_thrift_development_python_server/. -If you decide to do so, run the sai p4 thrift server with: -tests/sai_thrift_development_python_server/sai_rpc_server.sh - -## Implementing new SAI functionaity: -* in [sai_adapter_interface.h](inc/sai_adapter_interface.h) create C function decleration. -* in [sai_adapter_interface.cpp](src/sai_adapter_interface.cpp) create the function link, with the sai_object pointer. -* in [sai_adapter.h](inc/sai_adapter.h) add a static decleration for the function. -* for new/unimplemented api, also add the sai_api decleration, and link in the sai_api_query in the sai_object.h, and sai.c files. -* Add the function implementation to a .cpp file in the [src/](src/) dir, under the sai_object namespace. -* For PTF testing: - * add thrift function implementation to the [sai_thrift_server](test/sai_thrift_server). - * add PTF test in [test/ptf_tests/](test/ptf_tests/). -### Additional information -* the sai_object uses the [switch_meta_data.h](inc/switch_meta_data.h) to manage the runtime information regarding the sai_object_ids etc... -* to configure the BM tables, use the P4 thrift API is found (after p4-sofswitch compliation) in /SAI-P4-BM/p4-softswitch/thrift_src/gen-cpp/bm/Standard.h diff --git a/bm/sai_adapter/inc/sai_adapter.h b/bm/sai_adapter/inc/sai_adapter.h deleted file mode 100644 index 3aab783e8..000000000 --- a/bm/sai_adapter/inc/sai_adapter.h +++ /dev/null @@ -1,223 +0,0 @@ -#ifndef SAI_ADAPTER_H -#define SAI_ADAPTER_H - - -// SAI -#ifdef __cplusplus -extern "C" { -#endif -// TUN/TAP if -#include "tun_if.h" -#include -#ifdef __cplusplus -} -#endif - -// INTERNAL -#include "switch_meta_data.h" - -// thrift bm clinet -#include -#include -#include -#include -#include -#include - -// LOG -#include "../inc/spdlog/spdlog.h" - -// General -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace ::apache::thrift; -using namespace ::apache::thrift::protocol; -using namespace ::apache::thrift::transport; - -using namespace bm_runtime::standard; - -const int bm_port = 9090; -const int32_t cxt_id = 0; - -// static StandardClient* bm_client_ptr; -// static sai_id_map_t* sai_id_map_ptr; -string parse_param(uint64_t param, uint32_t num_of_bytes); -BmMatchParam parse_exact_match_param(uint64_t param, uint32_t num_of_bytes); -BmMatchParam parse_valid_match_param(bool param); -uint64_t parse_mac_64(uint8_t const mac_8[6]); - -class sai_adapter { - public: - // thrift - boost::shared_ptr socket; - boost::shared_ptr transport; - boost::shared_ptr bprotocol; - boost::shared_ptr protocol; - StandardClient bm_client; - // generals - sai_id_map_t sai_id_map; - Switch_metadata switch_metadata; - vector switch_list; - uint32_t list[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - // logger - std::shared_ptr logger_o; - static vector *switch_list_ptr; - static sai_id_map_t *sai_id_map_ptr; - static StandardClient *bm_client_ptr; - static Switch_metadata *switch_metadata_ptr; - static std::shared_ptr *logger; - // switch - static sai_status_t create_switch(sai_object_id_t *switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t get_switch_attribute(sai_object_id_t switch_id, - sai_uint32_t attr_count, - sai_attribute_t *attr_list); - // port functions - static sai_status_t create_port(sai_object_id_t *port_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_port(sai_object_id_t port_id); - static sai_status_t set_port_attribute(sai_object_id_t port_id, - const sai_attribute_t *attr); - static sai_status_t get_port_attribute(sai_object_id_t port_id, - uint32_t attr_count, - sai_attribute_t *attr_list); - static void config_port(Port_obj *port); - static void set_parsed_port_attribute(Port_obj *port, - sai_attribute_t attribute); - static void get_parsed_port_attribute(Port_obj *port, - sai_attribute_t *attribute); - // bridge functions - static sai_status_t create_bridge(sai_object_id_t *bridge_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_bridge(sai_object_id_t bridge_id); - static sai_status_t get_bridge_attribute(sai_object_id_t bridge_id, - uint32_t attr_count, - sai_attribute_t *attr_list); - - // bridge_port functions - static sai_status_t create_bridge_port(sai_object_id_t *bridge_port_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_bridge_port(sai_object_id_t bridge_port_id); - static sai_status_t get_bridge_port_attribute(sai_object_id_t bridge_port_id, - uint32_t attr_count, - sai_attribute_t *attr_list); - // fdb - static sai_status_t create_fdb_entry(const sai_fdb_entry_t *fdb_entry, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_fdb_entry(const sai_fdb_entry_t *fdb_entry); - // vlan - static sai_status_t create_vlan(sai_object_id_t *vlan_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_vlan(sai_object_id_t vlan_id); - static sai_status_t set_vlan_attribute(sai_object_id_t vlan_id, - const sai_attribute_t *attr); - static sai_status_t get_vlan_attribute(sai_object_id_t vlan_id, - const uint32_t attr_count, - sai_attribute_t *attr_list); - static sai_status_t create_vlan_member(sai_object_id_t *vlan_member_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_vlan_member(sai_object_id_t vlan_member_id); - static sai_status_t set_vlan_member_attribute(sai_object_id_t vlan_member_id, - const sai_attribute_t *attr); - static sai_status_t get_vlan_member_attribute(sai_object_id_t vlan_member_id, - const uint32_t attr_count, - sai_attribute_t *attr_list); - static sai_status_t get_vlan_stats(sai_object_id_t vlan_id, - const sai_vlan_stat_t *counter_ids, - uint32_t number_of_counters, - uint64_t *counters); - static sai_status_t clear_vlan_stats(sai_object_id_t vlan_id, - const sai_vlan_stat_t *counter_ids, - uint32_t number_of_counters); - // lag - static sai_status_t create_lag(sai_object_id_t *lag_id, - sai_object_id_t switch_id, uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_lag(sai_object_id_t lag_id); - static sai_status_t create_lag_member(sai_object_id_t *lag_member_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_lag_member(sai_object_id_t lag_member_id); - - // hostif - static sai_status_t create_hostif(sai_object_id_t *hif_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_hostif(sai_object_id_t hif_id); - static sai_status_t create_hostif_table_entry( - sai_object_id_t *hif_table_entry, sai_object_id_t switch_id, - uint32_t attr_count, const sai_attribute_t *attr_list); - static sai_status_t remove_hostif_table_entry( - sai_object_id_t hif_table_entry); - static sai_status_t create_hostif_trap_group( - sai_object_id_t *hostif_trap_group_id, sai_object_id_t switch_id, - uint32_t attr_count, const sai_attribute_t *attr_list); - static sai_status_t remove_hostif_trap_group( - sai_object_id_t hostif_trap_group_id); - static sai_status_t create_hostif_trap(sai_object_id_t *hostif_trap_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list); - static sai_status_t remove_hostif_trap(sai_object_id_t hostif_trap_id); - - // api s - sai_port_api_t port_api; - sai_bridge_api_t bridge_api; - sai_fdb_api_t fdb_api; - sai_switch_api_t switch_api; - sai_vlan_api_t vlan_api; - sai_lag_api_t lag_api; - sai_hostif_api_t hostif_api; - sai_adapter(); - ~sai_adapter(); - sai_status_t sai_api_query(sai_api_t sai_api_id, void **api_method_table); - - private: - // sai_object_id_t switch_id; - pcap_t *adapter_pcap; - // sai adapter threading handlers - std::thread SaiAdapterThread; - static bool pcap_loop_started; - static std::mutex m; - std::condition_variable cv; - void startSaiAdapterMain(); - void endSaiAdapterMain(); - void SaiAdapterMain(); - void release_pcap_lock(); - // - void PacketSniffer(); - void internal_init_switch(); - static uint32_t get_bridge_id_from_fdb_entry( - const sai_fdb_entry_t *fdb_entry); - static void packetHandler(u_char *, const struct pcap_pkthdr *, - const u_char *); - void adapter_create_fdb_entry(sai_object_id_t, sai_mac_t, - sai_fdb_entry_bridge_type_t, sai_vlan_id_t, - sai_object_id_t); - void learn_mac(uint32_t, uint8_t *); -}; - -#endif \ No newline at end of file diff --git a/bm/sai_adapter/inc/sai_adapter_interface.h b/bm/sai_adapter/inc/sai_adapter_interface.h deleted file mode 100644 index b3ecce7c9..000000000 --- a/bm/sai_adapter/inc/sai_adapter_interface.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef SAI_ADAPTER_INTERFACE_H -#define SAI_ADAPTER_INTERFACE_H -#include - -#ifdef __cplusplus -extern "C" { -#endif -typedef void *S_O_Handle; -S_O_Handle create_sai_adapter(); -void free_sai_adapter(S_O_Handle); - -// api -sai_status_t sai_adapter_api_query(S_O_Handle, sai_api_t, void **); - -// switch -sai_status_t sai_adapter_create_switch(S_O_Handle, sai_object_id_t *, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_get_switch_attribute(S_O_Handle, sai_object_id_t, - sai_uint32_t, sai_attribute_t *); - -// port -sai_status_t sai_adapter_create_port(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_port(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_set_port_attribute(S_O_Handle, sai_object_id_t port_id, - sai_attribute_t *); -sai_status_t sai_adapter_get_port_attribute(S_O_Handle, sai_object_id_t port_id, - uint32_t, sai_attribute_t *); - -// bridge -sai_status_t sai_adapter_create_bridge(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_bridge(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_get_bridge_attribute(S_O_Handle, - sai_object_id_t bridge_id, - uint32_t, sai_attribute_t *); - -// bridge_port -sai_status_t sai_adapter_create_bridge_port(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_bridge_port(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_get_bridge_port_attribute( - S_O_Handle, sai_object_id_t bridge_port_id, uint32_t, sai_attribute_t *); - -// FDB -sai_status_t sai_adapter_create_fdb_entry(S_O_Handle, sai_fdb_entry_t *, - uint32_t, const sai_attribute_t *); -sai_status_t sai_adapter_remove_fdb_entry(S_O_Handle, sai_fdb_entry_t *); - -// VLAN -sai_status_t sai_adapter_create_vlan(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_vlan(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_set_vlan_attribute(S_O_Handle, sai_object_id_t, - const sai_attribute_t *); -sai_status_t sai_adapter_get_vlan_attribute(S_O_Handle, sai_object_id_t, - const uint32_t, sai_attribute_t *); -sai_status_t sai_adapter_create_vlan_member(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_vlan_member(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_set_vlan_member_attribute(S_O_Handle, sai_object_id_t, - const sai_attribute_t *); -sai_status_t sai_adapter_get_vlan_member_attribute(S_O_Handle, sai_object_id_t, - const uint32_t, - sai_attribute_t *); -sai_status_t sai_adapter_get_vlan_stats(S_O_Handle, sai_object_id_t, - const sai_vlan_stat_t *, uint32_t, - uint64_t *); -sai_status_t sai_adapter_clear_vlan_stats(S_O_Handle, sai_object_id_t, - const sai_vlan_stat_t *, uint32_t); - -// LAG -sai_status_t sai_adapter_create_lag(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_lag(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_create_lag_member(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_lag_member(S_O_Handle, sai_object_id_t); - -// hostif -sai_status_t sai_adapter_create_hostif(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_hostif(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_create_hostif_table_entry(S_O_Handle, - sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_hostif_table_entry(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_create_hostif_trap_group(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_hostif_trap_group(S_O_Handle, sai_object_id_t); -sai_status_t sai_adapter_create_hostif_trap(S_O_Handle, sai_object_id_t *, - sai_object_id_t, uint32_t, - const sai_attribute_t *); -sai_status_t sai_adapter_remove_hostif_trap(S_O_Handle, sai_object_id_t); - -#ifdef __cplusplus -} -#endif -#endif \ No newline at end of file diff --git a/bm/sai_adapter/inc/spdlog/async_logger.h b/bm/sai_adapter/inc/spdlog/async_logger.h deleted file mode 100644 index 1c42fd9ce..000000000 --- a/bm/sai_adapter/inc/spdlog/async_logger.h +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// Very fast asynchronous logger (millions of logs per second on an average desktop) -// Uses pre allocated lockfree queue for maximum throughput even under large number of threads. -// Creates a single back thread to pop messages from the queue and log them. -// -// Upon each log write the logger: -// 1. Checks if its log level is enough to log the message -// 2. Push a new copy of the message to a queue (or block the caller until space is available in the queue) -// 3. will throw spdlog_ex upon log exceptions -// Upon destruction, logs all remaining messages in the queue before destructing.. - -#include -#include - -#include -#include -#include -#include - -namespace spdlog -{ - -namespace details -{ -class async_log_helper; -} - -class async_logger :public logger -{ -public: - template - async_logger(const std::string& name, - const It& begin, - const It& end, - size_t queue_size, - const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, - const std::function& worker_warmup_cb = nullptr, - const std::chrono::milliseconds& flush_interval_ms = std::chrono::milliseconds::zero(), - const std::function& worker_teardown_cb = nullptr); - - async_logger(const std::string& logger_name, - sinks_init_list sinks, - size_t queue_size, - const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, - const std::function& worker_warmup_cb = nullptr, - const std::chrono::milliseconds& flush_interval_ms = std::chrono::milliseconds::zero(), - const std::function& worker_teardown_cb = nullptr); - - async_logger(const std::string& logger_name, - sink_ptr single_sink, - size_t queue_size, - const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, - const std::function& worker_warmup_cb = nullptr, - const std::chrono::milliseconds& flush_interval_ms = std::chrono::milliseconds::zero(), - const std::function& worker_teardown_cb = nullptr); - - //Wait for the queue to be empty, and flush synchronously - //Warning: this can potentialy last forever as we wait it to complete - void flush() override; -protected: - void _sink_it(details::log_msg& msg) override; - void _set_formatter(spdlog::formatter_ptr msg_formatter) override; - void _set_pattern(const std::string& pattern) override; - -private: - std::unique_ptr _async_log_helper; -}; -} - - -#include diff --git a/bm/sai_adapter/inc/spdlog/common.h b/bm/sai_adapter/inc/spdlog/common.h deleted file mode 100644 index a0a227ef6..000000000 --- a/bm/sai_adapter/inc/spdlog/common.h +++ /dev/null @@ -1,143 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) -#include -#include -#endif - -#include - -//visual studio upto 2013 does not support noexcept nor constexpr -#if defined(_MSC_VER) && (_MSC_VER < 1900) -#define SPDLOG_NOEXCEPT throw() -#define SPDLOG_CONSTEXPR -#else -#define SPDLOG_NOEXCEPT noexcept -#define SPDLOG_CONSTEXPR constexpr -#endif - -#if defined(__GNUC__) || defined(__clang__) -#define SPDLOG_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) -#define SPDLOG_DEPRECATED __declspec(deprecated) -#else -#define SPDLOG_DEPRECATED -#endif - - -#include - -namespace spdlog -{ - -class formatter; - -namespace sinks -{ -class sink; -} - -using log_clock = std::chrono::system_clock; -using sink_ptr = std::shared_ptr < sinks::sink >; -using sinks_init_list = std::initializer_list < sink_ptr >; -using formatter_ptr = std::shared_ptr; -#if defined(SPDLOG_NO_ATOMIC_LEVELS) -using level_t = details::null_atomic_int; -#else -using level_t = std::atomic; -#endif - -using log_err_handler = std::function; - -//Log level enum -namespace level -{ -typedef enum -{ - trace = 0, - debug = 1, - info = 2, - warn = 3, - err = 4, - critical = 5, - off = 6 -} level_enum; - -static const char* level_names[] { "trace", "debug", "info", "warning", "error", "critical", "off" }; - -static const char* short_level_names[] { "T", "D", "I", "W", "E", "C", "O" }; - -inline const char* to_str(spdlog::level::level_enum l) -{ - return level_names[l]; -} - -inline const char* to_short_str(spdlog::level::level_enum l) -{ - return short_level_names[l]; -} -} //level - - -// -// Async overflow policy - block by default. -// -enum class async_overflow_policy -{ - block_retry, // Block / yield / sleep until message can be enqueued - discard_log_msg // Discard the message it enqueue fails -}; - - -// -// Log exception -// -namespace details -{ -namespace os -{ -std::string errno_str(int err_num); -} -} -class spdlog_ex: public std::exception -{ -public: - spdlog_ex(const std::string& msg):_msg(msg) - {} - spdlog_ex(const std::string& msg, int last_errno) - { - _msg = msg + ": " + details::os::errno_str(last_errno); - } - const char* what() const SPDLOG_NOEXCEPT override - { - return _msg.c_str(); - } -private: - std::string _msg; - -}; - -// -// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined) -// -#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) -using filename_t = std::wstring; -#else -using filename_t = std::string; -#endif - - -} //spdlog diff --git a/bm/sai_adapter/inc/spdlog/details/async_log_helper.h b/bm/sai_adapter/inc/spdlog/details/async_log_helper.h deleted file mode 100644 index deb8dcc60..000000000 --- a/bm/sai_adapter/inc/spdlog/details/async_log_helper.h +++ /dev/null @@ -1,378 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -// async log helper : -// Process logs asynchronously using a back thread. -// -// If the internal queue of log messages reaches its max size, -// then the client call will block until there is more room. -// -// If the back thread throws during logging, a spdlog::spdlog_ex exception -// will be thrown in client's thread when tries to log the next message - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace spdlog -{ -namespace details -{ - -class async_log_helper -{ - // Async msg to move to/from the queue - // Movable only. should never be copied - enum class async_msg_type - { - log, - flush, - terminate - }; - struct async_msg - { - std::string logger_name; - level::level_enum level; - log_clock::time_point time; - size_t thread_id; - std::string txt; - async_msg_type msg_type; - - async_msg() = default; - ~async_msg() = default; - - -async_msg(async_msg&& other) SPDLOG_NOEXCEPT: - logger_name(std::move(other.logger_name)), - level(std::move(other.level)), - time(std::move(other.time)), - txt(std::move(other.txt)), - msg_type(std::move(other.msg_type)) - {} - - async_msg(async_msg_type m_type) :msg_type(m_type) - {} - - async_msg& operator=(async_msg&& other) SPDLOG_NOEXCEPT - { - logger_name = std::move(other.logger_name); - level = other.level; - time = std::move(other.time); - thread_id = other.thread_id; - txt = std::move(other.txt); - msg_type = other.msg_type; - return *this; - } - - // never copy or assign. should only be moved.. - async_msg(const async_msg&) = delete; - async_msg& operator=(const async_msg& other) = delete; - - // construct from log_msg - async_msg(const details::log_msg& m) : - level(m.level), - time(m.time), - thread_id(m.thread_id), - txt(m.raw.data(), m.raw.size()), - msg_type(async_msg_type::log) - { -#ifndef SPDLOG_NO_NAME - logger_name = *m.logger_name; -#endif - } - - - // copy into log_msg - void fill_log_msg(log_msg &msg) - { - msg.logger_name = &logger_name; - msg.level = level; - msg.time = time; - msg.thread_id = thread_id; - msg.raw << txt; - } - }; - -public: - - using item_type = async_msg; - using q_type = details::mpmc_bounded_queue; - - using clock = std::chrono::steady_clock; - - - async_log_helper(formatter_ptr formatter, - const std::vector& sinks, - size_t queue_size, - const log_err_handler err_handler, - const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, - const std::function& worker_warmup_cb = nullptr, - const std::chrono::milliseconds& flush_interval_ms = std::chrono::milliseconds::zero(), - const std::function& worker_teardown_cb = nullptr); - - void log(const details::log_msg& msg); - - // stop logging and join the back thread - ~async_log_helper(); - - void set_formatter(formatter_ptr); - - void flush(bool wait_for_q); - - -private: - formatter_ptr _formatter; - std::vector> _sinks; - - // queue of messages to log - q_type _q; - - log_err_handler _err_handler; - - bool _flush_requested; - - bool _terminate_requested; - - - // overflow policy - const async_overflow_policy _overflow_policy; - - // worker thread warmup callback - one can set thread priority, affinity, etc - const std::function _worker_warmup_cb; - - // auto periodic sink flush parameter - const std::chrono::milliseconds _flush_interval_ms; - - // worker thread teardown callback - const std::function _worker_teardown_cb; - - // worker thread - std::thread _worker_thread; - - void push_msg(async_msg&& new_msg); - - // worker thread main loop - void worker_loop(); - - // pop next message from the queue and process it. will set the last_pop to the pop time - // return false if termination of the queue is required - bool process_next_msg(log_clock::time_point& last_pop, log_clock::time_point& last_flush); - - void handle_flush_interval(log_clock::time_point& now, log_clock::time_point& last_flush); - - // sleep,yield or return immediatly using the time passed since last message as a hint - static void sleep_or_yield(const spdlog::log_clock::time_point& now, const log_clock::time_point& last_op_time); - - // wait until the queue is empty - void wait_empty_q(); - -}; -} -} - -/////////////////////////////////////////////////////////////////////////////// -// async_sink class implementation -/////////////////////////////////////////////////////////////////////////////// -inline spdlog::details::async_log_helper::async_log_helper( - formatter_ptr formatter, - const std::vector& sinks, - size_t queue_size, - log_err_handler err_handler, - const async_overflow_policy overflow_policy, - const std::function& worker_warmup_cb, - const std::chrono::milliseconds& flush_interval_ms, - const std::function& worker_teardown_cb): - _formatter(formatter), - _sinks(sinks), - _q(queue_size), - _err_handler(err_handler), - _flush_requested(false), - _terminate_requested(false), - _overflow_policy(overflow_policy), - _worker_warmup_cb(worker_warmup_cb), - _flush_interval_ms(flush_interval_ms), - _worker_teardown_cb(worker_teardown_cb), - _worker_thread(&async_log_helper::worker_loop, this) -{} - -// Send to the worker thread termination message(level=off) -// and wait for it to finish gracefully -inline spdlog::details::async_log_helper::~async_log_helper() -{ - try - { - push_msg(async_msg(async_msg_type::terminate)); - _worker_thread.join(); - } - catch (...) // don't crash in destructor - {} -} - - -//Try to push and block until succeeded (if the policy is not to discard when the queue is full) -inline void spdlog::details::async_log_helper::log(const details::log_msg& msg) -{ - push_msg(async_msg(msg)); -} - -inline void spdlog::details::async_log_helper::push_msg(details::async_log_helper::async_msg&& new_msg) -{ - if (!_q.enqueue(std::move(new_msg)) && _overflow_policy != async_overflow_policy::discard_log_msg) - { - auto last_op_time = details::os::now(); - auto now = last_op_time; - do - { - now = details::os::now(); - sleep_or_yield(now, last_op_time); - } - while (!_q.enqueue(std::move(new_msg))); - } -} - -// optionally wait for the queue be empty and request flush from the sinks -inline void spdlog::details::async_log_helper::flush(bool wait_for_q) -{ - push_msg(async_msg(async_msg_type::flush)); - if(wait_for_q) - wait_empty_q(); //return only make after the above flush message was processed -} - -inline void spdlog::details::async_log_helper::worker_loop() -{ - try - { - if (_worker_warmup_cb) _worker_warmup_cb(); - auto last_pop = details::os::now(); - auto last_flush = last_pop; - while(process_next_msg(last_pop, last_flush)); - if (_worker_teardown_cb) _worker_teardown_cb(); - } - catch (const std::exception &ex) - { - _err_handler(ex.what()); - } - catch (...) - { - _err_handler("Unknown exception"); - } -} - -// process next message in the queue -// return true if this thread should still be active (while no terminate msg was received) -inline bool spdlog::details::async_log_helper::process_next_msg(log_clock::time_point& last_pop, log_clock::time_point& last_flush) -{ - async_msg incoming_async_msg; - - if (_q.dequeue(incoming_async_msg)) - { - last_pop = details::os::now(); - switch (incoming_async_msg.msg_type) - { - case async_msg_type::flush: - _flush_requested = true; - break; - - case async_msg_type::terminate: - _flush_requested = true; - _terminate_requested = true; - break; - - default: - log_msg incoming_log_msg; - incoming_async_msg.fill_log_msg(incoming_log_msg); - _formatter->format(incoming_log_msg); - for (auto &s : _sinks) - { - if(s->should_log( incoming_log_msg.level)) - { - s->log(incoming_log_msg); - } - } - } - return true; - } - - // Handle empty queue.. - // This is the only place where the queue can terminate or flush to avoid losing messages already in the queue - else - { - auto now = details::os::now(); - handle_flush_interval(now, last_flush); - sleep_or_yield(now, last_pop); - return !_terminate_requested; - } -} - -// flush all sinks if _flush_interval_ms has expired -inline void spdlog::details::async_log_helper::handle_flush_interval(log_clock::time_point& now, log_clock::time_point& last_flush) -{ - auto should_flush = _flush_requested || (_flush_interval_ms != std::chrono::milliseconds::zero() && now - last_flush >= _flush_interval_ms); - if (should_flush) - { - for (auto &s : _sinks) - s->flush(); - now = last_flush = details::os::now(); - _flush_requested = false; - } -} - -inline void spdlog::details::async_log_helper::set_formatter(formatter_ptr msg_formatter) -{ - _formatter = msg_formatter; -} - - -// spin, yield or sleep. use the time passed since last message as a hint -inline void spdlog::details::async_log_helper::sleep_or_yield(const spdlog::log_clock::time_point& now, const spdlog::log_clock::time_point& last_op_time) -{ - using namespace std::this_thread; - using std::chrono::milliseconds; - using std::chrono::microseconds; - - auto time_since_op = now - last_op_time; - - // spin upto 50 micros - if (time_since_op <= microseconds(50)) - return; - - // yield upto 150 micros - if (time_since_op <= microseconds(100)) - return std::this_thread::yield(); - - // sleep for 20 ms upto 200 ms - if (time_since_op <= milliseconds(200)) - return sleep_for(milliseconds(20)); - - // sleep for 200 ms - return sleep_for(milliseconds(200)); -} - -// wait for the queue to be empty -inline void spdlog::details::async_log_helper::wait_empty_q() -{ - auto last_op = details::os::now(); - while (_q.approx_size() > 0) - { - sleep_or_yield(details::os::now(), last_op); - } -} - - - diff --git a/bm/sai_adapter/inc/spdlog/details/async_logger_impl.h b/bm/sai_adapter/inc/spdlog/details/async_logger_impl.h deleted file mode 100644 index 2092f06cf..000000000 --- a/bm/sai_adapter/inc/spdlog/details/async_logger_impl.h +++ /dev/null @@ -1,89 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// Async Logger implementation -// Use an async_sink (queue per logger) to perform the logging in a worker thread - -#include -#include - -#include -#include -#include -#include - -template -inline spdlog::async_logger::async_logger(const std::string& logger_name, - const It& begin, - const It& end, - size_t queue_size, - const async_overflow_policy overflow_policy, - const std::function& worker_warmup_cb, - const std::chrono::milliseconds& flush_interval_ms, - const std::function& worker_teardown_cb) : - logger(logger_name, begin, end), - _async_log_helper(new details::async_log_helper(_formatter, _sinks, queue_size, _err_handler, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb)) -{ -} - -inline spdlog::async_logger::async_logger(const std::string& logger_name, - sinks_init_list sinks_list, - size_t queue_size, - const async_overflow_policy overflow_policy, - const std::function& worker_warmup_cb, - const std::chrono::milliseconds& flush_interval_ms, - const std::function& worker_teardown_cb) : - async_logger(logger_name, sinks_list.begin(), sinks_list.end(), queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb) {} - -inline spdlog::async_logger::async_logger(const std::string& logger_name, - sink_ptr single_sink, - size_t queue_size, - const async_overflow_policy overflow_policy, - const std::function& worker_warmup_cb, - const std::chrono::milliseconds& flush_interval_ms, - const std::function& worker_teardown_cb) : - async_logger(logger_name, -{ - single_sink -}, queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb) {} - - -inline void spdlog::async_logger::flush() -{ - _async_log_helper->flush(true); -} - -inline void spdlog::async_logger::_set_formatter(spdlog::formatter_ptr msg_formatter) -{ - _formatter = msg_formatter; - _async_log_helper->set_formatter(_formatter); -} - -inline void spdlog::async_logger::_set_pattern(const std::string& pattern) -{ - _formatter = std::make_shared(pattern); - _async_log_helper->set_formatter(_formatter); -} - - -inline void spdlog::async_logger::_sink_it(details::log_msg& msg) -{ - try - { - _async_log_helper->log(msg); - if (_should_flush_on(msg)) - _async_log_helper->flush(false); // do async flush - } - catch (const std::exception &ex) - { - _err_handler(ex.what()); - } - catch (...) - { - _err_handler("Unknown exception"); - } -} diff --git a/bm/sai_adapter/inc/spdlog/details/file_helper.h b/bm/sai_adapter/inc/spdlog/details/file_helper.h deleted file mode 100644 index 074d9b835..000000000 --- a/bm/sai_adapter/inc/spdlog/details/file_helper.h +++ /dev/null @@ -1,118 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// Helper class for file sink -// When failing to open a file, retry several times(5) with small delay between the tries(10 ms) -// Can be set to auto flush on every line -// Throw spdlog_ex exception on errors - -#include -#include - -#include -#include -#include -#include -#include - -namespace spdlog -{ -namespace details -{ - -class file_helper -{ - -public: - const int open_tries = 5; - const int open_interval = 10; - - explicit file_helper() : - _fd(nullptr) - {} - - file_helper(const file_helper&) = delete; - file_helper& operator=(const file_helper&) = delete; - - ~file_helper() - { - close(); - } - - - void open(const filename_t& fname, bool truncate = false) - { - - close(); - auto *mode = truncate ? SPDLOG_FILENAME_T("wb") : SPDLOG_FILENAME_T("ab"); - _filename = fname; - for (int tries = 0; tries < open_tries; ++tries) - { - if (!os::fopen_s(&_fd, fname, mode)) - return; - - std::this_thread::sleep_for(std::chrono::milliseconds(open_interval)); - } - - throw spdlog_ex("Failed opening file " + os::filename_to_str(_filename) + " for writing", errno); - } - - void reopen(bool truncate) - { - if (_filename.empty()) - throw spdlog_ex("Failed re opening file - was not opened before"); - open(_filename, truncate); - - } - - void flush() - { - std::fflush(_fd); - } - - void close() - { - if (_fd) - { - std::fclose(_fd); - _fd = nullptr; - } - } - - void write(const log_msg& msg) - { - - size_t msg_size = msg.formatted.size(); - auto data = msg.formatted.data(); - if (std::fwrite(data, 1, msg_size, _fd) != msg_size) - throw spdlog_ex("Failed writing to file " + os::filename_to_str(_filename), errno); - } - - size_t size() - { - if (!_fd) - throw spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(_filename)); - return os::filesize(_fd); - } - - const filename_t& filename() const - { - return _filename; - } - - static bool file_exists(const filename_t& name) - { - - return os::file_exists(name); - } - -private: - FILE* _fd; - filename_t _filename; -}; -} -} diff --git a/bm/sai_adapter/inc/spdlog/details/log_msg.h b/bm/sai_adapter/inc/spdlog/details/log_msg.h deleted file mode 100644 index ecdc73d7c..000000000 --- a/bm/sai_adapter/inc/spdlog/details/log_msg.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include - - -#include -#include - -namespace spdlog -{ -namespace details -{ -struct log_msg -{ - log_msg() = default; - log_msg(const std::string *loggers_name, level::level_enum lvl) : logger_name(loggers_name), level(lvl) - { -#ifndef SPDLOG_NO_DATETIME - time = os::now(); -#endif - -#ifndef SPDLOG_NO_THREAD_ID - thread_id = os::thread_id(); -#endif - } - - log_msg(const log_msg& other) = delete; - log_msg& operator=(log_msg&& other) = delete; - log_msg(log_msg&& other) = delete; - - - const std::string *logger_name; - level::level_enum level; - log_clock::time_point time; - size_t thread_id; - fmt::MemoryWriter raw; - fmt::MemoryWriter formatted; -}; -} -} diff --git a/bm/sai_adapter/inc/spdlog/details/logger_impl.h b/bm/sai_adapter/inc/spdlog/details/logger_impl.h deleted file mode 100644 index 2b27f1053..000000000 --- a/bm/sai_adapter/inc/spdlog/details/logger_impl.h +++ /dev/null @@ -1,298 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include - -#include -#include - - -// create logger with given name, sinks and the default pattern formatter -// all other ctors will call this one -template -inline spdlog::logger::logger(const std::string& logger_name, const It& begin, const It& end): - _name(logger_name), - _sinks(begin, end), - _formatter(std::make_shared("%+")) -{ - _level = level::info; - _flush_level = level::off; - _last_err_time = 0; - _err_handler = [this](const std::string &msg) - { - this->_default_err_handler(msg); - }; -} - -// ctor with sinks as init list -inline spdlog::logger::logger(const std::string& logger_name, sinks_init_list sinks_list): - logger(logger_name, sinks_list.begin(), sinks_list.end()) -{} - - -// ctor with single sink -inline spdlog::logger::logger(const std::string& logger_name, spdlog::sink_ptr single_sink): - logger(logger_name, -{ - single_sink -}) -{} - - -inline spdlog::logger::~logger() = default; - - -inline void spdlog::logger::set_formatter(spdlog::formatter_ptr msg_formatter) -{ - _set_formatter(msg_formatter); -} - -inline void spdlog::logger::set_pattern(const std::string& pattern) -{ - _set_pattern(pattern); -} - - -template -inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Args&... args) -{ - if (!should_log(lvl)) return; - - try - { - details::log_msg log_msg(&_name, lvl); - log_msg.raw.write(fmt, args...); - _sink_it(log_msg); - } - catch (const std::exception &ex) - { - _err_handler(ex.what()); - } - catch (...) - { - _err_handler("Unknown exception"); - } -} - -template -inline void spdlog::logger::log(level::level_enum lvl, const char* msg) -{ - if (!should_log(lvl)) return; - try - { - details::log_msg log_msg(&_name, lvl); - log_msg.raw << msg; - _sink_it(log_msg); - } - catch (const std::exception &ex) - { - _err_handler(ex.what()); - } - catch (...) - { - _err_handler("Unknown exception"); - } - -} - -template -inline void spdlog::logger::log(level::level_enum lvl, const T& msg) -{ - if (!should_log(lvl)) return; - try - { - details::log_msg log_msg(&_name, lvl); - log_msg.raw << msg; - _sink_it(log_msg); - } - catch (const std::exception &ex) - { - _err_handler(ex.what()); - } - catch (...) - { - _err_handler("Unknown exception"); - } -} - - -template -inline void spdlog::logger::trace(const char* fmt, const Args&... args) -{ - log(level::trace, fmt, args...); -} - -template -inline void spdlog::logger::debug(const char* fmt, const Args&... args) -{ - log(level::debug, fmt, args...); -} - -template -inline void spdlog::logger::info(const char* fmt, const Args&... args) -{ - log(level::info, fmt, args...); -} - - -template -inline void spdlog::logger::warn(const char* fmt, const Args&... args) -{ - log(level::warn, fmt, args...); -} - -template -inline void spdlog::logger::error(const char* fmt, const Args&... args) -{ - log(level::err, fmt, args...); -} - -template -inline void spdlog::logger::critical(const char* fmt, const Args&... args) -{ - log(level::critical, fmt, args...); -} - - -template -inline void spdlog::logger::trace(const T& msg) -{ - log(level::trace, msg); -} - -template -inline void spdlog::logger::debug(const T& msg) -{ - log(level::debug, msg); -} - - -template -inline void spdlog::logger::info(const T& msg) -{ - log(level::info, msg); -} - - -template -inline void spdlog::logger::warn(const T& msg) -{ - log(level::warn, msg); -} - -template -inline void spdlog::logger::error(const T& msg) -{ - log(level::err, msg); -} - -template -inline void spdlog::logger::critical(const T& msg) -{ - log(level::critical, msg); -} - - - - -// -// name and level -// -inline const std::string& spdlog::logger::name() const -{ - return _name; -} - -inline void spdlog::logger::set_level(spdlog::level::level_enum log_level) -{ - _level.store(log_level); -} - -inline void spdlog::logger::set_error_handler(spdlog::log_err_handler err_handler) -{ - _err_handler = err_handler; -} - -inline spdlog::log_err_handler spdlog::logger::error_handler() -{ - return _err_handler; -} - - -inline void spdlog::logger::flush_on(level::level_enum log_level) -{ - _flush_level.store(log_level); -} - -inline spdlog::level::level_enum spdlog::logger::level() const -{ - return static_cast(_level.load(std::memory_order_relaxed)); -} - -inline bool spdlog::logger::should_log(spdlog::level::level_enum msg_level) const -{ - return msg_level >= _level.load(std::memory_order_relaxed); -} - -// -// protected virtual called at end of each user log call (if enabled) by the line_logger -// -inline void spdlog::logger::_sink_it(details::log_msg& msg) -{ - _formatter->format(msg); - for (auto &sink : _sinks) - { - if( sink->should_log( msg.level)) - { - sink->log(msg); - } - } - - if(_should_flush_on(msg)) - flush(); -} - -inline void spdlog::logger::_set_pattern(const std::string& pattern) -{ - _formatter = std::make_shared(pattern); -} -inline void spdlog::logger::_set_formatter(formatter_ptr msg_formatter) -{ - _formatter = msg_formatter; -} - -inline void spdlog::logger::flush() -{ - for (auto& sink : _sinks) - sink->flush(); -} - -inline void spdlog::logger::_default_err_handler(const std::string &msg) -{ - auto now = time(nullptr); - if (now - _last_err_time < 60) - return; - auto tm_time = details::os::localtime(now); - char date_buf[100]; - std::strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm_time); - details::log_msg err_msg; - err_msg.formatted.write("[*** LOG ERROR ***] [{}] [{}] [{}]{}", name(), msg, date_buf, details::os::eol); - sinks::stderr_sink_mt::instance()->log(err_msg); - _last_err_time = now; -} - -inline bool spdlog::logger::_should_flush_on(const details::log_msg &msg) -{ - const auto flush_level = _flush_level.load(std::memory_order_relaxed); - return (msg.level >= flush_level) && (msg.level != level::off); -} - -inline const std::vector& spdlog::logger::sinks() const -{ - return _sinks; -} diff --git a/bm/sai_adapter/inc/spdlog/details/mpmc_bounded_q.h b/bm/sai_adapter/inc/spdlog/details/mpmc_bounded_q.h deleted file mode 100644 index 3a46e8ebd..000000000 --- a/bm/sai_adapter/inc/spdlog/details/mpmc_bounded_q.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -A modified version of Bounded MPMC queue by Dmitry Vyukov. - -Original code from: -http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue - -licensed by Dmitry Vyukov under the terms below: - -Simplified BSD license - -Copyright (c) 2010-2011 Dmitry Vyukov. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. - -2. 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. - -THIS SOFTWARE IS PROVIDED BY DMITRY VYUKOV "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 DMITRY VYUKOV 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. - -The views and conclusions contained in the software and documentation are those of the authors and -should not be interpreted as representing official policies, either expressed or implied, of Dmitry Vyukov. -*/ - -/* -The code in its current form adds the license below: - -Copyright(c) 2015 Gabi Melman. -Distributed under the MIT License (http://opensource.org/licenses/MIT) - -*/ - -#pragma once - -#include - -#include -#include - -namespace spdlog -{ -namespace details -{ - -template -class mpmc_bounded_queue -{ -public: - - using item_type = T; - mpmc_bounded_queue(size_t buffer_size) - :max_size_(buffer_size), - buffer_(new cell_t [buffer_size]), - buffer_mask_(buffer_size - 1) - { - //queue size must be power of two - if(!((buffer_size >= 2) && ((buffer_size & (buffer_size - 1)) == 0))) - throw spdlog_ex("async logger queue size must be power of two"); - - for (size_t i = 0; i != buffer_size; i += 1) - buffer_[i].sequence_.store(i, std::memory_order_relaxed); - enqueue_pos_.store(0, std::memory_order_relaxed); - dequeue_pos_.store(0, std::memory_order_relaxed); - } - - ~mpmc_bounded_queue() - { - delete [] buffer_; - } - - - bool enqueue(T&& data) - { - cell_t* cell; - size_t pos = enqueue_pos_.load(std::memory_order_relaxed); - for (;;) - { - cell = &buffer_[pos & buffer_mask_]; - size_t seq = cell->sequence_.load(std::memory_order_acquire); - intptr_t dif = (intptr_t)seq - (intptr_t)pos; - if (dif == 0) - { - if (enqueue_pos_.compare_exchange_weak(pos, pos + 1, std::memory_order_relaxed)) - break; - } - else if (dif < 0) - { - return false; - } - else - { - pos = enqueue_pos_.load(std::memory_order_relaxed); - } - } - cell->data_ = std::move(data); - cell->sequence_.store(pos + 1, std::memory_order_release); - return true; - } - - bool dequeue(T& data) - { - cell_t* cell; - size_t pos = dequeue_pos_.load(std::memory_order_relaxed); - for (;;) - { - cell = &buffer_[pos & buffer_mask_]; - size_t seq = - cell->sequence_.load(std::memory_order_acquire); - intptr_t dif = (intptr_t)seq - (intptr_t)(pos + 1); - if (dif == 0) - { - if (dequeue_pos_.compare_exchange_weak(pos, pos + 1, std::memory_order_relaxed)) - break; - } - else if (dif < 0) - return false; - else - pos = dequeue_pos_.load(std::memory_order_relaxed); - } - data = std::move(cell->data_); - cell->sequence_.store(pos + buffer_mask_ + 1, std::memory_order_release); - return true; - } - - size_t approx_size() - { - size_t first_pos = dequeue_pos_.load(std::memory_order_relaxed); - size_t last_pos = enqueue_pos_.load(std::memory_order_relaxed); - if (last_pos <= first_pos) - return 0; - auto size = last_pos - first_pos; - return size < max_size_ ? size : max_size_; - } - -private: - struct cell_t - { - std::atomic sequence_; - T data_; - }; - - size_t const max_size_; - - static size_t const cacheline_size = 64; - typedef char cacheline_pad_t [cacheline_size]; - - cacheline_pad_t pad0_; - cell_t* const buffer_; - size_t const buffer_mask_; - cacheline_pad_t pad1_; - std::atomic enqueue_pos_; - cacheline_pad_t pad2_; - std::atomic dequeue_pos_; - cacheline_pad_t pad3_; - - mpmc_bounded_queue(mpmc_bounded_queue const&) = delete; - void operator= (mpmc_bounded_queue const&) = delete; -}; - -} // ns details -} // ns spdlog diff --git a/bm/sai_adapter/inc/spdlog/details/null_mutex.h b/bm/sai_adapter/inc/spdlog/details/null_mutex.h deleted file mode 100644 index 67b0aeee0..000000000 --- a/bm/sai_adapter/inc/spdlog/details/null_mutex.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -// null, no cost dummy "mutex" and dummy "atomic" int - -namespace spdlog -{ -namespace details -{ -struct null_mutex -{ - void lock() {} - void unlock() {} - bool try_lock() - { - return true; - } -}; - -struct null_atomic_int -{ - int value; - null_atomic_int() = default; - - null_atomic_int(int val):value(val) - {} - - int load(std::memory_order) const - { - return value; - } - - void store(int val) - { - value = val; - } -}; - -} -} diff --git a/bm/sai_adapter/inc/spdlog/details/os.h b/bm/sai_adapter/inc/spdlog/details/os.h deleted file mode 100644 index b63ce667f..000000000 --- a/bm/sai_adapter/inc/spdlog/details/os.h +++ /dev/null @@ -1,406 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// -#pragma once - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 - -#ifndef NOMINMAX -#define NOMINMAX //prevent windows redefining min/max -#endif - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include // _get_pid support -#include // _get_osfhandle support - -#ifdef __MINGW32__ -#include -#endif - -#else // unix - -#include -#include - -#ifdef __linux__ -#include //Use gettid() syscall under linux to get thread id - -#elif __FreeBSD__ -#include //Use thr_self() syscall under FreeBSD to get thread id -#endif - -#endif //unix - -#ifndef __has_feature // Clang - feature checking macros. -#define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif - - -namespace spdlog -{ -namespace details -{ -namespace os -{ - -inline spdlog::log_clock::time_point now() -{ - -#if defined __linux__ && defined SPDLOG_CLOCK_COARSE - timespec ts; - ::clock_gettime(CLOCK_REALTIME_COARSE, &ts); - return std::chrono::time_point( - std::chrono::duration_cast( - std::chrono::seconds(ts.tv_sec) + std::chrono::nanoseconds(ts.tv_nsec))); - - -#else - return log_clock::now(); -#endif - -} -inline std::tm localtime(const std::time_t &time_tt) -{ - -#ifdef _WIN32 - std::tm tm; - localtime_s(&tm, &time_tt); -#else - std::tm tm; - localtime_r(&time_tt, &tm); -#endif - return tm; -} - -inline std::tm localtime() -{ - std::time_t now_t = time(nullptr); - return localtime(now_t); -} - - -inline std::tm gmtime(const std::time_t &time_tt) -{ - -#ifdef _WIN32 - std::tm tm; - gmtime_s(&tm, &time_tt); -#else - std::tm tm; - gmtime_r(&time_tt, &tm); -#endif - return tm; -} - -inline std::tm gmtime() -{ - std::time_t now_t = time(nullptr); - return gmtime(now_t); -} -inline bool operator==(const std::tm& tm1, const std::tm& tm2) -{ - return (tm1.tm_sec == tm2.tm_sec && - tm1.tm_min == tm2.tm_min && - tm1.tm_hour == tm2.tm_hour && - tm1.tm_mday == tm2.tm_mday && - tm1.tm_mon == tm2.tm_mon && - tm1.tm_year == tm2.tm_year && - tm1.tm_isdst == tm2.tm_isdst); -} - -inline bool operator!=(const std::tm& tm1, const std::tm& tm2) -{ - return !(tm1 == tm2); -} - -// eol definition -#if !defined (SPDLOG_EOL) -#ifdef _WIN32 -#define SPDLOG_EOL "\r\n" -#else -#define SPDLOG_EOL "\n" -#endif -#endif - -SPDLOG_CONSTEXPR static const char* eol = SPDLOG_EOL; -SPDLOG_CONSTEXPR static int eol_size = sizeof(SPDLOG_EOL) - 1; - -inline void prevent_child_fd(FILE *f) -{ -#ifdef _WIN32 - auto file_handle = (HANDLE)_get_osfhandle(_fileno(f)); - if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) - throw spdlog_ex("SetHandleInformation failed", errno); -#else - auto fd = fileno(f); - if(fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) - throw spdlog_ex("fcntl with FD_CLOEXEC failed", errno); -#endif -} - - -//fopen_s on non windows for writing -inline int fopen_s(FILE** fp, const filename_t& filename, const filename_t& mode) -{ -#ifdef _WIN32 -#ifdef SPDLOG_WCHAR_FILENAMES - *fp = _wfsopen((filename.c_str()), mode.c_str(), _SH_DENYWR); -#else - *fp = _fsopen((filename.c_str()), mode.c_str(), _SH_DENYWR); -#endif -#else //unix - *fp = fopen((filename.c_str()), mode.c_str()); -#endif - -#ifdef SPDLOG_PREVENT_CHILD_FD - if(*fp != nullptr) - prevent_child_fd(*fp); -#endif - return *fp == nullptr; -} - - -inline int remove(const filename_t &filename) -{ -#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) - return _wremove(filename.c_str()); -#else - return std::remove(filename.c_str()); -#endif -} - -inline int rename(const filename_t& filename1, const filename_t& filename2) -{ -#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) - return _wrename(filename1.c_str(), filename2.c_str()); -#else - return std::rename(filename1.c_str(), filename2.c_str()); -#endif -} - - -//Return if file exists -inline bool file_exists(const filename_t& filename) -{ -#ifdef _WIN32 -#ifdef SPDLOG_WCHAR_FILENAMES - auto attribs = GetFileAttributesW(filename.c_str()); -#else - auto attribs = GetFileAttributesA(filename.c_str()); -#endif - return (attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY)); -#else //common linux/unix all have the stat system call - struct stat buffer; - return (stat (filename.c_str(), &buffer) == 0); -#endif -} - - - - -//Return file size according to open FILE* object -inline size_t filesize(FILE *f) -{ - if (f == nullptr) - throw spdlog_ex("Failed getting file size. fd is null"); -#ifdef _WIN32 - int fd = _fileno(f); -#if _WIN64 //64 bits - struct _stat64 st; - if (_fstat64(fd, &st) == 0) - return st.st_size; - -#else //windows 32 bits - long ret = _filelength(fd); - if (ret >= 0) - return static_cast(ret); -#endif - -#else // unix - int fd = fileno(f); - //64 bits(but not in osx, where fstat64 is deprecated) -#if !defined(__FreeBSD__) && !defined(__APPLE__) && (defined(__x86_64__) || defined(__ppc64__)) - struct stat64 st; - if (fstat64(fd, &st) == 0) - return static_cast(st.st_size); -#else // unix 32 bits or osx - struct stat st; - if (fstat(fd, &st) == 0) - return static_cast(st.st_size); -#endif -#endif - throw spdlog_ex("Failed getting file size from fd", errno); -} - - - - -//Return utc offset in minutes or throw spdlog_ex on failure -inline int utc_minutes_offset(const std::tm& tm = details::os::localtime()) -{ - -#ifdef _WIN32 -#if _WIN32_WINNT < _WIN32_WINNT_WS08 - TIME_ZONE_INFORMATION tzinfo; - auto rv = GetTimeZoneInformation(&tzinfo); -#else - DYNAMIC_TIME_ZONE_INFORMATION tzinfo; - auto rv = GetDynamicTimeZoneInformation(&tzinfo); -#endif - if (rv == TIME_ZONE_ID_INVALID) - throw spdlog::spdlog_ex("Failed getting timezone info. ", errno); - - int offset = -tzinfo.Bias; - if (tm.tm_isdst) - offset -= tzinfo.DaylightBias; - else - offset -= tzinfo.StandardBias; - return offset; -#else - -#if defined(sun) || defined(__sun) - // 'tm_gmtoff' field is BSD extension and it's missing on SunOS/Solaris - struct helper - { - static long int calculate_gmt_offset(const std::tm & localtm = details::os::localtime(), const std::tm & gmtm = details::os::gmtime()) - { - int local_year = localtm.tm_year + (1900 - 1); - int gmt_year = gmtm.tm_year + (1900 - 1); - - long int days = ( - // difference in day of year - localtm.tm_yday - gmtm.tm_yday - - // + intervening leap days - + ((local_year >> 2) - (gmt_year >> 2)) - - (local_year / 100 - gmt_year / 100) - + ((local_year / 100 >> 2) - (gmt_year / 100 >> 2)) - - // + difference in years * 365 */ - + (long int)(local_year - gmt_year) * 365 - ); - - long int hours = (24 * days) + (localtm.tm_hour - gmtm.tm_hour); - long int mins = (60 * hours) + (localtm.tm_min - gmtm.tm_min); - long int secs = (60 * mins) + (localtm.tm_sec - gmtm.tm_sec); - - return secs; - } - }; - - long int offset_seconds = helper::calculate_gmt_offset(tm); -#else - long int offset_seconds = tm.tm_gmtoff; -#endif - - return static_cast(offset_seconds / 60); -#endif -} - -//Return current thread id as size_t -//It exists because the std::this_thread::get_id() is much slower(espcially under VS 2013) -inline size_t _thread_id() -{ -#ifdef _WIN32 - return static_cast(::GetCurrentThreadId()); -#elif __linux__ -# if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21) -# define SYS_gettid __NR_gettid -# endif - return static_cast(syscall(SYS_gettid)); -#elif __FreeBSD__ - long tid; - thr_self(&tid); - return static_cast(tid); -#else //Default to standard C++11 (OSX and other Unix) - return static_cast(std::hash()(std::this_thread::get_id())); -#endif -} - -//Return current thread id as size_t (from thread local storage) -inline size_t thread_id() -{ -#if defined(_MSC_VER) && (_MSC_VER < 1900) || defined(__clang__) && !__has_feature(cxx_thread_local) - return _thread_id(); -#else - static thread_local const size_t tid = _thread_id(); - return tid; -#endif -} - - - - -// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined) -#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) -#define SPDLOG_FILENAME_T(s) L ## s -inline std::string filename_to_str(const filename_t& filename) -{ - std::wstring_convert, wchar_t> c; - return c.to_bytes(filename); -} -#else -#define SPDLOG_FILENAME_T(s) s -inline std::string filename_to_str(const filename_t& filename) -{ - return filename; -} -#endif - - -// Return errno string (thread safe) -inline std::string errno_str(int err_num) -{ - char buf[256]; - SPDLOG_CONSTEXPR auto buf_size = sizeof(buf); - -#ifdef _WIN32 - if(strerror_s(buf, buf_size, err_num) == 0) - return std::string(buf); - else - return "Unkown error"; - -#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(ANDROID) || defined(__SUNPRO_CC) || \ - ((_POSIX_C_SOURCE >= 200112L) && ! defined(_GNU_SOURCE)) // posix version - - if (strerror_r(err_num, buf, buf_size) == 0) - return std::string(buf); - else - return "Unkown error"; - -#else // gnu version (might not use the given buf, so its retval pointer must be used) - return std::string(strerror_r(err_num, buf, buf_size)); -#endif -} - -inline int pid() -{ - -#ifdef _WIN32 - return ::_getpid(); -#else - return static_cast(::getpid()); -#endif - -} - -} //os -} //details -} //spdlog diff --git a/bm/sai_adapter/inc/spdlog/details/pattern_formatter_impl.h b/bm/sai_adapter/inc/spdlog/details/pattern_formatter_impl.h deleted file mode 100644 index 70b9dc807..000000000 --- a/bm/sai_adapter/inc/spdlog/details/pattern_formatter_impl.h +++ /dev/null @@ -1,670 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace spdlog -{ -namespace details -{ -class flag_formatter -{ -public: - virtual ~flag_formatter() - {} - virtual void format(details::log_msg& msg, const std::tm& tm_time) = 0; -}; - -/////////////////////////////////////////////////////////////////////// -// name & level pattern appenders -/////////////////////////////////////////////////////////////////////// -namespace -{ -class name_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << *msg.logger_name; - } -}; -} - -// log level appender -class level_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << level::to_str(msg.level); - } -}; - -// short log level appender -class short_level_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << level::to_short_str(msg.level); - } -}; - -/////////////////////////////////////////////////////////////////////// -// Date time pattern appenders -/////////////////////////////////////////////////////////////////////// - -static const char* ampm(const tm& t) -{ - return t.tm_hour >= 12 ? "PM" : "AM"; -} - -static int to12h(const tm& t) -{ - return t.tm_hour > 12 ? t.tm_hour - 12 : t.tm_hour; -} - -//Abbreviated weekday name -using days_array = std::array; -static const days_array& days() -{ - static const days_array arr{ { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } }; - return arr; -} -class a_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << days()[tm_time.tm_wday]; - } -}; - -//Full weekday name -static const days_array& full_days() -{ - static const days_array arr{ { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } }; - return arr; -} -class A_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << full_days()[tm_time.tm_wday]; - } -}; - -//Abbreviated month -using months_array = std::array; -static const months_array& months() -{ - static const months_array arr{ { "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec" } }; - return arr; -} -class b_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << months()[tm_time.tm_mon]; - } -}; - -//Full month name -static const months_array& full_months() -{ - static const months_array arr{ { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" } }; - return arr; -} -class B_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << full_months()[tm_time.tm_mon]; - } -}; - - -//write 2 ints seperated by sep with padding of 2 -static fmt::MemoryWriter& pad_n_join(fmt::MemoryWriter& w, int v1, int v2, char sep) -{ - w << fmt::pad(v1, 2, '0') << sep << fmt::pad(v2, 2, '0'); - return w; -} - -//write 3 ints seperated by sep with padding of 2 -static fmt::MemoryWriter& pad_n_join(fmt::MemoryWriter& w, int v1, int v2, int v3, char sep) -{ - w << fmt::pad(v1, 2, '0') << sep << fmt::pad(v2, 2, '0') << sep << fmt::pad(v3, 2, '0'); - return w; -} - - -//Date and time representation (Thu Aug 23 15:35:46 2014) -class c_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << days()[tm_time.tm_wday] << ' ' << months()[tm_time.tm_mon] << ' ' << tm_time.tm_mday << ' '; - pad_n_join(msg.formatted, tm_time.tm_hour, tm_time.tm_min, tm_time.tm_sec, ':') << ' ' << tm_time.tm_year + 1900; - } -}; - - -// year - 2 digit -class C_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << fmt::pad(tm_time.tm_year % 100, 2, '0'); - } -}; - - - -// Short MM/DD/YY date, equivalent to %m/%d/%y 08/23/01 -class D_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - pad_n_join(msg.formatted, tm_time.tm_mon + 1, tm_time.tm_mday, tm_time.tm_year % 100, '/'); - } -}; - - -// year - 4 digit -class Y_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << tm_time.tm_year + 1900; - } -}; - -// month 1-12 -class m_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << fmt::pad(tm_time.tm_mon + 1, 2, '0'); - } -}; - -// day of month 1-31 -class d_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << fmt::pad(tm_time.tm_mday, 2, '0'); - } -}; - -// hours in 24 format 0-23 -class H_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << fmt::pad(tm_time.tm_hour, 2, '0'); - } -}; - -// hours in 12 format 1-12 -class I_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << fmt::pad(to12h(tm_time), 2, '0'); - } -}; - -// minutes 0-59 -class M_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << fmt::pad(tm_time.tm_min, 2, '0'); - } -}; - -// seconds 0-59 -class S_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << fmt::pad(tm_time.tm_sec, 2, '0'); - } -}; - -// milliseconds -class e_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - auto duration = msg.time.time_since_epoch(); - auto millis = std::chrono::duration_cast(duration).count() % 1000; - msg.formatted << fmt::pad(static_cast(millis), 3, '0'); - } -}; - -// microseconds -class f_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - auto duration = msg.time.time_since_epoch(); - auto micros = std::chrono::duration_cast(duration).count() % 1000000; - msg.formatted << fmt::pad(static_cast(micros), 6, '0'); - } -}; - -// nanoseconds -class F_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - auto duration = msg.time.time_since_epoch(); - auto ns = std::chrono::duration_cast(duration).count() % 1000000000; - msg.formatted << fmt::pad(static_cast(ns), 9, '0'); - } -}; - -// AM/PM -class p_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - msg.formatted << ampm(tm_time); - } -}; - - -// 12 hour clock 02:55:02 pm -class r_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - pad_n_join(msg.formatted, to12h(tm_time), tm_time.tm_min, tm_time.tm_sec, ':') << ' ' << ampm(tm_time); - } -}; - -// 24-hour HH:MM time, equivalent to %H:%M -class R_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - pad_n_join(msg.formatted, tm_time.tm_hour, tm_time.tm_min, ':'); - } -}; - -// ISO 8601 time format (HH:MM:SS), equivalent to %H:%M:%S -class T_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { - pad_n_join(msg.formatted, tm_time.tm_hour, tm_time.tm_min, tm_time.tm_sec, ':'); - } -}; - - -// ISO 8601 offset from UTC in timezone (+-HH:MM) -class z_formatter:public flag_formatter -{ -public: - const std::chrono::seconds cache_refresh = std::chrono::seconds(5); - - z_formatter():_last_update(std::chrono::seconds(0)) - {} - z_formatter(const z_formatter&) = delete; - z_formatter& operator=(const z_formatter&) = delete; - - void format(details::log_msg& msg, const std::tm& tm_time) override - { -#ifdef _WIN32 - int total_minutes = get_cached_offset(msg, tm_time); -#else - // No need to chache under gcc, - // it is very fast (already stored in tm.tm_gmtoff) - int total_minutes = os::utc_minutes_offset(tm_time); -#endif - bool is_negative = total_minutes < 0; - char sign; - if (is_negative) - { - total_minutes = -total_minutes; - sign = '-'; - } - else - { - sign = '+'; - } - - int h = total_minutes / 60; - int m = total_minutes % 60; - msg.formatted << sign; - pad_n_join(msg.formatted, h, m, ':'); - } -private: - log_clock::time_point _last_update; - int _offset_minutes; - std::mutex _mutex; - - int get_cached_offset(const log_msg& msg, const std::tm& tm_time) - { - using namespace std::chrono; - std::lock_guard l(_mutex); - if (msg.time - _last_update >= cache_refresh) - { - _offset_minutes = os::utc_minutes_offset(tm_time); - _last_update = msg.time; - } - return _offset_minutes; - } -}; - - - -// Thread id -class t_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << msg.thread_id; - } -}; - -// Current pid -class pid_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << details::os::pid(); - } -}; - - -class v_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << fmt::StringRef(msg.raw.data(), msg.raw.size()); - } -}; - -class ch_formatter:public flag_formatter -{ -public: - explicit ch_formatter(char ch): _ch(ch) - {} - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << _ch; - } -private: - char _ch; -}; - - -//aggregate user chars to display as is -class aggregate_formatter:public flag_formatter -{ -public: - aggregate_formatter() - {} - void add_ch(char ch) - { - _str += ch; - } - void format(details::log_msg& msg, const std::tm&) override - { - msg.formatted << _str; - } -private: - std::string _str; -}; - -// Full info formatter -// pattern: [%Y-%m-%d %H:%M:%S.%e] [%n] [%l] %v -class full_formatter:public flag_formatter -{ - void format(details::log_msg& msg, const std::tm& tm_time) override - { -#ifndef SPDLOG_NO_DATETIME - auto duration = msg.time.time_since_epoch(); - auto millis = std::chrono::duration_cast(duration).count() % 1000; - - /* Slower version(while still very fast - about 3.2 million lines/sec under 10 threads), - msg.formatted.write("[{:d}-{:02d}-{:02d} {:02d}:{:02d}:{:02d}.{:03d}] [{}] [{}] {} ", - tm_time.tm_year + 1900, - tm_time.tm_mon + 1, - tm_time.tm_mday, - tm_time.tm_hour, - tm_time.tm_min, - tm_time.tm_sec, - static_cast(millis), - msg.logger_name, - level::to_str(msg.level), - msg.raw.str());*/ - - - // Faster (albeit uglier) way to format the line (5.6 million lines/sec under 10 threads) - msg.formatted << '[' << static_cast(tm_time.tm_year + 1900) << '-' - << fmt::pad(static_cast(tm_time.tm_mon + 1), 2, '0') << '-' - << fmt::pad(static_cast(tm_time.tm_mday), 2, '0') << ' ' - << fmt::pad(static_cast(tm_time.tm_hour), 2, '0') << ':' - << fmt::pad(static_cast(tm_time.tm_min), 2, '0') << ':' - << fmt::pad(static_cast(tm_time.tm_sec), 2, '0') << '.' - << fmt::pad(static_cast(millis), 3, '0') << "] "; - - //no datetime needed -#else - (void)tm_time; -#endif - -#ifndef SPDLOG_NO_NAME - msg.formatted << '[' << *msg.logger_name << "] "; -#endif - - msg.formatted << '[' << level::to_str(msg.level) << "] "; - msg.formatted << fmt::StringRef(msg.raw.data(), msg.raw.size()); - } -}; - - - -} -} -/////////////////////////////////////////////////////////////////////////////// -// pattern_formatter inline impl -/////////////////////////////////////////////////////////////////////////////// -inline spdlog::pattern_formatter::pattern_formatter(const std::string& pattern) -{ - compile_pattern(pattern); -} - -inline void spdlog::pattern_formatter::compile_pattern(const std::string& pattern) -{ - auto end = pattern.end(); - std::unique_ptr user_chars; - for (auto it = pattern.begin(); it != end; ++it) - { - if (*it == '%') - { - if (user_chars) //append user chars found so far - _formatters.push_back(std::move(user_chars)); - - if (++it != end) - handle_flag(*it); - else - break; - } - else // chars not following the % sign should be displayed as is - { - if (!user_chars) - user_chars = std::unique_ptr(new details::aggregate_formatter()); - user_chars->add_ch(*it); - } - } - if (user_chars) //append raw chars found so far - { - _formatters.push_back(std::move(user_chars)); - } - -} -inline void spdlog::pattern_formatter::handle_flag(char flag) -{ - switch (flag) - { - // logger name - case 'n': - _formatters.push_back(std::unique_ptr(new details::name_formatter())); - break; - - case 'l': - _formatters.push_back(std::unique_ptr(new details::level_formatter())); - break; - - case 'L': - _formatters.push_back(std::unique_ptr(new details::short_level_formatter())); - break; - - case('t'): - _formatters.push_back(std::unique_ptr(new details::t_formatter())); - break; - - case('v'): - _formatters.push_back(std::unique_ptr(new details::v_formatter())); - break; - - case('a'): - _formatters.push_back(std::unique_ptr(new details::a_formatter())); - break; - - case('A'): - _formatters.push_back(std::unique_ptr(new details::A_formatter())); - break; - - case('b'): - case('h'): - _formatters.push_back(std::unique_ptr(new details::b_formatter())); - break; - - case('B'): - _formatters.push_back(std::unique_ptr(new details::B_formatter())); - break; - case('c'): - _formatters.push_back(std::unique_ptr(new details::c_formatter())); - break; - - case('C'): - _formatters.push_back(std::unique_ptr(new details::C_formatter())); - break; - - case('Y'): - _formatters.push_back(std::unique_ptr(new details::Y_formatter())); - break; - - case('D'): - case('x'): - - _formatters.push_back(std::unique_ptr(new details::D_formatter())); - break; - - case('m'): - _formatters.push_back(std::unique_ptr(new details::m_formatter())); - break; - - case('d'): - _formatters.push_back(std::unique_ptr(new details::d_formatter())); - break; - - case('H'): - _formatters.push_back(std::unique_ptr(new details::H_formatter())); - break; - - case('I'): - _formatters.push_back(std::unique_ptr(new details::I_formatter())); - break; - - case('M'): - _formatters.push_back(std::unique_ptr(new details::M_formatter())); - break; - - case('S'): - _formatters.push_back(std::unique_ptr(new details::S_formatter())); - break; - - case('e'): - _formatters.push_back(std::unique_ptr(new details::e_formatter())); - break; - - case('f'): - _formatters.push_back(std::unique_ptr(new details::f_formatter())); - break; - case('F'): - _formatters.push_back(std::unique_ptr(new details::F_formatter())); - break; - - case('p'): - _formatters.push_back(std::unique_ptr(new details::p_formatter())); - break; - - case('r'): - _formatters.push_back(std::unique_ptr(new details::r_formatter())); - break; - - case('R'): - _formatters.push_back(std::unique_ptr(new details::R_formatter())); - break; - - case('T'): - case('X'): - _formatters.push_back(std::unique_ptr(new details::T_formatter())); - break; - - case('z'): - _formatters.push_back(std::unique_ptr(new details::z_formatter())); - break; - - case ('+'): - _formatters.push_back(std::unique_ptr(new details::full_formatter())); - break; - - case ('P'): - _formatters.push_back(std::unique_ptr(new details::pid_formatter())); - break; - - default: //Unkown flag appears as is - _formatters.push_back(std::unique_ptr(new details::ch_formatter('%'))); - _formatters.push_back(std::unique_ptr(new details::ch_formatter(flag))); - break; - } -} - - -inline void spdlog::pattern_formatter::format(details::log_msg& msg) -{ - -#ifndef SPDLOG_NO_DATETIME - auto tm_time = details::os::localtime(log_clock::to_time_t(msg.time)); -#else - std::tm tm_time; -#endif - for (auto &f : _formatters) - { - f->format(msg, tm_time); - } - //write eol - msg.formatted.write(details::os::eol, details::os::eol_size); -} diff --git a/bm/sai_adapter/inc/spdlog/details/registry.h b/bm/sai_adapter/inc/spdlog/details/registry.h deleted file mode 100644 index ee14adfdb..000000000 --- a/bm/sai_adapter/inc/spdlog/details/registry.h +++ /dev/null @@ -1,185 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// Loggers registy of unique name->logger pointer -// An attempt to create a logger with an already existing name will be ignored -// If user requests a non existing logger, nullptr will be returned -// This class is thread safe - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace spdlog -{ -namespace details -{ -template class registry_t -{ -public: - - void register_logger(std::shared_ptr logger) - { - std::lock_guard lock(_mutex); - auto logger_name = logger->name(); - throw_if_exists(logger_name); - _loggers[logger_name] = logger; - } - - - std::shared_ptr get(const std::string& logger_name) - { - std::lock_guard lock(_mutex); - auto found = _loggers.find(logger_name); - return found == _loggers.end() ? nullptr : found->second; - } - - template - std::shared_ptr create(const std::string& logger_name, const It& sinks_begin, const It& sinks_end) - { - std::lock_guard lock(_mutex); - throw_if_exists(logger_name); - std::shared_ptr new_logger; - if (_async_mode) - new_logger = std::make_shared(logger_name, sinks_begin, sinks_end, _async_q_size, _overflow_policy, _worker_warmup_cb, _flush_interval_ms, _worker_teardown_cb); - else - new_logger = std::make_shared(logger_name, sinks_begin, sinks_end); - - if (_formatter) - new_logger->set_formatter(_formatter); - - if (_err_handler) - new_logger->set_error_handler(_err_handler); - - new_logger->set_level(_level); - - - //Add to registry - _loggers[logger_name] = new_logger; - return new_logger; - } - - void apply_all(std::function)> fun) - { - std::lock_guard lock(_mutex); - for (auto &l : _loggers) - fun(l.second); - } - - void drop(const std::string& logger_name) - { - std::lock_guard lock(_mutex); - _loggers.erase(logger_name); - } - - void drop_all() - { - std::lock_guard lock(_mutex); - _loggers.clear(); - } - std::shared_ptr create(const std::string& logger_name, sinks_init_list sinks) - { - return create(logger_name, sinks.begin(), sinks.end()); - } - - std::shared_ptr create(const std::string& logger_name, sink_ptr sink) - { - return create(logger_name, { sink }); - } - - - void formatter(formatter_ptr f) - { - std::lock_guard lock(_mutex); - _formatter = f; - for (auto& l : _loggers) - l.second->set_formatter(_formatter); - } - - void set_pattern(const std::string& pattern) - { - std::lock_guard lock(_mutex); - _formatter = std::make_shared(pattern); - for (auto& l : _loggers) - l.second->set_formatter(_formatter); - } - - void set_level(level::level_enum log_level) - { - std::lock_guard lock(_mutex); - for (auto& l : _loggers) - l.second->set_level(log_level); - _level = log_level; - } - - void set_error_handler(log_err_handler handler) - { - for (auto& l : _loggers) - l.second->set_error_handler(handler); - _err_handler = handler; - } - - void set_async_mode(size_t q_size, const async_overflow_policy overflow_policy, const std::function& worker_warmup_cb, const std::chrono::milliseconds& flush_interval_ms, const std::function& worker_teardown_cb) - { - std::lock_guard lock(_mutex); - _async_mode = true; - _async_q_size = q_size; - _overflow_policy = overflow_policy; - _worker_warmup_cb = worker_warmup_cb; - _flush_interval_ms = flush_interval_ms; - _worker_teardown_cb = worker_teardown_cb; - } - - void set_sync_mode() - { - std::lock_guard lock(_mutex); - _async_mode = false; - } - - static registry_t& instance() - { - static registry_t s_instance; - return s_instance; - } - -private: - registry_t() {} - registry_t(const registry_t&) = delete; - registry_t& operator=(const registry_t&) = delete; - - void throw_if_exists(const std::string &logger_name) - { - if (_loggers.find(logger_name) != _loggers.end()) - throw spdlog_ex("logger with name '" + logger_name + "' already exists"); - } - Mutex _mutex; - std::unordered_map > _loggers; - formatter_ptr _formatter; - level::level_enum _level = level::info; - log_err_handler _err_handler; - bool _async_mode = false; - size_t _async_q_size = 0; - async_overflow_policy _overflow_policy = async_overflow_policy::block_retry; - std::function _worker_warmup_cb = nullptr; - std::chrono::milliseconds _flush_interval_ms; - std::function _worker_teardown_cb = nullptr; -}; -#ifdef SPDLOG_NO_REGISTRY_MUTEX -typedef registry_t registry; -#else -typedef registry_t registry; -#endif -} -} diff --git a/bm/sai_adapter/inc/spdlog/details/spdlog_impl.h b/bm/sai_adapter/inc/spdlog/details/spdlog_impl.h deleted file mode 100644 index 79d3ac450..000000000 --- a/bm/sai_adapter/inc/spdlog/details/spdlog_impl.h +++ /dev/null @@ -1,245 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// -// Global registry functions -// -#include -#include -#include -#include -#ifdef SPDLOG_ENABLE_SYSLOG -#include -#endif - -#ifdef _WIN32 -#include -#else -#include -#endif - - -#ifdef __ANDROID__ -#include -#endif - -#include -#include -#include -#include - -inline void spdlog::register_logger(std::shared_ptr logger) -{ - return details::registry::instance().register_logger(logger); -} - -inline std::shared_ptr spdlog::get(const std::string& name) -{ - return details::registry::instance().get(name); -} - -inline void spdlog::drop(const std::string &name) -{ - details::registry::instance().drop(name); -} - -// Create multi/single threaded simple file logger -inline std::shared_ptr spdlog::basic_logger_mt(const std::string& logger_name, const filename_t& filename, bool truncate) -{ - return create(logger_name, filename, truncate); -} - -inline std::shared_ptr spdlog::basic_logger_st(const std::string& logger_name, const filename_t& filename, bool truncate) -{ - return create(logger_name, filename, truncate); -} - -// Create multi/single threaded rotating file logger -inline std::shared_ptr spdlog::rotating_logger_mt(const std::string& logger_name, const filename_t& filename, size_t max_file_size, size_t max_files) -{ - return create(logger_name, filename, max_file_size, max_files); -} - -inline std::shared_ptr spdlog::rotating_logger_st(const std::string& logger_name, const filename_t& filename, size_t max_file_size, size_t max_files) -{ - return create(logger_name, filename, max_file_size, max_files); -} - -// Create file logger which creates new file at midnight): -inline std::shared_ptr spdlog::daily_logger_mt(const std::string& logger_name, const filename_t& filename, int hour, int minute) -{ - return create(logger_name, filename, hour, minute); -} - -inline std::shared_ptr spdlog::daily_logger_st(const std::string& logger_name, const filename_t& filename, int hour, int minute) -{ - return create(logger_name, filename, hour, minute); -} - - -// -// stdout/stderr loggers -// -inline std::shared_ptr spdlog::stdout_logger_mt(const std::string& logger_name) -{ - return spdlog::details::registry::instance().create(logger_name, spdlog::sinks::stdout_sink_mt::instance()); -} - -inline std::shared_ptr spdlog::stdout_logger_st(const std::string& logger_name) -{ - return spdlog::details::registry::instance().create(logger_name, spdlog::sinks::stdout_sink_st::instance()); -} - -inline std::shared_ptr spdlog::stderr_logger_mt(const std::string& logger_name) -{ - return spdlog::details::registry::instance().create(logger_name, spdlog::sinks::stderr_sink_mt::instance()); -} - -inline std::shared_ptr spdlog::stderr_logger_st(const std::string& logger_name) -{ - return spdlog::details::registry::instance().create(logger_name, spdlog::sinks::stderr_sink_st::instance()); -} - -// -// stdout/stderr color loggers -// -#ifdef _WIN32 -inline std::shared_ptr spdlog::stdout_color_mt(const std::string& logger_name) -{ - auto sink = std::make_shared(); - return spdlog::details::registry::instance().create(logger_name, sink); -} - -inline std::shared_ptr spdlog::stdout_color_st(const std::string& logger_name) -{ - auto sink = std::make_shared(); - return spdlog::details::registry::instance().create(logger_name, sink); -} - -inline std::shared_ptr spdlog::stderr_color_mt(const std::string& logger_name) -{ - auto sink = std::make_shared(); - return spdlog::details::registry::instance().create(logger_name, sink); -} - - -inline std::shared_ptr spdlog::stderr_color_st(const std::string& logger_name) -{ - auto sink = std::make_shared(); - return spdlog::details::registry::instance().create(logger_name, sink); -} - -#else //ansi terminal colors - -inline std::shared_ptr spdlog::stdout_color_mt(const std::string& logger_name) -{ - auto sink = std::make_shared(spdlog::sinks::stdout_sink_mt::instance()); - return spdlog::details::registry::instance().create(logger_name, sink); -} - -inline std::shared_ptr spdlog::stdout_color_st(const std::string& logger_name) -{ - auto sink = std::make_shared(spdlog::sinks::stdout_sink_st::instance()); - return spdlog::details::registry::instance().create(logger_name, sink); -} - -inline std::shared_ptr spdlog::stderr_color_mt(const std::string& logger_name) -{ - auto sink = std::make_shared(spdlog::sinks::stderr_sink_mt::instance()); - return spdlog::details::registry::instance().create(logger_name, sink); -} - -inline std::shared_ptr spdlog::stderr_color_st(const std::string& logger_name) -{ - auto sink = std::make_shared(spdlog::sinks::stderr_sink_st::instance()); - return spdlog::details::registry::instance().create(logger_name, sink); -} -#endif - -#ifdef SPDLOG_ENABLE_SYSLOG -// Create syslog logger -inline std::shared_ptr spdlog::syslog_logger(const std::string& logger_name, const std::string& syslog_ident, int syslog_option) -{ - return create(logger_name, syslog_ident, syslog_option); -} -#endif - -#ifdef __ANDROID__ -inline std::shared_ptr spdlog::android_logger(const std::string& logger_name, const std::string& tag) -{ - return create(logger_name, tag); -} -#endif - -// Create and register a logger a single sink -inline std::shared_ptr spdlog::create(const std::string& logger_name, const spdlog::sink_ptr& sink) -{ - return details::registry::instance().create(logger_name, sink); -} - -//Create logger with multiple sinks - -inline std::shared_ptr spdlog::create(const std::string& logger_name, spdlog::sinks_init_list sinks) -{ - return details::registry::instance().create(logger_name, sinks); -} - - -template -inline std::shared_ptr spdlog::create(const std::string& logger_name, Args... args) -{ - sink_ptr sink = std::make_shared(args...); - return details::registry::instance().create(logger_name, { sink }); -} - - -template -inline std::shared_ptr spdlog::create(const std::string& logger_name, const It& sinks_begin, const It& sinks_end) -{ - return details::registry::instance().create(logger_name, sinks_begin, sinks_end); -} - -inline void spdlog::set_formatter(spdlog::formatter_ptr f) -{ - details::registry::instance().formatter(f); -} - -inline void spdlog::set_pattern(const std::string& format_string) -{ - return details::registry::instance().set_pattern(format_string); -} - -inline void spdlog::set_level(level::level_enum log_level) -{ - return details::registry::instance().set_level(log_level); -} - -inline void spdlog::set_error_handler(log_err_handler handler) -{ - return details::registry::instance().set_error_handler(handler); -} - - -inline void spdlog::set_async_mode(size_t queue_size, const async_overflow_policy overflow_policy, const std::function& worker_warmup_cb, const std::chrono::milliseconds& flush_interval_ms, const std::function& worker_teardown_cb) -{ - details::registry::instance().set_async_mode(queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb); -} - -inline void spdlog::set_sync_mode() -{ - details::registry::instance().set_sync_mode(); -} - -inline void spdlog::apply_all(std::function)> fun) -{ - details::registry::instance().apply_all(fun); -} - -inline void spdlog::drop_all() -{ - details::registry::instance().drop_all(); -} diff --git a/bm/sai_adapter/inc/spdlog/fmt/bundled/format.cc b/bm/sai_adapter/inc/spdlog/fmt/bundled/format.cc deleted file mode 100644 index 2bd774e44..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/bundled/format.cc +++ /dev/null @@ -1,940 +0,0 @@ -/* - Formatting library for C++ - - Copyright (c) 2012 - 2016, Victor Zverovich - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. 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. - - 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. - */ - -#include "format.h" - -#include - -#include -#include -#include -#include -#include -#include // for std::ptrdiff_t - -#if defined(_WIN32) && defined(__MINGW32__) -# include -#endif - -#if FMT_USE_WINDOWS_H -# if defined(NOMINMAX) || defined(FMT_WIN_MINMAX) -# include -# else -# define NOMINMAX -# include -# undef NOMINMAX -# endif -#endif - -using fmt::internal::Arg; - -#if FMT_EXCEPTIONS -# define FMT_TRY try -# define FMT_CATCH(x) catch (x) -#else -# define FMT_TRY if (true) -# define FMT_CATCH(x) if (false) -#endif - -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable: 4127) // conditional expression is constant -# pragma warning(disable: 4702) // unreachable code -// Disable deprecation warning for strerror. The latter is not called but -// MSVC fails to detect it. -# pragma warning(disable: 4996) -#endif - -// Dummy implementations of strerror_r and strerror_s called if corresponding -// system functions are not available. -static inline fmt::internal::Null<> strerror_r(int, char *, ...) { - return fmt::internal::Null<>(); -} -static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { - return fmt::internal::Null<>(); -} - -namespace fmt { - -FMT_FUNC internal::RuntimeError::~RuntimeError() throw() {} -FMT_FUNC FormatError::~FormatError() throw() {} -FMT_FUNC SystemError::~SystemError() throw() {} - -namespace { - -#ifndef _MSC_VER -# define FMT_SNPRINTF snprintf -#else // _MSC_VER -inline int fmt_snprintf(char *buffer, size_t size, const char *format, ...) { - va_list args; - va_start(args, format); - int result = vsnprintf_s(buffer, size, _TRUNCATE, format, args); - va_end(args); - return result; -} -# define FMT_SNPRINTF fmt_snprintf -#endif // _MSC_VER - -#if defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT) -# define FMT_SWPRINTF snwprintf -#else -# define FMT_SWPRINTF swprintf -#endif // defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT) - -// Checks if a value fits in int - used to avoid warnings about comparing -// signed and unsigned integers. -template -struct IntChecker { - template - static bool fits_in_int(T value) { - unsigned max = INT_MAX; - return value <= max; - } - static bool fits_in_int(bool) { return true; } -}; - -template <> -struct IntChecker { - template - static bool fits_in_int(T value) { - return value >= INT_MIN && value <= INT_MAX; - } - static bool fits_in_int(int) { return true; } -}; - -const char RESET_COLOR[] = "\x1b[0m"; - -typedef void (*FormatFunc)(Writer &, int, StringRef); - -// Portable thread-safe version of strerror. -// Sets buffer to point to a string describing the error code. -// This can be either a pointer to a string stored in buffer, -// or a pointer to some static immutable string. -// Returns one of the following values: -// 0 - success -// ERANGE - buffer is not large enough to store the error message -// other - failure -// Buffer should be at least of size 1. -int safe_strerror( - int error_code, char *&buffer, std::size_t buffer_size) FMT_NOEXCEPT { - FMT_ASSERT(buffer != 0 && buffer_size != 0, "invalid buffer"); - - class StrError { - private: - int error_code_; - char *&buffer_; - std::size_t buffer_size_; - - // A noop assignment operator to avoid bogus warnings. - void operator=(const StrError &) {} - - // Handle the result of XSI-compliant version of strerror_r. - int handle(int result) { - // glibc versions before 2.13 return result in errno. - return result == -1 ? errno : result; - } - - // Handle the result of GNU-specific version of strerror_r. - int handle(char *message) { - // If the buffer is full then the message is probably truncated. - if (message == buffer_ && strlen(buffer_) == buffer_size_ - 1) - return ERANGE; - buffer_ = message; - return 0; - } - - // Handle the case when strerror_r is not available. - int handle(internal::Null<>) { - return fallback(strerror_s(buffer_, buffer_size_, error_code_)); - } - - // Fallback to strerror_s when strerror_r is not available. - int fallback(int result) { - // If the buffer is full then the message is probably truncated. - return result == 0 && strlen(buffer_) == buffer_size_ - 1 ? - ERANGE : result; - } - - // Fallback to strerror if strerror_r and strerror_s are not available. - int fallback(internal::Null<>) { - errno = 0; - buffer_ = strerror(error_code_); - return errno; - } - - public: - StrError(int err_code, char *&buf, std::size_t buf_size) - : error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {} - - int run() { - strerror_r(0, 0, ""); // Suppress a warning about unused strerror_r. - return handle(strerror_r(error_code_, buffer_, buffer_size_)); - } - }; - return StrError(error_code, buffer, buffer_size).run(); -} - -void format_error_code(Writer &out, int error_code, - StringRef message) FMT_NOEXCEPT { - // Report error code making sure that the output fits into - // INLINE_BUFFER_SIZE to avoid dynamic memory allocation and potential - // bad_alloc. - out.clear(); - static const char SEP[] = ": "; - static const char ERROR_STR[] = "error "; - // Subtract 2 to account for terminating null characters in SEP and ERROR_STR. - std::size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2; - typedef internal::IntTraits::MainType MainType; - MainType abs_value = static_cast(error_code); - if (internal::is_negative(error_code)) { - abs_value = 0 - abs_value; - ++error_code_size; - } - error_code_size += internal::count_digits(abs_value); - if (message.size() <= internal::INLINE_BUFFER_SIZE - error_code_size) - out << message << SEP; - out << ERROR_STR << error_code; - assert(out.size() <= internal::INLINE_BUFFER_SIZE); -} - -void report_error(FormatFunc func, int error_code, - StringRef message) FMT_NOEXCEPT { - MemoryWriter full_message; - func(full_message, error_code, message); - // Use Writer::data instead of Writer::c_str to avoid potential memory - // allocation. - std::fwrite(full_message.data(), full_message.size(), 1, stderr); - std::fputc('\n', stderr); -} - -// IsZeroInt::visit(arg) returns true iff arg is a zero integer. -class IsZeroInt : public ArgVisitor { - public: - template - bool visit_any_int(T value) { return value == 0; } -}; - -// Checks if an argument is a valid printf width specifier and sets -// left alignment if it is negative. -class WidthHandler : public ArgVisitor { - private: - FormatSpec &spec_; - - FMT_DISALLOW_COPY_AND_ASSIGN(WidthHandler); - - public: - explicit WidthHandler(FormatSpec &spec) : spec_(spec) {} - - void report_unhandled_arg() { - FMT_THROW(FormatError("width is not integer")); - } - - template - unsigned visit_any_int(T value) { - typedef typename internal::IntTraits::MainType UnsignedType; - UnsignedType width = static_cast(value); - if (internal::is_negative(value)) { - spec_.align_ = ALIGN_LEFT; - width = 0 - width; - } - if (width > INT_MAX) - FMT_THROW(FormatError("number is too big")); - return static_cast(width); - } -}; - -class PrecisionHandler : public ArgVisitor { - public: - void report_unhandled_arg() { - FMT_THROW(FormatError("precision is not integer")); - } - - template - int visit_any_int(T value) { - if (!IntChecker::is_signed>::fits_in_int(value)) - FMT_THROW(FormatError("number is too big")); - return static_cast(value); - } -}; - -template -struct is_same { - enum { value = 0 }; -}; - -template -struct is_same { - enum { value = 1 }; -}; - -// An argument visitor that converts an integer argument to T for printf, -// if T is an integral type. If T is void, the argument is converted to -// corresponding signed or unsigned type depending on the type specifier: -// 'd' and 'i' - signed, other - unsigned) -template -class ArgConverter : public ArgVisitor, void> { - private: - internal::Arg &arg_; - wchar_t type_; - - FMT_DISALLOW_COPY_AND_ASSIGN(ArgConverter); - - public: - ArgConverter(internal::Arg &arg, wchar_t type) - : arg_(arg), type_(type) {} - - void visit_bool(bool value) { - if (type_ != 's') - visit_any_int(value); - } - - template - void visit_any_int(U value) { - bool is_signed = type_ == 'd' || type_ == 'i'; - using internal::Arg; - typedef typename internal::Conditional< - is_same::value, U, T>::type TargetType; - if (sizeof(TargetType) <= sizeof(int)) { - // Extra casts are used to silence warnings. - if (is_signed) { - arg_.type = Arg::INT; - arg_.int_value = static_cast(static_cast(value)); - } else { - arg_.type = Arg::UINT; - typedef typename internal::MakeUnsigned::Type Unsigned; - arg_.uint_value = static_cast(static_cast(value)); - } - } else { - if (is_signed) { - arg_.type = Arg::LONG_LONG; - // glibc's printf doesn't sign extend arguments of smaller types: - // std::printf("%lld", -42); // prints "4294967254" - // but we don't have to do the same because it's a UB. - arg_.long_long_value = static_cast(value); - } else { - arg_.type = Arg::ULONG_LONG; - arg_.ulong_long_value = - static_cast::Type>(value); - } - } - } -}; - -// Converts an integer argument to char for printf. -class CharConverter : public ArgVisitor { - private: - internal::Arg &arg_; - - FMT_DISALLOW_COPY_AND_ASSIGN(CharConverter); - - public: - explicit CharConverter(internal::Arg &arg) : arg_(arg) {} - - template - void visit_any_int(T value) { - arg_.type = internal::Arg::CHAR; - arg_.int_value = static_cast(value); - } -}; -} // namespace - -namespace internal { - -template -class PrintfArgFormatter : - public ArgFormatterBase, Char> { - - void write_null_pointer() { - this->spec().type_ = 0; - this->write("(nil)"); - } - - typedef ArgFormatterBase, Char> Base; - - public: - PrintfArgFormatter(BasicWriter &w, FormatSpec &s) - : ArgFormatterBase, Char>(w, s) {} - - void visit_bool(bool value) { - FormatSpec &fmt_spec = this->spec(); - if (fmt_spec.type_ != 's') - return this->visit_any_int(value); - fmt_spec.type_ = 0; - this->write(value); - } - - void visit_char(int value) { - const FormatSpec &fmt_spec = this->spec(); - BasicWriter &w = this->writer(); - if (fmt_spec.type_ && fmt_spec.type_ != 'c') - w.write_int(value, fmt_spec); - typedef typename BasicWriter::CharPtr CharPtr; - CharPtr out = CharPtr(); - if (fmt_spec.width_ > 1) { - Char fill = ' '; - out = w.grow_buffer(fmt_spec.width_); - if (fmt_spec.align_ != ALIGN_LEFT) { - std::fill_n(out, fmt_spec.width_ - 1, fill); - out += fmt_spec.width_ - 1; - } else { - std::fill_n(out + 1, fmt_spec.width_ - 1, fill); - } - } else { - out = w.grow_buffer(1); - } - *out = static_cast(value); - } - - void visit_cstring(const char *value) { - if (value) - Base::visit_cstring(value); - else if (this->spec().type_ == 'p') - write_null_pointer(); - else - this->write("(null)"); - } - - void visit_pointer(const void *value) { - if (value) - return Base::visit_pointer(value); - this->spec().type_ = 0; - write_null_pointer(); - } - - void visit_custom(Arg::CustomValue c) { - BasicFormatter formatter(ArgList(), this->writer()); - const Char format_str[] = {'}', 0}; - const Char *format = format_str; - c.format(&formatter, c.value, &format); - } -}; -} // namespace internal -} // namespace fmt - -FMT_FUNC void fmt::SystemError::init( - int err_code, CStringRef format_str, ArgList args) { - error_code_ = err_code; - MemoryWriter w; - internal::format_system_error(w, err_code, format(format_str, args)); - std::runtime_error &base = *this; - base = std::runtime_error(w.str()); -} - -template -int fmt::internal::CharTraits::format_float( - char *buffer, std::size_t size, const char *format, - unsigned width, int precision, T value) { - if (width == 0) { - return precision < 0 ? - FMT_SNPRINTF(buffer, size, format, value) : - FMT_SNPRINTF(buffer, size, format, precision, value); - } - return precision < 0 ? - FMT_SNPRINTF(buffer, size, format, width, value) : - FMT_SNPRINTF(buffer, size, format, width, precision, value); -} - -template -int fmt::internal::CharTraits::format_float( - wchar_t *buffer, std::size_t size, const wchar_t *format, - unsigned width, int precision, T value) { - if (width == 0) { - return precision < 0 ? - FMT_SWPRINTF(buffer, size, format, value) : - FMT_SWPRINTF(buffer, size, format, precision, value); - } - return precision < 0 ? - FMT_SWPRINTF(buffer, size, format, width, value) : - FMT_SWPRINTF(buffer, size, format, width, precision, value); -} - -template -const char fmt::internal::BasicData::DIGITS[] = - "0001020304050607080910111213141516171819" - "2021222324252627282930313233343536373839" - "4041424344454647484950515253545556575859" - "6061626364656667686970717273747576777879" - "8081828384858687888990919293949596979899"; - -#define FMT_POWERS_OF_10(factor) \ - factor * 10, \ - factor * 100, \ - factor * 1000, \ - factor * 10000, \ - factor * 100000, \ - factor * 1000000, \ - factor * 10000000, \ - factor * 100000000, \ - factor * 1000000000 - -template -const uint32_t fmt::internal::BasicData::POWERS_OF_10_32[] = { - 0, FMT_POWERS_OF_10(1) -}; - -template -const uint64_t fmt::internal::BasicData::POWERS_OF_10_64[] = { - 0, - FMT_POWERS_OF_10(1), - FMT_POWERS_OF_10(fmt::ULongLong(1000000000)), - // Multiply several constants instead of using a single long long constant - // to avoid warnings about C++98 not supporting long long. - fmt::ULongLong(1000000000) * fmt::ULongLong(1000000000) * 10 -}; - -FMT_FUNC void fmt::internal::report_unknown_type(char code, const char *type) { - (void)type; - if (std::isprint(static_cast(code))) { - FMT_THROW(fmt::FormatError( - fmt::format("unknown format code '{}' for {}", code, type))); - } - FMT_THROW(fmt::FormatError( - fmt::format("unknown format code '\\x{:02x}' for {}", - static_cast(code), type))); -} - -#if FMT_USE_WINDOWS_H - -FMT_FUNC fmt::internal::UTF8ToUTF16::UTF8ToUTF16(fmt::StringRef s) { - static const char ERROR_MSG[] = "cannot convert string from UTF-8 to UTF-16"; - if (s.size() > INT_MAX) - FMT_THROW(WindowsError(ERROR_INVALID_PARAMETER, ERROR_MSG)); - int s_size = static_cast(s.size()); - int length = MultiByteToWideChar( - CP_UTF8, MB_ERR_INVALID_CHARS, s.data(), s_size, 0, 0); - if (length == 0) - FMT_THROW(WindowsError(GetLastError(), ERROR_MSG)); - buffer_.resize(length + 1); - length = MultiByteToWideChar( - CP_UTF8, MB_ERR_INVALID_CHARS, s.data(), s_size, &buffer_[0], length); - if (length == 0) - FMT_THROW(WindowsError(GetLastError(), ERROR_MSG)); - buffer_[length] = 0; -} - -FMT_FUNC fmt::internal::UTF16ToUTF8::UTF16ToUTF8(fmt::WStringRef s) { - if (int error_code = convert(s)) { - FMT_THROW(WindowsError(error_code, - "cannot convert string from UTF-16 to UTF-8")); - } -} - -FMT_FUNC int fmt::internal::UTF16ToUTF8::convert(fmt::WStringRef s) { - if (s.size() > INT_MAX) - return ERROR_INVALID_PARAMETER; - int s_size = static_cast(s.size()); - int length = WideCharToMultiByte(CP_UTF8, 0, s.data(), s_size, 0, 0, 0, 0); - if (length == 0) - return GetLastError(); - buffer_.resize(length + 1); - length = WideCharToMultiByte( - CP_UTF8, 0, s.data(), s_size, &buffer_[0], length, 0, 0); - if (length == 0) - return GetLastError(); - buffer_[length] = 0; - return 0; -} - -FMT_FUNC void fmt::WindowsError::init( - int err_code, CStringRef format_str, ArgList args) { - error_code_ = err_code; - MemoryWriter w; - internal::format_windows_error(w, err_code, format(format_str, args)); - std::runtime_error &base = *this; - base = std::runtime_error(w.str()); -} - -FMT_FUNC void fmt::internal::format_windows_error( - fmt::Writer &out, int error_code, - fmt::StringRef message) FMT_NOEXCEPT { - FMT_TRY { - MemoryBuffer buffer; - buffer.resize(INLINE_BUFFER_SIZE); - for (;;) { - wchar_t *system_message = &buffer[0]; - int result = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - 0, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - system_message, static_cast(buffer.size()), 0); - if (result != 0) { - UTF16ToUTF8 utf8_message; - if (utf8_message.convert(system_message) == ERROR_SUCCESS) { - out << message << ": " << utf8_message; - return; - } - break; - } - if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) - break; // Can't get error message, report error code instead. - buffer.resize(buffer.size() * 2); - } - } FMT_CATCH(...) {} - fmt::format_error_code(out, error_code, message); // 'fmt::' is for bcc32. -} - -#endif // FMT_USE_WINDOWS_H - -FMT_FUNC void fmt::internal::format_system_error( - fmt::Writer &out, int error_code, - fmt::StringRef message) FMT_NOEXCEPT { - FMT_TRY { - MemoryBuffer buffer; - buffer.resize(INLINE_BUFFER_SIZE); - for (;;) { - char *system_message = &buffer[0]; - int result = safe_strerror(error_code, system_message, buffer.size()); - if (result == 0) { - out << message << ": " << system_message; - return; - } - if (result != ERANGE) - break; // Can't get error message, report error code instead. - buffer.resize(buffer.size() * 2); - } - } FMT_CATCH(...) {} - fmt::format_error_code(out, error_code, message); // 'fmt::' is for bcc32. -} - -template -void fmt::internal::ArgMap::init(const ArgList &args) { - if (!map_.empty()) - return; - typedef internal::NamedArg NamedArg; - const NamedArg *named_arg = 0; - bool use_values = - args.type(ArgList::MAX_PACKED_ARGS - 1) == internal::Arg::NONE; - if (use_values) { - for (unsigned i = 0;/*nothing*/; ++i) { - internal::Arg::Type arg_type = args.type(i); - switch (arg_type) { - case internal::Arg::NONE: - return; - case internal::Arg::NAMED_ARG: - named_arg = static_cast(args.values_[i].pointer); - map_.push_back(Pair(named_arg->name, *named_arg)); - break; - default: - /*nothing*/; - } - } - return; - } - for (unsigned i = 0; i != ArgList::MAX_PACKED_ARGS; ++i) { - internal::Arg::Type arg_type = args.type(i); - if (arg_type == internal::Arg::NAMED_ARG) { - named_arg = static_cast(args.args_[i].pointer); - map_.push_back(Pair(named_arg->name, *named_arg)); - } - } - for (unsigned i = ArgList::MAX_PACKED_ARGS;/*nothing*/; ++i) { - switch (args.args_[i].type) { - case internal::Arg::NONE: - return; - case internal::Arg::NAMED_ARG: - named_arg = static_cast(args.args_[i].pointer); - map_.push_back(Pair(named_arg->name, *named_arg)); - break; - default: - /*nothing*/; - } - } -} - -template -void fmt::internal::FixedBuffer::grow(std::size_t) { - FMT_THROW(std::runtime_error("buffer overflow")); -} - -FMT_FUNC Arg fmt::internal::FormatterBase::do_get_arg( - unsigned arg_index, const char *&error) { - Arg arg = args_[arg_index]; - switch (arg.type) { - case Arg::NONE: - error = "argument index out of range"; - break; - case Arg::NAMED_ARG: - arg = *static_cast(arg.pointer); - break; - default: - /*nothing*/; - } - return arg; -} - -template -void fmt::internal::PrintfFormatter::parse_flags( - FormatSpec &spec, const Char *&s) { - for (;;) { - switch (*s++) { - case '-': - spec.align_ = ALIGN_LEFT; - break; - case '+': - spec.flags_ |= SIGN_FLAG | PLUS_FLAG; - break; - case '0': - spec.fill_ = '0'; - break; - case ' ': - spec.flags_ |= SIGN_FLAG; - break; - case '#': - spec.flags_ |= HASH_FLAG; - break; - default: - --s; - return; - } - } -} - -template -Arg fmt::internal::PrintfFormatter::get_arg( - const Char *s, unsigned arg_index) { - (void)s; - const char *error = 0; - Arg arg = arg_index == UINT_MAX ? - next_arg(error) : FormatterBase::get_arg(arg_index - 1, error); - if (error) - FMT_THROW(FormatError(!*s ? "invalid format string" : error)); - return arg; -} - -template -unsigned fmt::internal::PrintfFormatter::parse_header( - const Char *&s, FormatSpec &spec) { - unsigned arg_index = UINT_MAX; - Char c = *s; - if (c >= '0' && c <= '9') { - // Parse an argument index (if followed by '$') or a width possibly - // preceded with '0' flag(s). - unsigned value = parse_nonnegative_int(s); - if (*s == '$') { // value is an argument index - ++s; - arg_index = value; - } else { - if (c == '0') - spec.fill_ = '0'; - if (value != 0) { - // Nonzero value means that we parsed width and don't need to - // parse it or flags again, so return now. - spec.width_ = value; - return arg_index; - } - } - } - parse_flags(spec, s); - // Parse width. - if (*s >= '0' && *s <= '9') { - spec.width_ = parse_nonnegative_int(s); - } else if (*s == '*') { - ++s; - spec.width_ = WidthHandler(spec).visit(get_arg(s)); - } - return arg_index; -} - -template -void fmt::internal::PrintfFormatter::format( - BasicWriter &writer, BasicCStringRef format_str) { - const Char *start = format_str.c_str(); - const Char *s = start; - while (*s) { - Char c = *s++; - if (c != '%') continue; - if (*s == c) { - write(writer, start, s); - start = ++s; - continue; - } - write(writer, start, s - 1); - - FormatSpec spec; - spec.align_ = ALIGN_RIGHT; - - // Parse argument index, flags and width. - unsigned arg_index = parse_header(s, spec); - - // Parse precision. - if (*s == '.') { - ++s; - if ('0' <= *s && *s <= '9') { - spec.precision_ = static_cast(parse_nonnegative_int(s)); - } else if (*s == '*') { - ++s; - spec.precision_ = PrecisionHandler().visit(get_arg(s)); - } - } - - Arg arg = get_arg(s, arg_index); - if (spec.flag(HASH_FLAG) && IsZeroInt().visit(arg)) - spec.flags_ &= ~to_unsigned(HASH_FLAG); - if (spec.fill_ == '0') { - if (arg.type <= Arg::LAST_NUMERIC_TYPE) - spec.align_ = ALIGN_NUMERIC; - else - spec.fill_ = ' '; // Ignore '0' flag for non-numeric types. - } - - // Parse length and convert the argument to the required type. - switch (*s++) { - case 'h': - if (*s == 'h') - ArgConverter(arg, *++s).visit(arg); - else - ArgConverter(arg, *s).visit(arg); - break; - case 'l': - if (*s == 'l') - ArgConverter(arg, *++s).visit(arg); - else - ArgConverter(arg, *s).visit(arg); - break; - case 'j': - ArgConverter(arg, *s).visit(arg); - break; - case 'z': - ArgConverter(arg, *s).visit(arg); - break; - case 't': - ArgConverter(arg, *s).visit(arg); - break; - case 'L': - // printf produces garbage when 'L' is omitted for long double, no - // need to do the same. - break; - default: - --s; - ArgConverter(arg, *s).visit(arg); - } - - // Parse type. - if (!*s) - FMT_THROW(FormatError("invalid format string")); - spec.type_ = static_cast(*s++); - if (arg.type <= Arg::LAST_INTEGER_TYPE) { - // Normalize type. - switch (spec.type_) { - case 'i': case 'u': - spec.type_ = 'd'; - break; - case 'c': - // TODO: handle wchar_t - CharConverter(arg).visit(arg); - break; - } - } - - start = s; - - // Format argument. - internal::PrintfArgFormatter(writer, spec).visit(arg); - } - write(writer, start, s); -} - -FMT_FUNC void fmt::report_system_error( - int error_code, fmt::StringRef message) FMT_NOEXCEPT { - // 'fmt::' is for bcc32. - fmt::report_error(internal::format_system_error, error_code, message); -} - -#if FMT_USE_WINDOWS_H -FMT_FUNC void fmt::report_windows_error( - int error_code, fmt::StringRef message) FMT_NOEXCEPT { - // 'fmt::' is for bcc32. - fmt::report_error(internal::format_windows_error, error_code, message); -} -#endif - -FMT_FUNC void fmt::print(std::FILE *f, CStringRef format_str, ArgList args) { - MemoryWriter w; - w.write(format_str, args); - std::fwrite(w.data(), 1, w.size(), f); -} - -FMT_FUNC void fmt::print(CStringRef format_str, ArgList args) { - print(stdout, format_str, args); -} - -FMT_FUNC void fmt::print_colored(Color c, CStringRef format, ArgList args) { - char escape[] = "\x1b[30m"; - escape[3] = static_cast('0' + c); - std::fputs(escape, stdout); - print(format, args); - std::fputs(RESET_COLOR, stdout); -} - -FMT_FUNC int fmt::fprintf(std::FILE *f, CStringRef format, ArgList args) { - MemoryWriter w; - printf(w, format, args); - std::size_t size = w.size(); - return std::fwrite(w.data(), 1, size, f) < size ? -1 : static_cast(size); -} - -#ifndef FMT_HEADER_ONLY - -template struct fmt::internal::BasicData; - -// Explicit instantiations for char. - -template void fmt::internal::FixedBuffer::grow(std::size_t); - -template void fmt::internal::ArgMap::init(const fmt::ArgList &args); - -template void fmt::internal::PrintfFormatter::format( - BasicWriter &writer, CStringRef format); - -template int fmt::internal::CharTraits::format_float( - char *buffer, std::size_t size, const char *format, - unsigned width, int precision, double value); - -template int fmt::internal::CharTraits::format_float( - char *buffer, std::size_t size, const char *format, - unsigned width, int precision, long double value); - -// Explicit instantiations for wchar_t. - -template void fmt::internal::FixedBuffer::grow(std::size_t); - -template void fmt::internal::ArgMap::init(const fmt::ArgList &args); - -template void fmt::internal::PrintfFormatter::format( - BasicWriter &writer, WCStringRef format); - -template int fmt::internal::CharTraits::format_float( - wchar_t *buffer, std::size_t size, const wchar_t *format, - unsigned width, int precision, double value); - -template int fmt::internal::CharTraits::format_float( - wchar_t *buffer, std::size_t size, const wchar_t *format, - unsigned width, int precision, long double value); - -#endif // FMT_HEADER_ONLY - -#ifdef _MSC_VER -# pragma warning(pop) -#endif diff --git a/bm/sai_adapter/inc/spdlog/fmt/bundled/format.h b/bm/sai_adapter/inc/spdlog/fmt/bundled/format.h deleted file mode 100644 index f8ce147cb..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/bundled/format.h +++ /dev/null @@ -1,3883 +0,0 @@ -/* - Formatting library for C++ - - Copyright (c) 2012 - 2016, Victor Zverovich - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. 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. - - 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. - */ - -#ifndef FMT_FORMAT_H_ -#define FMT_FORMAT_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _SECURE_SCL -# define FMT_SECURE_SCL _SECURE_SCL -#else -# define FMT_SECURE_SCL 0 -#endif - -#if FMT_SECURE_SCL -# include -#endif - -#ifdef _MSC_VER -# define FMT_MSC_VER _MSC_VER -#else -# define FMT_MSC_VER 0 -#endif - -#if FMT_MSC_VER && FMT_MSC_VER <= 1500 -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; -typedef __int64 intmax_t; -#else -#include -#endif - -#if !defined(FMT_HEADER_ONLY) && defined(_WIN32) -# ifdef FMT_EXPORT -# define FMT_API __declspec(dllexport) -# elif defined(FMT_SHARED) -# define FMT_API __declspec(dllimport) -# endif -#endif -#ifndef FMT_API -# define FMT_API -#endif - -#ifdef __GNUC__ -# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) -# define FMT_GCC_EXTENSION __extension__ -# if FMT_GCC_VERSION >= 406 -# pragma GCC diagnostic push -// Disable the warning about "long long" which is sometimes reported even -// when using __extension__. -# pragma GCC diagnostic ignored "-Wlong-long" -// Disable the warning about declaration shadowing because it affects too -// many valid cases. -# pragma GCC diagnostic ignored "-Wshadow" -// Disable the warning about implicit conversions that may change the sign of -// an integer; silencing it otherwise would require many explicit casts. -# pragma GCC diagnostic ignored "-Wsign-conversion" -# endif -# if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__ -# define FMT_HAS_GXX_CXX11 1 -# endif -#else -# define FMT_GCC_EXTENSION -#endif - -#if defined(__INTEL_COMPILER) -# define FMT_ICC_VERSION __INTEL_COMPILER -#elif defined(__ICL) -# define FMT_ICC_VERSION __ICL -#endif - -#if defined(__clang__) && !defined(FMT_ICC_VERSION) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdocumentation-unknown-command" -# pragma clang diagnostic ignored "-Wpadded" -#endif - -#ifdef __GNUC_LIBSTD__ -# define FMT_GNUC_LIBSTD_VERSION (__GNUC_LIBSTD__ * 100 + __GNUC_LIBSTD_MINOR__) -#endif - -#ifdef __has_feature -# define FMT_HAS_FEATURE(x) __has_feature(x) -#else -# define FMT_HAS_FEATURE(x) 0 -#endif - -#ifdef __has_builtin -# define FMT_HAS_BUILTIN(x) __has_builtin(x) -#else -# define FMT_HAS_BUILTIN(x) 0 -#endif - -#ifdef __has_cpp_attribute -# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) -#else -# define FMT_HAS_CPP_ATTRIBUTE(x) 0 -#endif - -#ifndef FMT_USE_VARIADIC_TEMPLATES -// Variadic templates are available in GCC since version 4.4 -// (http://gcc.gnu.org/projects/cxx0x.html) and in Visual C++ -// since version 2013. -# define FMT_USE_VARIADIC_TEMPLATES \ - (FMT_HAS_FEATURE(cxx_variadic_templates) || \ - (FMT_GCC_VERSION >= 404 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1800) -#endif - -#ifndef FMT_USE_RVALUE_REFERENCES -// Don't use rvalue references when compiling with clang and an old libstdc++ -// as the latter doesn't provide std::move. -# if defined(FMT_GNUC_LIBSTD_VERSION) && FMT_GNUC_LIBSTD_VERSION <= 402 -# define FMT_USE_RVALUE_REFERENCES 0 -# else -# define FMT_USE_RVALUE_REFERENCES \ - (FMT_HAS_FEATURE(cxx_rvalue_references) || \ - (FMT_GCC_VERSION >= 403 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1600) -# endif -#endif - -#if FMT_USE_RVALUE_REFERENCES -# include // for std::move -#endif - -// Check if exceptions are disabled. -#if defined(__GNUC__) && !defined(__EXCEPTIONS) -# define FMT_EXCEPTIONS 0 -#endif -#if FMT_MSC_VER && !_HAS_EXCEPTIONS -# define FMT_EXCEPTIONS 0 -#endif -#ifndef FMT_EXCEPTIONS -# define FMT_EXCEPTIONS 1 -#endif - -#ifndef FMT_THROW -# if FMT_EXCEPTIONS -# define FMT_THROW(x) throw x -# else -# define FMT_THROW(x) assert(false) -# endif -#endif - -// Define FMT_USE_NOEXCEPT to make fmt use noexcept (C++11 feature). -#ifndef FMT_USE_NOEXCEPT -# define FMT_USE_NOEXCEPT 0 -#endif - -#ifndef FMT_NOEXCEPT -# if FMT_EXCEPTIONS -# if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \ - (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \ - FMT_MSC_VER >= 1900 -# define FMT_NOEXCEPT noexcept -# else -# define FMT_NOEXCEPT throw() -# endif -# else -# define FMT_NOEXCEPT -# endif -#endif - -#ifndef FMT_OVERRIDE -# if FMT_USE_OVERRIDE || FMT_HAS_FEATURE(cxx_override) || \ - (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \ - FMT_MSC_VER >= 1900 -# define FMT_OVERRIDE override -# else -# define FMT_OVERRIDE -# endif -#endif - - -// A macro to disallow the copy constructor and operator= functions -// This should be used in the private: declarations for a class -#ifndef FMT_USE_DELETED_FUNCTIONS -# define FMT_USE_DELETED_FUNCTIONS 0 -#endif - -#if FMT_USE_DELETED_FUNCTIONS || FMT_HAS_FEATURE(cxx_deleted_functions) || \ - (FMT_GCC_VERSION >= 404 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1800 -# define FMT_DELETED_OR_UNDEFINED = delete -# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&) = delete; \ - TypeName& operator=(const TypeName&) = delete -#else -# define FMT_DELETED_OR_UNDEFINED -# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - TypeName& operator=(const TypeName&) -#endif - -#ifndef FMT_USE_USER_DEFINED_LITERALS -// All compilers which support UDLs also support variadic templates. This -// makes the fmt::literals implementation easier. However, an explicit check -// for variadic templates is added here just in case. -// For Intel's compiler both it and the system gcc/msc must support UDLs. -# define FMT_USE_USER_DEFINED_LITERALS \ - FMT_USE_VARIADIC_TEMPLATES && FMT_USE_RVALUE_REFERENCES && \ - (FMT_HAS_FEATURE(cxx_user_literals) || \ - (FMT_GCC_VERSION >= 407 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900) && \ - (!defined(FMT_ICC_VERSION) || FMT_ICC_VERSION >= 1500) -#endif - -#ifndef FMT_ASSERT -# define FMT_ASSERT(condition, message) assert((condition) && message) -#endif - -#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clz) -# define FMT_BUILTIN_CLZ(n) __builtin_clz(n) -#endif - -#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clzll) -# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n) -#endif - -// Some compilers masquerade as both MSVC and GCC-likes or -// otherwise support __builtin_clz and __builtin_clzll, so -// only define FMT_BUILTIN_CLZ using the MSVC intrinsics -// if the clz and clzll builtins are not available. -#if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) -# include // _BitScanReverse, _BitScanReverse64 - -namespace fmt { -namespace internal { -# pragma intrinsic(_BitScanReverse) -inline uint32_t clz(uint32_t x) { - unsigned long r = 0; - _BitScanReverse(&r, x); - - assert(x != 0); - // Static analysis complains about using uninitialized data - // "r", but the only way that can happen is if "x" is 0, - // which the callers guarantee to not happen. -# pragma warning(suppress: 6102) - return 31 - r; -} -# define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n) - -# ifdef _WIN64 -# pragma intrinsic(_BitScanReverse64) -# endif - -inline uint32_t clzll(uint64_t x) { - unsigned long r = 0; -# ifdef _WIN64 - _BitScanReverse64(&r, x); -# else - // Scan the high 32 bits. - if (_BitScanReverse(&r, static_cast(x >> 32))) - return 63 - (r + 32); - - // Scan the low 32 bits. - _BitScanReverse(&r, static_cast(x)); -# endif - - assert(x != 0); - // Static analysis complains about using uninitialized data - // "r", but the only way that can happen is if "x" is 0, - // which the callers guarantee to not happen. -# pragma warning(suppress: 6102) - return 63 - r; -} -# define FMT_BUILTIN_CLZLL(n) fmt::internal::clzll(n) -} -} -#endif - -namespace fmt { -namespace internal { -struct DummyInt { - int data[2]; - operator int() const { return 0; } -}; -typedef std::numeric_limits FPUtil; - -// Dummy implementations of system functions such as signbit and ecvt called -// if the latter are not available. -inline DummyInt signbit(...) { return DummyInt(); } -inline DummyInt _ecvt_s(...) { return DummyInt(); } -inline DummyInt isinf(...) { return DummyInt(); } -inline DummyInt _finite(...) { return DummyInt(); } -inline DummyInt isnan(...) { return DummyInt(); } -inline DummyInt _isnan(...) { return DummyInt(); } - -// A helper function to suppress bogus "conditional expression is constant" -// warnings. -template -inline T const_check(T value) { return value; } -} -} // namespace fmt - -namespace std { -// Standard permits specialization of std::numeric_limits. This specialization -// is used to resolve ambiguity between isinf and std::isinf in glibc: -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891 -// and the same for isnan and signbit. -template <> -class numeric_limits : - public std::numeric_limits { - public: - // Portable version of isinf. - template - static bool isinfinity(T x) { - using namespace fmt::internal; - // The resolution "priority" is: - // isinf macro > std::isinf > ::isinf > fmt::internal::isinf - if (const_check(sizeof(isinf(x)) == sizeof(bool) || - sizeof(isinf(x)) == sizeof(int))) { - return isinf(x) != 0; - } - return !_finite(static_cast(x)); - } - - // Portable version of isnan. - template - static bool isnotanumber(T x) { - using namespace fmt::internal; - if (const_check(sizeof(isnan(x)) == sizeof(bool) || - sizeof(isnan(x)) == sizeof(int))) { - return isnan(x) != 0; - } - return _isnan(static_cast(x)) != 0; - } - - // Portable version of signbit. - static bool isnegative(double x) { - using namespace fmt::internal; - if (const_check(sizeof(signbit(x)) == sizeof(int))) - return signbit(x) != 0; - if (x < 0) return true; - if (!isnotanumber(x)) return false; - int dec = 0, sign = 0; - char buffer[2]; // The buffer size must be >= 2 or _ecvt_s will fail. - _ecvt_s(buffer, sizeof(buffer), x, 0, &dec, &sign); - return sign != 0; - } -}; -} // namespace std - -namespace fmt { - -// Fix the warning about long long on older versions of GCC -// that don't support the diagnostic pragma. -FMT_GCC_EXTENSION typedef long long LongLong; -FMT_GCC_EXTENSION typedef unsigned long long ULongLong; - -#if FMT_USE_RVALUE_REFERENCES -using std::move; -#endif - -template -class BasicWriter; - -typedef BasicWriter Writer; -typedef BasicWriter WWriter; - -template -class ArgFormatter; - -template > -class BasicFormatter; - -/** - \rst - A string reference. It can be constructed from a C string or ``std::string``. - - You can use one of the following typedefs for common character types: - - +------------+-------------------------+ - | Type | Definition | - +============+=========================+ - | StringRef | BasicStringRef | - +------------+-------------------------+ - | WStringRef | BasicStringRef | - +------------+-------------------------+ - - This class is most useful as a parameter type to allow passing - different types of strings to a function, for example:: - - template - std::string format(StringRef format_str, const Args & ... args); - - format("{}", 42); - format(std::string("{}"), 42); - \endrst - */ -template -class BasicStringRef { - private: - const Char *data_; - std::size_t size_; - - public: - /** Constructs a string reference object from a C string and a size. */ - BasicStringRef(const Char *s, std::size_t size) : data_(s), size_(size) {} - - /** - \rst - Constructs a string reference object from a C string computing - the size with ``std::char_traits::length``. - \endrst - */ - BasicStringRef(const Char *s) - : data_(s), size_(std::char_traits::length(s)) {} - - /** - \rst - Constructs a string reference from an ``std::string`` object. - \endrst - */ - BasicStringRef(const std::basic_string &s) - : data_(s.c_str()), size_(s.size()) {} - - /** - \rst - Converts a string reference to an ``std::string`` object. - \endrst - */ - std::basic_string to_string() const { - return std::basic_string(data_, size_); - } - - /** Returns a pointer to the string data. */ - const Char *data() const { return data_; } - - /** Returns the string size. */ - std::size_t size() const { return size_; } - - // Lexicographically compare this string reference to other. - int compare(BasicStringRef other) const { - std::size_t size = size_ < other.size_ ? size_ : other.size_; - int result = std::char_traits::compare(data_, other.data_, size); - if (result == 0) - result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1); - return result; - } - - friend bool operator==(BasicStringRef lhs, BasicStringRef rhs) { - return lhs.compare(rhs) == 0; - } - friend bool operator!=(BasicStringRef lhs, BasicStringRef rhs) { - return lhs.compare(rhs) != 0; - } - friend bool operator<(BasicStringRef lhs, BasicStringRef rhs) { - return lhs.compare(rhs) < 0; - } - friend bool operator<=(BasicStringRef lhs, BasicStringRef rhs) { - return lhs.compare(rhs) <= 0; - } - friend bool operator>(BasicStringRef lhs, BasicStringRef rhs) { - return lhs.compare(rhs) > 0; - } - friend bool operator>=(BasicStringRef lhs, BasicStringRef rhs) { - return lhs.compare(rhs) >= 0; - } -}; - -typedef BasicStringRef StringRef; -typedef BasicStringRef WStringRef; - -/** - \rst - A reference to a null terminated string. It can be constructed from a C - string or ``std::string``. - - You can use one of the following typedefs for common character types: - - +-------------+--------------------------+ - | Type | Definition | - +=============+==========================+ - | CStringRef | BasicCStringRef | - +-------------+--------------------------+ - | WCStringRef | BasicCStringRef | - +-------------+--------------------------+ - - This class is most useful as a parameter type to allow passing - different types of strings to a function, for example:: - - template - std::string format(CStringRef format_str, const Args & ... args); - - format("{}", 42); - format(std::string("{}"), 42); - \endrst - */ -template -class BasicCStringRef { - private: - const Char *data_; - - public: - /** Constructs a string reference object from a C string. */ - BasicCStringRef(const Char *s) : data_(s) {} - - /** - \rst - Constructs a string reference from an ``std::string`` object. - \endrst - */ - BasicCStringRef(const std::basic_string &s) : data_(s.c_str()) {} - - /** Returns the pointer to a C string. */ - const Char *c_str() const { return data_; } -}; - -typedef BasicCStringRef CStringRef; -typedef BasicCStringRef WCStringRef; - -/** A formatting error such as invalid format string. */ -class FormatError : public std::runtime_error { - public: - explicit FormatError(CStringRef message) - : std::runtime_error(message.c_str()) {} - ~FormatError() throw(); -}; - -namespace internal { - -// MakeUnsigned::Type gives an unsigned type corresponding to integer type T. -template -struct MakeUnsigned { typedef T Type; }; - -#define FMT_SPECIALIZE_MAKE_UNSIGNED(T, U) \ - template <> \ - struct MakeUnsigned { typedef U Type; } - -FMT_SPECIALIZE_MAKE_UNSIGNED(char, unsigned char); -FMT_SPECIALIZE_MAKE_UNSIGNED(signed char, unsigned char); -FMT_SPECIALIZE_MAKE_UNSIGNED(short, unsigned short); -FMT_SPECIALIZE_MAKE_UNSIGNED(int, unsigned); -FMT_SPECIALIZE_MAKE_UNSIGNED(long, unsigned long); -FMT_SPECIALIZE_MAKE_UNSIGNED(LongLong, ULongLong); - -// Casts nonnegative integer to unsigned. -template -inline typename MakeUnsigned::Type to_unsigned(Int value) { - FMT_ASSERT(value >= 0, "negative value"); - return static_cast::Type>(value); -} - -// The number of characters to store in the MemoryBuffer object itself -// to avoid dynamic memory allocation. -enum { INLINE_BUFFER_SIZE = 500 }; - -#if FMT_SECURE_SCL -// Use checked iterator to avoid warnings on MSVC. -template -inline stdext::checked_array_iterator make_ptr(T *ptr, std::size_t size) { - return stdext::checked_array_iterator(ptr, size); -} -#else -template -inline T *make_ptr(T *ptr, std::size_t) { return ptr; } -#endif -} // namespace internal - -/** - \rst - A buffer supporting a subset of ``std::vector``'s operations. - \endrst - */ -template -class Buffer { - private: - FMT_DISALLOW_COPY_AND_ASSIGN(Buffer); - - protected: - T *ptr_; - std::size_t size_; - std::size_t capacity_; - - Buffer(T *ptr = 0, std::size_t capacity = 0) - : ptr_(ptr), size_(0), capacity_(capacity) {} - - /** - \rst - Increases the buffer capacity to hold at least *size* elements updating - ``ptr_`` and ``capacity_``. - \endrst - */ - virtual void grow(std::size_t size) = 0; - - public: - virtual ~Buffer() {} - - /** Returns the size of this buffer. */ - std::size_t size() const { return size_; } - - /** Returns the capacity of this buffer. */ - std::size_t capacity() const { return capacity_; } - - /** - Resizes the buffer. If T is a POD type new elements may not be initialized. - */ - void resize(std::size_t new_size) { - if (new_size > capacity_) - grow(new_size); - size_ = new_size; - } - - /** - \rst - Reserves space to store at least *capacity* elements. - \endrst - */ - void reserve(std::size_t capacity) { - if (capacity > capacity_) - grow(capacity); - } - - void clear() FMT_NOEXCEPT { size_ = 0; } - - void push_back(const T &value) { - if (size_ == capacity_) - grow(size_ + 1); - ptr_[size_++] = value; - } - - /** Appends data to the end of the buffer. */ - template - void append(const U *begin, const U *end); - - T &operator[](std::size_t index) { return ptr_[index]; } - const T &operator[](std::size_t index) const { return ptr_[index]; } -}; - -template -template -void Buffer::append(const U *begin, const U *end) { - std::size_t new_size = size_ + internal::to_unsigned(end - begin); - if (new_size > capacity_) - grow(new_size); - std::uninitialized_copy(begin, end, - internal::make_ptr(ptr_, capacity_) + size_); - size_ = new_size; -} - -namespace internal { - -// A memory buffer for trivially copyable/constructible types with the first -// SIZE elements stored in the object itself. -template > -class MemoryBuffer : private Allocator, public Buffer { - private: - T data_[SIZE]; - - // Deallocate memory allocated by the buffer. - void deallocate() { - if (this->ptr_ != data_) Allocator::deallocate(this->ptr_, this->capacity_); - } - - protected: - void grow(std::size_t size) FMT_OVERRIDE; - - public: - explicit MemoryBuffer(const Allocator &alloc = Allocator()) - : Allocator(alloc), Buffer(data_, SIZE) {} - ~MemoryBuffer() { deallocate(); } - -#if FMT_USE_RVALUE_REFERENCES - private: - // Move data from other to this buffer. - void move(MemoryBuffer &other) { - Allocator &this_alloc = *this, &other_alloc = other; - this_alloc = std::move(other_alloc); - this->size_ = other.size_; - this->capacity_ = other.capacity_; - if (other.ptr_ == other.data_) { - this->ptr_ = data_; - std::uninitialized_copy(other.data_, other.data_ + this->size_, - make_ptr(data_, this->capacity_)); - } else { - this->ptr_ = other.ptr_; - // Set pointer to the inline array so that delete is not called - // when deallocating. - other.ptr_ = other.data_; - } - } - - public: - MemoryBuffer(MemoryBuffer &&other) { - move(other); - } - - MemoryBuffer &operator=(MemoryBuffer &&other) { - assert(this != &other); - deallocate(); - move(other); - return *this; - } -#endif - - // Returns a copy of the allocator associated with this buffer. - Allocator get_allocator() const { return *this; } -}; - -template -void MemoryBuffer::grow(std::size_t size) { - std::size_t new_capacity = this->capacity_ + this->capacity_ / 2; - if (size > new_capacity) - new_capacity = size; - T *new_ptr = this->allocate(new_capacity); - // The following code doesn't throw, so the raw pointer above doesn't leak. - std::uninitialized_copy(this->ptr_, this->ptr_ + this->size_, - make_ptr(new_ptr, new_capacity)); - std::size_t old_capacity = this->capacity_; - T *old_ptr = this->ptr_; - this->capacity_ = new_capacity; - this->ptr_ = new_ptr; - // deallocate may throw (at least in principle), but it doesn't matter since - // the buffer already uses the new storage and will deallocate it in case - // of exception. - if (old_ptr != data_) - Allocator::deallocate(old_ptr, old_capacity); -} - -// A fixed-size buffer. -template -class FixedBuffer : public fmt::Buffer { - public: - FixedBuffer(Char *array, std::size_t size) : fmt::Buffer(array, size) {} - - protected: - FMT_API void grow(std::size_t size); -}; - -template -class BasicCharTraits { - public: -#if FMT_SECURE_SCL - typedef stdext::checked_array_iterator CharPtr; -#else - typedef Char *CharPtr; -#endif - static Char cast(int value) { return static_cast(value); } -}; - -template -class CharTraits; - -template <> -class CharTraits : public BasicCharTraits { - private: - // Conversion from wchar_t to char is not allowed. - static char convert(wchar_t); - - public: - static char convert(char value) { return value; } - - // Formats a floating-point number. - template - FMT_API static int format_float(char *buffer, std::size_t size, - const char *format, unsigned width, int precision, T value); -}; - -template <> -class CharTraits : public BasicCharTraits { - public: - static wchar_t convert(char value) { return value; } - static wchar_t convert(wchar_t value) { return value; } - - template - FMT_API static int format_float(wchar_t *buffer, std::size_t size, - const wchar_t *format, unsigned width, int precision, T value); -}; - -// Checks if a number is negative - used to avoid warnings. -template -struct SignChecker { - template - static bool is_negative(T value) { return value < 0; } -}; - -template <> -struct SignChecker { - template - static bool is_negative(T) { return false; } -}; - -// Returns true if value is negative, false otherwise. -// Same as (value < 0) but doesn't produce warnings if T is an unsigned type. -template -inline bool is_negative(T value) { - return SignChecker::is_signed>::is_negative(value); -} - -// Selects uint32_t if FitsIn32Bits is true, uint64_t otherwise. -template -struct TypeSelector { typedef uint32_t Type; }; - -template <> -struct TypeSelector { typedef uint64_t Type; }; - -template -struct IntTraits { - // Smallest of uint32_t and uint64_t that is large enough to represent - // all values of T. - typedef typename - TypeSelector::digits <= 32>::Type MainType; -}; - -FMT_API void report_unknown_type(char code, const char *type); - -// Static data is placed in this class template to allow header-only -// configuration. -template -struct FMT_API BasicData { - static const uint32_t POWERS_OF_10_32[]; - static const uint64_t POWERS_OF_10_64[]; - static const char DIGITS[]; -}; - -#ifndef FMT_USE_EXTERN_TEMPLATES -// Clang doesn't have a feature check for extern templates so we check -// for variadic templates which were introduced in the same version. -# define FMT_USE_EXTERN_TEMPLATES (__clang__ && FMT_USE_VARIADIC_TEMPLATES) -#endif - -#if FMT_USE_EXTERN_TEMPLATES && !defined(FMT_HEADER_ONLY) -extern template struct BasicData; -#endif - -typedef BasicData<> Data; - -#ifdef FMT_BUILTIN_CLZLL -// Returns the number of decimal digits in n. Leading zeros are not counted -// except for n == 0 in which case count_digits returns 1. -inline unsigned count_digits(uint64_t n) { - // Based on http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10 - // and the benchmark https://github.com/localvoid/cxx-benchmark-count-digits. - int t = (64 - FMT_BUILTIN_CLZLL(n | 1)) * 1233 >> 12; - return to_unsigned(t) - (n < Data::POWERS_OF_10_64[t]) + 1; -} -#else -// Fallback version of count_digits used when __builtin_clz is not available. -inline unsigned count_digits(uint64_t n) { - unsigned count = 1; - for (;;) { - // Integer division is slow so do it for a group of four digits instead - // of for every digit. The idea comes from the talk by Alexandrescu - // "Three Optimization Tips for C++". See speed-test for a comparison. - if (n < 10) return count; - if (n < 100) return count + 1; - if (n < 1000) return count + 2; - if (n < 10000) return count + 3; - n /= 10000u; - count += 4; - } -} -#endif - -#ifdef FMT_BUILTIN_CLZ -// Optional version of count_digits for better performance on 32-bit platforms. -inline unsigned count_digits(uint32_t n) { - int t = (32 - FMT_BUILTIN_CLZ(n | 1)) * 1233 >> 12; - return to_unsigned(t) - (n < Data::POWERS_OF_10_32[t]) + 1; -} -#endif - -// A functor that doesn't add a thousands separator. -struct NoThousandsSep { - template - void operator()(Char *) {} -}; - -// A functor that adds a thousands separator. -class ThousandsSep { - private: - fmt::StringRef sep_; - - // Index of a decimal digit with the least significant digit having index 0. - unsigned digit_index_; - - public: - explicit ThousandsSep(fmt::StringRef sep) : sep_(sep), digit_index_(0) {} - - template - void operator()(Char *&buffer) { - if (++digit_index_ % 3 != 0) - return; - buffer -= sep_.size(); - std::uninitialized_copy(sep_.data(), sep_.data() + sep_.size(), - internal::make_ptr(buffer, sep_.size())); - } -}; - -// Formats a decimal unsigned integer value writing into buffer. -// thousands_sep is a functor that is called after writing each char to -// add a thousands separator if necessary. -template -inline void format_decimal(Char *buffer, UInt value, unsigned num_digits, - ThousandsSep thousands_sep) { - buffer += num_digits; - while (value >= 100) { - // Integer division is slow so do it for a group of two digits instead - // of for every digit. The idea comes from the talk by Alexandrescu - // "Three Optimization Tips for C++". See speed-test for a comparison. - unsigned index = static_cast((value % 100) * 2); - value /= 100; - *--buffer = Data::DIGITS[index + 1]; - thousands_sep(buffer); - *--buffer = Data::DIGITS[index]; - thousands_sep(buffer); - } - if (value < 10) { - *--buffer = static_cast('0' + value); - return; - } - unsigned index = static_cast(value * 2); - *--buffer = Data::DIGITS[index + 1]; - thousands_sep(buffer); - *--buffer = Data::DIGITS[index]; -} - -template -inline void format_decimal(Char *buffer, UInt value, unsigned num_digits) { - return format_decimal(buffer, value, num_digits, NoThousandsSep()); -} - -#ifndef _WIN32 -# define FMT_USE_WINDOWS_H 0 -#elif !defined(FMT_USE_WINDOWS_H) -# define FMT_USE_WINDOWS_H 1 -#endif - -// Define FMT_USE_WINDOWS_H to 0 to disable use of windows.h. -// All the functionality that relies on it will be disabled too. -#if FMT_USE_WINDOWS_H -// A converter from UTF-8 to UTF-16. -// It is only provided for Windows since other systems support UTF-8 natively. -class UTF8ToUTF16 { - private: - MemoryBuffer buffer_; - - public: - FMT_API explicit UTF8ToUTF16(StringRef s); - operator WStringRef() const { return WStringRef(&buffer_[0], size()); } - size_t size() const { return buffer_.size() - 1; } - const wchar_t *c_str() const { return &buffer_[0]; } - std::wstring str() const { return std::wstring(&buffer_[0], size()); } -}; - -// A converter from UTF-16 to UTF-8. -// It is only provided for Windows since other systems support UTF-8 natively. -class UTF16ToUTF8 { - private: - MemoryBuffer buffer_; - - public: - UTF16ToUTF8() {} - FMT_API explicit UTF16ToUTF8(WStringRef s); - operator StringRef() const { return StringRef(&buffer_[0], size()); } - size_t size() const { return buffer_.size() - 1; } - const char *c_str() const { return &buffer_[0]; } - std::string str() const { return std::string(&buffer_[0], size()); } - - // Performs conversion returning a system error code instead of - // throwing exception on conversion error. This method may still throw - // in case of memory allocation error. - FMT_API int convert(WStringRef s); -}; - -FMT_API void format_windows_error(fmt::Writer &out, int error_code, - fmt::StringRef message) FMT_NOEXCEPT; -#endif - -FMT_API void format_system_error(fmt::Writer &out, int error_code, - fmt::StringRef message) FMT_NOEXCEPT; - -// A formatting argument value. -struct Value { - template - struct StringValue { - const Char *value; - std::size_t size; - }; - - typedef void (*FormatFunc)( - void *formatter, const void *arg, void *format_str_ptr); - - struct CustomValue { - const void *value; - FormatFunc format; - }; - - union { - int int_value; - unsigned uint_value; - LongLong long_long_value; - ULongLong ulong_long_value; - double double_value; - long double long_double_value; - const void *pointer; - StringValue string; - StringValue sstring; - StringValue ustring; - StringValue wstring; - CustomValue custom; - }; - - enum Type { - NONE, NAMED_ARG, - // Integer types should go first, - INT, UINT, LONG_LONG, ULONG_LONG, BOOL, CHAR, LAST_INTEGER_TYPE = CHAR, - // followed by floating-point types. - DOUBLE, LONG_DOUBLE, LAST_NUMERIC_TYPE = LONG_DOUBLE, - CSTRING, STRING, WSTRING, POINTER, CUSTOM - }; -}; - -// A formatting argument. It is a trivially copyable/constructible type to -// allow storage in internal::MemoryBuffer. -struct Arg : Value { - Type type; -}; - -template -struct NamedArg; - -template -struct Null {}; - -// A helper class template to enable or disable overloads taking wide -// characters and strings in MakeValue. -template -struct WCharHelper { - typedef Null Supported; - typedef T Unsupported; -}; - -template -struct WCharHelper { - typedef T Supported; - typedef Null Unsupported; -}; - -typedef char Yes[1]; -typedef char No[2]; - -template -T &get(); - -// These are non-members to workaround an overload resolution bug in bcc32. -Yes &convert(fmt::ULongLong); -No &convert(...); - -template -struct ConvertToIntImpl { - enum { value = ENABLE_CONVERSION }; -}; - -template -struct ConvertToIntImpl2 { - enum { value = false }; -}; - -template -struct ConvertToIntImpl2 { - enum { - // Don't convert numeric types. - value = ConvertToIntImpl::is_specialized>::value - }; -}; - -template -struct ConvertToInt { - enum { enable_conversion = sizeof(convert(get())) == sizeof(Yes) }; - enum { value = ConvertToIntImpl2::value }; -}; - -#define FMT_DISABLE_CONVERSION_TO_INT(Type) \ - template <> \ - struct ConvertToInt { enum { value = 0 }; } - -// Silence warnings about convering float to int. -FMT_DISABLE_CONVERSION_TO_INT(float); -FMT_DISABLE_CONVERSION_TO_INT(double); -FMT_DISABLE_CONVERSION_TO_INT(long double); - -template -struct EnableIf {}; - -template -struct EnableIf { typedef T type; }; - -template -struct Conditional { typedef T type; }; - -template -struct Conditional { typedef F type; }; - -// For bcc32 which doesn't understand ! in template arguments. -template -struct Not { enum { value = 0 }; }; - -template<> -struct Not { enum { value = 1 }; }; - -template struct LConvCheck { - LConvCheck(int) {} -}; - -// Returns the thousands separator for the current locale. -// We check if ``lconv`` contains ``thousands_sep`` because on Android -// ``lconv`` is stubbed as an empty struct. -template -inline StringRef thousands_sep( - LConv *lc, LConvCheck = 0) { - return lc->thousands_sep; -} - -inline fmt::StringRef thousands_sep(...) { return ""; } - -// Makes an Arg object from any type. -template -class MakeValue : public Arg { - public: - typedef typename Formatter::Char Char; - - private: - // The following two methods are private to disallow formatting of - // arbitrary pointers. If you want to output a pointer cast it to - // "void *" or "const void *". In particular, this forbids formatting - // of "[const] volatile char *" which is printed as bool by iostreams. - // Do not implement! - template - MakeValue(const T *value); - template - MakeValue(T *value); - - // The following methods are private to disallow formatting of wide - // characters and strings into narrow strings as in - // fmt::format("{}", L"test"); - // To fix this, use a wide format string: fmt::format(L"{}", L"test"). -#if !FMT_MSC_VER || defined(_NATIVE_WCHAR_T_DEFINED) - MakeValue(typename WCharHelper::Unsupported); -#endif - MakeValue(typename WCharHelper::Unsupported); - MakeValue(typename WCharHelper::Unsupported); - MakeValue(typename WCharHelper::Unsupported); - MakeValue(typename WCharHelper::Unsupported); - - void set_string(StringRef str) { - string.value = str.data(); - string.size = str.size(); - } - - void set_string(WStringRef str) { - wstring.value = str.data(); - wstring.size = str.size(); - } - - // Formats an argument of a custom type, such as a user-defined class. - template - static void format_custom_arg( - void *formatter, const void *arg, void *format_str_ptr) { - format(*static_cast(formatter), - *static_cast(format_str_ptr), - *static_cast(arg)); - } - - public: - MakeValue() {} - -#define FMT_MAKE_VALUE_(Type, field, TYPE, rhs) \ - MakeValue(Type value) { field = rhs; } \ - static uint64_t type(Type) { return Arg::TYPE; } - -#define FMT_MAKE_VALUE(Type, field, TYPE) \ - FMT_MAKE_VALUE_(Type, field, TYPE, value) - - FMT_MAKE_VALUE(bool, int_value, BOOL) - FMT_MAKE_VALUE(short, int_value, INT) - FMT_MAKE_VALUE(unsigned short, uint_value, UINT) - FMT_MAKE_VALUE(int, int_value, INT) - FMT_MAKE_VALUE(unsigned, uint_value, UINT) - - MakeValue(long value) { - // To minimize the number of types we need to deal with, long is - // translated either to int or to long long depending on its size. - if (const_check(sizeof(long) == sizeof(int))) - int_value = static_cast(value); - else - long_long_value = value; - } - static uint64_t type(long) { - return sizeof(long) == sizeof(int) ? Arg::INT : Arg::LONG_LONG; - } - - MakeValue(unsigned long value) { - if (const_check(sizeof(unsigned long) == sizeof(unsigned))) - uint_value = static_cast(value); - else - ulong_long_value = value; - } - static uint64_t type(unsigned long) { - return sizeof(unsigned long) == sizeof(unsigned) ? - Arg::UINT : Arg::ULONG_LONG; - } - - FMT_MAKE_VALUE(LongLong, long_long_value, LONG_LONG) - FMT_MAKE_VALUE(ULongLong, ulong_long_value, ULONG_LONG) - FMT_MAKE_VALUE(float, double_value, DOUBLE) - FMT_MAKE_VALUE(double, double_value, DOUBLE) - FMT_MAKE_VALUE(long double, long_double_value, LONG_DOUBLE) - FMT_MAKE_VALUE(signed char, int_value, INT) - FMT_MAKE_VALUE(unsigned char, uint_value, UINT) - FMT_MAKE_VALUE(char, int_value, CHAR) - -#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) - MakeValue(typename WCharHelper::Supported value) { - int_value = value; - } - static uint64_t type(wchar_t) { return Arg::CHAR; } -#endif - -#define FMT_MAKE_STR_VALUE(Type, TYPE) \ - MakeValue(Type value) { set_string(value); } \ - static uint64_t type(Type) { return Arg::TYPE; } - - FMT_MAKE_VALUE(char *, string.value, CSTRING) - FMT_MAKE_VALUE(const char *, string.value, CSTRING) - FMT_MAKE_VALUE(signed char *, sstring.value, CSTRING) - FMT_MAKE_VALUE(const signed char *, sstring.value, CSTRING) - FMT_MAKE_VALUE(unsigned char *, ustring.value, CSTRING) - FMT_MAKE_VALUE(const unsigned char *, ustring.value, CSTRING) - FMT_MAKE_STR_VALUE(const std::string &, STRING) - FMT_MAKE_STR_VALUE(StringRef, STRING) - FMT_MAKE_VALUE_(CStringRef, string.value, CSTRING, value.c_str()) - -#define FMT_MAKE_WSTR_VALUE(Type, TYPE) \ - MakeValue(typename WCharHelper::Supported value) { \ - set_string(value); \ - } \ - static uint64_t type(Type) { return Arg::TYPE; } - - FMT_MAKE_WSTR_VALUE(wchar_t *, WSTRING) - FMT_MAKE_WSTR_VALUE(const wchar_t *, WSTRING) - FMT_MAKE_WSTR_VALUE(const std::wstring &, WSTRING) - FMT_MAKE_WSTR_VALUE(WStringRef, WSTRING) - - FMT_MAKE_VALUE(void *, pointer, POINTER) - FMT_MAKE_VALUE(const void *, pointer, POINTER) - - template - MakeValue(const T &value, - typename EnableIf::value>::value, int>::type = 0) { - custom.value = &value; - custom.format = &format_custom_arg; - } - - template - MakeValue(const T &value, - typename EnableIf::value, int>::type = 0) { - int_value = value; - } - - template - static uint64_t type(const T &) { - return ConvertToInt::value ? Arg::INT : Arg::CUSTOM; - } - - // Additional template param `Char_` is needed here because make_type always - // uses char. - template - MakeValue(const NamedArg &value) { pointer = &value; } - - template - static uint64_t type(const NamedArg &) { return Arg::NAMED_ARG; } -}; - -template -class MakeArg : public Arg { -public: - MakeArg() { - type = Arg::NONE; - } - - template - MakeArg(const T &value) - : Arg(MakeValue(value)) { - type = static_cast(MakeValue::type(value)); - } -}; - -template -struct NamedArg : Arg { - BasicStringRef name; - - template - NamedArg(BasicStringRef argname, const T &value) - : Arg(MakeArg< BasicFormatter >(value)), name(argname) {} -}; - -class RuntimeError : public std::runtime_error { - protected: - RuntimeError() : std::runtime_error("") {} - ~RuntimeError() throw(); -}; - -template -class PrintfArgFormatter; - -template -class ArgMap; -} // namespace internal - -/** An argument list. */ -class ArgList { - private: - // To reduce compiled code size per formatting function call, types of first - // MAX_PACKED_ARGS arguments are passed in the types_ field. - uint64_t types_; - union { - // If the number of arguments is less than MAX_PACKED_ARGS, the argument - // values are stored in values_, otherwise they are stored in args_. - // This is done to reduce compiled code size as storing larger objects - // may require more code (at least on x86-64) even if the same amount of - // data is actually copied to stack. It saves ~10% on the bloat test. - const internal::Value *values_; - const internal::Arg *args_; - }; - - internal::Arg::Type type(unsigned index) const { - unsigned shift = index * 4; - uint64_t mask = 0xf; - return static_cast( - (types_ & (mask << shift)) >> shift); - } - - template - friend class internal::ArgMap; - - public: - // Maximum number of arguments with packed types. - enum { MAX_PACKED_ARGS = 16 }; - - ArgList() : types_(0) {} - - ArgList(ULongLong types, const internal::Value *values) - : types_(types), values_(values) {} - ArgList(ULongLong types, const internal::Arg *args) - : types_(types), args_(args) {} - - /** Returns the argument at specified index. */ - internal::Arg operator[](unsigned index) const { - using internal::Arg; - Arg arg; - bool use_values = type(MAX_PACKED_ARGS - 1) == Arg::NONE; - if (index < MAX_PACKED_ARGS) { - Arg::Type arg_type = type(index); - internal::Value &val = arg; - if (arg_type != Arg::NONE) - val = use_values ? values_[index] : args_[index]; - arg.type = arg_type; - return arg; - } - if (use_values) { - // The index is greater than the number of arguments that can be stored - // in values, so return a "none" argument. - arg.type = Arg::NONE; - return arg; - } - for (unsigned i = MAX_PACKED_ARGS; i <= index; ++i) { - if (args_[i].type == Arg::NONE) - return args_[i]; - } - return args_[index]; - } -}; - -#define FMT_DISPATCH(call) static_cast(this)->call - -/** - \rst - An argument visitor based on the `curiously recurring template pattern - `_. - - To use `~fmt::ArgVisitor` define a subclass that implements some or all of the - visit methods with the same signatures as the methods in `~fmt::ArgVisitor`, - for example, `~fmt::ArgVisitor::visit_int()`. - Pass the subclass as the *Impl* template parameter. Then calling - `~fmt::ArgVisitor::visit` for some argument will dispatch to a visit method - specific to the argument type. For example, if the argument type is - ``double`` then the `~fmt::ArgVisitor::visit_double()` method of a subclass - will be called. If the subclass doesn't contain a method with this signature, - then a corresponding method of `~fmt::ArgVisitor` will be called. - - **Example**:: - - class MyArgVisitor : public fmt::ArgVisitor { - public: - void visit_int(int value) { fmt::print("{}", value); } - void visit_double(double value) { fmt::print("{}", value ); } - }; - \endrst - */ -template -class ArgVisitor { - private: - typedef internal::Arg Arg; - - public: - void report_unhandled_arg() {} - - Result visit_unhandled_arg() { - FMT_DISPATCH(report_unhandled_arg()); - return Result(); - } - - /** Visits an ``int`` argument. **/ - Result visit_int(int value) { - return FMT_DISPATCH(visit_any_int(value)); - } - - /** Visits a ``long long`` argument. **/ - Result visit_long_long(LongLong value) { - return FMT_DISPATCH(visit_any_int(value)); - } - - /** Visits an ``unsigned`` argument. **/ - Result visit_uint(unsigned value) { - return FMT_DISPATCH(visit_any_int(value)); - } - - /** Visits an ``unsigned long long`` argument. **/ - Result visit_ulong_long(ULongLong value) { - return FMT_DISPATCH(visit_any_int(value)); - } - - /** Visits a ``bool`` argument. **/ - Result visit_bool(bool value) { - return FMT_DISPATCH(visit_any_int(value)); - } - - /** Visits a ``char`` or ``wchar_t`` argument. **/ - Result visit_char(int value) { - return FMT_DISPATCH(visit_any_int(value)); - } - - /** Visits an argument of any integral type. **/ - template - Result visit_any_int(T) { - return FMT_DISPATCH(visit_unhandled_arg()); - } - - /** Visits a ``double`` argument. **/ - Result visit_double(double value) { - return FMT_DISPATCH(visit_any_double(value)); - } - - /** Visits a ``long double`` argument. **/ - Result visit_long_double(long double value) { - return FMT_DISPATCH(visit_any_double(value)); - } - - /** Visits a ``double`` or ``long double`` argument. **/ - template - Result visit_any_double(T) { - return FMT_DISPATCH(visit_unhandled_arg()); - } - - /** Visits a null-terminated C string (``const char *``) argument. **/ - Result visit_cstring(const char *) { - return FMT_DISPATCH(visit_unhandled_arg()); - } - - /** Visits a string argument. **/ - Result visit_string(Arg::StringValue) { - return FMT_DISPATCH(visit_unhandled_arg()); - } - - /** Visits a wide string argument. **/ - Result visit_wstring(Arg::StringValue) { - return FMT_DISPATCH(visit_unhandled_arg()); - } - - /** Visits a pointer argument. **/ - Result visit_pointer(const void *) { - return FMT_DISPATCH(visit_unhandled_arg()); - } - - /** Visits an argument of a custom (user-defined) type. **/ - Result visit_custom(Arg::CustomValue) { - return FMT_DISPATCH(visit_unhandled_arg()); - } - - /** - \rst - Visits an argument dispatching to the appropriate visit method based on - the argument type. For example, if the argument type is ``double`` then - the `~fmt::ArgVisitor::visit_double()` method of the *Impl* class will be - called. - \endrst - */ - Result visit(const Arg &arg) { - switch (arg.type) { - case Arg::NONE: - case Arg::NAMED_ARG: - FMT_ASSERT(false, "invalid argument type"); - break; - case Arg::INT: - return FMT_DISPATCH(visit_int(arg.int_value)); - case Arg::UINT: - return FMT_DISPATCH(visit_uint(arg.uint_value)); - case Arg::LONG_LONG: - return FMT_DISPATCH(visit_long_long(arg.long_long_value)); - case Arg::ULONG_LONG: - return FMT_DISPATCH(visit_ulong_long(arg.ulong_long_value)); - case Arg::BOOL: - return FMT_DISPATCH(visit_bool(arg.int_value != 0)); - case Arg::CHAR: - return FMT_DISPATCH(visit_char(arg.int_value)); - case Arg::DOUBLE: - return FMT_DISPATCH(visit_double(arg.double_value)); - case Arg::LONG_DOUBLE: - return FMT_DISPATCH(visit_long_double(arg.long_double_value)); - case Arg::CSTRING: - return FMT_DISPATCH(visit_cstring(arg.string.value)); - case Arg::STRING: - return FMT_DISPATCH(visit_string(arg.string)); - case Arg::WSTRING: - return FMT_DISPATCH(visit_wstring(arg.wstring)); - case Arg::POINTER: - return FMT_DISPATCH(visit_pointer(arg.pointer)); - case Arg::CUSTOM: - return FMT_DISPATCH(visit_custom(arg.custom)); - } - return Result(); - } -}; - -enum Alignment { - ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_NUMERIC -}; - -// Flags. -enum { - SIGN_FLAG = 1, PLUS_FLAG = 2, MINUS_FLAG = 4, HASH_FLAG = 8, - CHAR_FLAG = 0x10 // Argument has char type - used in error reporting. -}; - -// An empty format specifier. -struct EmptySpec {}; - -// A type specifier. -template -struct TypeSpec : EmptySpec { - Alignment align() const { return ALIGN_DEFAULT; } - unsigned width() const { return 0; } - int precision() const { return -1; } - bool flag(unsigned) const { return false; } - char type() const { return TYPE; } - char fill() const { return ' '; } -}; - -// A width specifier. -struct WidthSpec { - unsigned width_; - // Fill is always wchar_t and cast to char if necessary to avoid having - // two specialization of WidthSpec and its subclasses. - wchar_t fill_; - - WidthSpec(unsigned width, wchar_t fill) : width_(width), fill_(fill) {} - - unsigned width() const { return width_; } - wchar_t fill() const { return fill_; } -}; - -// An alignment specifier. -struct AlignSpec : WidthSpec { - Alignment align_; - - AlignSpec(unsigned width, wchar_t fill, Alignment align = ALIGN_DEFAULT) - : WidthSpec(width, fill), align_(align) {} - - Alignment align() const { return align_; } - - int precision() const { return -1; } -}; - -// An alignment and type specifier. -template -struct AlignTypeSpec : AlignSpec { - AlignTypeSpec(unsigned width, wchar_t fill) : AlignSpec(width, fill) {} - - bool flag(unsigned) const { return false; } - char type() const { return TYPE; } -}; - -// A full format specifier. -struct FormatSpec : AlignSpec { - unsigned flags_; - int precision_; - char type_; - - FormatSpec( - unsigned width = 0, char type = 0, wchar_t fill = ' ') - : AlignSpec(width, fill), flags_(0), precision_(-1), type_(type) {} - - bool flag(unsigned f) const { return (flags_ & f) != 0; } - int precision() const { return precision_; } - char type() const { return type_; } -}; - -// An integer format specifier. -template , typename Char = char> -class IntFormatSpec : public SpecT { - private: - T value_; - - public: - IntFormatSpec(T val, const SpecT &spec = SpecT()) - : SpecT(spec), value_(val) {} - - T value() const { return value_; } -}; - -// A string format specifier. -template -class StrFormatSpec : public AlignSpec { - private: - const Char *str_; - - public: - template - StrFormatSpec(const Char *str, unsigned width, FillChar fill) - : AlignSpec(width, fill), str_(str) { - internal::CharTraits::convert(FillChar()); - } - - const Char *str() const { return str_; } -}; - -/** - Returns an integer format specifier to format the value in base 2. - */ -IntFormatSpec > bin(int value); - -/** - Returns an integer format specifier to format the value in base 8. - */ -IntFormatSpec > oct(int value); - -/** - Returns an integer format specifier to format the value in base 16 using - lower-case letters for the digits above 9. - */ -IntFormatSpec > hex(int value); - -/** - Returns an integer formatter format specifier to format in base 16 using - upper-case letters for the digits above 9. - */ -IntFormatSpec > hexu(int value); - -/** - \rst - Returns an integer format specifier to pad the formatted argument with the - fill character to the specified width using the default (right) numeric - alignment. - - **Example**:: - - MemoryWriter out; - out << pad(hex(0xcafe), 8, '0'); - // out.str() == "0000cafe" - - \endrst - */ -template -IntFormatSpec, Char> pad( - int value, unsigned width, Char fill = ' '); - -#define FMT_DEFINE_INT_FORMATTERS(TYPE) \ -inline IntFormatSpec > bin(TYPE value) { \ - return IntFormatSpec >(value, TypeSpec<'b'>()); \ -} \ - \ -inline IntFormatSpec > oct(TYPE value) { \ - return IntFormatSpec >(value, TypeSpec<'o'>()); \ -} \ - \ -inline IntFormatSpec > hex(TYPE value) { \ - return IntFormatSpec >(value, TypeSpec<'x'>()); \ -} \ - \ -inline IntFormatSpec > hexu(TYPE value) { \ - return IntFormatSpec >(value, TypeSpec<'X'>()); \ -} \ - \ -template \ -inline IntFormatSpec > pad( \ - IntFormatSpec > f, unsigned width) { \ - return IntFormatSpec >( \ - f.value(), AlignTypeSpec(width, ' ')); \ -} \ - \ -/* For compatibility with older compilers we provide two overloads for pad, */ \ -/* one that takes a fill character and one that doesn't. In the future this */ \ -/* can be replaced with one overload making the template argument Char */ \ -/* default to char (C++11). */ \ -template \ -inline IntFormatSpec, Char> pad( \ - IntFormatSpec, Char> f, \ - unsigned width, Char fill) { \ - return IntFormatSpec, Char>( \ - f.value(), AlignTypeSpec(width, fill)); \ -} \ - \ -inline IntFormatSpec > pad( \ - TYPE value, unsigned width) { \ - return IntFormatSpec >( \ - value, AlignTypeSpec<0>(width, ' ')); \ -} \ - \ -template \ -inline IntFormatSpec, Char> pad( \ - TYPE value, unsigned width, Char fill) { \ - return IntFormatSpec, Char>( \ - value, AlignTypeSpec<0>(width, fill)); \ -} - -FMT_DEFINE_INT_FORMATTERS(int) -FMT_DEFINE_INT_FORMATTERS(long) -FMT_DEFINE_INT_FORMATTERS(unsigned) -FMT_DEFINE_INT_FORMATTERS(unsigned long) -FMT_DEFINE_INT_FORMATTERS(LongLong) -FMT_DEFINE_INT_FORMATTERS(ULongLong) - -/** - \rst - Returns a string formatter that pads the formatted argument with the fill - character to the specified width using the default (left) string alignment. - - **Example**:: - - std::string s = str(MemoryWriter() << pad("abc", 8)); - // s == "abc " - - \endrst - */ -template -inline StrFormatSpec pad( - const Char *str, unsigned width, Char fill = ' ') { - return StrFormatSpec(str, width, fill); -} - -inline StrFormatSpec pad( - const wchar_t *str, unsigned width, char fill = ' ') { - return StrFormatSpec(str, width, fill); -} - -namespace internal { - -template -class ArgMap { - private: - typedef std::vector< - std::pair, internal::Arg> > MapType; - typedef typename MapType::value_type Pair; - - MapType map_; - - public: - FMT_API void init(const ArgList &args); - - const internal::Arg* find(const fmt::BasicStringRef &name) const { - // The list is unsorted, so just return the first matching name. - for (typename MapType::const_iterator it = map_.begin(), end = map_.end(); - it != end; ++it) { - if (it->first == name) - return &it->second; - } - return 0; - } -}; - -template -class ArgFormatterBase : public ArgVisitor { - private: - BasicWriter &writer_; - FormatSpec &spec_; - - FMT_DISALLOW_COPY_AND_ASSIGN(ArgFormatterBase); - - void write_pointer(const void *p) { - spec_.flags_ = HASH_FLAG; - spec_.type_ = 'x'; - writer_.write_int(reinterpret_cast(p), spec_); - } - - protected: - BasicWriter &writer() { return writer_; } - FormatSpec &spec() { return spec_; } - - void write(bool value) { - const char *str_value = value ? "true" : "false"; - Arg::StringValue str = { str_value, std::strlen(str_value) }; - writer_.write_str(str, spec_); - } - - void write(const char *value) { - Arg::StringValue str = {value, value != 0 ? std::strlen(value) : 0}; - writer_.write_str(str, spec_); - } - - public: - ArgFormatterBase(BasicWriter &w, FormatSpec &s) - : writer_(w), spec_(s) {} - - template - void visit_any_int(T value) { writer_.write_int(value, spec_); } - - template - void visit_any_double(T value) { writer_.write_double(value, spec_); } - - void visit_bool(bool value) { - if (spec_.type_) - return visit_any_int(value); - write(value); - } - - void visit_char(int value) { - if (spec_.type_ && spec_.type_ != 'c') { - spec_.flags_ |= CHAR_FLAG; - writer_.write_int(value, spec_); - return; - } - if (spec_.align_ == ALIGN_NUMERIC || spec_.flags_ != 0) - FMT_THROW(FormatError("invalid format specifier for char")); - typedef typename BasicWriter::CharPtr CharPtr; - Char fill = internal::CharTraits::cast(spec_.fill()); - CharPtr out = CharPtr(); - const unsigned CHAR_SIZE = 1; - if (spec_.width_ > CHAR_SIZE) { - out = writer_.grow_buffer(spec_.width_); - if (spec_.align_ == ALIGN_RIGHT) { - std::uninitialized_fill_n(out, spec_.width_ - CHAR_SIZE, fill); - out += spec_.width_ - CHAR_SIZE; - } else if (spec_.align_ == ALIGN_CENTER) { - out = writer_.fill_padding(out, spec_.width_, - internal::const_check(CHAR_SIZE), fill); - } else { - std::uninitialized_fill_n(out + CHAR_SIZE, - spec_.width_ - CHAR_SIZE, fill); - } - } else { - out = writer_.grow_buffer(CHAR_SIZE); - } - *out = internal::CharTraits::cast(value); - } - - void visit_cstring(const char *value) { - if (spec_.type_ == 'p') - return write_pointer(value); - write(value); - } - - void visit_string(Arg::StringValue value) { - writer_.write_str(value, spec_); - } - - using ArgVisitor::visit_wstring; - - void visit_wstring(Arg::StringValue value) { - writer_.write_str(value, spec_); - } - - void visit_pointer(const void *value) { - if (spec_.type_ && spec_.type_ != 'p') - report_unknown_type(spec_.type_, "pointer"); - write_pointer(value); - } -}; - -class FormatterBase { - private: - ArgList args_; - int next_arg_index_; - - // Returns the argument with specified index. - FMT_API Arg do_get_arg(unsigned arg_index, const char *&error); - - protected: - const ArgList &args() const { return args_; } - - explicit FormatterBase(const ArgList &args) { - args_ = args; - next_arg_index_ = 0; - } - - // Returns the next argument. - Arg next_arg(const char *&error) { - if (next_arg_index_ >= 0) - return do_get_arg(internal::to_unsigned(next_arg_index_++), error); - error = "cannot switch from manual to automatic argument indexing"; - return Arg(); - } - - // Checks if manual indexing is used and returns the argument with - // specified index. - Arg get_arg(unsigned arg_index, const char *&error) { - return check_no_auto_index(error) ? do_get_arg(arg_index, error) : Arg(); - } - - bool check_no_auto_index(const char *&error) { - if (next_arg_index_ > 0) { - error = "cannot switch from automatic to manual argument indexing"; - return false; - } - next_arg_index_ = -1; - return true; - } - - template - void write(BasicWriter &w, const Char *start, const Char *end) { - if (start != end) - w << BasicStringRef(start, internal::to_unsigned(end - start)); - } -}; - -// A printf formatter. -template -class PrintfFormatter : private FormatterBase { - private: - void parse_flags(FormatSpec &spec, const Char *&s); - - // Returns the argument with specified index or, if arg_index is equal - // to the maximum unsigned value, the next argument. - Arg get_arg(const Char *s, - unsigned arg_index = (std::numeric_limits::max)()); - - // Parses argument index, flags and width and returns the argument index. - unsigned parse_header(const Char *&s, FormatSpec &spec); - - public: - explicit PrintfFormatter(const ArgList &args) : FormatterBase(args) {} - FMT_API void format(BasicWriter &writer, - BasicCStringRef format_str); -}; -} // namespace internal - -/** - \rst - An argument formatter based on the `curiously recurring template pattern - `_. - - To use `~fmt::BasicArgFormatter` define a subclass that implements some or - all of the visit methods with the same signatures as the methods in - `~fmt::ArgVisitor`, for example, `~fmt::ArgVisitor::visit_int()`. - Pass the subclass as the *Impl* template parameter. When a formatting - function processes an argument, it will dispatch to a visit method - specific to the argument type. For example, if the argument type is - ``double`` then the `~fmt::ArgVisitor::visit_double()` method of a subclass - will be called. If the subclass doesn't contain a method with this signature, - then a corresponding method of `~fmt::BasicArgFormatter` or its superclass - will be called. - \endrst - */ -template -class BasicArgFormatter : public internal::ArgFormatterBase { - private: - BasicFormatter &formatter_; - const Char *format_; - - public: - /** - \rst - Constructs an argument formatter object. - *formatter* is a reference to the main formatter object, *spec* contains - format specifier information for standard argument types, and *fmt* points - to the part of the format string being parsed for custom argument types. - \endrst - */ - BasicArgFormatter(BasicFormatter &formatter, - FormatSpec &spec, const Char *fmt) - : internal::ArgFormatterBase(formatter.writer(), spec), - formatter_(formatter), format_(fmt) {} - - /** Formats argument of a custom (user-defined) type. */ - void visit_custom(internal::Arg::CustomValue c) { - c.format(&formatter_, c.value, &format_); - } -}; - -/** The default argument formatter. */ -template -class ArgFormatter : public BasicArgFormatter, Char> { - public: - /** Constructs an argument formatter object. */ - ArgFormatter(BasicFormatter &formatter, - FormatSpec &spec, const Char *fmt) - : BasicArgFormatter, Char>(formatter, spec, fmt) {} -}; - -/** This template formats data and writes the output to a writer. */ -template -class BasicFormatter : private internal::FormatterBase { - public: - /** The character type for the output. */ - typedef CharType Char; - - private: - BasicWriter &writer_; - internal::ArgMap map_; - - FMT_DISALLOW_COPY_AND_ASSIGN(BasicFormatter); - - using internal::FormatterBase::get_arg; - - // Checks if manual indexing is used and returns the argument with - // specified name. - internal::Arg get_arg(BasicStringRef arg_name, const char *&error); - - // Parses argument index and returns corresponding argument. - internal::Arg parse_arg_index(const Char *&s); - - // Parses argument name and returns corresponding argument. - internal::Arg parse_arg_name(const Char *&s); - - public: - /** - \rst - Constructs a ``BasicFormatter`` object. References to the arguments and - the writer are stored in the formatter object so make sure they have - appropriate lifetimes. - \endrst - */ - BasicFormatter(const ArgList &args, BasicWriter &w) - : internal::FormatterBase(args), writer_(w) {} - - /** Returns a reference to the writer associated with this formatter. */ - BasicWriter &writer() { return writer_; } - - /** Formats stored arguments and writes the output to the writer. */ - void format(BasicCStringRef format_str); - - // Formats a single argument and advances format_str, a format string pointer. - const Char *format(const Char *&format_str, const internal::Arg &arg); -}; - -// Generates a comma-separated list with results of applying f to -// numbers 0..n-1. -# define FMT_GEN(n, f) FMT_GEN##n(f) -# define FMT_GEN1(f) f(0) -# define FMT_GEN2(f) FMT_GEN1(f), f(1) -# define FMT_GEN3(f) FMT_GEN2(f), f(2) -# define FMT_GEN4(f) FMT_GEN3(f), f(3) -# define FMT_GEN5(f) FMT_GEN4(f), f(4) -# define FMT_GEN6(f) FMT_GEN5(f), f(5) -# define FMT_GEN7(f) FMT_GEN6(f), f(6) -# define FMT_GEN8(f) FMT_GEN7(f), f(7) -# define FMT_GEN9(f) FMT_GEN8(f), f(8) -# define FMT_GEN10(f) FMT_GEN9(f), f(9) -# define FMT_GEN11(f) FMT_GEN10(f), f(10) -# define FMT_GEN12(f) FMT_GEN11(f), f(11) -# define FMT_GEN13(f) FMT_GEN12(f), f(12) -# define FMT_GEN14(f) FMT_GEN13(f), f(13) -# define FMT_GEN15(f) FMT_GEN14(f), f(14) - -namespace internal { -inline uint64_t make_type() { return 0; } - -template -inline uint64_t make_type(const T &arg) { - return MakeValue< BasicFormatter >::type(arg); -} - -template -struct ArgArray; - -template -struct ArgArray { - typedef Value Type[N > 0 ? N : 1]; - - template - static Value make(const T &value) { -#ifdef __clang__ - Value result = MakeValue(value); - // Workaround a bug in Apple LLVM version 4.2 (clang-425.0.28) of clang: - // https://github.com/fmtlib/fmt/issues/276 - (void)result.custom.format; - return result; -#else - return MakeValue(value); -#endif - } -}; - -template -struct ArgArray { - typedef Arg Type[N + 1]; // +1 for the list end Arg::NONE - - template - static Arg make(const T &value) { return MakeArg(value); } -}; - -#if FMT_USE_VARIADIC_TEMPLATES -template -inline uint64_t make_type(const Arg &first, const Args & ... tail) { - return make_type(first) | (make_type(tail...) << 4); -} - -#else - -struct ArgType { - uint64_t type; - - ArgType() : type(0) {} - - template - ArgType(const T &arg) : type(make_type(arg)) {} -}; - -# define FMT_ARG_TYPE_DEFAULT(n) ArgType t##n = ArgType() - -inline uint64_t make_type(FMT_GEN15(FMT_ARG_TYPE_DEFAULT)) { - return t0.type | (t1.type << 4) | (t2.type << 8) | (t3.type << 12) | - (t4.type << 16) | (t5.type << 20) | (t6.type << 24) | (t7.type << 28) | - (t8.type << 32) | (t9.type << 36) | (t10.type << 40) | (t11.type << 44) | - (t12.type << 48) | (t13.type << 52) | (t14.type << 56); -} -#endif -} // namespace internal - -# define FMT_MAKE_TEMPLATE_ARG(n) typename T##n -# define FMT_MAKE_ARG_TYPE(n) T##n -# define FMT_MAKE_ARG(n) const T##n &v##n -# define FMT_ASSIGN_char(n) \ - arr[n] = fmt::internal::MakeValue< fmt::BasicFormatter >(v##n) -# define FMT_ASSIGN_wchar_t(n) \ - arr[n] = fmt::internal::MakeValue< fmt::BasicFormatter >(v##n) - -#if FMT_USE_VARIADIC_TEMPLATES -// Defines a variadic function returning void. -# define FMT_VARIADIC_VOID(func, arg_type) \ - template \ - void func(arg_type arg0, const Args & ... args) { \ - typedef fmt::internal::ArgArray ArgArray; \ - typename ArgArray::Type array{ \ - ArgArray::template make >(args)...}; \ - func(arg0, fmt::ArgList(fmt::internal::make_type(args...), array)); \ - } - -// Defines a variadic constructor. -# define FMT_VARIADIC_CTOR(ctor, func, arg0_type, arg1_type) \ - template \ - ctor(arg0_type arg0, arg1_type arg1, const Args & ... args) { \ - typedef fmt::internal::ArgArray ArgArray; \ - typename ArgArray::Type array{ \ - ArgArray::template make >(args)...}; \ - func(arg0, arg1, fmt::ArgList(fmt::internal::make_type(args...), array)); \ - } - -#else - -# define FMT_MAKE_REF(n) \ - fmt::internal::MakeValue< fmt::BasicFormatter >(v##n) -# define FMT_MAKE_REF2(n) v##n - -// Defines a wrapper for a function taking one argument of type arg_type -// and n additional arguments of arbitrary types. -# define FMT_WRAP1(func, arg_type, n) \ - template \ - inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \ - const fmt::internal::ArgArray::Type array = {FMT_GEN(n, FMT_MAKE_REF)}; \ - func(arg1, fmt::ArgList( \ - fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), array)); \ - } - -// Emulates a variadic function returning void on a pre-C++11 compiler. -# define FMT_VARIADIC_VOID(func, arg_type) \ - inline void func(arg_type arg) { func(arg, fmt::ArgList()); } \ - FMT_WRAP1(func, arg_type, 1) FMT_WRAP1(func, arg_type, 2) \ - FMT_WRAP1(func, arg_type, 3) FMT_WRAP1(func, arg_type, 4) \ - FMT_WRAP1(func, arg_type, 5) FMT_WRAP1(func, arg_type, 6) \ - FMT_WRAP1(func, arg_type, 7) FMT_WRAP1(func, arg_type, 8) \ - FMT_WRAP1(func, arg_type, 9) FMT_WRAP1(func, arg_type, 10) - -# define FMT_CTOR(ctor, func, arg0_type, arg1_type, n) \ - template \ - ctor(arg0_type arg0, arg1_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \ - const fmt::internal::ArgArray::Type array = {FMT_GEN(n, FMT_MAKE_REF)}; \ - func(arg0, arg1, fmt::ArgList( \ - fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), array)); \ - } - -// Emulates a variadic constructor on a pre-C++11 compiler. -# define FMT_VARIADIC_CTOR(ctor, func, arg0_type, arg1_type) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 1) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 2) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 3) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 4) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 5) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 6) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 7) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 8) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 9) \ - FMT_CTOR(ctor, func, arg0_type, arg1_type, 10) -#endif - -// Generates a comma-separated list with results of applying f to pairs -// (argument, index). -#define FMT_FOR_EACH1(f, x0) f(x0, 0) -#define FMT_FOR_EACH2(f, x0, x1) \ - FMT_FOR_EACH1(f, x0), f(x1, 1) -#define FMT_FOR_EACH3(f, x0, x1, x2) \ - FMT_FOR_EACH2(f, x0 ,x1), f(x2, 2) -#define FMT_FOR_EACH4(f, x0, x1, x2, x3) \ - FMT_FOR_EACH3(f, x0, x1, x2), f(x3, 3) -#define FMT_FOR_EACH5(f, x0, x1, x2, x3, x4) \ - FMT_FOR_EACH4(f, x0, x1, x2, x3), f(x4, 4) -#define FMT_FOR_EACH6(f, x0, x1, x2, x3, x4, x5) \ - FMT_FOR_EACH5(f, x0, x1, x2, x3, x4), f(x5, 5) -#define FMT_FOR_EACH7(f, x0, x1, x2, x3, x4, x5, x6) \ - FMT_FOR_EACH6(f, x0, x1, x2, x3, x4, x5), f(x6, 6) -#define FMT_FOR_EACH8(f, x0, x1, x2, x3, x4, x5, x6, x7) \ - FMT_FOR_EACH7(f, x0, x1, x2, x3, x4, x5, x6), f(x7, 7) -#define FMT_FOR_EACH9(f, x0, x1, x2, x3, x4, x5, x6, x7, x8) \ - FMT_FOR_EACH8(f, x0, x1, x2, x3, x4, x5, x6, x7), f(x8, 8) -#define FMT_FOR_EACH10(f, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) \ - FMT_FOR_EACH9(f, x0, x1, x2, x3, x4, x5, x6, x7, x8), f(x9, 9) - -/** - An error returned by an operating system or a language runtime, - for example a file opening error. -*/ -class SystemError : public internal::RuntimeError { - private: - void init(int err_code, CStringRef format_str, ArgList args); - - protected: - int error_code_; - - typedef char Char; // For FMT_VARIADIC_CTOR. - - SystemError() {} - - public: - /** - \rst - Constructs a :class:`fmt::SystemError` object with the description - of the form - - .. parsed-literal:: - **: ** - - where ** is the formatted message and ** is - the system message corresponding to the error code. - *error_code* is a system error code as given by ``errno``. - If *error_code* is not a valid error code such as -1, the system message - may look like "Unknown error -1" and is platform-dependent. - - **Example**:: - - // This throws a SystemError with the description - // cannot open file 'madeup': No such file or directory - // or similar (system message may vary). - const char *filename = "madeup"; - std::FILE *file = std::fopen(filename, "r"); - if (!file) - throw fmt::SystemError(errno, "cannot open file '{}'", filename); - \endrst - */ - SystemError(int error_code, CStringRef message) { - init(error_code, message, ArgList()); - } - FMT_VARIADIC_CTOR(SystemError, init, int, CStringRef) - - ~SystemError() throw(); - - int error_code() const { return error_code_; } -}; - -/** - \rst - This template provides operations for formatting and writing data into - a character stream. The output is stored in a buffer provided by a subclass - such as :class:`fmt::BasicMemoryWriter`. - - You can use one of the following typedefs for common character types: - - +---------+----------------------+ - | Type | Definition | - +=========+======================+ - | Writer | BasicWriter | - +---------+----------------------+ - | WWriter | BasicWriter | - +---------+----------------------+ - - \endrst - */ -template -class BasicWriter { - private: - // Output buffer. - Buffer &buffer_; - - FMT_DISALLOW_COPY_AND_ASSIGN(BasicWriter); - - typedef typename internal::CharTraits::CharPtr CharPtr; - -#if FMT_SECURE_SCL - // Returns pointer value. - static Char *get(CharPtr p) { return p.base(); } -#else - static Char *get(Char *p) { return p; } -#endif - - // Fills the padding around the content and returns the pointer to the - // content area. - static CharPtr fill_padding(CharPtr buffer, - unsigned total_size, std::size_t content_size, wchar_t fill); - - // Grows the buffer by n characters and returns a pointer to the newly - // allocated area. - CharPtr grow_buffer(std::size_t n) { - std::size_t size = buffer_.size(); - buffer_.resize(size + n); - return internal::make_ptr(&buffer_[size], n); - } - - // Writes an unsigned decimal integer. - template - Char *write_unsigned_decimal(UInt value, unsigned prefix_size = 0) { - unsigned num_digits = internal::count_digits(value); - Char *ptr = get(grow_buffer(prefix_size + num_digits)); - internal::format_decimal(ptr + prefix_size, value, num_digits); - return ptr; - } - - // Writes a decimal integer. - template - void write_decimal(Int value) { - typedef typename internal::IntTraits::MainType MainType; - MainType abs_value = static_cast(value); - if (internal::is_negative(value)) { - abs_value = 0 - abs_value; - *write_unsigned_decimal(abs_value, 1) = '-'; - } else { - write_unsigned_decimal(abs_value, 0); - } - } - - // Prepare a buffer for integer formatting. - CharPtr prepare_int_buffer(unsigned num_digits, - const EmptySpec &, const char *prefix, unsigned prefix_size) { - unsigned size = prefix_size + num_digits; - CharPtr p = grow_buffer(size); - std::uninitialized_copy(prefix, prefix + prefix_size, p); - return p + size - 1; - } - - template - CharPtr prepare_int_buffer(unsigned num_digits, - const Spec &spec, const char *prefix, unsigned prefix_size); - - // Formats an integer. - template - void write_int(T value, Spec spec); - - // Formats a floating-point number (double or long double). - template - void write_double(T value, const FormatSpec &spec); - - // Writes a formatted string. - template - CharPtr write_str(const StrChar *s, std::size_t size, const AlignSpec &spec); - - template - void write_str(const internal::Arg::StringValue &str, - const FormatSpec &spec); - - // This following methods are private to disallow writing wide characters - // and strings to a char stream. If you want to print a wide string as a - // pointer as std::ostream does, cast it to const void*. - // Do not implement! - void operator<<(typename internal::WCharHelper::Unsupported); - void operator<<( - typename internal::WCharHelper::Unsupported); - - // Appends floating-point length specifier to the format string. - // The second argument is only used for overload resolution. - void append_float_length(Char *&format_ptr, long double) { - *format_ptr++ = 'L'; - } - - template - void append_float_length(Char *&, T) {} - - template - friend class internal::ArgFormatterBase; - - friend class internal::PrintfArgFormatter; - - protected: - /** - Constructs a ``BasicWriter`` object. - */ - explicit BasicWriter(Buffer &b) : buffer_(b) {} - - public: - /** - \rst - Destroys a ``BasicWriter`` object. - \endrst - */ - virtual ~BasicWriter() {} - - /** - Returns the total number of characters written. - */ - std::size_t size() const { return buffer_.size(); } - - /** - Returns a pointer to the output buffer content. No terminating null - character is appended. - */ - const Char *data() const FMT_NOEXCEPT { return &buffer_[0]; } - - /** - Returns a pointer to the output buffer content with terminating null - character appended. - */ - const Char *c_str() const { - std::size_t size = buffer_.size(); - buffer_.reserve(size + 1); - buffer_[size] = '\0'; - return &buffer_[0]; - } - - /** - \rst - Returns the content of the output buffer as an `std::string`. - \endrst - */ - std::basic_string str() const { - return std::basic_string(&buffer_[0], buffer_.size()); - } - - /** - \rst - Writes formatted data. - - *args* is an argument list representing arbitrary arguments. - - **Example**:: - - MemoryWriter out; - out.write("Current point:\n"); - out.write("({:+f}, {:+f})", -3.14, 3.14); - - This will write the following output to the ``out`` object: - - .. code-block:: none - - Current point: - (-3.140000, +3.140000) - - The output can be accessed using :func:`data()`, :func:`c_str` or - :func:`str` methods. - - See also :ref:`syntax`. - \endrst - */ - void write(BasicCStringRef format, ArgList args) { - BasicFormatter(args, *this).format(format); - } - FMT_VARIADIC_VOID(write, BasicCStringRef) - - BasicWriter &operator<<(int value) { - write_decimal(value); - return *this; - } - BasicWriter &operator<<(unsigned value) { - return *this << IntFormatSpec(value); - } - BasicWriter &operator<<(long value) { - write_decimal(value); - return *this; - } - BasicWriter &operator<<(unsigned long value) { - return *this << IntFormatSpec(value); - } - BasicWriter &operator<<(LongLong value) { - write_decimal(value); - return *this; - } - - /** - \rst - Formats *value* and writes it to the stream. - \endrst - */ - BasicWriter &operator<<(ULongLong value) { - return *this << IntFormatSpec(value); - } - - BasicWriter &operator<<(double value) { - write_double(value, FormatSpec()); - return *this; - } - - /** - \rst - Formats *value* using the general format for floating-point numbers - (``'g'``) and writes it to the stream. - \endrst - */ - BasicWriter &operator<<(long double value) { - write_double(value, FormatSpec()); - return *this; - } - - /** - Writes a character to the stream. - */ - BasicWriter &operator<<(char value) { - buffer_.push_back(value); - return *this; - } - - BasicWriter &operator<<( - typename internal::WCharHelper::Supported value) { - buffer_.push_back(value); - return *this; - } - - /** - \rst - Writes *value* to the stream. - \endrst - */ - BasicWriter &operator<<(fmt::BasicStringRef value) { - const Char *str = value.data(); - buffer_.append(str, str + value.size()); - return *this; - } - - BasicWriter &operator<<( - typename internal::WCharHelper::Supported value) { - const char *str = value.data(); - buffer_.append(str, str + value.size()); - return *this; - } - - template - BasicWriter &operator<<(IntFormatSpec spec) { - internal::CharTraits::convert(FillChar()); - write_int(spec.value(), spec); - return *this; - } - - template - BasicWriter &operator<<(const StrFormatSpec &spec) { - const StrChar *s = spec.str(); - write_str(s, std::char_traits::length(s), spec); - return *this; - } - - void clear() FMT_NOEXCEPT { buffer_.clear(); } - - Buffer &buffer() FMT_NOEXCEPT { return buffer_; } -}; - -template -template -typename BasicWriter::CharPtr BasicWriter::write_str( - const StrChar *s, std::size_t size, const AlignSpec &spec) { - CharPtr out = CharPtr(); - if (spec.width() > size) { - out = grow_buffer(spec.width()); - Char fill = internal::CharTraits::cast(spec.fill()); - if (spec.align() == ALIGN_RIGHT) { - std::uninitialized_fill_n(out, spec.width() - size, fill); - out += spec.width() - size; - } else if (spec.align() == ALIGN_CENTER) { - out = fill_padding(out, spec.width(), size, fill); - } else { - std::uninitialized_fill_n(out + size, spec.width() - size, fill); - } - } else { - out = grow_buffer(size); - } - std::uninitialized_copy(s, s + size, out); - return out; -} - -template -template -void BasicWriter::write_str( - const internal::Arg::StringValue &s, const FormatSpec &spec) { - // Check if StrChar is convertible to Char. - internal::CharTraits::convert(StrChar()); - if (spec.type_ && spec.type_ != 's') - internal::report_unknown_type(spec.type_, "string"); - const StrChar *str_value = s.value; - std::size_t str_size = s.size; - if (str_size == 0) { - if (!str_value) { - FMT_THROW(FormatError("string pointer is null")); - } - } - std::size_t precision = static_cast(spec.precision_); - if (spec.precision_ >= 0 && precision < str_size) - str_size = precision; - write_str(str_value, str_size, spec); -} - -template -typename BasicWriter::CharPtr - BasicWriter::fill_padding( - CharPtr buffer, unsigned total_size, - std::size_t content_size, wchar_t fill) { - std::size_t padding = total_size - content_size; - std::size_t left_padding = padding / 2; - Char fill_char = internal::CharTraits::cast(fill); - std::uninitialized_fill_n(buffer, left_padding, fill_char); - buffer += left_padding; - CharPtr content = buffer; - std::uninitialized_fill_n(buffer + content_size, - padding - left_padding, fill_char); - return content; -} - -template -template -typename BasicWriter::CharPtr - BasicWriter::prepare_int_buffer( - unsigned num_digits, const Spec &spec, - const char *prefix, unsigned prefix_size) { - unsigned width = spec.width(); - Alignment align = spec.align(); - Char fill = internal::CharTraits::cast(spec.fill()); - if (spec.precision() > static_cast(num_digits)) { - // Octal prefix '0' is counted as a digit, so ignore it if precision - // is specified. - if (prefix_size > 0 && prefix[prefix_size - 1] == '0') - --prefix_size; - unsigned number_size = - prefix_size + internal::to_unsigned(spec.precision()); - AlignSpec subspec(number_size, '0', ALIGN_NUMERIC); - if (number_size >= width) - return prepare_int_buffer(num_digits, subspec, prefix, prefix_size); - buffer_.reserve(width); - unsigned fill_size = width - number_size; - if (align != ALIGN_LEFT) { - CharPtr p = grow_buffer(fill_size); - std::uninitialized_fill(p, p + fill_size, fill); - } - CharPtr result = prepare_int_buffer( - num_digits, subspec, prefix, prefix_size); - if (align == ALIGN_LEFT) { - CharPtr p = grow_buffer(fill_size); - std::uninitialized_fill(p, p + fill_size, fill); - } - return result; - } - unsigned size = prefix_size + num_digits; - if (width <= size) { - CharPtr p = grow_buffer(size); - std::uninitialized_copy(prefix, prefix + prefix_size, p); - return p + size - 1; - } - CharPtr p = grow_buffer(width); - CharPtr end = p + width; - if (align == ALIGN_LEFT) { - std::uninitialized_copy(prefix, prefix + prefix_size, p); - p += size; - std::uninitialized_fill(p, end, fill); - } else if (align == ALIGN_CENTER) { - p = fill_padding(p, width, size, fill); - std::uninitialized_copy(prefix, prefix + prefix_size, p); - p += size; - } else { - if (align == ALIGN_NUMERIC) { - if (prefix_size != 0) { - p = std::uninitialized_copy(prefix, prefix + prefix_size, p); - size -= prefix_size; - } - } else { - std::uninitialized_copy(prefix, prefix + prefix_size, end - size); - } - std::uninitialized_fill(p, end - size, fill); - p = end; - } - return p - 1; -} - -template -template -void BasicWriter::write_int(T value, Spec spec) { - unsigned prefix_size = 0; - typedef typename internal::IntTraits::MainType UnsignedType; - UnsignedType abs_value = static_cast(value); - char prefix[4] = ""; - if (internal::is_negative(value)) { - prefix[0] = '-'; - ++prefix_size; - abs_value = 0 - abs_value; - } else if (spec.flag(SIGN_FLAG)) { - prefix[0] = spec.flag(PLUS_FLAG) ? '+' : ' '; - ++prefix_size; - } - switch (spec.type()) { - case 0: case 'd': { - unsigned num_digits = internal::count_digits(abs_value); - CharPtr p = prepare_int_buffer(num_digits, spec, prefix, prefix_size) + 1; - internal::format_decimal(get(p), abs_value, 0); - break; - } - case 'x': case 'X': { - UnsignedType n = abs_value; - if (spec.flag(HASH_FLAG)) { - prefix[prefix_size++] = '0'; - prefix[prefix_size++] = spec.type(); - } - unsigned num_digits = 0; - do { - ++num_digits; - } while ((n >>= 4) != 0); - Char *p = get(prepare_int_buffer( - num_digits, spec, prefix, prefix_size)); - n = abs_value; - const char *digits = spec.type() == 'x' ? - "0123456789abcdef" : "0123456789ABCDEF"; - do { - *p-- = digits[n & 0xf]; - } while ((n >>= 4) != 0); - break; - } - case 'b': case 'B': { - UnsignedType n = abs_value; - if (spec.flag(HASH_FLAG)) { - prefix[prefix_size++] = '0'; - prefix[prefix_size++] = spec.type(); - } - unsigned num_digits = 0; - do { - ++num_digits; - } while ((n >>= 1) != 0); - Char *p = get(prepare_int_buffer(num_digits, spec, prefix, prefix_size)); - n = abs_value; - do { - *p-- = static_cast('0' + (n & 1)); - } while ((n >>= 1) != 0); - break; - } - case 'o': { - UnsignedType n = abs_value; - if (spec.flag(HASH_FLAG)) - prefix[prefix_size++] = '0'; - unsigned num_digits = 0; - do { - ++num_digits; - } while ((n >>= 3) != 0); - Char *p = get(prepare_int_buffer(num_digits, spec, prefix, prefix_size)); - n = abs_value; - do { - *p-- = static_cast('0' + (n & 7)); - } while ((n >>= 3) != 0); - break; - } - case 'n': { - unsigned num_digits = internal::count_digits(abs_value); - fmt::StringRef sep = ""; -#ifndef ANDROID - sep = internal::thousands_sep(std::localeconv()); -#endif - unsigned size = static_cast( - num_digits + sep.size() * ((num_digits - 1) / 3)); - CharPtr p = prepare_int_buffer(size, spec, prefix, prefix_size) + 1; - internal::format_decimal(get(p), abs_value, 0, internal::ThousandsSep(sep)); - break; - } - default: - internal::report_unknown_type( - spec.type(), spec.flag(CHAR_FLAG) ? "char" : "integer"); - break; - } -} - -template -template -void BasicWriter::write_double(T value, const FormatSpec &spec) { - // Check type. - char type = spec.type(); - bool upper = false; - switch (type) { - case 0: - type = 'g'; - break; - case 'e': case 'f': case 'g': case 'a': - break; - case 'F': -#if FMT_MSC_VER - // MSVC's printf doesn't support 'F'. - type = 'f'; -#endif - // Fall through. - case 'E': case 'G': case 'A': - upper = true; - break; - default: - internal::report_unknown_type(type, "double"); - break; - } - - char sign = 0; - // Use isnegative instead of value < 0 because the latter is always - // false for NaN. - if (internal::FPUtil::isnegative(static_cast(value))) { - sign = '-'; - value = -value; - } else if (spec.flag(SIGN_FLAG)) { - sign = spec.flag(PLUS_FLAG) ? '+' : ' '; - } - - if (internal::FPUtil::isnotanumber(value)) { - // Format NaN ourselves because sprintf's output is not consistent - // across platforms. - std::size_t nan_size = 4; - const char *nan = upper ? " NAN" : " nan"; - if (!sign) { - --nan_size; - ++nan; - } - CharPtr out = write_str(nan, nan_size, spec); - if (sign) - *out = sign; - return; - } - - if (internal::FPUtil::isinfinity(value)) { - // Format infinity ourselves because sprintf's output is not consistent - // across platforms. - std::size_t inf_size = 4; - const char *inf = upper ? " INF" : " inf"; - if (!sign) { - --inf_size; - ++inf; - } - CharPtr out = write_str(inf, inf_size, spec); - if (sign) - *out = sign; - return; - } - - std::size_t offset = buffer_.size(); - unsigned width = spec.width(); - if (sign) { - buffer_.reserve(buffer_.size() + (width > 1u ? width : 1u)); - if (width > 0) - --width; - ++offset; - } - - // Build format string. - enum { MAX_FORMAT_SIZE = 10}; // longest format: %#-*.*Lg - Char format[MAX_FORMAT_SIZE]; - Char *format_ptr = format; - *format_ptr++ = '%'; - unsigned width_for_sprintf = width; - if (spec.flag(HASH_FLAG)) - *format_ptr++ = '#'; - if (spec.align() == ALIGN_CENTER) { - width_for_sprintf = 0; - } else { - if (spec.align() == ALIGN_LEFT) - *format_ptr++ = '-'; - if (width != 0) - *format_ptr++ = '*'; - } - if (spec.precision() >= 0) { - *format_ptr++ = '.'; - *format_ptr++ = '*'; - } - - append_float_length(format_ptr, value); - *format_ptr++ = type; - *format_ptr = '\0'; - - // Format using snprintf. - Char fill = internal::CharTraits::cast(spec.fill()); - unsigned n = 0; - Char *start = 0; - for (;;) { - std::size_t buffer_size = buffer_.capacity() - offset; -#if FMT_MSC_VER - // MSVC's vsnprintf_s doesn't work with zero size, so reserve - // space for at least one extra character to make the size non-zero. - // Note that the buffer's capacity will increase by more than 1. - if (buffer_size == 0) { - buffer_.reserve(offset + 1); - buffer_size = buffer_.capacity() - offset; - } -#endif - start = &buffer_[offset]; - int result = internal::CharTraits::format_float( - start, buffer_size, format, width_for_sprintf, spec.precision(), value); - if (result >= 0) { - n = internal::to_unsigned(result); - if (offset + n < buffer_.capacity()) - break; // The buffer is large enough - continue with formatting. - buffer_.reserve(offset + n + 1); - } else { - // If result is negative we ask to increase the capacity by at least 1, - // but as std::vector, the buffer grows exponentially. - buffer_.reserve(buffer_.capacity() + 1); - } - } - if (sign) { - if ((spec.align() != ALIGN_RIGHT && spec.align() != ALIGN_DEFAULT) || - *start != ' ') { - *(start - 1) = sign; - sign = 0; - } else { - *(start - 1) = fill; - } - ++n; - } - if (spec.align() == ALIGN_CENTER && spec.width() > n) { - width = spec.width(); - CharPtr p = grow_buffer(width); - std::memmove(get(p) + (width - n) / 2, get(p), n * sizeof(Char)); - fill_padding(p, spec.width(), n, fill); - return; - } - if (spec.fill() != ' ' || sign) { - while (*start == ' ') - *start++ = fill; - if (sign) - *(start - 1) = sign; - } - grow_buffer(n); -} - -/** - \rst - This class template provides operations for formatting and writing data - into a character stream. The output is stored in a memory buffer that grows - dynamically. - - You can use one of the following typedefs for common character types - and the standard allocator: - - +---------------+-----------------------------------------------------+ - | Type | Definition | - +===============+=====================================================+ - | MemoryWriter | BasicMemoryWriter> | - +---------------+-----------------------------------------------------+ - | WMemoryWriter | BasicMemoryWriter> | - +---------------+-----------------------------------------------------+ - - **Example**:: - - MemoryWriter out; - out << "The answer is " << 42 << "\n"; - out.write("({:+f}, {:+f})", -3.14, 3.14); - - This will write the following output to the ``out`` object: - - .. code-block:: none - - The answer is 42 - (-3.140000, +3.140000) - - The output can be converted to an ``std::string`` with ``out.str()`` or - accessed as a C string with ``out.c_str()``. - \endrst - */ -template > -class BasicMemoryWriter : public BasicWriter { - private: - internal::MemoryBuffer buffer_; - - public: - explicit BasicMemoryWriter(const Allocator& alloc = Allocator()) - : BasicWriter(buffer_), buffer_(alloc) {} - -#if FMT_USE_RVALUE_REFERENCES - /** - \rst - Constructs a :class:`fmt::BasicMemoryWriter` object moving the content - of the other object to it. - \endrst - */ - BasicMemoryWriter(BasicMemoryWriter &&other) - : BasicWriter(buffer_), buffer_(std::move(other.buffer_)) { - } - - /** - \rst - Moves the content of the other ``BasicMemoryWriter`` object to this one. - \endrst - */ - BasicMemoryWriter &operator=(BasicMemoryWriter &&other) { - buffer_ = std::move(other.buffer_); - return *this; - } -#endif -}; - -typedef BasicMemoryWriter MemoryWriter; -typedef BasicMemoryWriter WMemoryWriter; - -/** - \rst - This class template provides operations for formatting and writing data - into a fixed-size array. For writing into a dynamically growing buffer - use :class:`fmt::BasicMemoryWriter`. - - Any write method will throw ``std::runtime_error`` if the output doesn't fit - into the array. - - You can use one of the following typedefs for common character types: - - +--------------+---------------------------+ - | Type | Definition | - +==============+===========================+ - | ArrayWriter | BasicArrayWriter | - +--------------+---------------------------+ - | WArrayWriter | BasicArrayWriter | - +--------------+---------------------------+ - \endrst - */ -template -class BasicArrayWriter : public BasicWriter { - private: - internal::FixedBuffer buffer_; - - public: - /** - \rst - Constructs a :class:`fmt::BasicArrayWriter` object for *array* of the - given size. - \endrst - */ - BasicArrayWriter(Char *array, std::size_t size) - : BasicWriter(buffer_), buffer_(array, size) {} - - /** - \rst - Constructs a :class:`fmt::BasicArrayWriter` object for *array* of the - size known at compile time. - \endrst - */ - template - explicit BasicArrayWriter(Char (&array)[SIZE]) - : BasicWriter(buffer_), buffer_(array, SIZE) {} -}; - -typedef BasicArrayWriter ArrayWriter; -typedef BasicArrayWriter WArrayWriter; - -// Reports a system error without throwing an exception. -// Can be used to report errors from destructors. -FMT_API void report_system_error(int error_code, - StringRef message) FMT_NOEXCEPT; - -#if FMT_USE_WINDOWS_H - -/** A Windows error. */ -class WindowsError : public SystemError { - private: - FMT_API void init(int error_code, CStringRef format_str, ArgList args); - - public: - /** - \rst - Constructs a :class:`fmt::WindowsError` object with the description - of the form - - .. parsed-literal:: - **: ** - - where ** is the formatted message and ** is the - system message corresponding to the error code. - *error_code* is a Windows error code as given by ``GetLastError``. - If *error_code* is not a valid error code such as -1, the system message - will look like "error -1". - - **Example**:: - - // This throws a WindowsError with the description - // cannot open file 'madeup': The system cannot find the file specified. - // or similar (system message may vary). - const char *filename = "madeup"; - LPOFSTRUCT of = LPOFSTRUCT(); - HFILE file = OpenFile(filename, &of, OF_READ); - if (file == HFILE_ERROR) { - throw fmt::WindowsError(GetLastError(), - "cannot open file '{}'", filename); - } - \endrst - */ - WindowsError(int error_code, CStringRef message) { - init(error_code, message, ArgList()); - } - FMT_VARIADIC_CTOR(WindowsError, init, int, CStringRef) -}; - -// Reports a Windows error without throwing an exception. -// Can be used to report errors from destructors. -FMT_API void report_windows_error(int error_code, - StringRef message) FMT_NOEXCEPT; - -#endif - -enum Color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE }; - -/** - Formats a string and prints it to stdout using ANSI escape sequences - to specify color (experimental). - Example: - print_colored(fmt::RED, "Elapsed time: {0:.2f} seconds", 1.23); - */ -FMT_API void print_colored(Color c, CStringRef format, ArgList args); - -/** - \rst - Formats arguments and returns the result as a string. - - **Example**:: - - std::string message = format("The answer is {}", 42); - \endrst -*/ -inline std::string format(CStringRef format_str, ArgList args) { - MemoryWriter w; - w.write(format_str, args); - return w.str(); -} - -inline std::wstring format(WCStringRef format_str, ArgList args) { - WMemoryWriter w; - w.write(format_str, args); - return w.str(); -} - -/** - \rst - Prints formatted data to the file *f*. - - **Example**:: - - print(stderr, "Don't {}!", "panic"); - \endrst - */ -FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args); - -/** - \rst - Prints formatted data to ``stdout``. - - **Example**:: - - print("Elapsed time: {0:.2f} seconds", 1.23); - \endrst - */ -FMT_API void print(CStringRef format_str, ArgList args); - -template -void printf(BasicWriter &w, BasicCStringRef format, ArgList args) { - internal::PrintfFormatter(args).format(w, format); -} - -/** - \rst - Formats arguments and returns the result as a string. - - **Example**:: - - std::string message = fmt::sprintf("The answer is %d", 42); - \endrst -*/ -inline std::string sprintf(CStringRef format, ArgList args) { - MemoryWriter w; - printf(w, format, args); - return w.str(); -} - -inline std::wstring sprintf(WCStringRef format, ArgList args) { - WMemoryWriter w; - printf(w, format, args); - return w.str(); -} - -/** - \rst - Prints formatted data to the file *f*. - - **Example**:: - - fmt::fprintf(stderr, "Don't %s!", "panic"); - \endrst - */ -FMT_API int fprintf(std::FILE *f, CStringRef format, ArgList args); - -/** - \rst - Prints formatted data to ``stdout``. - - **Example**:: - - fmt::printf("Elapsed time: %.2f seconds", 1.23); - \endrst - */ -inline int printf(CStringRef format, ArgList args) { - return fprintf(stdout, format, args); -} - -/** - Fast integer formatter. - */ -class FormatInt { - private: - // Buffer should be large enough to hold all digits (digits10 + 1), - // a sign and a null character. - enum {BUFFER_SIZE = std::numeric_limits::digits10 + 3}; - mutable char buffer_[BUFFER_SIZE]; - char *str_; - - // Formats value in reverse and returns the number of digits. - char *format_decimal(ULongLong value) { - char *buffer_end = buffer_ + BUFFER_SIZE - 1; - while (value >= 100) { - // Integer division is slow so do it for a group of two digits instead - // of for every digit. The idea comes from the talk by Alexandrescu - // "Three Optimization Tips for C++". See speed-test for a comparison. - unsigned index = static_cast((value % 100) * 2); - value /= 100; - *--buffer_end = internal::Data::DIGITS[index + 1]; - *--buffer_end = internal::Data::DIGITS[index]; - } - if (value < 10) { - *--buffer_end = static_cast('0' + value); - return buffer_end; - } - unsigned index = static_cast(value * 2); - *--buffer_end = internal::Data::DIGITS[index + 1]; - *--buffer_end = internal::Data::DIGITS[index]; - return buffer_end; - } - - void FormatSigned(LongLong value) { - ULongLong abs_value = static_cast(value); - bool negative = value < 0; - if (negative) - abs_value = 0 - abs_value; - str_ = format_decimal(abs_value); - if (negative) - *--str_ = '-'; - } - - public: - explicit FormatInt(int value) { FormatSigned(value); } - explicit FormatInt(long value) { FormatSigned(value); } - explicit FormatInt(LongLong value) { FormatSigned(value); } - explicit FormatInt(unsigned value) : str_(format_decimal(value)) {} - explicit FormatInt(unsigned long value) : str_(format_decimal(value)) {} - explicit FormatInt(ULongLong value) : str_(format_decimal(value)) {} - - /** Returns the number of characters written to the output buffer. */ - std::size_t size() const { - return internal::to_unsigned(buffer_ - str_ + BUFFER_SIZE - 1); - } - - /** - Returns a pointer to the output buffer content. No terminating null - character is appended. - */ - const char *data() const { return str_; } - - /** - Returns a pointer to the output buffer content with terminating null - character appended. - */ - const char *c_str() const { - buffer_[BUFFER_SIZE - 1] = '\0'; - return str_; - } - - /** - \rst - Returns the content of the output buffer as an ``std::string``. - \endrst - */ - std::string str() const { return std::string(str_, size()); } -}; - -// Formats a decimal integer value writing into buffer and returns -// a pointer to the end of the formatted string. This function doesn't -// write a terminating null character. -template -inline void format_decimal(char *&buffer, T value) { - typedef typename internal::IntTraits::MainType MainType; - MainType abs_value = static_cast(value); - if (internal::is_negative(value)) { - *buffer++ = '-'; - abs_value = 0 - abs_value; - } - if (abs_value < 100) { - if (abs_value < 10) { - *buffer++ = static_cast('0' + abs_value); - return; - } - unsigned index = static_cast(abs_value * 2); - *buffer++ = internal::Data::DIGITS[index]; - *buffer++ = internal::Data::DIGITS[index + 1]; - return; - } - unsigned num_digits = internal::count_digits(abs_value); - internal::format_decimal(buffer, abs_value, num_digits); - buffer += num_digits; -} - -/** - \rst - Returns a named argument for formatting functions. - - **Example**:: - - print("Elapsed time: {s:.2f} seconds", arg("s", 1.23)); - - \endrst - */ -template -inline internal::NamedArg arg(StringRef name, const T &arg) { - return internal::NamedArg(name, arg); -} - -template -inline internal::NamedArg arg(WStringRef name, const T &arg) { - return internal::NamedArg(name, arg); -} - -// The following two functions are deleted intentionally to disable -// nested named arguments as in ``format("{}", arg("a", arg("b", 42)))``. -template -void arg(StringRef, const internal::NamedArg&) FMT_DELETED_OR_UNDEFINED; -template -void arg(WStringRef, const internal::NamedArg&) FMT_DELETED_OR_UNDEFINED; -} - -#if FMT_GCC_VERSION -// Use the system_header pragma to suppress warnings about variadic macros -// because suppressing -Wvariadic-macros with the diagnostic pragma doesn't -// work. It is used at the end because we want to suppress as little warnings -// as possible. -# pragma GCC system_header -#endif - -// This is used to work around VC++ bugs in handling variadic macros. -#define FMT_EXPAND(args) args - -// Returns the number of arguments. -// Based on https://groups.google.com/forum/#!topic/comp.std.c/d-6Mj5Lko_s. -#define FMT_NARG(...) FMT_NARG_(__VA_ARGS__, FMT_RSEQ_N()) -#define FMT_NARG_(...) FMT_EXPAND(FMT_ARG_N(__VA_ARGS__)) -#define FMT_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N -#define FMT_RSEQ_N() 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 - -#define FMT_CONCAT(a, b) a##b -#define FMT_FOR_EACH_(N, f, ...) \ - FMT_EXPAND(FMT_CONCAT(FMT_FOR_EACH, N)(f, __VA_ARGS__)) -#define FMT_FOR_EACH(f, ...) \ - FMT_EXPAND(FMT_FOR_EACH_(FMT_NARG(__VA_ARGS__), f, __VA_ARGS__)) - -#define FMT_ADD_ARG_NAME(type, index) type arg##index -#define FMT_GET_ARG_NAME(type, index) arg##index - -#if FMT_USE_VARIADIC_TEMPLATES -# define FMT_VARIADIC_(Char, ReturnType, func, call, ...) \ - template \ - ReturnType func(FMT_FOR_EACH(FMT_ADD_ARG_NAME, __VA_ARGS__), \ - const Args & ... args) { \ - typedef fmt::internal::ArgArray ArgArray; \ - typename ArgArray::Type array{ \ - ArgArray::template make >(args)...}; \ - call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), \ - fmt::ArgList(fmt::internal::make_type(args...), array)); \ - } -#else -// Defines a wrapper for a function taking __VA_ARGS__ arguments -// and n additional arguments of arbitrary types. -# define FMT_WRAP(Char, ReturnType, func, call, n, ...) \ - template \ - inline ReturnType func(FMT_FOR_EACH(FMT_ADD_ARG_NAME, __VA_ARGS__), \ - FMT_GEN(n, FMT_MAKE_ARG)) { \ - fmt::internal::ArgArray::Type arr; \ - FMT_GEN(n, FMT_ASSIGN_##Char); \ - call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), fmt::ArgList( \ - fmt::internal::make_type(FMT_GEN(n, FMT_MAKE_REF2)), arr)); \ - } - -# define FMT_VARIADIC_(Char, ReturnType, func, call, ...) \ - inline ReturnType func(FMT_FOR_EACH(FMT_ADD_ARG_NAME, __VA_ARGS__)) { \ - call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), fmt::ArgList()); \ - } \ - FMT_WRAP(Char, ReturnType, func, call, 1, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 2, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 3, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 4, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 5, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 6, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 7, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 8, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 9, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 10, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 11, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 12, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 13, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 14, __VA_ARGS__) \ - FMT_WRAP(Char, ReturnType, func, call, 15, __VA_ARGS__) -#endif // FMT_USE_VARIADIC_TEMPLATES - -/** - \rst - Defines a variadic function with the specified return type, function name - and argument types passed as variable arguments to this macro. - - **Example**:: - - void print_error(const char *file, int line, const char *format, - fmt::ArgList args) { - fmt::print("{}: {}: ", file, line); - fmt::print(format, args); - } - FMT_VARIADIC(void, print_error, const char *, int, const char *) - - ``FMT_VARIADIC`` is used for compatibility with legacy C++ compilers that - don't implement variadic templates. You don't have to use this macro if - you don't need legacy compiler support and can use variadic templates - directly:: - - template - void print_error(const char *file, int line, const char *format, - const Args & ... args) { - fmt::print("{}: {}: ", file, line); - fmt::print(format, args...); - } - \endrst - */ -#define FMT_VARIADIC(ReturnType, func, ...) \ - FMT_VARIADIC_(char, ReturnType, func, return func, __VA_ARGS__) - -#define FMT_VARIADIC_W(ReturnType, func, ...) \ - FMT_VARIADIC_(wchar_t, ReturnType, func, return func, __VA_ARGS__) - -#define FMT_CAPTURE_ARG_(id, index) ::fmt::arg(#id, id) - -#define FMT_CAPTURE_ARG_W_(id, index) ::fmt::arg(L###id, id) - -/** - \rst - Convenient macro to capture the arguments' names and values into several - ``fmt::arg(name, value)``. - - **Example**:: - - int x = 1, y = 2; - print("point: ({x}, {y})", FMT_CAPTURE(x, y)); - // same as: - // print("point: ({x}, {y})", arg("x", x), arg("y", y)); - - \endrst - */ -#define FMT_CAPTURE(...) FMT_FOR_EACH(FMT_CAPTURE_ARG_, __VA_ARGS__) - -#define FMT_CAPTURE_W(...) FMT_FOR_EACH(FMT_CAPTURE_ARG_W_, __VA_ARGS__) - -namespace fmt { -FMT_VARIADIC(std::string, format, CStringRef) -FMT_VARIADIC_W(std::wstring, format, WCStringRef) -FMT_VARIADIC(void, print, CStringRef) -FMT_VARIADIC(void, print, std::FILE *, CStringRef) - -FMT_VARIADIC(void, print_colored, Color, CStringRef) -FMT_VARIADIC(std::string, sprintf, CStringRef) -FMT_VARIADIC_W(std::wstring, sprintf, WCStringRef) -FMT_VARIADIC(int, printf, CStringRef) -FMT_VARIADIC(int, fprintf, std::FILE *, CStringRef) - -namespace internal { -template -inline bool is_name_start(Char c) { - return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || '_' == c; -} - -// Parses an unsigned integer advancing s to the end of the parsed input. -// This function assumes that the first character of s is a digit. -template -unsigned parse_nonnegative_int(const Char *&s) { - assert('0' <= *s && *s <= '9'); - unsigned value = 0; - do { - unsigned new_value = value * 10 + (*s++ - '0'); - // Check if value wrapped around. - if (new_value < value) { - value = (std::numeric_limits::max)(); - break; - } - value = new_value; - } while ('0' <= *s && *s <= '9'); - // Convert to unsigned to prevent a warning. - unsigned max_int = (std::numeric_limits::max)(); - if (value > max_int) - FMT_THROW(FormatError("number is too big")); - return value; -} - -inline void require_numeric_argument(const Arg &arg, char spec) { - if (arg.type > Arg::LAST_NUMERIC_TYPE) { - std::string message = - fmt::format("format specifier '{}' requires numeric argument", spec); - FMT_THROW(fmt::FormatError(message)); - } -} - -template -void check_sign(const Char *&s, const Arg &arg) { - char sign = static_cast(*s); - require_numeric_argument(arg, sign); - if (arg.type == Arg::UINT || arg.type == Arg::ULONG_LONG) { - FMT_THROW(FormatError(fmt::format( - "format specifier '{}' requires signed argument", sign))); - } - ++s; -} -} // namespace internal - -template -inline internal::Arg BasicFormatter::get_arg( - BasicStringRef arg_name, const char *&error) { - if (check_no_auto_index(error)) { - map_.init(args()); - const internal::Arg *arg = map_.find(arg_name); - if (arg) - return *arg; - error = "argument not found"; - } - return internal::Arg(); -} - -template -inline internal::Arg BasicFormatter::parse_arg_index(const Char *&s) { - const char *error = 0; - internal::Arg arg = *s < '0' || *s > '9' ? - next_arg(error) : get_arg(internal::parse_nonnegative_int(s), error); - if (error) { - FMT_THROW(FormatError( - *s != '}' && *s != ':' ? "invalid format string" : error)); - } - return arg; -} - -template -inline internal::Arg BasicFormatter::parse_arg_name(const Char *&s) { - assert(internal::is_name_start(*s)); - const Char *start = s; - Char c; - do { - c = *++s; - } while (internal::is_name_start(c) || ('0' <= c && c <= '9')); - const char *error = 0; - internal::Arg arg = get_arg(BasicStringRef(start, s - start), error); - if (error) - FMT_THROW(FormatError(error)); - return arg; -} - -template -const Char *BasicFormatter::format( - const Char *&format_str, const internal::Arg &arg) { - using internal::Arg; - const Char *s = format_str; - FormatSpec spec; - if (*s == ':') { - if (arg.type == Arg::CUSTOM) { - arg.custom.format(this, arg.custom.value, &s); - return s; - } - ++s; - // Parse fill and alignment. - if (Char c = *s) { - const Char *p = s + 1; - spec.align_ = ALIGN_DEFAULT; - do { - switch (*p) { - case '<': - spec.align_ = ALIGN_LEFT; - break; - case '>': - spec.align_ = ALIGN_RIGHT; - break; - case '=': - spec.align_ = ALIGN_NUMERIC; - break; - case '^': - spec.align_ = ALIGN_CENTER; - break; - } - if (spec.align_ != ALIGN_DEFAULT) { - if (p != s) { - if (c == '}') break; - if (c == '{') - FMT_THROW(FormatError("invalid fill character '{'")); - s += 2; - spec.fill_ = c; - } else ++s; - if (spec.align_ == ALIGN_NUMERIC) - require_numeric_argument(arg, '='); - break; - } - } while (--p >= s); - } - - // Parse sign. - switch (*s) { - case '+': - check_sign(s, arg); - spec.flags_ |= SIGN_FLAG | PLUS_FLAG; - break; - case '-': - check_sign(s, arg); - spec.flags_ |= MINUS_FLAG; - break; - case ' ': - check_sign(s, arg); - spec.flags_ |= SIGN_FLAG; - break; - } - - if (*s == '#') { - require_numeric_argument(arg, '#'); - spec.flags_ |= HASH_FLAG; - ++s; - } - - // Parse zero flag. - if (*s == '0') { - require_numeric_argument(arg, '0'); - spec.align_ = ALIGN_NUMERIC; - spec.fill_ = '0'; - ++s; - } - - // Parse width. - if ('0' <= *s && *s <= '9') { - spec.width_ = internal::parse_nonnegative_int(s); - } else if (*s == '{') { - ++s; - Arg width_arg = internal::is_name_start(*s) ? - parse_arg_name(s) : parse_arg_index(s); - if (*s++ != '}') - FMT_THROW(FormatError("invalid format string")); - ULongLong value = 0; - switch (width_arg.type) { - case Arg::INT: - if (width_arg.int_value < 0) - FMT_THROW(FormatError("negative width")); - value = width_arg.int_value; - break; - case Arg::UINT: - value = width_arg.uint_value; - break; - case Arg::LONG_LONG: - if (width_arg.long_long_value < 0) - FMT_THROW(FormatError("negative width")); - value = width_arg.long_long_value; - break; - case Arg::ULONG_LONG: - value = width_arg.ulong_long_value; - break; - default: - FMT_THROW(FormatError("width is not integer")); - } - if (value > (std::numeric_limits::max)()) - FMT_THROW(FormatError("number is too big")); - spec.width_ = static_cast(value); - } - - // Parse precision. - if (*s == '.') { - ++s; - spec.precision_ = 0; - if ('0' <= *s && *s <= '9') { - spec.precision_ = internal::parse_nonnegative_int(s); - } else if (*s == '{') { - ++s; - Arg precision_arg = internal::is_name_start(*s) ? - parse_arg_name(s) : parse_arg_index(s); - if (*s++ != '}') - FMT_THROW(FormatError("invalid format string")); - ULongLong value = 0; - switch (precision_arg.type) { - case Arg::INT: - if (precision_arg.int_value < 0) - FMT_THROW(FormatError("negative precision")); - value = precision_arg.int_value; - break; - case Arg::UINT: - value = precision_arg.uint_value; - break; - case Arg::LONG_LONG: - if (precision_arg.long_long_value < 0) - FMT_THROW(FormatError("negative precision")); - value = precision_arg.long_long_value; - break; - case Arg::ULONG_LONG: - value = precision_arg.ulong_long_value; - break; - default: - FMT_THROW(FormatError("precision is not integer")); - } - if (value > (std::numeric_limits::max)()) - FMT_THROW(FormatError("number is too big")); - spec.precision_ = static_cast(value); - } else { - FMT_THROW(FormatError("missing precision specifier")); - } - if (arg.type <= Arg::LAST_INTEGER_TYPE || arg.type == Arg::POINTER) { - FMT_THROW(FormatError( - fmt::format("precision not allowed in {} format specifier", - arg.type == Arg::POINTER ? "pointer" : "integer"))); - } - } - - // Parse type. - if (*s != '}' && *s) - spec.type_ = static_cast(*s++); - } - - if (*s++ != '}') - FMT_THROW(FormatError("missing '}' in format string")); - - // Format argument. - ArgFormatter(*this, spec, s - 1).visit(arg); - return s; -} - -template -void BasicFormatter::format(BasicCStringRef format_str) { - const Char *s = format_str.c_str(); - const Char *start = s; - while (*s) { - Char c = *s++; - if (c != '{' && c != '}') continue; - if (*s == c) { - write(writer_, start, s); - start = ++s; - continue; - } - if (c == '}') - FMT_THROW(FormatError("unmatched '}' in format string")); - write(writer_, start, s - 1); - internal::Arg arg = internal::is_name_start(*s) ? - parse_arg_name(s) : parse_arg_index(s); - start = s = format(s, arg); - } - write(writer_, start, s); -} -} // namespace fmt - -#if FMT_USE_USER_DEFINED_LITERALS -namespace fmt { -namespace internal { - -template -struct UdlFormat { - const Char *str; - - template - auto operator()(Args && ... args) const - -> decltype(format(str, std::forward(args)...)) { - return format(str, std::forward(args)...); - } -}; - -template -struct UdlArg { - const Char *str; - - template - NamedArg operator=(T &&value) const { - return {str, std::forward(value)}; - } -}; - -} // namespace internal - -inline namespace literals { - -/** - \rst - C++11 literal equivalent of :func:`fmt::format`. - - **Example**:: - - using namespace fmt::literals; - std::string message = "The answer is {}"_format(42); - \endrst - */ -inline internal::UdlFormat -operator"" _format(const char *s, std::size_t) { return {s}; } -inline internal::UdlFormat -operator"" _format(const wchar_t *s, std::size_t) { return {s}; } - -/** - \rst - C++11 literal equivalent of :func:`fmt::arg`. - - **Example**:: - - using namespace fmt::literals; - print("Elapsed time: {s:.2f} seconds", "s"_a=1.23); - \endrst - */ -inline internal::UdlArg -operator"" _a(const char *s, std::size_t) { return {s}; } -inline internal::UdlArg -operator"" _a(const wchar_t *s, std::size_t) { return {s}; } - -} // inline namespace literals -} // namespace fmt -#endif // FMT_USE_USER_DEFINED_LITERALS - -// Restore warnings. -#if FMT_GCC_VERSION >= 406 -# pragma GCC diagnostic pop -#endif - -#if defined(__clang__) && !defined(FMT_ICC_VERSION) -# pragma clang diagnostic pop -#endif - -#ifdef FMT_HEADER_ONLY -# define FMT_FUNC inline -# include "format.cc" -#else -# define FMT_FUNC -#endif - -#endif // FMT_FORMAT_H_ diff --git a/bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.cc b/bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.cc deleted file mode 100644 index bcb67fe15..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.cc +++ /dev/null @@ -1,43 +0,0 @@ -/* - Formatting library for C++ - std::ostream support - - Copyright (c) 2012 - 2016, Victor Zverovich - All rights reserved. - - For the license information refer to format.h. - */ - -#include "ostream.h" - -namespace fmt { - -namespace { -// Write the content of w to os. -void write(std::ostream &os, Writer &w) { - const char *data = w.data(); - typedef internal::MakeUnsigned::Type UnsignedStreamSize; - UnsignedStreamSize size = w.size(); - UnsignedStreamSize max_size = - internal::to_unsigned((std::numeric_limits::max)()); - do { - UnsignedStreamSize n = size <= max_size ? size : max_size; - os.write(data, static_cast(n)); - data += n; - size -= n; - } while (size != 0); -} -} - -FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) { - MemoryWriter w; - w.write(format_str, args); - write(os, w); -} - -FMT_FUNC int fprintf(std::ostream &os, CStringRef format, ArgList args) { - MemoryWriter w; - printf(w, format, args); - write(os, w); - return static_cast(w.size()); -} -} // namespace fmt diff --git a/bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.h b/bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.h deleted file mode 100644 index 29483c1bc..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/bundled/ostream.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Formatting library for C++ - std::ostream support - - Copyright (c) 2012 - 2016, Victor Zverovich - All rights reserved. - - For the license information refer to format.h. - */ - -#ifndef FMT_OSTREAM_H_ -#define FMT_OSTREAM_H_ - -#include "format.h" -#include - -namespace fmt { - -namespace internal { - -template -class FormatBuf : public std::basic_streambuf { - private: - typedef typename std::basic_streambuf::int_type int_type; - typedef typename std::basic_streambuf::traits_type traits_type; - - Buffer &buffer_; - Char *start_; - - public: - FormatBuf(Buffer &buffer) : buffer_(buffer), start_(&buffer[0]) { - this->setp(start_, start_ + buffer_.capacity()); - } - - int_type overflow(int_type ch = traits_type::eof()) { - if (!traits_type::eq_int_type(ch, traits_type::eof())) { - size_t buf_size = size(); - buffer_.resize(buf_size); - buffer_.reserve(buf_size * 2); - - start_ = &buffer_[0]; - start_[buf_size] = traits_type::to_char_type(ch); - this->setp(start_+ buf_size + 1, start_ + buf_size * 2); - } - return ch; - } - - size_t size() const { - return to_unsigned(this->pptr() - start_); - } -}; - -Yes &convert(std::ostream &); - -struct DummyStream : std::ostream { - DummyStream(); // Suppress a bogus warning in MSVC. - // Hide all operator<< overloads from std::ostream. - void operator<<(Null<>); -}; - -No &operator<<(std::ostream &, int); - -template -struct ConvertToIntImpl { - // Convert to int only if T doesn't have an overloaded operator<<. - enum { - value = sizeof(convert(get() << get())) == sizeof(No) - }; -}; -} // namespace internal - -// Formats a value. -template -void format(BasicFormatter &f, - const Char *&format_str, const T &value) { - internal::MemoryBuffer buffer; - - internal::FormatBuf format_buf(buffer); - std::basic_ostream output(&format_buf); - output << value; - - BasicStringRef str(&buffer[0], format_buf.size()); - typedef internal::MakeArg< BasicFormatter > MakeArg; - format_str = f.format(format_str, MakeArg(str)); -} - -/** - \rst - Prints formatted data to the stream *os*. - - **Example**:: - - print(cerr, "Don't {}!", "panic"); - \endrst - */ -FMT_API void print(std::ostream &os, CStringRef format_str, ArgList args); -FMT_VARIADIC(void, print, std::ostream &, CStringRef) - -/** - \rst - Prints formatted data to the stream *os*. - - **Example**:: - - fprintf(cerr, "Don't %s!", "panic"); - \endrst - */ -FMT_API int fprintf(std::ostream &os, CStringRef format_str, ArgList args); -FMT_VARIADIC(int, fprintf, std::ostream &, CStringRef) -} // namespace fmt - -#ifdef FMT_HEADER_ONLY -# include "ostream.cc" -#endif - -#endif // FMT_OSTREAM_H_ diff --git a/bm/sai_adapter/inc/spdlog/fmt/bundled/posix.cc b/bm/sai_adapter/inc/spdlog/fmt/bundled/posix.cc deleted file mode 100644 index 76eb7f05e..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/bundled/posix.cc +++ /dev/null @@ -1,238 +0,0 @@ -/* - A C++ interface to POSIX functions. - - Copyright (c) 2012 - 2016, Victor Zverovich - All rights reserved. - - For the license information refer to format.h. - */ - -// Disable bogus MSVC warnings. -#ifndef _CRT_SECURE_NO_WARNINGS -# define _CRT_SECURE_NO_WARNINGS -#endif - -#include "posix.h" - -#include -#include -#include - -#ifndef _WIN32 -# include -#else -# include -# include - -# define O_CREAT _O_CREAT -# define O_TRUNC _O_TRUNC - -# ifndef S_IRUSR -# define S_IRUSR _S_IREAD -# endif - -# ifndef S_IWUSR -# define S_IWUSR _S_IWRITE -# endif - -# ifdef __MINGW32__ -# define _SH_DENYNO 0x40 -# endif - -#endif // _WIN32 - -#ifdef fileno -# undef fileno -#endif - -namespace { -#ifdef _WIN32 -// Return type of read and write functions. -typedef int RWResult; - -// On Windows the count argument to read and write is unsigned, so convert -// it from size_t preventing integer overflow. -inline unsigned convert_rwcount(std::size_t count) { - return count <= UINT_MAX ? static_cast(count) : UINT_MAX; -} -#else -// Return type of read and write functions. -typedef ssize_t RWResult; - -inline std::size_t convert_rwcount(std::size_t count) { return count; } -#endif -} - -fmt::BufferedFile::~BufferedFile() FMT_NOEXCEPT { - if (file_ && FMT_SYSTEM(fclose(file_)) != 0) - fmt::report_system_error(errno, "cannot close file"); -} - -fmt::BufferedFile::BufferedFile( - fmt::CStringRef filename, fmt::CStringRef mode) { - FMT_RETRY_VAL(file_, FMT_SYSTEM(fopen(filename.c_str(), mode.c_str())), 0); - if (!file_) - FMT_THROW(SystemError(errno, "cannot open file {}", filename)); -} - -void fmt::BufferedFile::close() { - if (!file_) - return; - int result = FMT_SYSTEM(fclose(file_)); - file_ = 0; - if (result != 0) - FMT_THROW(SystemError(errno, "cannot close file")); -} - -// A macro used to prevent expansion of fileno on broken versions of MinGW. -#define FMT_ARGS - -int fmt::BufferedFile::fileno() const { - int fd = FMT_POSIX_CALL(fileno FMT_ARGS(file_)); - if (fd == -1) - FMT_THROW(SystemError(errno, "cannot get file descriptor")); - return fd; -} - -fmt::File::File(fmt::CStringRef path, int oflag) { - int mode = S_IRUSR | S_IWUSR; -#if defined(_WIN32) && !defined(__MINGW32__) - fd_ = -1; - FMT_POSIX_CALL(sopen_s(&fd_, path.c_str(), oflag, _SH_DENYNO, mode)); -#else - FMT_RETRY(fd_, FMT_POSIX_CALL(open(path.c_str(), oflag, mode))); -#endif - if (fd_ == -1) - FMT_THROW(SystemError(errno, "cannot open file {}", path)); -} - -fmt::File::~File() FMT_NOEXCEPT { - // Don't retry close in case of EINTR! - // See http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-09/3000.html - if (fd_ != -1 && FMT_POSIX_CALL(close(fd_)) != 0) - fmt::report_system_error(errno, "cannot close file"); -} - -void fmt::File::close() { - if (fd_ == -1) - return; - // Don't retry close in case of EINTR! - // See http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-09/3000.html - int result = FMT_POSIX_CALL(close(fd_)); - fd_ = -1; - if (result != 0) - FMT_THROW(SystemError(errno, "cannot close file")); -} - -fmt::LongLong fmt::File::size() const { -#ifdef _WIN32 - // Use GetFileSize instead of GetFileSizeEx for the case when _WIN32_WINNT - // is less than 0x0500 as is the case with some default MinGW builds. - // Both functions support large file sizes. - DWORD size_upper = 0; - HANDLE handle = reinterpret_cast(_get_osfhandle(fd_)); - DWORD size_lower = FMT_SYSTEM(GetFileSize(handle, &size_upper)); - if (size_lower == INVALID_FILE_SIZE) { - DWORD error = GetLastError(); - if (error != NO_ERROR) - FMT_THROW(WindowsError(GetLastError(), "cannot get file size")); - } - fmt::ULongLong long_size = size_upper; - return (long_size << sizeof(DWORD) * CHAR_BIT) | size_lower; -#else - typedef struct stat Stat; - Stat file_stat = Stat(); - if (FMT_POSIX_CALL(fstat(fd_, &file_stat)) == -1) - FMT_THROW(SystemError(errno, "cannot get file attributes")); - FMT_STATIC_ASSERT(sizeof(fmt::LongLong) >= sizeof(file_stat.st_size), - "return type of File::size is not large enough"); - return file_stat.st_size; -#endif -} - -std::size_t fmt::File::read(void *buffer, std::size_t count) { - RWResult result = 0; - FMT_RETRY(result, FMT_POSIX_CALL(read(fd_, buffer, convert_rwcount(count)))); - if (result < 0) - FMT_THROW(SystemError(errno, "cannot read from file")); - return internal::to_unsigned(result); -} - -std::size_t fmt::File::write(const void *buffer, std::size_t count) { - RWResult result = 0; - FMT_RETRY(result, FMT_POSIX_CALL(write(fd_, buffer, convert_rwcount(count)))); - if (result < 0) - FMT_THROW(SystemError(errno, "cannot write to file")); - return internal::to_unsigned(result); -} - -fmt::File fmt::File::dup(int fd) { - // Don't retry as dup doesn't return EINTR. - // http://pubs.opengroup.org/onlinepubs/009695399/functions/dup.html - int new_fd = FMT_POSIX_CALL(dup(fd)); - if (new_fd == -1) - FMT_THROW(SystemError(errno, "cannot duplicate file descriptor {}", fd)); - return File(new_fd); -} - -void fmt::File::dup2(int fd) { - int result = 0; - FMT_RETRY(result, FMT_POSIX_CALL(dup2(fd_, fd))); - if (result == -1) { - FMT_THROW(SystemError(errno, - "cannot duplicate file descriptor {} to {}", fd_, fd)); - } -} - -void fmt::File::dup2(int fd, ErrorCode &ec) FMT_NOEXCEPT { - int result = 0; - FMT_RETRY(result, FMT_POSIX_CALL(dup2(fd_, fd))); - if (result == -1) - ec = ErrorCode(errno); -} - -void fmt::File::pipe(File &read_end, File &write_end) { - // Close the descriptors first to make sure that assignments don't throw - // and there are no leaks. - read_end.close(); - write_end.close(); - int fds[2] = {}; -#ifdef _WIN32 - // Make the default pipe capacity same as on Linux 2.6.11+. - enum { DEFAULT_CAPACITY = 65536 }; - int result = FMT_POSIX_CALL(pipe(fds, DEFAULT_CAPACITY, _O_BINARY)); -#else - // Don't retry as the pipe function doesn't return EINTR. - // http://pubs.opengroup.org/onlinepubs/009696799/functions/pipe.html - int result = FMT_POSIX_CALL(pipe(fds)); -#endif - if (result != 0) - FMT_THROW(SystemError(errno, "cannot create pipe")); - // The following assignments don't throw because read_fd and write_fd - // are closed. - read_end = File(fds[0]); - write_end = File(fds[1]); -} - -fmt::BufferedFile fmt::File::fdopen(const char *mode) { - // Don't retry as fdopen doesn't return EINTR. - FILE *f = FMT_POSIX_CALL(fdopen(fd_, mode)); - if (!f) - FMT_THROW(SystemError(errno, "cannot associate stream with file descriptor")); - BufferedFile file(f); - fd_ = -1; - return file; -} - -long fmt::getpagesize() { -#ifdef _WIN32 - SYSTEM_INFO si; - GetSystemInfo(&si); - return si.dwPageSize; -#else - long size = FMT_POSIX_CALL(sysconf(_SC_PAGESIZE)); - if (size < 0) - FMT_THROW(SystemError(errno, "cannot get memory page size")); - return size; -#endif -} diff --git a/bm/sai_adapter/inc/spdlog/fmt/bundled/posix.h b/bm/sai_adapter/inc/spdlog/fmt/bundled/posix.h deleted file mode 100644 index be1286c42..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/bundled/posix.h +++ /dev/null @@ -1,386 +0,0 @@ -/* - A C++ interface to POSIX functions. - - Copyright (c) 2012 - 2016, Victor Zverovich - All rights reserved. - - For the license information refer to format.h. - */ - -#ifndef FMT_POSIX_H_ -#define FMT_POSIX_H_ - -#if defined(__MINGW32__) || defined(__CYGWIN__) -// Workaround MinGW bug https://sourceforge.net/p/mingw/bugs/2024/. -# undef __STRICT_ANSI__ -#endif - -#include -#include // for O_RDONLY -#include // for locale_t -#include -#include // for strtod_l - -#include - -#if defined __APPLE__ || defined(__FreeBSD__) -# include // for LC_NUMERIC_MASK on OS X -#endif - -#include "format.h" - -#ifndef FMT_POSIX -# if defined(_WIN32) && !defined(__MINGW32__) -// Fix warnings about deprecated symbols. -# define FMT_POSIX(call) _##call -# else -# define FMT_POSIX(call) call -# endif -#endif - -// Calls to system functions are wrapped in FMT_SYSTEM for testability. -#ifdef FMT_SYSTEM -# define FMT_POSIX_CALL(call) FMT_SYSTEM(call) -#else -# define FMT_SYSTEM(call) call -# ifdef _WIN32 -// Fix warnings about deprecated symbols. -# define FMT_POSIX_CALL(call) ::_##call -# else -# define FMT_POSIX_CALL(call) ::call -# endif -#endif - -#if FMT_GCC_VERSION >= 407 -# define FMT_UNUSED __attribute__((unused)) -#else -# define FMT_UNUSED -#endif - -#ifndef FMT_USE_STATIC_ASSERT -# define FMT_USE_STATIC_ASSERT 0 -#endif - -#if FMT_USE_STATIC_ASSERT || FMT_HAS_FEATURE(cxx_static_assert) || \ - (FMT_GCC_VERSION >= 403 && FMT_HAS_GXX_CXX11) || _MSC_VER >= 1600 -# define FMT_STATIC_ASSERT(cond, message) static_assert(cond, message) -#else -# define FMT_CONCAT_(a, b) FMT_CONCAT(a, b) -# define FMT_STATIC_ASSERT(cond, message) \ - typedef int FMT_CONCAT_(Assert, __LINE__)[(cond) ? 1 : -1] FMT_UNUSED -#endif - -// Retries the expression while it evaluates to error_result and errno -// equals to EINTR. -#ifndef _WIN32 -# define FMT_RETRY_VAL(result, expression, error_result) \ - do { \ - result = (expression); \ - } while (result == error_result && errno == EINTR) -#else -# define FMT_RETRY_VAL(result, expression, error_result) result = (expression) -#endif - -#define FMT_RETRY(result, expression) FMT_RETRY_VAL(result, expression, -1) - -namespace fmt { - -// An error code. -class ErrorCode { - private: - int value_; - - public: - explicit ErrorCode(int value = 0) FMT_NOEXCEPT : value_(value) {} - - int get() const FMT_NOEXCEPT { return value_; } -}; - -// A buffered file. -class BufferedFile { - private: - FILE *file_; - - friend class File; - - explicit BufferedFile(FILE *f) : file_(f) {} - - public: - // Constructs a BufferedFile object which doesn't represent any file. - BufferedFile() FMT_NOEXCEPT : file_(0) {} - - // Destroys the object closing the file it represents if any. - ~BufferedFile() FMT_NOEXCEPT; - -#if !FMT_USE_RVALUE_REFERENCES - // Emulate a move constructor and a move assignment operator if rvalue - // references are not supported. - - private: - // A proxy object to emulate a move constructor. - // It is private to make it impossible call operator Proxy directly. - struct Proxy { - FILE *file; - }; - -public: - // A "move constructor" for moving from a temporary. - BufferedFile(Proxy p) FMT_NOEXCEPT : file_(p.file) {} - - // A "move constructor" for moving from an lvalue. - BufferedFile(BufferedFile &f) FMT_NOEXCEPT : file_(f.file_) { - f.file_ = 0; - } - - // A "move assignment operator" for moving from a temporary. - BufferedFile &operator=(Proxy p) { - close(); - file_ = p.file; - return *this; - } - - // A "move assignment operator" for moving from an lvalue. - BufferedFile &operator=(BufferedFile &other) { - close(); - file_ = other.file_; - other.file_ = 0; - return *this; - } - - // Returns a proxy object for moving from a temporary: - // BufferedFile file = BufferedFile(...); - operator Proxy() FMT_NOEXCEPT { - Proxy p = {file_}; - file_ = 0; - return p; - } - -#else - private: - FMT_DISALLOW_COPY_AND_ASSIGN(BufferedFile); - - public: - BufferedFile(BufferedFile &&other) FMT_NOEXCEPT : file_(other.file_) { - other.file_ = 0; - } - - BufferedFile& operator=(BufferedFile &&other) { - close(); - file_ = other.file_; - other.file_ = 0; - return *this; - } -#endif - - // Opens a file. - BufferedFile(CStringRef filename, CStringRef mode); - - // Closes the file. - void close(); - - // Returns the pointer to a FILE object representing this file. - FILE *get() const FMT_NOEXCEPT { return file_; } - - // We place parentheses around fileno to workaround a bug in some versions - // of MinGW that define fileno as a macro. - int (fileno)() const; - - void print(CStringRef format_str, const ArgList &args) { - fmt::print(file_, format_str, args); - } - FMT_VARIADIC(void, print, CStringRef) -}; - -// A file. Closed file is represented by a File object with descriptor -1. -// Methods that are not declared with FMT_NOEXCEPT may throw -// fmt::SystemError in case of failure. Note that some errors such as -// closing the file multiple times will cause a crash on Windows rather -// than an exception. You can get standard behavior by overriding the -// invalid parameter handler with _set_invalid_parameter_handler. -class File { - private: - int fd_; // File descriptor. - - // Constructs a File object with a given descriptor. - explicit File(int fd) : fd_(fd) {} - - public: - // Possible values for the oflag argument to the constructor. - enum { - RDONLY = FMT_POSIX(O_RDONLY), // Open for reading only. - WRONLY = FMT_POSIX(O_WRONLY), // Open for writing only. - RDWR = FMT_POSIX(O_RDWR) // Open for reading and writing. - }; - - // Constructs a File object which doesn't represent any file. - File() FMT_NOEXCEPT : fd_(-1) {} - - // Opens a file and constructs a File object representing this file. - File(CStringRef path, int oflag); - -#if !FMT_USE_RVALUE_REFERENCES - // Emulate a move constructor and a move assignment operator if rvalue - // references are not supported. - - private: - // A proxy object to emulate a move constructor. - // It is private to make it impossible call operator Proxy directly. - struct Proxy { - int fd; - }; - - public: - // A "move constructor" for moving from a temporary. - File(Proxy p) FMT_NOEXCEPT : fd_(p.fd) {} - - // A "move constructor" for moving from an lvalue. - File(File &other) FMT_NOEXCEPT : fd_(other.fd_) { - other.fd_ = -1; - } - - // A "move assignment operator" for moving from a temporary. - File &operator=(Proxy p) { - close(); - fd_ = p.fd; - return *this; - } - - // A "move assignment operator" for moving from an lvalue. - File &operator=(File &other) { - close(); - fd_ = other.fd_; - other.fd_ = -1; - return *this; - } - - // Returns a proxy object for moving from a temporary: - // File file = File(...); - operator Proxy() FMT_NOEXCEPT { - Proxy p = {fd_}; - fd_ = -1; - return p; - } - -#else - private: - FMT_DISALLOW_COPY_AND_ASSIGN(File); - - public: - File(File &&other) FMT_NOEXCEPT : fd_(other.fd_) { - other.fd_ = -1; - } - - File& operator=(File &&other) { - close(); - fd_ = other.fd_; - other.fd_ = -1; - return *this; - } -#endif - - // Destroys the object closing the file it represents if any. - ~File() FMT_NOEXCEPT; - - // Returns the file descriptor. - int descriptor() const FMT_NOEXCEPT { return fd_; } - - // Closes the file. - void close(); - - // Returns the file size. The size has signed type for consistency with - // stat::st_size. - LongLong size() const; - - // Attempts to read count bytes from the file into the specified buffer. - std::size_t read(void *buffer, std::size_t count); - - // Attempts to write count bytes from the specified buffer to the file. - std::size_t write(const void *buffer, std::size_t count); - - // Duplicates a file descriptor with the dup function and returns - // the duplicate as a file object. - static File dup(int fd); - - // Makes fd be the copy of this file descriptor, closing fd first if - // necessary. - void dup2(int fd); - - // Makes fd be the copy of this file descriptor, closing fd first if - // necessary. - void dup2(int fd, ErrorCode &ec) FMT_NOEXCEPT; - - // Creates a pipe setting up read_end and write_end file objects for reading - // and writing respectively. - static void pipe(File &read_end, File &write_end); - - // Creates a BufferedFile object associated with this file and detaches - // this File object from the file. - BufferedFile fdopen(const char *mode); -}; - -// Returns the memory page size. -long getpagesize(); - -#if (defined(LC_NUMERIC_MASK) || defined(_MSC_VER)) && \ - !defined(__ANDROID__) && !defined(__CYGWIN__) -# define FMT_LOCALE -#endif - -#ifdef FMT_LOCALE -// A "C" numeric locale. -class Locale { - private: -# ifdef _MSC_VER - typedef _locale_t locale_t; - - enum { LC_NUMERIC_MASK = LC_NUMERIC }; - - static locale_t newlocale(int category_mask, const char *locale, locale_t) { - return _create_locale(category_mask, locale); - } - - static void freelocale(locale_t locale) { - _free_locale(locale); - } - - static double strtod_l(const char *nptr, char **endptr, _locale_t locale) { - return _strtod_l(nptr, endptr, locale); - } -# endif - - locale_t locale_; - - FMT_DISALLOW_COPY_AND_ASSIGN(Locale); - - public: - typedef locale_t Type; - - Locale() : locale_(newlocale(LC_NUMERIC_MASK, "C", NULL)) { - if (!locale_) - FMT_THROW(fmt::SystemError(errno, "cannot create locale")); - } - ~Locale() { freelocale(locale_); } - - Type get() const { return locale_; } - - // Converts string to floating-point number and advances str past the end - // of the parsed input. - double strtod(const char *&str) const { - char *end = 0; - double result = strtod_l(str, &end, locale_); - str = end; - return result; - } -}; -#endif // FMT_LOCALE -} // namespace fmt - -#if !FMT_USE_RVALUE_REFERENCES -namespace std { -// For compatibility with C++98. -inline fmt::BufferedFile &move(fmt::BufferedFile &f) { return f; } -inline fmt::File &move(fmt::File &f) { return f; } -} -#endif - -#endif // FMT_POSIX_H_ diff --git a/bm/sai_adapter/inc/spdlog/fmt/bundled/time.h b/bm/sai_adapter/inc/spdlog/fmt/bundled/time.h deleted file mode 100644 index 10225c03e..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/bundled/time.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Formatting library for C++ - time formatting - - Copyright (c) 2012 - 2016, Victor Zverovich - All rights reserved. - - For the license information refer to format.h. - */ - -#ifndef FMT_TIME_H_ -#define FMT_TIME_H_ - -#include "format.h" -#include - -namespace fmt { -template -void format(BasicFormatter &f, - const char *&format_str, const std::tm &tm) { - if (*format_str == ':') - ++format_str; - const char *end = format_str; - while (*end && *end != '}') - ++end; - if (*end != '}') - FMT_THROW(FormatError("missing '}' in format string")); - internal::MemoryBuffer format; - format.append(format_str, end + 1); - format[format.size() - 1] = '\0'; - Buffer &buffer = f.writer().buffer(); - std::size_t start = buffer.size(); - for (;;) { - std::size_t size = buffer.capacity() - start; - std::size_t count = std::strftime(&buffer[start], size, &format[0], &tm); - if (count != 0) { - buffer.resize(start + count); - break; - } - if (size >= format.size() * 256) { - // If the buffer is 256 times larger than the format string, assume - // that `strftime` gives an empty result. There doesn't seem to be a - // better way to distinguish the two cases: - // https://github.com/fmtlib/fmt/issues/367 - break; - } - const std::size_t MIN_GROWTH = 10; - buffer.reserve(buffer.capacity() + (size > MIN_GROWTH ? size : MIN_GROWTH)); - } - format_str = end + 1; -} -} - -#endif // FMT_TIME_H_ diff --git a/bm/sai_adapter/inc/spdlog/fmt/fmt.h b/bm/sai_adapter/inc/spdlog/fmt/fmt.h deleted file mode 100644 index dd035fd29..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/fmt.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright(c) 2016 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// -// Include a bundled header-only copy of fmtlib or an external one. -// By default spdlog include its own copy. -// - -#if !defined(SPDLOG_FMT_EXTERNAL) - -#ifndef FMT_HEADER_ONLY -#define FMT_HEADER_ONLY -#endif -#ifndef FMT_USE_WINDOWS_H -#define FMT_USE_WINDOWS_H 0 -#endif -#include - -#else //external fmtlib - -#include - -#endif - diff --git a/bm/sai_adapter/inc/spdlog/fmt/ostr.h b/bm/sai_adapter/inc/spdlog/fmt/ostr.h deleted file mode 100644 index 7a6518654..000000000 --- a/bm/sai_adapter/inc/spdlog/fmt/ostr.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// Copyright(c) 2016 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// include external or bundled copy of fmtlib's ostream support -// -#if !defined(SPDLOG_FMT_EXTERNAL) -#include -#include -#else -#include -#endif - - diff --git a/bm/sai_adapter/inc/spdlog/formatter.h b/bm/sai_adapter/inc/spdlog/formatter.h deleted file mode 100644 index 0ffcec03e..000000000 --- a/bm/sai_adapter/inc/spdlog/formatter.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include - -#include -#include -#include - -namespace spdlog -{ -namespace details -{ -class flag_formatter; -} - -class formatter -{ -public: - virtual ~formatter() {} - virtual void format(details::log_msg& msg) = 0; -}; - -class pattern_formatter : public formatter -{ - -public: - explicit pattern_formatter(const std::string& pattern); - pattern_formatter(const pattern_formatter&) = delete; - pattern_formatter& operator=(const pattern_formatter&) = delete; - void format(details::log_msg& msg) override; -private: - const std::string _pattern; - std::vector> _formatters; - void handle_flag(char flag); - void compile_pattern(const std::string& pattern); -}; -} - -#include - diff --git a/bm/sai_adapter/inc/spdlog/logger.h b/bm/sai_adapter/inc/spdlog/logger.h deleted file mode 100644 index a2deb51df..000000000 --- a/bm/sai_adapter/inc/spdlog/logger.h +++ /dev/null @@ -1,94 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -// Thread safe logger (except for set_pattern(..), set_formatter(..) and set_error_handler()) -// Has name, log level, vector of std::shared sink pointers and formatter -// Upon each log write the logger: -// 1. Checks if its log level is enough to log the message -// 2. Format the message using the formatter function -// 3. Pass the formatted message to its sinks to performa the actual logging - -#include -#include - -#include -#include -#include - -namespace spdlog -{ - -class logger -{ -public: - logger(const std::string& logger_name, sink_ptr single_sink); - logger(const std::string& name, sinks_init_list); - template - logger(const std::string& name, const It& begin, const It& end); - - virtual ~logger(); - logger(const logger&) = delete; - logger& operator=(const logger&) = delete; - - - template void log(level::level_enum lvl, const char* fmt, const Args&... args); - template void log(level::level_enum lvl, const char* msg); - template void trace(const char* fmt, const Args&... args); - template void debug(const char* fmt, const Args&... args); - template void info(const char* fmt, const Args&... args); - template void warn(const char* fmt, const Args&... args); - template void error(const char* fmt, const Args&... args); - template void critical(const char* fmt, const Args&... args); - - template void log(level::level_enum lvl, const T&); - template void trace(const T&); - template void debug(const T&); - template void info(const T&); - template void warn(const T&); - template void error(const T&); - template void critical(const T&); - - bool should_log(level::level_enum) const; - void set_level(level::level_enum); - level::level_enum level() const; - const std::string& name() const; - void set_pattern(const std::string&); - void set_formatter(formatter_ptr); - - // error handler - void set_error_handler(log_err_handler); - log_err_handler error_handler(); - - // automatically call flush() if message level >= log_level - void flush_on(level::level_enum log_level); - - virtual void flush(); - - const std::vector& sinks() const; - -protected: - virtual void _sink_it(details::log_msg&); - virtual void _set_pattern(const std::string&); - virtual void _set_formatter(formatter_ptr); - - // default error handler: print the error to stderr with the max rate of 1 message/minute - virtual void _default_err_handler(const std::string &msg); - - // return true if the given message level should trigger a flush - bool _should_flush_on(const details::log_msg&); - - const std::string _name; - std::vector _sinks; - formatter_ptr _formatter; - spdlog::level_t _level; - spdlog::level_t _flush_level; - log_err_handler _err_handler; - std::atomic _last_err_time; -}; -} - -#include diff --git a/bm/sai_adapter/inc/spdlog/sinks/android_sink.h b/bm/sai_adapter/inc/spdlog/sinks/android_sink.h deleted file mode 100644 index d8c97e03b..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/android_sink.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#if defined(__ANDROID__) - -#include - -#include -#include -#include - -namespace spdlog -{ -namespace sinks -{ - -/* -* Android sink (logging using __android_log_write) -* __android_log_write is thread-safe. No lock is needed. -*/ -class android_sink : public sink -{ -public: - explicit android_sink(const std::string& tag = "spdlog"): _tag(tag) {} - - void log(const details::log_msg& msg) override - { - const android_LogPriority priority = convert_to_android(msg.level); - // See system/core/liblog/logger_write.c for explanation of return value - const int ret = __android_log_write( - priority, _tag.c_str(), msg.formatted.c_str() - ); - if (ret < 0) - { - throw spdlog_ex("__android_log_write() failed", ret); - } - } - - void flush() override - { - } - -private: - static android_LogPriority convert_to_android(spdlog::level::level_enum level) - { - switch(level) - { - case spdlog::level::trace: - return ANDROID_LOG_VERBOSE; - case spdlog::level::debug: - return ANDROID_LOG_DEBUG; - case spdlog::level::info: - return ANDROID_LOG_INFO; - case spdlog::level::warn: - return ANDROID_LOG_WARN; - case spdlog::level::err: - return ANDROID_LOG_ERROR; - case spdlog::level::critical: - return ANDROID_LOG_FATAL; - default: - return ANDROID_LOG_DEFAULT; - } - } - - std::string _tag; -}; - -} -} - -#endif diff --git a/bm/sai_adapter/inc/spdlog/sinks/ansicolor_sink.h b/bm/sai_adapter/inc/spdlog/sinks/ansicolor_sink.h deleted file mode 100644 index 96e10148e..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/ansicolor_sink.h +++ /dev/null @@ -1,116 +0,0 @@ -// -// Copyright(c) 2016 Kevin M. Godby (a modified version by spdlog). -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include - -#include -#include - -namespace spdlog -{ -namespace sinks -{ - -/** - * @brief The ansi_color_sink is a decorator around another sink and prefixes - * the output with an ANSI escape sequence color code depending on the severity - * of the message. - */ -class ansicolor_sink : public sink -{ -public: - ansicolor_sink(sink_ptr wrapped_sink); - virtual ~ansicolor_sink(); - - ansicolor_sink(const ansicolor_sink& other) = delete; - ansicolor_sink& operator=(const ansicolor_sink& other) = delete; - - virtual void log(const details::log_msg& msg) override; - virtual void flush() override; - - void set_color(level::level_enum color_level, const std::string& color); - - /// Formatting codes - const std::string reset = "\033[00m"; - const std::string bold = "\033[1m"; - const std::string dark = "\033[2m"; - const std::string underline = "\033[4m"; - const std::string blink = "\033[5m"; - const std::string reverse = "\033[7m"; - const std::string concealed = "\033[8m"; - - // Foreground colors - const std::string grey = "\033[30m"; - const std::string red = "\033[31m"; - const std::string green = "\033[32m"; - const std::string yellow = "\033[33m"; - const std::string blue = "\033[34m"; - const std::string magenta = "\033[35m"; - const std::string cyan = "\033[36m"; - const std::string white = "\033[37m"; - - /// Background colors - const std::string on_grey = "\033[40m"; - const std::string on_red = "\033[41m"; - const std::string on_green = "\033[42m"; - const std::string on_yellow = "\033[43m"; - const std::string on_blue = "\033[44m"; - const std::string on_magenta = "\033[45m"; - const std::string on_cyan = "\033[46m"; - const std::string on_white = "\033[47m"; - - -protected: - sink_ptr sink_; - std::map colors_; -}; - -inline ansicolor_sink::ansicolor_sink(sink_ptr wrapped_sink) : sink_(wrapped_sink) -{ - colors_[level::trace] = cyan; - colors_[level::debug] = cyan; - colors_[level::info] = bold; - colors_[level::warn] = yellow + bold; - colors_[level::err] = red + bold; - colors_[level::critical] = bold + on_red; - colors_[level::off] = reset; -} - -inline void ansicolor_sink::log(const details::log_msg& msg) -{ - // Wrap the originally formatted message in color codes - const std::string& prefix = colors_[msg.level]; - const std::string& s = msg.formatted.str(); - const std::string& suffix = reset; - details::log_msg m; - m.level = msg.level; - m.logger_name = msg.logger_name; - m.time = msg.time; - m.thread_id = msg.thread_id; - m.formatted << prefix << s << suffix; - sink_->log(m); -} - -inline void ansicolor_sink::flush() -{ - sink_->flush(); -} - -inline void ansicolor_sink::set_color(level::level_enum color_level, const std::string& color) -{ - colors_[color_level] = color; -} - -inline ansicolor_sink::~ansicolor_sink() -{ - flush(); -} - -} // namespace sinks -} // namespace spdlog - diff --git a/bm/sai_adapter/inc/spdlog/sinks/base_sink.h b/bm/sai_adapter/inc/spdlog/sinks/base_sink.h deleted file mode 100644 index 7f1a31dbd..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/base_sink.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once -// -// base sink templated over a mutex (either dummy or realy) -// concrete implementation should only overrid the _sink_it method. -// all locking is taken care of here so no locking needed by the implementers.. -// - -#include -#include -#include -#include - -#include - -namespace spdlog -{ -namespace sinks -{ -template -class base_sink:public sink -{ -public: - base_sink():_mutex() {} - virtual ~base_sink() = default; - - base_sink(const base_sink&) = delete; - base_sink& operator=(const base_sink&) = delete; - - void log(const details::log_msg& msg) override - { - std::lock_guard lock(_mutex); - _sink_it(msg); - } - -protected: - virtual void _sink_it(const details::log_msg& msg) = 0; - Mutex _mutex; -}; -} -} diff --git a/bm/sai_adapter/inc/spdlog/sinks/dist_sink.h b/bm/sai_adapter/inc/spdlog/sinks/dist_sink.h deleted file mode 100644 index cef08bfb4..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/dist_sink.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) 2015 David Schury, Gabi Melman -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include -#include -#include - -#include -#include -#include -#include - -// Distribution sink (mux). Stores a vector of sinks which get called when log is called - -namespace spdlog -{ -namespace sinks -{ -template -class dist_sink: public base_sink -{ -public: - explicit dist_sink() :_sinks() {} - dist_sink(const dist_sink&) = delete; - dist_sink& operator=(const dist_sink&) = delete; - virtual ~dist_sink() = default; - -protected: - std::vector> _sinks; - - void _sink_it(const details::log_msg& msg) override - { - for (auto &sink : _sinks) - { - if( sink->should_log( msg.level)) - { - sink->log(msg); - } - } - } - -public: - void flush() override - { - std::lock_guard lock(base_sink::_mutex); - for (auto &sink : _sinks) - sink->flush(); - } - - void add_sink(std::shared_ptr sink) - { - std::lock_guard lock(base_sink::_mutex); - _sinks.push_back(sink); - } - - void remove_sink(std::shared_ptr sink) - { - std::lock_guard lock(base_sink::_mutex); - _sinks.erase(std::remove(_sinks.begin(), _sinks.end(), sink), _sinks.end()); - } -}; - -typedef dist_sink dist_sink_mt; -typedef dist_sink dist_sink_st; -} -} diff --git a/bm/sai_adapter/inc/spdlog/sinks/file_sinks.h b/bm/sai_adapter/inc/spdlog/sinks/file_sinks.h deleted file mode 100644 index 721a96df0..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/file_sinks.h +++ /dev/null @@ -1,239 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace spdlog -{ -namespace sinks -{ -/* - * Trivial file sink with single file as target - */ -template -class simple_file_sink : public base_sink < Mutex > -{ -public: - explicit simple_file_sink(const filename_t &filename, bool truncate = false):_force_flush(false) - { - _file_helper.open(filename, truncate); - } - void flush() override - { - _file_helper.flush(); - } - void set_force_flush(bool force_flush) - { - _force_flush = force_flush; - } - -protected: - void _sink_it(const details::log_msg& msg) override - { - _file_helper.write(msg); - if(_force_flush) - _file_helper.flush(); - } -private: - details::file_helper _file_helper; - bool _force_flush; -}; - -typedef simple_file_sink simple_file_sink_mt; -typedef simple_file_sink simple_file_sink_st; - -/* - * Rotating file sink based on size - */ -template -class rotating_file_sink : public base_sink < Mutex > -{ -public: - rotating_file_sink(const filename_t &base_filename, - std::size_t max_size, std::size_t max_files) : - _base_filename(base_filename), - _max_size(max_size), - _max_files(max_files), - _current_size(0), - _file_helper() - { - _file_helper.open(calc_filename(_base_filename, 0)); - _current_size = _file_helper.size(); //expensive. called only once - } - - void flush() override - { - _file_helper.flush(); - } - -protected: - void _sink_it(const details::log_msg& msg) override - { - _current_size += msg.formatted.size(); - if (_current_size > _max_size) - { - _rotate(); - _current_size = msg.formatted.size(); - } - _file_helper.write(msg); - } - -private: - static filename_t calc_filename(const filename_t& filename, std::size_t index) - { - std::conditional::value, fmt::MemoryWriter, fmt::WMemoryWriter>::type w; - if (index) - w.write(SPDLOG_FILENAME_T("{}.{}"), filename, index); - else - w.write(SPDLOG_FILENAME_T("{}"), filename); - return w.str(); - } - - // Rotate files: - // log.txt -> log.txt.1 - // log.txt.1 -> log.txt.2 - // log.txt.2 -> log.txt.3 - // lo3.txt.3 -> delete - - void _rotate() - { - using details::os::filename_to_str; - _file_helper.close(); - for (auto i = _max_files; i > 0; --i) - { - filename_t src = calc_filename(_base_filename, i - 1); - filename_t target = calc_filename(_base_filename, i); - - if (details::file_helper::file_exists(target)) - { - if (details::os::remove(target) != 0) - { - throw spdlog_ex("rotating_file_sink: failed removing " + filename_to_str(target), errno); - } - } - if (details::file_helper::file_exists(src) && details::os::rename(src, target)) - { - throw spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target), errno); - } - } - _file_helper.reopen(true); - } - filename_t _base_filename; - std::size_t _max_size; - std::size_t _max_files; - std::size_t _current_size; - details::file_helper _file_helper; -}; - -typedef rotating_file_sink rotating_file_sink_mt; -typedef rotating_file_sinkrotating_file_sink_st; - -/* - * Default generator of daily log file names. - */ -struct default_daily_file_name_calculator -{ - // Create filename for the form basename.YYYY-MM-DD_hh-mm - static filename_t calc_filename(const filename_t& basename) - { - std::tm tm = spdlog::details::os::localtime(); - std::conditional::value, fmt::MemoryWriter, fmt::WMemoryWriter>::type w; - w.write(SPDLOG_FILENAME_T("{}_{:04d}-{:02d}-{:02d}_{:02d}-{:02d}"), basename, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min); - return w.str(); - } -}; - -/* - * Generator of daily log file names in format basename.YYYY-MM-DD - */ -struct dateonly_daily_file_name_calculator -{ - // Create filename for the form basename.YYYY-MM-DD - static filename_t calc_filename(const filename_t& basename) - { - std::tm tm = spdlog::details::os::localtime(); - std::conditional::value, fmt::MemoryWriter, fmt::WMemoryWriter>::type w; - w.write(SPDLOG_FILENAME_T("{}_{:04d}-{:02d}-{:02d}"), basename, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); - return w.str(); - } -}; - -/* - * Rotating file sink based on date. rotates at midnight - */ -template -class daily_file_sink :public base_sink < Mutex > -{ -public: - //create daily file sink which rotates on given time - daily_file_sink( - const filename_t& base_filename, - int rotation_hour, - int rotation_minute) : _base_filename(base_filename), - _rotation_h(rotation_hour), - _rotation_m(rotation_minute) - { - if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || rotation_minute > 59) - throw spdlog_ex("daily_file_sink: Invalid rotation time in ctor"); - _rotation_tp = _next_rotation_tp(); - _file_helper.open(FileNameCalc::calc_filename(_base_filename)); - } - - void flush() override - { - _file_helper.flush(); - } - -protected: - void _sink_it(const details::log_msg& msg) override - { - if (std::chrono::system_clock::now() >= _rotation_tp) - { - _file_helper.open(FileNameCalc::calc_filename(_base_filename)); - _rotation_tp = _next_rotation_tp(); - } - _file_helper.write(msg); - } - -private: - std::chrono::system_clock::time_point _next_rotation_tp() - { - auto now = std::chrono::system_clock::now(); - time_t tnow = std::chrono::system_clock::to_time_t(now); - tm date = spdlog::details::os::localtime(tnow); - date.tm_hour = _rotation_h; - date.tm_min = _rotation_m; - date.tm_sec = 0; - auto rotation_time = std::chrono::system_clock::from_time_t(std::mktime(&date)); - if (rotation_time > now) - return rotation_time; - else - return std::chrono::system_clock::time_point(rotation_time + std::chrono::hours(24)); - } - - filename_t _base_filename; - int _rotation_h; - int _rotation_m; - std::chrono::system_clock::time_point _rotation_tp; - details::file_helper _file_helper; -}; - -typedef daily_file_sink daily_file_sink_mt; -typedef daily_file_sink daily_file_sink_st; -} -} diff --git a/bm/sai_adapter/inc/spdlog/sinks/msvc_sink.h b/bm/sai_adapter/inc/spdlog/sinks/msvc_sink.h deleted file mode 100644 index 16342ca26..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/msvc_sink.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright(c) 2016 Alexander Dalshov. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#if defined(_MSC_VER) - -#include -#include - -#include - -#include -#include - -namespace spdlog -{ -namespace sinks -{ -/* -* MSVC sink (logging using OutputDebugStringA) -*/ -template -class msvc_sink : public base_sink < Mutex > -{ -public: - explicit msvc_sink() - { - } - - void flush() override - { - } - -protected: - void _sink_it(const details::log_msg& msg) override - { - OutputDebugStringA(msg.formatted.c_str()); - } -}; - -typedef msvc_sink msvc_sink_mt; -typedef msvc_sink msvc_sink_st; - -} -} - -#endif diff --git a/bm/sai_adapter/inc/spdlog/sinks/null_sink.h b/bm/sai_adapter/inc/spdlog/sinks/null_sink.h deleted file mode 100644 index 1d427aa2a..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/null_sink.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include - -#include - -namespace spdlog -{ -namespace sinks -{ - -template -class null_sink : public base_sink < Mutex > -{ -protected: - void _sink_it(const details::log_msg&) override - {} - - void flush() override - {} - -}; -typedef null_sink null_sink_st; -typedef null_sink null_sink_mt; - -} -} - diff --git a/bm/sai_adapter/inc/spdlog/sinks/ostream_sink.h b/bm/sai_adapter/inc/spdlog/sinks/ostream_sink.h deleted file mode 100644 index feb5efa18..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/ostream_sink.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include - -#include -#include - -namespace spdlog -{ -namespace sinks -{ -template -class ostream_sink: public base_sink -{ -public: - explicit ostream_sink(std::ostream& os, bool force_flush=false) :_ostream(os), _force_flush(force_flush) {} - ostream_sink(const ostream_sink&) = delete; - ostream_sink& operator=(const ostream_sink&) = delete; - virtual ~ostream_sink() = default; - -protected: - void _sink_it(const details::log_msg& msg) override - { - _ostream.write(msg.formatted.data(), msg.formatted.size()); - if (_force_flush) - _ostream.flush(); - } - - void flush() override - { - _ostream.flush(); - } - - std::ostream& _ostream; - bool _force_flush; -}; - -typedef ostream_sink ostream_sink_mt; -typedef ostream_sink ostream_sink_st; -} -} diff --git a/bm/sai_adapter/inc/spdlog/sinks/sink.h b/bm/sai_adapter/inc/spdlog/sinks/sink.h deleted file mode 100644 index b48dd8b9d..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/sink.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - - -#pragma once - -#include - -namespace spdlog -{ -namespace sinks -{ -class sink -{ -public: - sink() - { - _level = level::trace; - } - - virtual ~sink() {} - virtual void log(const details::log_msg& msg) = 0; - virtual void flush() = 0; - - bool should_log(level::level_enum msg_level) const; - void set_level(level::level_enum log_level); - level::level_enum level() const; - -private: - level_t _level; - -}; - -inline bool sink::should_log(level::level_enum msg_level) const -{ - return msg_level >= _level.load(std::memory_order_relaxed); -} - -inline void sink::set_level(level::level_enum log_level) -{ - _level.store(log_level); -} - -inline level::level_enum sink::level() const -{ - return static_cast(_level.load(std::memory_order_relaxed)); -} - -} -} - diff --git a/bm/sai_adapter/inc/spdlog/sinks/stdout_sinks.h b/bm/sai_adapter/inc/spdlog/sinks/stdout_sinks.h deleted file mode 100644 index c05f80dd1..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/stdout_sinks.h +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include - -#include -#include -#include - -namespace spdlog -{ -namespace sinks -{ - -template -class stdout_sink: public base_sink -{ - using MyType = stdout_sink; -public: - stdout_sink() - {} - static std::shared_ptr instance() - { - static std::shared_ptr instance = std::make_shared(); - return instance; - } - - void _sink_it(const details::log_msg& msg) override - { - fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stdout); - flush(); - } - - void flush() override - { - fflush(stdout); - } -}; - -typedef stdout_sink stdout_sink_st; -typedef stdout_sink stdout_sink_mt; - - -template -class stderr_sink: public base_sink -{ - using MyType = stderr_sink; -public: - stderr_sink() - {} - static std::shared_ptr instance() - { - static std::shared_ptr instance = std::make_shared(); - return instance; - } - - void _sink_it(const details::log_msg& msg) override - { - fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stderr); - flush(); - } - - void flush() override - { - fflush(stderr); - } -}; - -typedef stderr_sink stderr_sink_mt; -typedef stderr_sink stderr_sink_st; -} -} diff --git a/bm/sai_adapter/inc/spdlog/sinks/syslog_sink.h b/bm/sai_adapter/inc/spdlog/sinks/syslog_sink.h deleted file mode 100644 index 0d8633c5e..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/syslog_sink.h +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include - -#ifdef SPDLOG_ENABLE_SYSLOG - -#include -#include - -#include -#include -#include - - -namespace spdlog -{ -namespace sinks -{ -/** - * Sink that write to syslog using the `syscall()` library call. - * - * Locking is not needed, as `syslog()` itself is thread-safe. - */ -class syslog_sink : public sink -{ -public: - // - syslog_sink(const std::string& ident = "", int syslog_option=0, int syslog_facility=LOG_USER): - _ident(ident) - { - _priorities[static_cast(level::trace)] = LOG_DEBUG; - _priorities[static_cast(level::debug)] = LOG_DEBUG; - _priorities[static_cast(level::info)] = LOG_INFO; - _priorities[static_cast(level::warn)] = LOG_WARNING; - _priorities[static_cast(level::err)] = LOG_ERR; - _priorities[static_cast(level::critical)] = LOG_CRIT; - _priorities[static_cast(level::off)] = LOG_INFO; - - //set ident to be program name if empty - ::openlog(_ident.empty()? nullptr:_ident.c_str(), syslog_option, syslog_facility); - } - ~syslog_sink() - { - ::closelog(); - } - - syslog_sink(const syslog_sink&) = delete; - syslog_sink& operator=(const syslog_sink&) = delete; - - void log(const details::log_msg &msg) override - { - ::syslog(syslog_prio_from_level(msg), "%s", msg.raw.str().c_str()); - } - - void flush() override - { - } - - -private: - std::array _priorities; - //must store the ident because the man says openlog might use the pointer as is and not a string copy - const std::string _ident; - - // - // Simply maps spdlog's log level to syslog priority level. - // - int syslog_prio_from_level(const details::log_msg &msg) const - { - return _priorities[static_cast(msg.level)]; - } -}; -} -} - -#endif diff --git a/bm/sai_adapter/inc/spdlog/sinks/wincolor_sink.h b/bm/sai_adapter/inc/spdlog/sinks/wincolor_sink.h deleted file mode 100644 index 63ecbe217..000000000 --- a/bm/sai_adapter/inc/spdlog/sinks/wincolor_sink.h +++ /dev/null @@ -1,116 +0,0 @@ -// -// Copyright(c) 2016 spdlog -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -#include -#include -#include - -#include -#include -#include -#include - -namespace spdlog -{ -namespace sinks -{ -/* - * Windows color console sink. Uses WriteConsoleA to write to the console with colors - */ -template -class wincolor_sink: public base_sink -{ -public: - const WORD BOLD = FOREGROUND_INTENSITY; - const WORD RED = FOREGROUND_RED; - const WORD CYAN = FOREGROUND_GREEN | FOREGROUND_BLUE; - const WORD WHITE = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; - const WORD YELLOW = FOREGROUND_RED | FOREGROUND_GREEN; - - wincolor_sink(HANDLE std_handle): out_handle_(std_handle) - { - colors_[level::trace] = CYAN; - colors_[level::debug] = CYAN; - colors_[level::info] = WHITE | BOLD; - colors_[level::warn] = YELLOW | BOLD; - colors_[level::err] = RED | BOLD; // red bold - colors_[level::critical] = BACKGROUND_RED | WHITE | BOLD; // white bold on red background - colors_[level::off] = 0; - } - - virtual ~wincolor_sink() - { - flush(); - } - - wincolor_sink(const wincolor_sink& other) = delete; - wincolor_sink& operator=(const wincolor_sink& other) = delete; - - virtual void _sink_it(const details::log_msg& msg) override - { - auto color = colors_[msg.level]; - auto orig_attribs = set_console_attribs(color); - WriteConsoleA(out_handle_, msg.formatted.data(), static_cast(msg.formatted.size()), nullptr, nullptr); - SetConsoleTextAttribute(out_handle_, orig_attribs); //reset to orig colors - } - - virtual void flush() override - { - // windows console always flushed? - } - - // change the color for the given level - void set_color(level::level_enum level, WORD color) - { - std::lock_guard lock(base_sink::_mutex); - colors_[level] = color; - } - -private: - HANDLE out_handle_; - std::map colors_; - - // set color and return the orig console attributes (for resetting later) - WORD set_console_attribs(WORD attribs) - { - CONSOLE_SCREEN_BUFFER_INFO orig_buffer_info; - GetConsoleScreenBufferInfo(out_handle_, &orig_buffer_info); - SetConsoleTextAttribute(out_handle_, attribs); - return orig_buffer_info.wAttributes; //return orig attribs - } -}; - -// -// windows color console to stdout -// -template -class wincolor_stdout_sink: public wincolor_sink -{ -public: - wincolor_stdout_sink() : wincolor_sink(GetStdHandle(STD_OUTPUT_HANDLE)) - {} -}; - -typedef wincolor_stdout_sink wincolor_stdout_sink_mt; -typedef wincolor_stdout_sink wincolor_stdout_sink_st; - -// -// windows color console to stderr -// -template -class wincolor_stderr_sink: public wincolor_sink -{ -public: - wincolor_stderr_sink() : wincolor_sink(GetStdHandle(STD_ERROR_HANDLE)) - {} -}; - -typedef wincolor_stderr_sink wincolor_stderr_sink_mt; -typedef wincolor_stderr_sink wincolor_stderr_sink_st; - -} -} diff --git a/bm/sai_adapter/inc/spdlog/spdlog.h b/bm/sai_adapter/inc/spdlog/spdlog.h deleted file mode 100644 index a505b0031..000000000 --- a/bm/sai_adapter/inc/spdlog/spdlog.h +++ /dev/null @@ -1,178 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// -// spdlog main header file. -// see example.cpp for usage example - -#pragma once - -#define SPDLOG_VERSION "0.12.0" - -#include -#include -#include - -#include -#include -#include -#include - -namespace spdlog -{ - -// -// Return an existing logger or nullptr if a logger with such name doesn't exist. -// example: spdlog::get("my_logger")->info("hello {}", "world"); -// -std::shared_ptr get(const std::string& name); - - -// -// Set global formatting -// example: spdlog::set_pattern("%Y-%m-%d %H:%M:%S.%e %l : %v"); -// -void set_pattern(const std::string& format_string); -void set_formatter(formatter_ptr f); - -// -// Set global logging level for -// -void set_level(level::level_enum log_level); - -// -// Set global error handler -// -void set_error_handler(log_err_handler); - -// -// Turn on async mode (off by default) and set the queue size for each async_logger. -// effective only for loggers created after this call. -// queue_size: size of queue (must be power of 2): -// Each logger will pre-allocate a dedicated queue with queue_size entries upon construction. -// -// async_overflow_policy (optional, block_retry by default): -// async_overflow_policy::block_retry - if queue is full, block until queue has room for the new log entry. -// async_overflow_policy::discard_log_msg - never block and discard any new messages when queue overflows. -// -// worker_warmup_cb (optional): -// callback function that will be called in worker thread upon start (can be used to init stuff like thread affinity) -// -// worker_teardown_cb (optional): -// callback function that will be called in worker thread upon exit -// -void set_async_mode(size_t queue_size, const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, const std::function& worker_warmup_cb = nullptr, const std::chrono::milliseconds& flush_interval_ms = std::chrono::milliseconds::zero(), const std::function& worker_teardown_cb = nullptr); - -// Turn off async mode -void set_sync_mode(); - - -// -// Create and register multi/single threaded basic file logger. -// Basic logger simply writes to given file without any limitatons or rotations. -// -std::shared_ptr basic_logger_mt(const std::string& logger_name, const filename_t& filename, bool truncate = false); -std::shared_ptr basic_logger_st(const std::string& logger_name, const filename_t& filename, bool truncate = false); - -// -// Create and register multi/single threaded rotating file logger -// -std::shared_ptr rotating_logger_mt(const std::string& logger_name, const filename_t& filename, size_t max_file_size, size_t max_files); -std::shared_ptr rotating_logger_st(const std::string& logger_name, const filename_t& filename, size_t max_file_size, size_t max_files); - -// -// Create file logger which creates new file on the given time (default in midnight): -// -std::shared_ptr daily_logger_mt(const std::string& logger_name, const filename_t& filename, int hour=0, int minute=0); -std::shared_ptr daily_logger_st(const std::string& logger_name, const filename_t& filename, int hour=0, int minute=0); - -// -// Create and register stdout/stderr loggers -// -std::shared_ptr stdout_logger_mt(const std::string& logger_name); -std::shared_ptr stdout_logger_st(const std::string& logger_name); -std::shared_ptr stderr_logger_mt(const std::string& logger_name); -std::shared_ptr stderr_logger_st(const std::string& logger_name); -// -// Create and register colored stdout/stderr loggers -// -std::shared_ptr stdout_color_mt(const std::string& logger_name); -std::shared_ptr stdout_color_st(const std::string& logger_name); -std::shared_ptr stderr_color_mt(const std::string& logger_name); -std::shared_ptr stderr_color_st(const std::string& logger_name); - - -// -// Create and register a syslog logger -// -#ifdef SPDLOG_ENABLE_SYSLOG -std::shared_ptr syslog_logger(const std::string& logger_name, const std::string& ident = "", int syslog_option = 0); -#endif - -#if defined(__ANDROID__) -std::shared_ptr android_logger(const std::string& logger_name, const std::string& tag = "spdlog"); -#endif - -// Create and register a logger a single sink -std::shared_ptr create(const std::string& logger_name, const sink_ptr& sink); - -// Create and register a logger with multiple sinks -std::shared_ptr create(const std::string& logger_name, sinks_init_list sinks); -template -std::shared_ptr create(const std::string& logger_name, const It& sinks_begin, const It& sinks_end); - - -// Create and register a logger with templated sink type -// Example: -// spdlog::create("mylog", "dailylog_filename"); -template -std::shared_ptr create(const std::string& logger_name, Args...); - - -// Register the given logger with the given name -void register_logger(std::shared_ptr logger); - -// Apply a user defined function on all registered loggers -// Example: -// spdlog::apply_all([&](std::shared_ptr l) {l->flush();}); -void apply_all(std::function)> fun); - -// Drop the reference to the given logger -void drop(const std::string &name); - -// Drop all references from the registry -void drop_all(); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Trace & Debug can be switched on/off at compile time for zero cost debug statements. -// Uncomment SPDLOG_DEBUG_ON/SPDLOG_TRACE_ON in teakme.h to enable. -// SPDLOG_TRACE(..) will also print current file and line. -// -// Example: -// spdlog::set_level(spdlog::level::trace); -// SPDLOG_TRACE(my_logger, "some trace message"); -// SPDLOG_TRACE(my_logger, "another trace message {} {}", 1, 2); -// SPDLOG_DEBUG(my_logger, "some debug message {} {}", 3, 4); -/////////////////////////////////////////////////////////////////////////////// - -#ifdef SPDLOG_TRACE_ON -#define SPDLOG_STR_H(x) #x -#define SPDLOG_STR_HELPER(x) SPDLOG_STR_H(x) -#define SPDLOG_TRACE(logger, ...) logger->trace("[" __FILE__ " line #" SPDLOG_STR_HELPER(__LINE__) "] " __VA_ARGS__) -#else -#define SPDLOG_TRACE(logger, ...) -#endif - -#ifdef SPDLOG_DEBUG_ON -#define SPDLOG_DEBUG(logger, ...) logger->debug(__VA_ARGS__) -#else -#define SPDLOG_DEBUG(logger, ...) -#endif - - -} - - -#include diff --git a/bm/sai_adapter/inc/spdlog/tweakme.h b/bm/sai_adapter/inc/spdlog/tweakme.h deleted file mode 100644 index 86f66b9e0..000000000 --- a/bm/sai_adapter/inc/spdlog/tweakme.h +++ /dev/null @@ -1,108 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#pragma once - -/////////////////////////////////////////////////////////////////////////////// -// -// Edit this file to squeeze more performance, and to customize supported features -// -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Under Linux, the much faster CLOCK_REALTIME_COARSE clock can be used. -// This clock is less accurate - can be off by dozens of millis - depending on the kernel HZ. -// Uncomment to use it instead of the regular clock. -// -// #define SPDLOG_CLOCK_COARSE -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment if date/time logging is not needed and never appear in the log pattern. -// This will prevent spdlog from quering the clock on each log call. -// -// WARNING: If the log pattern contains any date/time while this flag is on, the result is undefined. -// You must set new pattern(spdlog::set_pattern(..") without any date/time in it -// -// #define SPDLOG_NO_DATETIME -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment if thread id logging is not needed (i.e. no %t in the log pattern). -// This will prevent spdlog from quering the thread id on each log call. -// -// WARNING: If the log pattern contains thread id (i.e, %t) while this flag is on, the result is undefined. -// -// #define SPDLOG_NO_THREAD_ID -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment if logger name logging is not needed. -// This will prevent spdlog from copying the logger name on each log call. -// -// #define SPDLOG_NO_NAME -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to enable the SPDLOG_DEBUG/SPDLOG_TRACE macros. -// -// #define SPDLOG_DEBUG_ON -// #define SPDLOG_TRACE_ON -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to avoid locking in the registry operations (spdlog::get(), spdlog::drop() spdlog::register()). -// Use only if your code never modifes concurrently the registry. -// Note that upon creating a logger the registry is modified by spdlog.. -// -// #define SPDLOG_NO_REGISTRY_MUTEX -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to avoid spdlog's usage of atomic log levels -// Use only if your code never modifies a logger's log levels concurrently by different threads. -// -// #define SPDLOG_NO_ATOMIC_LEVELS -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to enable usage of wchar_t for file names on Windows. -// -// #define SPDLOG_WCHAR_FILENAMES -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to override default eol ("\n" or "\r\n" under Linux/Windows) -// -// #define SPDLOG_EOL ";-)\n" -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to use your own copy of the fmt library instead of spdlog's copy. -// In this case spdlog will try to include so set your -I flag accordingly. -// -// #define SPDLOG_FMT_EXTERNAL -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to enable syslog (disabled by default) -// -// #define SPDLOG_ENABLE_SYSLOG -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Uncomment to prevent child processes from inheriting log file descriptors -// -// #define SPDLOG_PREVENT_CHILD_FD -/////////////////////////////////////////////////////////////////////////////// diff --git a/bm/sai_adapter/inc/switch_meta_data.h b/bm/sai_adapter/inc/switch_meta_data.h deleted file mode 100644 index 8cde05b40..000000000 --- a/bm/sai_adapter/inc/switch_meta_data.h +++ /dev/null @@ -1,339 +0,0 @@ -#ifndef SWITCH_META_DATA_H -#define SWITCH_META_DATA_H - -#define NULL_HANDLE -1 -#include "spdlog/spdlog.h" -#include -#include -#include -#include -#include -#include - -using namespace bm_runtime::standard; - -class sai_id_map_t { // object pointer and it's id -protected: - std::map id_map; - std::vector unused_id; - -public: - sai_id_map_t() { - // init - unused_id.clear(); - id_map.clear(); - } - - ~sai_id_map_t() {} - - void free_id(sai_object_id_t sai_object_id) { - spdlog::get("logger")->debug("freeing object with sai_id {}", - sai_object_id); - delete id_map[sai_object_id]; - id_map.erase(sai_object_id); - unused_id.push_back(sai_object_id); - } - - sai_object_id_t get_new_id(void *obj_ptr) { // pointer to object - sai_object_id_t id; - if (!unused_id.empty()) { - id = unused_id.back(); - unused_id.pop_back(); - } else { - id = id_map.size(); - } - id_map[id] = obj_ptr; - return id; - } - - void *get_object(sai_object_id_t sai_object_id) { - return id_map[sai_object_id]; - } -}; - -class Sai_obj { -public: - sai_object_id_t sai_object_id; // TODO maybe use the map and don't save here - Sai_obj(sai_id_map_t *sai_id_map_ptr) { - sai_object_id = - sai_id_map_ptr->get_new_id(this); // sai_id_map. set map to true. - } - ~Sai_obj() { - // free_id(sai_object_id); TODO: fix this - } -}; - -class Port_obj : public Sai_obj { -public: - uint32_t hw_port; - uint32_t l2_if; - uint32_t pvid; - uint32_t bind_mode; - uint32_t mtu; - uint32_t drop_tagged; - uint32_t drop_untagged; - bool is_lag; - BmEntryHandle handle_lag_if; - BmEntryHandle handle_port_cfg; - BmEntryHandle handle_ingress_lag; - Port_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - // printf("create port object"); - this->mtu = 1512; - this->drop_tagged = 0; - this->drop_untagged = 0; - this->hw_port = 0; - this->l2_if = 0; - this->pvid = 1; - this->bind_mode = SAI_PORT_BIND_MODE_PORT; - this->is_lag = false; - this->handle_ingress_lag = NULL_HANDLE; - this->handle_port_cfg = NULL_HANDLE; - this->handle_lag_if = NULL_HANDLE; - } -}; - -class BridgePort_obj : public Sai_obj { -public: - uint32_t port_id; - uint32_t vlan_id; - uint32_t bridge_port; - sai_bridge_port_type_t bridge_port_type; - sai_object_id_t bridge_id; - BmEntryHandle handle_id_1d; - BmEntryHandle handle_egress_set_vlan; - BmEntryHandle handle_egress_br_port_to_if; - BmEntryHandle handle_subport_ingress_interface_type; - BmEntryHandle handle_port_ingress_interface_type; - // BmEntryHandle handle_cfg; // TODO - BridgePort_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - this->port_id = 0; - this->vlan_id = 1; - this->bridge_port = NULL; - this->bridge_id = NULL; - this->bridge_port_type = SAI_BRIDGE_PORT_TYPE_PORT; - // TODO NULL_HANDLE is inavlid. consider other notation - this->handle_id_1d = NULL_HANDLE; - this->handle_egress_set_vlan = NULL_HANDLE; - this->handle_egress_br_port_to_if = NULL_HANDLE; - this->handle_subport_ingress_interface_type = NULL_HANDLE; - this->handle_port_ingress_interface_type = NULL_HANDLE; - } -}; - -class Bridge_obj : public Sai_obj { -public: - sai_bridge_type_t bridge_type; - std::vector bridge_port_list; - uint32_t bridge_id; // Valid for .1D bridges. - Bridge_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - this->bridge_type = SAI_BRIDGE_TYPE_1Q; - this->bridge_port_list.clear(); - this->bridge_id = 1; - } -}; - -class Vlan_obj : public Sai_obj { -public: - uint16_t vid; - uint32_t bridge_id; // Valid for .1Q bridge - std::vector vlan_members; - BmEntryHandle handle_id_1q; - Vlan_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - this->vlan_members.clear(); - this->vid = 0; - this->handle_id_1q = NULL_HANDLE; - } -}; - -class Vlan_member_obj : public Sai_obj { -public: - sai_object_id_t bridge_port_id; - sai_object_id_t vlan_oid; - uint32_t tagging_mode; - uint16_t vid; - BmEntryHandle handle_egress_vlan_tag; - BmEntryHandle handle_egress_vlan_filtering; - BmEntryHandle handle_ingress_vlan_filtering; - Vlan_member_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - this->vid = NULL_HANDLE; - this->vlan_oid = NULL_HANDLE; // TODO needed? consider remove. - this->tagging_mode = SAI_VLAN_TAGGING_MODE_UNTAGGED; - this->bridge_port_id = NULL_HANDLE; - } -}; - -class Lag_obj : public Sai_obj { -public: - uint32_t l2_if; - std::vector lag_members; - BmEntryHandle handle_lag_hash; - BmEntryHandle handle_port_configurations; - Port_obj *port_obj; - Lag_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - this->lag_members.clear(); - this->l2_if = 0; - this->port_obj = NULL; - this->handle_lag_hash = NULL_HANDLE; - this->handle_port_configurations = NULL_HANDLE; - } -}; - -class Lag_member_obj : public Sai_obj { -public: - Port_obj *port; - Lag_obj *lag; - BmEntryHandle handle_egress_lag; - Lag_member_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - this->port = NULL; - this->lag = NULL; - this->handle_egress_lag = NULL_HANDLE; - } -}; - -class HostIF_obj : public Sai_obj { -public: - Port_obj *port; - sai_hostif_type_t hostif_type; - std::string netdev_name; - HostIF_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - this->port = nullptr; - this->hostif_type = SAI_HOSTIF_TYPE_NETDEV; - this->netdev_name = ""; - } -}; - -class HostIF_Table_obj : public Sai_obj { -public: - - HostIF_Table_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - - } -}; - -class HostIF_Trap_obj : public Sai_obj { -public: - - HostIF_Trap_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - - } -}; - -class HostIF_Trap_Group_obj : public Sai_obj { -public: - - HostIF_Trap_Group_obj(sai_id_map_t *sai_id_map_ptr) : Sai_obj(sai_id_map_ptr) { - - } -}; - -typedef std::map bridge_port_id_map_t; -typedef std::map port_id_map_t; -typedef std::map bridge_id_map_t; -typedef std::map vlan_id_map_t; -typedef std::map vlan_member_id_map_t; -typedef std::map lag_id_map_t; -typedef std::map l2_if_map_t; -typedef std::map lag_member_id_map_t; -typedef std::map hostif_id_map_t; -typedef std::map hostif_table_id_map_t; -typedef std::map hostif_trap_id_map_t; -typedef std::map hostif_trap_group_id_map_t; -class Switch_metadata { // TODO: add default.. // this object_id is the - // switch_id -public: - sai_u32_list_t hw_port_list; - port_id_map_t ports; - bridge_port_id_map_t bridge_ports; - bridge_id_map_t bridges; - vlan_id_map_t vlans; - vlan_member_id_map_t vlan_members; - lag_id_map_t lags; - lag_member_id_map_t lag_members; - hostif_id_map_t hostifs; - hostif_table_id_map_t hostif_tables; - hostif_trap_id_map_t hostif_traps; - hostif_trap_group_id_map_t hostif_trap_groups; - sai_object_id_t default_bridge_id; - Switch_metadata() { - ports.clear(); - bridge_ports.clear(); - bridges.clear(); - vlans.clear(); - vlan_members.clear(); - lags.clear(); - } - - uint16_t GetVlanObjIdFromVid(uint16_t vid) { - for (vlan_id_map_t::iterator it = vlans.begin(); it != vlans.end(); ++it) { - if (it->second->vid == vid) { - return it->first; - } - } - return 0; - } - - uint32_t GetNewBridgePort() { - std::vector bridge_port_nums; - for (bridge_port_id_map_t::iterator it = bridge_ports.begin(); - it != bridge_ports.end(); ++it) { - bridge_port_nums.push_back(it->second->bridge_port); - spdlog::get("logger")->debug("{} ", it->second->bridge_port); - } - for (int i = 0; i < bridge_port_nums.size(); ++i) { - if (std::find(bridge_port_nums.begin(), bridge_port_nums.end(), i) == - bridge_port_nums.end()) { - spdlog::get("logger")->debug("-->GetNewBridgePort: bridge_port is: {} ", - i); - return i; - } - } - spdlog::get("logger")->debug("--> GetNewBridgePort: bridge_port is: {} ", - bridge_port_nums.size()); - return bridge_port_nums.size(); - } - - uint32_t GetNewBridgeID(uint32_t prefered_id) { - std::vector bridge_ids; - for (bridge_id_map_t::iterator it = bridges.begin(); it != bridges.end(); - ++it) { - bridge_ids.push_back(it->second->bridge_id); - } - for (vlan_id_map_t::iterator it = vlans.begin(); it != vlans.end(); ++it) { - bridge_ids.push_back(it->second->bridge_id); - } - - if (std::find(bridge_ids.begin(), bridge_ids.end(), prefered_id) == - bridge_ids.end()) { - return prefered_id; - } - - for (int i = 0; i < bridge_ids.size(); ++i) { - if (std::find(bridge_ids.begin(), bridge_ids.end(), i) == - bridge_ids.end()) { - return i; - } - } - return bridge_ids.size(); - } - uint32_t GetNewL2IF() { - std::vector l2_ifs_nums; - for (port_id_map_t::iterator it = ports.begin(); it != ports.end(); ++it) { - l2_ifs_nums.push_back(it->second->l2_if); - } - for (lag_id_map_t::iterator it = lags.begin(); it != lags.end(); ++it) { - l2_ifs_nums.push_back(it->second->l2_if); - } - for (int i = 0; i < l2_ifs_nums.size(); ++i) { - if (std::find(l2_ifs_nums.begin(), l2_ifs_nums.end(), i) == - l2_ifs_nums.end()) { - spdlog::get("logger")->debug("--> Get_New_L2_if: new if is: {} ", i); - return i; - } - } - spdlog::get("logger")->debug("--> Get_New_L2_if: new if is: {} ", - l2_ifs_nums.size()); - return l2_ifs_nums.size(); - } -}; - -#endif diff --git a/bm/sai_adapter/inc/tun_if.h b/bm/sai_adapter/inc/tun_if.h deleted file mode 100644 index ae0844946..000000000 --- a/bm/sai_adapter/inc/tun_if.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TUN_IF_H -#define TUN_IF_H -int tun_alloc(char*, int); -#endif \ No newline at end of file diff --git a/bm/sai_adapter/src/.gitignore b/bm/sai_adapter/src/.gitignore deleted file mode 100644 index 857da5b5b..000000000 --- a/bm/sai_adapter/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -sai_adapter \ No newline at end of file diff --git a/bm/sai_adapter/src/logs/.gitignore b/bm/sai_adapter/src/logs/.gitignore deleted file mode 100644 index 314f02b1b..000000000 --- a/bm/sai_adapter/src/logs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.txt \ No newline at end of file diff --git a/bm/sai_adapter/src/obj/.gitignore b/bm/sai_adapter/src/obj/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/bm/sai_adapter/src/sai.c b/bm/sai_adapter/src/sai.c deleted file mode 100644 index 1102a62c6..000000000 --- a/bm/sai_adapter/src/sai.c +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -#include "../inc/sai_adapter_interface.h" -#include -// static sai_api_service_t sai_api_service; -static S_O_Handle sai_adapter; -static sai_api_t api_id = SAI_API_UNSPECIFIED; -// switch_device_t device = 0; - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -static const char *module[] = { - "UNSPECIFIED", - "SWITCH", - "PORT", - "FDB", - "VLAN", - "VIRTUAL_ROUTER", - "ROUTE", - "NEXT_HOP", - "NEXT_HOP_GROUP", - "ROUTER_INTERFACE", - "NEIGHBOR", - "ACL", - "HOST_INTERFACE", - "MIRROR", - "SAMPLEPACKET", - "STP", - "LAG", - "POLICER", - "WRED", - "QOS_MAP", - "QUEUE", - "SCHEDULER", - "SCHEDULER_GROUP", - "BUFFERS", - "HASH", - "UDF", - "IPMC", - "L2MC", -}; - -sai_status_t sai_api_query(sai_api_t sai_api_id, void **api_method_table) { - sai_status_t status = SAI_STATUS_SUCCESS; - - // SAI_LOG_ENTER(); - - if (!api_method_table) { - status = SAI_STATUS_INVALID_PARAMETER; - // SAI_LOG_ERROR("null api method table: %s", sai_status_to_string(status)); - return status; - } - - status = sai_adapter_api_query(sai_adapter, sai_api_id, api_method_table); - return status; -} - -sai_status_t sai_api_initialize(uint64_t flags, - const service_method_table_t *services) { - sai_adapter = create_sai_adapter(); -} - -sai_status_t sai_api_uninitialize(void) { - free_sai_adapter(sai_adapter); -} - -#ifdef __cplusplus -} -#endif /* __cplusplus */ \ No newline at end of file diff --git a/bm/sai_adapter/src/sai_adapter.cpp b/bm/sai_adapter/src/sai_adapter.cpp deleted file mode 100644 index 8c40a4afa..000000000 --- a/bm/sai_adapter/src/sai_adapter.cpp +++ /dev/null @@ -1,199 +0,0 @@ -#include "../inc/sai_adapter.h" - -StandardClient *sai_adapter::bm_client_ptr; -sai_id_map_t *sai_adapter::sai_id_map_ptr; -Switch_metadata *sai_adapter::switch_metadata_ptr; -std::vector *sai_adapter::switch_list_ptr; -std::shared_ptr *sai_adapter::logger; -bool sai_adapter::pcap_loop_started; -std::mutex sai_adapter::m; - -sai_adapter::sai_adapter() - : // constructor pre initializations - socket(new TSocket("localhost", bm_port)), - transport(new TBufferedTransport(socket)), - bprotocol(new TBinaryProtocol(transport)), - protocol(new TMultiplexedProtocol(bprotocol, "standard")), - bm_client(protocol) { - // logger - logger_o = spdlog::get("logger"); - if (logger_o == 0) { - logger_o = spdlog::basic_logger_mt("logger", "logs/log.txt"); - logger_o->flush_on(spdlog::level::info); // make err - spdlog::set_pattern("[thread %t] [%l] %v "); // add %T for time - } - logger = &logger_o; - - // start P4 link - switch_list_ptr = &switch_list; - switch_metadata_ptr = &switch_metadata; - switch_metadata.hw_port_list.list = list; - switch_metadata.hw_port_list.count = 8; - bm_client_ptr = &bm_client; - sai_id_map_ptr = &sai_id_map; - transport->open(); - - // api set - switch_api.create_switch = &sai_adapter::create_switch; - switch_api.get_switch_attribute = &sai_adapter::get_switch_attribute; - - port_api.create_port = &sai_adapter::create_port; - port_api.remove_port = &sai_adapter::remove_port; - port_api.set_port_attribute = &sai_adapter::set_port_attribute; - port_api.get_port_attribute = &sai_adapter::get_port_attribute; - - bridge_api.create_bridge = &sai_adapter::create_bridge; - bridge_api.remove_bridge = &sai_adapter::remove_bridge; - bridge_api.get_bridge_attribute = &sai_adapter::get_bridge_attribute; - bridge_api.create_bridge_port = &sai_adapter::create_bridge_port; - bridge_api.remove_bridge_port = &sai_adapter::remove_bridge_port; - bridge_api.get_bridge_port_attribute = - &sai_adapter::get_bridge_port_attribute; - - fdb_api.create_fdb_entry = &sai_adapter::create_fdb_entry; - fdb_api.remove_fdb_entry = &sai_adapter::remove_fdb_entry; - - vlan_api.create_vlan = &sai_adapter::create_vlan; - vlan_api.remove_vlan = &sai_adapter::remove_vlan; - vlan_api.set_vlan_attribute = &sai_adapter::set_vlan_attribute; - vlan_api.get_vlan_attribute = &sai_adapter::get_vlan_attribute; - vlan_api.create_vlan_member = &sai_adapter::create_vlan_member; - vlan_api.remove_vlan_member = &sai_adapter::remove_vlan_member; - vlan_api.set_vlan_member_attribute = &sai_adapter::set_vlan_member_attribute; - vlan_api.get_vlan_member_attribute = &sai_adapter::get_vlan_member_attribute; - vlan_api.get_vlan_stats = &sai_adapter::get_vlan_stats; - vlan_api.clear_vlan_stats = &sai_adapter::clear_vlan_stats; - - lag_api.create_lag = &sai_adapter::create_lag; - lag_api.remove_lag = &sai_adapter::remove_lag; - lag_api.create_lag_member = &sai_adapter::create_lag_member; - lag_api.remove_lag_member = &sai_adapter::remove_lag_member; - - hostif_api.create_hostif = &sai_adapter::create_hostif; - hostif_api.remove_hostif = &sai_adapter::remove_hostif; - hostif_api.create_hostif_table_entry = &sai_adapter::create_hostif_table_entry; - hostif_api.remove_hostif_table_entry = &sai_adapter::remove_hostif_table_entry; - hostif_api.create_hostif_trap_group = &sai_adapter::create_hostif_trap_group; - hostif_api.remove_hostif_trap_group = &sai_adapter::remove_hostif_trap_group; - hostif_api.create_hostif_trap = &sai_adapter::create_hostif_trap; - hostif_api.remove_hostif_trap = &sai_adapter::remove_hostif_trap; - - startSaiAdapterMain(); - printf("startSaiAdapterMain\n"); - (*logger)->info("BM connection started on port {}", bm_port); -} - -sai_adapter::~sai_adapter() { - endSaiAdapterMain(); - transport->close(); - (*logger)->info("BM clients closed\n"); -} - -sai_status_t sai_adapter::sai_api_query(sai_api_t sai_api_id, - void **api_method_table) { - switch (sai_api_id) { - case SAI_API_PORT: - *api_method_table = &port_api; - break; - case SAI_API_BRIDGE: - *api_method_table = &bridge_api; - break; - case SAI_API_FDB: - *api_method_table = &fdb_api; - break; - case SAI_API_SWITCH: - *api_method_table = &switch_api; - break; - case SAI_API_VLAN: - *api_method_table = &vlan_api; - break; - case SAI_API_LAG: - *api_method_table = &lag_api; - break; - case SAI_API_HOSTIF: - *api_method_table = &hostif_api; - break; - default: - (*logger)->info("api requested was %d, while sai_api_port is %d\n", - sai_api_id, SAI_API_PORT); - return SAI_STATUS_FAILURE; - } - return SAI_STATUS_SUCCESS; -} - -void sai_adapter::internal_init_switch() { - sai_object_id_t switch_id2; - (*logger)->info("Switch init with default configurations"); - switch_api.create_switch(&switch_id2, 0, NULL); - (*logger)->info("Switch init with default configurations done"); - return; -} - -void sai_adapter::startSaiAdapterMain() { - internal_init_switch(); - pcap_loop_started = false; - SaiAdapterThread = std::thread(&sai_adapter::SaiAdapterMain, this); - { - std::unique_lock lk(m); - cv.wait(lk,[]{return pcap_loop_started;}); - } - std::this_thread::sleep_for(std::chrono::milliseconds(500)); // TODO consider later release of lock - (*logger)->info("Sniffer initialization done"); -} - -void sai_adapter::endSaiAdapterMain() { - pcap_breakloop(adapter_pcap); - pcap_close(adapter_pcap); - SaiAdapterThread.join(); -} - -void sai_adapter::SaiAdapterMain() { - (*logger)->info("SAI Adapter Thread Started"); - // Change to sai_adapter network namespace (hostif_net) - int fd = open("/var/run/netns/hostif_net", - O_RDONLY); /* Get descriptor for namespace */ - if (fd == -1) { - (*logger)->error("open netns fd failed"); - release_pcap_lock(); - return; - } - if (setns(fd, 0) == -1) { /* Join that namespace */ - (*logger)->error("setns failed"); - release_pcap_lock(); - return; - } - - PacketSniffer(); - (*logger)->info("SAI Adapter Thread Ended"); -} - -std::string parse_param(uint64_t param, uint32_t num_of_bytes) { - std::string my_string = std::string( - static_cast(static_cast(¶m)), num_of_bytes); - std::reverse(my_string.begin(), my_string.end()); - return my_string; -} - -BmMatchParam parse_exact_match_param(uint64_t param, uint32_t num_of_bytes) { - BmMatchParam match_param; - match_param.type = BmMatchParamType::type::EXACT; - BmMatchParamExact match_param_exact; - match_param_exact.key = parse_param(param, num_of_bytes); - match_param.__set_exact(match_param_exact); - return match_param; -} - -BmMatchParam parse_valid_match_param(bool param) { - BmMatchParam match_param; - match_param.type = BmMatchParamType::type::VALID; - BmMatchParamValid match_param_valid; - match_param_valid.key = param; - match_param.__set_valid(match_param_valid); - return match_param; -} - -uint64_t parse_mac_64(uint8_t const mac_8[6]) { - uint64_t mac_64 = 0; - memcpy(&mac_64, mac_8, 6); - return mac_64; -} \ No newline at end of file diff --git a/bm/sai_adapter/src/sai_adapter_interface.cpp b/bm/sai_adapter/src/sai_adapter_interface.cpp deleted file mode 100644 index ddc09f5dc..000000000 --- a/bm/sai_adapter/src/sai_adapter_interface.cpp +++ /dev/null @@ -1,266 +0,0 @@ -#include "../inc/sai_adapter_interface.h" -#include "../inc/sai_adapter.h" -#include "../inc/switch_meta_data.h" - -extern "C" { -S_O_Handle create_sai_adapter() { - return new sai_adapter(); -} -void free_sai_adapter(S_O_Handle p) { - sai_adapter *q = (sai_adapter *)p; - // q->~sai_adapter(); - delete q; -} - -// API -sai_status_t sai_adapter_api_query(S_O_Handle p, sai_api_t sai_api_id, - void **api_method_table) { - sai_adapter *q = (sai_adapter *)p; - return q->sai_api_query(sai_api_id, api_method_table); -} -// SWITCH -sai_status_t sai_adapter_create_switch(S_O_Handle p, sai_object_id_t *switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_switch(switch_id, attr_count, attr_list); -} -sai_status_t sai_adapter_get_switch_attribute(S_O_Handle p, - sai_object_id_t switch_id, - sai_uint32_t attr_count, - sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->get_switch_attribute(switch_id, attr_count, attr_list); -} - -// PORT -sai_status_t sai_adapter_create_port(S_O_Handle p, sai_object_id_t *port_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_port(port_id, switch_id, attr_count, attr_list); -} - -sai_status_t sai_adapter_remove_port(S_O_Handle p, sai_object_id_t port_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_port(port_id); -} - -sai_status_t sai_adapter_set_port_attribute(S_O_Handle p, - sai_object_id_t port_id, - sai_attribute_t *attr) { - sai_adapter *q = (sai_adapter *)p; - return q->set_port_attribute(port_id, attr); -} - -sai_status_t sai_adapter_get_port_attribute(S_O_Handle p, - sai_object_id_t port_id, - uint32_t attr_count, - sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->get_port_attribute(port_id, attr_count, attr_list); -} - -// BRIDGE -sai_status_t sai_adapter_create_bridge(S_O_Handle p, sai_object_id_t *bridge_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_bridge(bridge_id, switch_id, attr_count, attr_list); -} -sai_status_t sai_adapter_remove_bridge(S_O_Handle p, - sai_object_id_t bridge_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_bridge(bridge_id); -} -sai_status_t get_bridge_attribute(S_O_Handle p, sai_object_id_t bridge_id, - uint32_t attr_count, - sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->get_bridge_attribute(bridge_id, attr_count, attr_list); -} - -// BRIDGE PORT -sai_status_t sai_adapter_create_bridge_port(S_O_Handle p, - sai_object_id_t *bridge_port_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_bridge_port(bridge_port_id, switch_id, attr_count, - attr_list); -} -sai_status_t sai_adapter_remove_bridge_port(S_O_Handle p, - sai_object_id_t bridge_port_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_bridge_port(bridge_port_id); -} -sai_status_t get_bridge_port_attribute(S_O_Handle p, - sai_object_id_t bridge_port_id, - uint32_t attr_count, - sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->get_bridge_port_attribute(bridge_port_id, attr_count, attr_list); -} - -// FDB -sai_status_t sai_adapter_create_fdb_entry(S_O_Handle p, - sai_fdb_entry_t *fdb_entry, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_fdb_entry(fdb_entry, attr_count, attr_list); -} -sai_status_t sai_adapter_remove_fdb_entry(S_O_Handle p, - sai_fdb_entry_t *fdb_entry) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_fdb_entry(fdb_entry); -} - -// VLAN -sai_status_t sai_adapter_create_vlan(S_O_Handle p, sai_object_id_t *vlan_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_vlan(vlan_id, switch_id, attr_count, attr_list); -} -sai_status_t sai_adapter_remove_vlan(S_O_Handle p, sai_object_id_t vlan_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_vlan(vlan_id); -} - -sai_status_t sai_adapter_set_vlan_attribute(S_O_Handle p, - sai_object_id_t vlan_id, - const sai_attribute_t *attr) { - sai_adapter *q = (sai_adapter *)p; - return q->set_vlan_attribute(vlan_id, attr); -} - -sai_status_t sai_adapter_get_vlan_attribute(S_O_Handle p, - sai_object_id_t vlan_id, - const uint32_t attr_count, - sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->get_vlan_attribute(vlan_id, attr_count, attr_list); -} - -sai_status_t sai_adapter_create_vlan_member(S_O_Handle p, - sai_object_id_t *vlan_member_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_vlan_member(vlan_member_id, switch_id, attr_count, - attr_list); -} -sai_status_t sai_adapter_remove_vlan_member(S_O_Handle p, - sai_object_id_t vlan_member_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_vlan_member(vlan_member_id); -} -sai_status_t sai_adapter_set_vlan_member_attribute( - S_O_Handle p, sai_object_id_t vlan_member_id, const sai_attribute_t *attr) { - sai_adapter *q = (sai_adapter *)p; - return q->set_vlan_member_attribute(vlan_member_id, attr); -} -sai_status_t sai_adapter_get_vlan_member_attribute( - S_O_Handle p, sai_object_id_t vlan_member_id, const uint32_t attr_count, - sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->get_vlan_member_attribute(vlan_member_id, attr_count, attr_list); -} -sai_status_t sai_adapter_get_vlan_stats(S_O_Handle p, sai_object_id_t vlan_id, - const sai_vlan_stat_t *counter_ids, - uint32_t number_of_counters, - uint64_t *counters) { - sai_adapter *q = (sai_adapter *)p; - return q->get_vlan_stats(vlan_id, counter_ids, number_of_counters, counters); -} -sai_status_t sai_adapter_clear_vlan_stats(S_O_Handle p, sai_object_id_t vlan_id, - const sai_vlan_stat_t *counter_ids, - uint32_t number_of_counters) { - sai_adapter *q = (sai_adapter *)p; - return q->clear_vlan_stats(vlan_id, counter_ids, number_of_counters); -} - -// LAG -sai_status_t sai_adapter_create_lag(S_O_Handle p, sai_object_id_t *lag_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_lag(lag_id, switch_id, attr_count, attr_list); -} -sai_status_t sai_adapter_remove_lag(S_O_Handle p, sai_object_id_t lag_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_lag(lag_id); -} -sai_status_t sai_adapter_create_lag_member(S_O_Handle p, - sai_object_id_t *lag_member_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_lag_member(lag_member_id, switch_id, attr_count, attr_list); -} -sai_status_t sai_adapter_remove_lag_member(S_O_Handle p, - sai_object_id_t lag_member_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_lag_member(lag_member_id); -} - -// hostif -sai_status_t sai_adapter_create_hostif(S_O_Handle p, sai_object_id_t *hif_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_hostif(hif_id, switch_id, attr_count, attr_list); -} -sai_status_t sai_adapter_remove_hostif(S_O_Handle p, sai_object_id_t hif_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_hostif(hif_id); -} -sai_status_t sai_adapter_create_hostif_table_entry( - S_O_Handle p, sai_object_id_t *hif_table_entry, sai_object_id_t switch_id, - uint32_t attr_count, const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_hostif_table_entry(hif_table_entry, switch_id, attr_count, - attr_list); -} -sai_status_t sai_adapter_remove_hostif_table_entry( - S_O_Handle p, sai_object_id_t hif_table_entry) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_hostif_table_entry(hif_table_entry); -} -sai_status_t sai_adapter_create_hostif_trap_group( - S_O_Handle p, sai_object_id_t *hostif_trap_group_id, - sai_object_id_t switch_id, uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_hostif_trap_group(hostif_trap_group_id, switch_id, - attr_count, attr_list); -} -sai_status_t sai_adapter_remove_hostif_trap_group( - S_O_Handle p, sai_object_id_t hostif_trap_group_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_hostif_trap_group(hostif_trap_group_id); -} -sai_status_t sai_adapter_create_hostif_trap(S_O_Handle p, - sai_object_id_t *hostif_trap_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - sai_adapter *q = (sai_adapter *)p; - return q->create_hostif_trap(hostif_trap_id, switch_id, attr_count, - attr_list); -} -sai_status_t sai_adapter_remove_hostif_trap(S_O_Handle p, - sai_object_id_t hostif_trap_id) { - sai_adapter *q = (sai_adapter *)p; - return q->remove_hostif_trap(hostif_trap_id); -} -} \ No newline at end of file diff --git a/bm/sai_adapter/src/sai_sniffer.cpp b/bm/sai_adapter/src/sai_sniffer.cpp deleted file mode 100644 index f56621b9f..000000000 --- a/bm/sai_adapter/src/sai_sniffer.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include "../inc/sai_adapter.h" -#include - -#define ETHER_ADDR_LEN 6 -#define CPU_HDR_LEN 6 -#define MAC_LEARN_TRAP_ID 512 - -typedef struct _ethernet_hdr_t { - uint8_t dst_addr[ETHER_ADDR_LEN]; - uint8_t src_addr[ETHER_ADDR_LEN]; - uint16_t ether_type; -} ethernet_hdr_t; - -typedef struct _cpu_hdr_t { // TODO: remove bridge_port and id - unsigned int ingress_port : 8; - unsigned int bridge_port : 8; - unsigned int bridge_id : 16; - unsigned int trap_id : 16; -} cpu_hdr_t; - -void ReverseBytes(uint8_t *byte_arr, int size) { - uint8_t tmp; - for (int lo = 0, hi = size - 1; hi > lo; lo++, hi--) { - tmp = byte_arr[lo]; - byte_arr[lo] = byte_arr[hi]; - byte_arr[hi] = tmp; - } -} - -void print_mac_to_log(const uint8_t *mac, - std::shared_ptr logger) { - logger->info("{0:02X}:{1:02X}:{2:02X}:{3:02X}:{4:02X}:{5:02X}", mac[5], - mac[4], mac[3], mac[2], mac[1], mac[0]); -} - -void sai_adapter::release_pcap_lock(){ - (*logger)->info("release pcap lock"); - std::unique_lock lk(m); - pcap_loop_started = true; - lk.unlock(); - cv.notify_one(); -} - -void sai_adapter::PacketSniffer() { - const char *dev = "host_port"; - - char errbuf[PCAP_ERRBUF_SIZE]; - - (*logger)->info("pcap started on dev {}", dev); - adapter_pcap = pcap_open_live(dev, BUFSIZ, 0, -1, errbuf); - if (adapter_pcap == NULL) { - (*logger)->error("pcap_open_live() failed: {}", errbuf); - release_pcap_lock(); - return; - } - - release_pcap_lock(); - - if (pcap_loop(adapter_pcap, 0, packetHandler, (u_char *)this) == -1) { - (*logger)->error("pcap_loop() failed: {}", pcap_geterr(adapter_pcap)); - } - (*logger)->info("pcap loop ended"); - return; -} - -void sai_adapter::adapter_create_fdb_entry( - sai_object_id_t bridge_port_id, sai_mac_t mac, - sai_fdb_entry_bridge_type_t bridge_type, sai_vlan_id_t vlan_id, - sai_object_id_t bridge_id) { - sai_attribute_t attr[3]; - attr[0].id = SAI_FDB_ENTRY_ATTR_TYPE; - attr[0].value.s32 = SAI_FDB_ENTRY_TYPE_STATIC; - - attr[1].id = SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID; - attr[1].value.oid = bridge_port_id; - - attr[2].id = SAI_FDB_ENTRY_ATTR_PACKET_ACTION; - attr[2].value.s32 = SAI_PACKET_ACTION_FORWARD; - - sai_fdb_entry_t sai_fdb_entry; - sai_fdb_entry.switch_id = 0; - for (int i = 0; i < ETHER_ADDR_LEN; i++) { - sai_fdb_entry.mac_address[i] = mac[i]; - } - sai_fdb_entry.bridge_type = bridge_type; - if (bridge_type == SAI_FDB_ENTRY_BRIDGE_TYPE_1Q) { - sai_fdb_entry.vlan_id = vlan_id; - } - sai_fdb_entry.bridge_id = bridge_id; - fdb_api.create_fdb_entry(&sai_fdb_entry, 3, attr); -} - -void sai_adapter::packetHandler(u_char *userData, - const struct pcap_pkthdr *pkthdr, - const u_char *packet) { - - sai_adapter *adapter = (sai_adapter *)userData; - (*logger)->info("CPU packet captured"); - cpu_hdr_t *cpu_hdr = (cpu_hdr_t *)packet; - ReverseBytes((uint8_t *)cpu_hdr, CPU_HDR_LEN); - ethernet_hdr_t *ether = (ethernet_hdr_t *)(packet + CPU_HDR_LEN); - ReverseBytes((uint8_t *)&(ether->ether_type), 2); - ReverseBytes(ether->dst_addr, 6); - ReverseBytes(ether->src_addr, 6); - if (cpu_hdr->trap_id == 512) { - adapter->learn_mac(cpu_hdr->ingress_port, ether->src_addr); - } -} - -void sai_adapter::learn_mac(uint32_t ingress_port, uint8_t *src_mac) { - // TODO: Add LAG support - BridgePort_obj *bridge_port; - Bridge_obj *bridge; - sai_object_id_t port_id; - for (port_id_map_t::iterator it = switch_metadata_ptr->ports.begin(); - it != switch_metadata_ptr->ports.end(); ++it) { - if (it->second->hw_port == ingress_port) { - port_id = it->first; - break; - } - } - - for (lag_id_map_t::iterator it = switch_metadata_ptr->lags.begin(); - it != switch_metadata_ptr->lags.end(); ++it) { - for (std::vector::iterator mem_it = - it->second->lag_members.begin(); - mem_it != it->second->lag_members.end(); ++mem_it) { - if (switch_metadata_ptr->lag_members[*mem_it]->port->hw_port == - ingress_port) { - (*logger)->info("MAC learning from ingress lag {}", it->first); - port_id = it->first; - break; - } - } - } - - for (bridge_port_id_map_t::iterator it = - switch_metadata_ptr->bridge_ports.begin(); - it != switch_metadata_ptr->bridge_ports.end(); ++it) { - if (it->second->port_id == port_id) { - bridge_port = it->second; - bridge = switch_metadata_ptr->bridges[it->second->bridge_id]; - break; - } - } - - (*logger)->info("MAC learned (bridge sai_object_id {}):", - bridge->sai_object_id); - print_mac_to_log(src_mac, *logger); - sai_fdb_entry_bridge_type_t bridge_type; - if (bridge->bridge_type == SAI_BRIDGE_TYPE_1Q) { - bridge_type = SAI_FDB_ENTRY_BRIDGE_TYPE_1Q; - } else { - bridge_type = SAI_FDB_ENTRY_BRIDGE_TYPE_1D; - } - adapter_create_fdb_entry(bridge_port->sai_object_id, src_mac, bridge_type, - bridge_port->vlan_id, bridge->sai_object_id); -} \ No newline at end of file diff --git a/bm/sai_adapter/src/saibridge.cpp b/bm/sai_adapter/src/saibridge.cpp deleted file mode 100644 index f75da802d..000000000 --- a/bm/sai_adapter/src/saibridge.cpp +++ /dev/null @@ -1,288 +0,0 @@ -#include "../inc/sai_adapter.h" - -sai_status_t sai_adapter::create_bridge(sai_object_id_t *bridge_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - Bridge_obj *bridge = new Bridge_obj(sai_id_map_ptr); - switch_metadata_ptr->bridges[bridge->sai_object_id] = bridge; - - // parsing attributes - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_BRIDGE_ATTR_TYPE: - bridge->bridge_type = (sai_bridge_type_t)attribute.value.s32; - break; - } - } - - if (bridge->bridge_type == SAI_BRIDGE_TYPE_1D) { - uint32_t bridge_id_num = switch_metadata_ptr->GetNewBridgeID(0); - bridge->bridge_id = bridge_id_num; - (*logger)->info("--> Created new .1D bridge {} (sai_object_id={})", - bridge->bridge_id, bridge->sai_object_id); - } else { // 1Q bridge - (*logger)->info("--> Created new .1Q bridge(sai_object_id={})", - bridge->sai_object_id); - } - - *bridge_id = bridge->sai_object_id; - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::remove_bridge(sai_object_id_t bridge_id) { - (*logger)->info("remove bridge: bridge_id {}", bridge_id); - Bridge_obj *bridge = switch_metadata_ptr->bridges[bridge_id]; - switch_metadata_ptr->bridges.erase(bridge->sai_object_id); - sai_id_map_ptr->free_id(bridge->sai_object_id); - // (*logger)->info("bridges.size={}",switch_metadata_ptr->bridges.size()); - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::get_bridge_attribute(sai_object_id_t bridge_id, - uint32_t attr_count, - sai_attribute_t *attr_list) { - int i; - Bridge_obj *bridge = (Bridge_obj *)sai_id_map_ptr->get_object(bridge_id); - for (i = 0; i < attr_count; i++) { - switch ((attr_list + i)->id) { - case SAI_BRIDGE_ATTR_TYPE: - (attr_list + i)->value.s32 = bridge->bridge_type; - break; - case SAI_BRIDGE_ATTR_PORT_LIST: - (attr_list + i)->value.objlist.count = bridge->bridge_port_list.size(); - (attr_list + i)->value.objlist.list = &bridge->bridge_port_list[0]; - break; - } - } -} - -// Bridge Port - -sai_status_t sai_adapter::create_bridge_port(sai_object_id_t *bridge_port_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - uint32_t bridge_port_num = switch_metadata_ptr->GetNewBridgePort(); - BridgePort_obj *bridge_port = new BridgePort_obj(sai_id_map_ptr); - switch_metadata_ptr->bridge_ports[bridge_port->sai_object_id] = bridge_port; - bridge_port->bridge_port = bridge_port_num; - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_BRIDGE_PORT_ATTR_VLAN_ID: - bridge_port->vlan_id = attribute.value.u16; - break; - case SAI_BRIDGE_PORT_ATTR_BRIDGE_ID: - bridge_port->bridge_id = attribute.value.oid; - break; - case SAI_BRIDGE_PORT_ATTR_TYPE: - bridge_port->bridge_port_type = - (sai_bridge_port_type_t)attribute.value.s32; - break; - case SAI_BRIDGE_PORT_ATTR_PORT_ID: - bridge_port->port_id = attribute.value.oid; - break; - } - } - - switch_metadata_ptr->bridges[bridge_port->bridge_id] - ->bridge_port_list.push_back(bridge_port->sai_object_id); - - BmAddEntryOptions options; - BmMatchParams match_params; - BmActionData action_data; - match_params.clear(); - action_data.clear(); - int32_t l2_if_type; - // 1D - if (bridge_port->bridge_port_type == SAI_BRIDGE_PORT_TYPE_SUB_PORT) { - uint32_t bridge_id = - switch_metadata_ptr->bridges[bridge_port->bridge_id]->bridge_id; - match_params.push_back( - parse_exact_match_param(bridge_port->bridge_port, 1)); - action_data.push_back(parse_param(bridge_id, 2)); - bridge_port->handle_id_1d = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_bridge_id_1d", match_params, "action_set_bridge_id", - action_data, options); - action_data.clear(); - action_data.push_back(parse_param(bridge_port->vlan_id, 2)); - bridge_port->handle_egress_set_vlan = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_set_vlan", match_params, "action_set_vlan", - action_data, options); - l2_if_type = 2; - } - // 1Q - else if (bridge_port->bridge_port_type == SAI_BRIDGE_PORT_TYPE_PORT) { - // match_params.clear(); - // match_params.push_back(parse_exact_match_param(bridge_port->vlan_id, 2)); - // action_data.clear(); - // action_data.push_back(parse_param(bridge_id, 2)); - // if (bridge_port->handle_id_1q == NULL_HANDLE) { - // try { - // BmMtEntry entry; - // bm_client_ptr->bm_mt_get_entry_from_key( - // entry, cxt_id, "table_bridge_id_1q", match_params, options); - // bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_bridge_id_1q", - // entry.entry_handle); - // } catch (...) { - // (*logger)->debug("--> InvalidTableOperation while removing " - // "table_bridge_id_1q entry"); - // } - // (*logger)->debug("--> adding table_bridge_id_1q entry, key:{}", - // bridge_port->vlan_id); - // bridge_port->handle_id_1q = bm_client_ptr->bm_mt_add_entry( - // cxt_id, "table_bridge_id_1q", match_params, "action_set_bridge_id", - // action_data, options); - // } - l2_if_type = 3; - } - - uint32_t bind_mode; - uint32_t l2_if; - uint32_t is_lag; - port_id_map_t::iterator it = - switch_metadata_ptr->ports.find(bridge_port->port_id); - if (it != switch_metadata_ptr->ports.end()) { // port_id is port - Port_obj *port = (Port_obj *)it->second; - bind_mode = port->bind_mode; - l2_if = port->l2_if; - is_lag = 0; - } else { // port_id is lag - Lag_obj *lag = (Lag_obj *)sai_id_map_ptr->get_object(bridge_port->port_id); - bind_mode = lag->port_obj->bind_mode; - l2_if = lag->l2_if; - is_lag = 1; - } - - match_params.clear(); - match_params.push_back(parse_exact_match_param(bridge_port->bridge_port, 1)); - action_data.clear(); - action_data.push_back(parse_param(l2_if, 1)); - action_data.push_back(parse_param(is_lag, 1)); - bridge_port->handle_egress_br_port_to_if = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_br_port_to_if", match_params, - "action_forward_set_outIfType", action_data, options); - if (bind_mode == SAI_PORT_BIND_MODE_SUB_PORT) { - match_params.clear(); - match_params.push_back( - parse_exact_match_param(l2_if, 1)); // TODO p4 table match is on l2_if - match_params.push_back(parse_exact_match_param(bridge_port->vlan_id, 2)); - action_data.clear(); - action_data.push_back(parse_param(l2_if_type, 1)); - action_data.push_back(parse_param(bridge_port->bridge_port, 1)); - bridge_port->handle_subport_ingress_interface_type = - bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_subport_ingress_interface_type", match_params, - "action_set_l2_if_type", action_data, options); - } else { - match_params.clear(); - match_params.push_back(parse_exact_match_param(l2_if, 1)); - action_data.clear(); - action_data.push_back(parse_param(l2_if_type, 1)); - action_data.push_back(parse_param(bridge_port->bridge_port, 1)); - bridge_port->handle_port_ingress_interface_type = - bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_port_ingress_interface_type", match_params, - "action_set_l2_if_type", action_data, options); - } - *bridge_port_id = bridge_port->sai_object_id; - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::remove_bridge_port(sai_object_id_t bridge_port_id) { - sai_status_t status = SAI_STATUS_SUCCESS; - BridgePort_obj *bridge_port = - switch_metadata_ptr->bridge_ports[bridge_port_id]; - - if (bridge_port->handle_id_1d != NULL_HANDLE) { - try { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_bridge_id_1d", - bridge_port->handle_id_1d); - } catch (...) { - (*logger)->debug("--> Unable to remove table_bridge_id_1d entry, " - "possible entry override"); - } - } - if (bridge_port->handle_egress_set_vlan != NULL_HANDLE) { - try { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_egress_set_vlan", - bridge_port->handle_egress_set_vlan); - } catch (...) { - (*logger)->debug("--> Unable to remove table_egress_set_vlan entry, " - "possible entry override"); - } - } - if (bridge_port->handle_egress_br_port_to_if != NULL_HANDLE) { - try { - bm_client_ptr->bm_mt_delete_entry( - cxt_id, "table_egress_br_port_to_if", - bridge_port->handle_egress_br_port_to_if); - } catch (...) { - (*logger)->debug("--> Unable to remove table_egress_br_port_to_if entry, " - "possible entry override"); - } - } - if (bridge_port->handle_subport_ingress_interface_type != NULL_HANDLE) { - try { - bm_client_ptr->bm_mt_delete_entry( - cxt_id, "table_subport_ingress_interface_type", - bridge_port->handle_subport_ingress_interface_type); - } catch (...) { - (*logger)->debug("--> Unable to remove " - "table_subport_ingress_interface_type entry, possible " - "entry override"); - } - } - if (bridge_port->handle_port_ingress_interface_type != NULL_HANDLE) { - try { - bm_client_ptr->bm_mt_delete_entry( - cxt_id, "table_port_ingress_interface_type", - bridge_port->handle_port_ingress_interface_type); - } catch (...) { - (*logger)->debug("--> Unable to remove table_port_ingress_interface_type " - "entry, possible entry override"); - } - } - (*logger)->debug("deleted bridge port {} bm_entries", - bridge_port->sai_object_id); - switch_metadata_ptr->bridge_ports.erase(bridge_port->sai_object_id); - std::vector *vec = - &switch_metadata_ptr->bridges[bridge_port->bridge_id]->bridge_port_list; - vec->erase(std::remove(vec->begin(), vec->end(), bridge_port->sai_object_id), - vec->end()); - - sai_id_map_ptr->free_id(bridge_port->sai_object_id); - (*logger)->debug("deleted bridge port {} bm_entries", - bridge_port->sai_object_id); - return status; -} - -sai_status_t -sai_adapter::get_bridge_port_attribute(sai_object_id_t bridge_port_id, - uint32_t attr_count, - sai_attribute_t *attr_list) { - (*logger)->debug("get_bridge_port_attribute: bridge_port_id {}", - bridge_port_id); - BridgePort_obj *bridge_port = - (BridgePort_obj *)sai_id_map_ptr->get_object(bridge_port_id); - for (int i = 0; i < attr_count; i++) { - switch ((attr_list + i)->id) { - case SAI_BRIDGE_PORT_ATTR_PORT_ID: - (attr_list + i)->value.oid = bridge_port->port_id; - break; - case SAI_BRIDGE_PORT_ATTR_VLAN_ID: - (attr_list + i)->value.u16 = bridge_port->vlan_id; - break; - case SAI_BRIDGE_PORT_ATTR_TYPE: - (attr_list + i)->value.s32 = bridge_port->bridge_port_type; - break; - case SAI_BRIDGE_PORT_ATTR_BRIDGE_ID: - (attr_list + i)->value.oid = bridge_port->bridge_port_type; - break; - } - } -} \ No newline at end of file diff --git a/bm/sai_adapter/src/saifdb.cpp b/bm/sai_adapter/src/saifdb.cpp deleted file mode 100644 index a87e5efa0..000000000 --- a/bm/sai_adapter/src/saifdb.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "../inc/sai_adapter.h" - -sai_status_t sai_adapter::create_fdb_entry(const sai_fdb_entry_t *fdb_entry, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - (*logger)->info("create_fdb_entry"); - sai_status_t status = SAI_STATUS_SUCCESS; - // parsing attributes - sai_fdb_entry_type_t entry_type; - uint32_t bridge_port; - sai_packet_action_t packet_action; - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_FDB_ENTRY_ATTR_TYPE: - entry_type = (sai_fdb_entry_type_t)attribute.value.s32; - // (*logger)->error("--> attr packet type="<error("--> attr packet_static" << - // SAI_FDB_ENTRY_TYPE_STATIC - // <bridge_ports[attribute.value.oid]->bridge_port; - break; - case SAI_FDB_ENTRY_ATTR_PACKET_ACTION: - packet_action = (sai_packet_action_t)attribute.value.s32; - // (*logger)->error("--> attr - // packet_action="<error("--> attr packet_action_fwd=" << - // SAI_PACKET_ACTION_FORWARD - // <error( - "create_fdb_entry attribute.id = {} was dumped in sai_obj", - attribute.id); - break; - } - } - - // out_if_type = 0 # port_type (not lag or router). TODO: check how to do it - // with SAI - - uint32_t bridge_id = get_bridge_id_from_fdb_entry(fdb_entry); - (*logger)->info("create fdb - bridge_id = {}", bridge_id); - if (packet_action == SAI_PACKET_ACTION_FORWARD) { - if (entry_type == SAI_FDB_ENTRY_TYPE_STATIC) { - BmAddEntryOptions options; - BmMatchParams match_params; - BmActionData action_data; - uint64_t mac_address = parse_mac_64(fdb_entry->mac_address); - match_params.push_back(parse_exact_match_param(mac_address, 6)); - match_params.push_back(parse_exact_match_param(bridge_id, 2)); - (*logger)->info("--> mac: {}, b_id: {}", mac_address, bridge_id); - action_data.push_back(parse_param(bridge_port, 1)); - bm_client_ptr->bm_mt_add_entry(cxt_id, "table_fdb", match_params, - "action_set_egress_br_port", action_data, - options); - action_data.clear(); - bm_client_ptr->bm_mt_add_entry(cxt_id, "table_learn_fdb", match_params, - "_nop", action_data, options); - } - } - return status; -} - -sai_status_t sai_adapter::remove_fdb_entry(const sai_fdb_entry_t *fdb_entry) { - (*logger)->info("remove_fdb_entry"); - sai_status_t status = SAI_STATUS_SUCCESS; - BmAddEntryOptions options; - BmMatchParams match_params; - BmActionData action_data; - uint64_t mac_address = parse_mac_64(fdb_entry->mac_address); - match_params.push_back(parse_exact_match_param(mac_address, 6)); - uint32_t bridge_id = get_bridge_id_from_fdb_entry(fdb_entry); - match_params.push_back(parse_exact_match_param(bridge_id, 2)); - BmMtEntry bm_entry; - bm_client_ptr->bm_mt_get_entry_from_key(bm_entry, cxt_id, "table_fdb", - match_params, options); - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_fdb", bm_entry.entry_handle); - bm_client_ptr->bm_mt_get_entry_from_key(bm_entry, cxt_id, "table_learn_fdb", - match_params, options); - - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_learn_fdb", - bm_entry.entry_handle); - - return status; -} - -uint32_t -sai_adapter::get_bridge_id_from_fdb_entry(const sai_fdb_entry_t *fdb_entry) { - if (fdb_entry->bridge_type == SAI_FDB_ENTRY_BRIDGE_TYPE_1Q) { - sai_object_id_t vlan_obj_id = - switch_metadata_ptr->GetVlanObjIdFromVid(fdb_entry->vlan_id); - if (vlan_obj_id != 0) { - return switch_metadata_ptr->vlans[vlan_obj_id]->bridge_id; - } else { - return fdb_entry->vlan_id; - } - } else { - return switch_metadata_ptr->bridges[fdb_entry->bridge_id]->bridge_id; - } -} \ No newline at end of file diff --git a/bm/sai_adapter/src/saihostif.cpp b/bm/sai_adapter/src/saihostif.cpp deleted file mode 100644 index 945257f45..000000000 --- a/bm/sai_adapter/src/saihostif.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "../inc/sai_adapter.h" - -sai_status_t sai_adapter::create_hostif(sai_object_id_t *hif_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - (*logger)->info("create_hostif"); - HostIF_obj *hostif = new HostIF_obj(sai_id_map_ptr); - switch_metadata_ptr->hostifs[hostif->sai_object_id] = hostif; - // parsing attributes - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_HOSTIF_ATTR_TYPE: - hostif->hostif_type = (sai_hostif_type_t)attribute.value.s32; - break; - case SAI_HOSTIF_ATTR_OBJ_ID: - hostif->port = switch_metadata_ptr->ports[attribute.value.oid]; - break; - case SAI_HOSTIF_ATTR_NAME: - hostif->netdev_name = string(attribute.value.chardata); - break; - } - } - - *hif_id = hostif->sai_object_id; -} - -sai_status_t sai_adapter::remove_hostif(sai_object_id_t hif_id) { - (*logger)->info("remove_hostif"); -} - -sai_status_t sai_adapter::create_hostif_table_entry( - sai_object_id_t *hif_table_entry, sai_object_id_t switch_id, - uint32_t attr_count, const sai_attribute_t *attr_list) { - (*logger)->info("create_hostif_table_entry"); - HostIF_Table_obj *hostif_table = new HostIF_Table_obj(sai_id_map_ptr); - switch_metadata_ptr->hostif_tables[hostif_table->sai_object_id] = hostif_table; - - *hif_table_entry = hostif_table->sai_object_id; -} - -sai_status_t sai_adapter::remove_hostif_table_entry( - sai_object_id_t hif_table_entry) { - (*logger)->info("remove_hostif_table_entry"); -} - -sai_status_t sai_adapter::create_hostif_trap_group( - sai_object_id_t *hostif_trap_group_id, sai_object_id_t switch_id, - uint32_t attr_count, const sai_attribute_t *attr_list) { - (*logger)->info("create_hostif_trap_group"); - HostIF_Trap_Group_obj *hostif_trap_group = new HostIF_Trap_Group_obj(sai_id_map_ptr); - switch_metadata_ptr->hostif_trap_groups[hostif_trap_group->sai_object_id] = hostif_trap_group; - - *hostif_trap_group_id = hostif_trap_group->sai_object_id; -} - -sai_status_t sai_adapter::remove_hostif_trap_group( - sai_object_id_t hostif_trap_group_id) { - (*logger)->info("remove_hostif_trap_group"); -} - -sai_status_t sai_adapter::create_hostif_trap(sai_object_id_t *hostif_trap_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - (*logger)->info("create_hostif_trap"); - HostIF_Trap_obj *hostif_trap = new HostIF_Trap_obj(sai_id_map_ptr); - switch_metadata_ptr->hostif_traps[hostif_trap->sai_object_id] = hostif_trap; - - *hostif_trap_id = hostif_trap->sai_object_id; -} - -sai_status_t sai_adapter::remove_hostif_trap(sai_object_id_t hostif_trap_id) { - (*logger)->info("remove_hostif_trap"); -} \ No newline at end of file diff --git a/bm/sai_adapter/src/sailag.cpp b/bm/sai_adapter/src/sailag.cpp deleted file mode 100644 index 7f812c665..000000000 --- a/bm/sai_adapter/src/sailag.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include "../inc/sai_adapter.h" - -sai_status_t sai_adapter::create_lag(sai_object_id_t *lag_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - Lag_obj *lag = new Lag_obj(sai_id_map_ptr); - lag->l2_if = switch_metadata_ptr->GetNewL2IF(); - (*logger)->info("create_lag. l2_if = {}. sai_object_id = {}", lag->l2_if, - lag->sai_object_id); - switch_metadata_ptr->lags[lag->sai_object_id] = lag; - *lag_id = lag->sai_object_id; - return SAI_STATUS_SUCCESS; -} -sai_status_t sai_adapter::remove_lag(sai_object_id_t lag_id) { - (*logger)->info("remove_lag: {}", lag_id); - sai_status_t status = SAI_STATUS_SUCCESS; - Lag_obj *lag = switch_metadata_ptr->lags[lag_id]; - try { - if (lag->handle_port_configurations != NULL_HANDLE) { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_port_configurations", - lag->handle_port_configurations); - } - if (lag->handle_lag_hash != NULL_HANDLE) { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_lag_hash", - lag->handle_lag_hash); - } - } catch (...) { - status = SAI_STATUS_FAILURE; - (*logger)->error("Unable to remove lag tables entries"); - } - switch_metadata_ptr->lags.erase(lag->sai_object_id); - sai_id_map_ptr->free_id(lag->sai_object_id); - return status; -} -sai_status_t sai_adapter::create_lag_member(sai_object_id_t *lag_member_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - (*logger)->info("create_lag_member "); - Lag_member_obj *lag_member = new Lag_member_obj(sai_id_map_ptr); - switch_metadata_ptr->lag_members[lag_member->sai_object_id] = lag_member; - Port_obj *port; - Lag_obj *lag; - // parsing attributes - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_LAG_MEMBER_ATTR_PORT_ID: - port = switch_metadata_ptr->ports[attribute.value.oid]; - lag_member->port = port; - break; - case SAI_LAG_MEMBER_ATTR_LAG_ID: - lag = switch_metadata_ptr->lags[attribute.value.oid]; - lag_member->lag = lag; - lag->lag_members.push_back(lag_member->sai_object_id); - break; - default: - (*logger)->error( - "while parsing lag member, attribute.id = was dumped in sai_obj", - attribute.id); - break; - } - } - lag->port_obj = port; - uint32_t l2_if = lag->l2_if; - if (port->handle_ingress_lag != NULL_HANDLE) { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_ingress_lag", - port->handle_ingress_lag); - port->handle_ingress_lag = NULL_HANDLE; - } - if (lag->handle_lag_hash != NULL_HANDLE) { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_lag_hash", - lag->handle_lag_hash); - lag->handle_lag_hash = NULL_HANDLE; - } - - BmAddEntryOptions options; - BmMatchParams match_params; - BmActionData action_data; - match_params.push_back(parse_exact_match_param(port->hw_port, 2)); - action_data.push_back(parse_param(1, 1)); - action_data.push_back(parse_param(lag->l2_if, 1)); - port->handle_ingress_lag = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_ingress_lag", match_params, "action_set_lag_l2if", - action_data, options); - match_params.clear(); - match_params.push_back(parse_exact_match_param(l2_if, 1)); - match_params.push_back( - parse_exact_match_param(lag->lag_members.size() - 1, 1)); - action_data.clear(); - action_data.push_back(parse_param(port->hw_port, 1)); - lag_member->handle_egress_lag = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_lag", match_params, "action_set_out_port", - action_data, options); - action_data.clear(); - match_params.clear(); - match_params.push_back(parse_exact_match_param(l2_if, 1)); - action_data.push_back(parse_param(lag->lag_members.size(), 1)); - lag->handle_lag_hash = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_lag_hash", match_params, "action_set_lag_hash_size", - action_data, options); - uint32_t port_l2if = port->l2_if; - port->l2_if = l2_if; - config_port(port); - port->l2_if = port_l2if; - *lag_member_id = lag_member->sai_object_id; - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::remove_lag_member(sai_object_id_t lag_member_id) { - (*logger)->info("sai_remove_lag_member: {}", lag_member_id); - BmAddEntryOptions options; - BmMatchParams match_params; - BmActionData action_data; - Lag_member_obj *lag_member = switch_metadata_ptr->lag_members[lag_member_id]; - Lag_obj *lag = lag_member->lag; - sai_status_t status = SAI_STATUS_SUCCESS; - std::vector::iterator iter = std::find( - lag->lag_members.begin(), lag->lag_members.end(), lag_member_id); - size_t hash_index = std::distance(lag->lag_members.begin(), iter); - (*logger)->info("hash_index = {}", hash_index); - lag->lag_members.erase(lag->lag_members.begin() + hash_index); - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_lag_hash", - lag->handle_lag_hash); - action_data.clear(); - match_params.clear(); - match_params.push_back(parse_exact_match_param(lag->l2_if, 1)); - action_data.push_back(parse_param(lag->lag_members.size(), 1)); - lag->handle_lag_hash = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_lag_hash", match_params, "action_set_lag_hash_size", - action_data, options); - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_ingress_lag", - lag_member->port->handle_ingress_lag); - lag_member->port->handle_ingress_lag = NULL_HANDLE; - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_egress_lag", - lag_member->handle_egress_lag); - lag_member->handle_egress_lag = NULL_HANDLE; - - if (hash_index != lag->lag_members.size()) { - sai_object_id_t last_lag_member_id = lag->lag_members.back(); - Lag_member_obj *last_lag_member = - switch_metadata_ptr->lag_members[last_lag_member_id]; - lag->lag_members.pop_back(); - lag->lag_members.insert(lag->lag_members.begin() + hash_index, - last_lag_member_id); - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_egress_lag", - last_lag_member->handle_egress_lag); - match_params.clear(); - match_params.push_back(parse_exact_match_param(lag->l2_if, 1)); - match_params.push_back(parse_exact_match_param(hash_index, 1)); - action_data.clear(); - action_data.push_back(parse_param(last_lag_member->port->hw_port, 1)); - last_lag_member->handle_egress_lag = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_lag", match_params, "action_set_out_port", - action_data, options); - } - switch_metadata_ptr->lag_members.erase(lag_member->sai_object_id); - sai_id_map_ptr->free_id(lag_member->sai_object_id); - return status; -} diff --git a/bm/sai_adapter/src/saiport.cpp b/bm/sai_adapter/src/saiport.cpp deleted file mode 100644 index dbd2a0e66..000000000 --- a/bm/sai_adapter/src/saiport.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include "../inc/sai_adapter.h" - -sai_status_t sai_adapter::create_port(sai_object_id_t *port_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - Port_obj *port = new Port_obj(sai_id_map_ptr); - switch_metadata_ptr->ports[port->sai_object_id] = port; - (*logger)->info("--> new port sai_id = {}, tot port num: {}", - port->sai_object_id, switch_metadata_ptr->ports.size()); - // parsing attributes - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - set_parsed_port_attribute(port, attribute); - } - BmAddEntryOptions options; - BmMatchParams match_params; - BmActionData action_data; - action_data.clear(); - match_params.clear(); - match_params.push_back(parse_exact_match_param(port->hw_port, 2)); - action_data.push_back(parse_param(0, 1)); - action_data.push_back(parse_param(port->sai_object_id, 1)); - port->handle_lag_if = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_ingress_lag", match_params, "action_set_lag_l2if", - action_data, options); - action_data.clear(); - match_params.clear(); - match_params.push_back(parse_exact_match_param(port->sai_object_id, 1)); - action_data.push_back(parse_param(port->pvid, 2)); - action_data.push_back(parse_param(port->bind_mode, 1)); - action_data.push_back(parse_param(port->mtu, 4)); - action_data.push_back(parse_param(port->drop_tagged, 1)); - action_data.push_back(parse_param(port->drop_untagged, 1)); - port->handle_port_cfg = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_port_configurations", match_params, - "action_set_port_configurations", action_data, options); - *port_id = port->sai_object_id; - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::remove_port(sai_object_id_t port_id) { - (*logger)->info("sai_remove_port: {} ", port_id); - Port_obj *port = switch_metadata_ptr->ports[port_id]; - try { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_ingress_lag", - port->handle_lag_if); - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_port_configurations", - port->handle_port_cfg); - } catch (...) { - (*logger)->info("--> unable to remove port tables entries"); - } - switch_metadata_ptr->ports.erase(port->sai_object_id); - sai_id_map_ptr->free_id(port->sai_object_id); - (*logger)->debug("--> ports.size after remove: {}", - switch_metadata_ptr->ports.size()); - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::set_port_attribute(sai_object_id_t port_id, - const sai_attribute_t *attr) { - Port_obj *port; - port_id_map_t::iterator it = switch_metadata_ptr->ports.find(port_id); - if (it != switch_metadata_ptr->ports.end()) { - (*logger)->info("set port {} attribute (port).", port_id); - port = (Port_obj *)it->second; - } else { - (*logger)->info("set port {} attribute (lag).", port_id); - port = ((Lag_obj *)sai_id_map_ptr->get_object(port_id))->port_obj; - } - set_parsed_port_attribute(port, *attr); - config_port(port); - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::get_port_attribute(sai_object_id_t port_id, - uint32_t attr_count, - sai_attribute_t *attr_list) { - Port_obj *port = (Port_obj *)sai_id_map_ptr->get_object(port_id); - for (int i = 0; i < attr_count; i++) { - get_parsed_port_attribute(port, attr_list + i); - } - return SAI_STATUS_SUCCESS; -} - -void sai_adapter::set_parsed_port_attribute(Port_obj *port, - sai_attribute_t attribute) { - (*logger)->info("set_parsed_port_attribute. attribute id = {}", attribute.id); - (*logger)->trace("vlan = {} | bind_mode = {} | hw_lane_list = {} | " - "drop_untagged = {} | drop_tagged = {}", - SAI_PORT_ATTR_PORT_VLAN_ID, SAI_PORT_ATTR_BIND_MODE, - SAI_PORT_ATTR_HW_LANE_LIST, SAI_PORT_ATTR_DROP_UNTAGGED, - SAI_PORT_ATTR_DROP_TAGGED); - switch (attribute.id) { - case SAI_PORT_ATTR_PORT_VLAN_ID: - port->pvid = attribute.value.u16; - break; - case SAI_PORT_ATTR_BIND_MODE: - port->bind_mode = attribute.value.s32; - break; - case SAI_PORT_ATTR_HW_LANE_LIST: - port->hw_port = attribute.value.u32list.list[0]; - break; - case SAI_PORT_ATTR_DROP_UNTAGGED: - port->drop_untagged = attribute.value.booldata; - break; - case SAI_PORT_ATTR_DROP_TAGGED: - port->drop_tagged = attribute.value.booldata; - break; - } -} - -void sai_adapter::get_parsed_port_attribute(Port_obj *port, - sai_attribute_t *attribute) { - switch (attribute->id) { - case SAI_PORT_ATTR_PORT_VLAN_ID: - attribute->value.u16 = port->pvid; - break; - case SAI_PORT_ATTR_BIND_MODE: - attribute->value.s32 = port->bind_mode; - break; - case SAI_PORT_ATTR_HW_LANE_LIST: - attribute->value.u32list.count = 1; - attribute->value.u32list.list[0] = port->hw_port; - break; - case SAI_PORT_ATTR_DROP_UNTAGGED: - attribute->value.booldata = port->drop_untagged; - break; - case SAI_PORT_ATTR_DROP_TAGGED: - attribute->value.booldata = port->drop_tagged; - break; - } -} - -void sai_adapter::config_port(Port_obj *port) { - BmAddEntryOptions options; - BmMatchParams match_params; - match_params.clear(); - match_params.push_back(parse_exact_match_param(port->l2_if, 1)); - BmActionData action_data; - action_data.clear(); - action_data.push_back(parse_param(port->pvid, 2)); - action_data.push_back(parse_param(port->bind_mode, 1)); - action_data.push_back(parse_param(port->mtu, 4)); - action_data.push_back(parse_param(port->drop_tagged, 1)); - action_data.push_back(parse_param(port->drop_untagged, 1)); - try { - BmMtEntry entry; - bm_client_ptr->bm_mt_get_entry_from_key( - entry, cxt_id, "table_port_configurations", match_params, options); - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_port_configurations", - entry.entry_handle); - } catch (...) { - (*logger)->warn("--> InvalidTableOperation while removing " - "table_port_configurations entry"); - } - try { - port->handle_port_cfg = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_port_configurations", match_params, - "action_set_port_configurations", action_data, options); - } catch (...) { - (*logger)->warn("--> InvalidTableOperation while adding " - "table_port_configurations entry"); - } -} \ No newline at end of file diff --git a/bm/sai_adapter/src/saiswitch.cpp b/bm/sai_adapter/src/saiswitch.cpp deleted file mode 100644 index d72a20318..000000000 --- a/bm/sai_adapter/src/saiswitch.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "../inc/sai_adapter.h" - -sai_status_t sai_adapter::create_switch(sai_object_id_t *switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - (*logger)->info("create switch"); - if (switch_list_ptr->size() != 0) { - (*logger)->debug( - "currently one switch is supportred, returning operating switch_id: {}", - (*switch_list_ptr)[0]); - return (*switch_list_ptr)[0]; - } else { - BmAddEntryOptions options; - BmMatchParams match_params; - BmMtEntry entry; - - // Create Default 1Q Bridge, and switch_obj (not sure if switch is needed). - Bridge_obj *bridge = new Bridge_obj(sai_id_map_ptr); - (*logger)->info("Default 1Q bridge. sai_object_id {} bridge_id {}", - bridge->sai_object_id, bridge->bridge_id); - Sai_obj *switch_obj = new Sai_obj(sai_id_map_ptr); - switch_metadata_ptr->bridges[bridge->sai_object_id] = bridge; - switch_metadata_ptr->default_bridge_id = bridge->sai_object_id; - - for (int i = 0; i < switch_metadata_ptr->hw_port_list.count; i++) { - int hw_port = switch_metadata_ptr->hw_port_list.list[i]; - - // Create Default Ports (one for each hw_port) - Port_obj *port = new Port_obj(sai_id_map_ptr); - switch_metadata_ptr->ports[port->sai_object_id] = port; - port->hw_port = hw_port; - port->l2_if = hw_port; - (*logger)->info("Default port_id {}. hw_port = {}", port->sai_object_id, - port->hw_port); - - // Create Default Bridge ports and connect to 1Q bridge - BridgePort_obj *bridge_port = new BridgePort_obj(sai_id_map_ptr); - switch_metadata_ptr->bridge_ports[bridge_port->sai_object_id] = - bridge_port; - bridge_port->port_id = port->sai_object_id; - bridge_port->bridge_port = hw_port; - bridge_port->bridge_id = bridge->sai_object_id; - bridge->bridge_port_list.push_back(bridge_port->sai_object_id); - (*logger)->info("Default bridge_port_id {}. bridge_port = {}", - bridge_port->sai_object_id, bridge_port->bridge_port); - - // Store default table entries - match_params.clear(); - match_params.push_back(parse_exact_match_param(port->l2_if, 1)); - bm_client_ptr->bm_mt_get_entry_from_key( - entry, cxt_id, "table_port_ingress_interface_type", match_params, - options); - bridge_port->handle_port_ingress_interface_type = entry.entry_handle; - match_params.clear(); - match_params.push_back( - parse_exact_match_param(bridge_port->bridge_port, 1)); - bm_client_ptr->bm_mt_get_entry_from_key( - entry, cxt_id, "table_egress_br_port_to_if", match_params, options); - bridge_port->handle_egress_br_port_to_if = entry.entry_handle; - } - switch_list_ptr->push_back(switch_obj->sai_object_id); - return switch_obj->sai_object_id; - } -} - -sai_status_t sai_adapter::get_switch_attribute(sai_object_id_t switch_id, - sai_uint32_t attr_count, - sai_attribute_t *attr_list) { - (*logger)->info("get_switch_attribute"); - int i; - int index = 0; - for (i = 0; i < attr_count; i++) { - switch ((attr_list + i)->id) { - case SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID: - (attr_list + i)->value.oid = switch_metadata_ptr->default_bridge_id; - break; - case SAI_SWITCH_ATTR_PORT_LIST: - for (port_id_map_t::iterator it = switch_metadata_ptr->ports.begin(); - it != switch_metadata_ptr->ports.end(); ++it) { - (attr_list + i)->value.objlist.list[index] = it->first; - index += 1; - } - break; - case SAI_SWITCH_ATTR_PORT_NUMBER: - (attr_list + i)->value.u32 = switch_metadata_ptr->hw_port_list.count; - break; - } - } - return SAI_STATUS_SUCCESS; -} - -// sai_status_t sai_adapter::sai_get_switch_attribute(sai_object_id_t -// switch_id,sai_uint32_t attr_count,sai_attribute_t *attr_list){ -// } diff --git a/bm/sai_adapter/src/saivlan.cpp b/bm/sai_adapter/src/saivlan.cpp deleted file mode 100644 index 6b4c777e8..000000000 --- a/bm/sai_adapter/src/saivlan.cpp +++ /dev/null @@ -1,229 +0,0 @@ -#include "../inc/sai_adapter.h" - -sai_status_t sai_adapter::create_vlan(sai_object_id_t *vlan_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - (*logger)->info("create_vlan "); - Vlan_obj *vlan = new Vlan_obj(sai_id_map_ptr); - switch_metadata_ptr->vlans[vlan->sai_object_id] = vlan; - // parsing attributes - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_VLAN_ATTR_VLAN_ID: - vlan->vid = (uint32_t)attribute.value.u16; // TODO correct casting type - break; - } - } - - uint32_t bridge_id = switch_metadata_ptr->GetNewBridgeID(vlan->vid); - vlan->bridge_id = bridge_id; - if (vlan->vid != bridge_id) { - BmMatchParams match_params; - BmActionData action_data; - BmAddEntryOptions options; - match_params.push_back(parse_exact_match_param(vlan->vid, 2)); - action_data.push_back(parse_param(bridge_id, 2)); - vlan->handle_id_1q = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_bridge_id_1q", match_params, "action_set_bridge_id", - action_data, options); - } - *vlan_id = vlan->sai_object_id; - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::remove_vlan(sai_object_id_t vlan_id) { - (*logger)->info("remove_vlan: {}", vlan_id); - Vlan_obj *vlan = switch_metadata_ptr->vlans[vlan_id]; - if (vlan->handle_id_1q != NULL_HANDLE) { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_bridge_id_1q", - vlan->handle_id_1q); - } - switch_metadata_ptr->vlans.erase(vlan->sai_object_id); - sai_id_map_ptr->free_id(vlan->sai_object_id); - // (*logger)->info("vlans.size={}",switch_metadata_ptr->vlans.size()); - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::create_vlan_member(sai_object_id_t *vlan_member_id, - sai_object_id_t switch_id, - uint32_t attr_count, - const sai_attribute_t *attr_list) { - (*logger)->info("create_vlan_member"); - Vlan_member_obj *vlan_member = new Vlan_member_obj(sai_id_map_ptr); - switch_metadata_ptr->vlan_members[vlan_member->sai_object_id] = vlan_member; - // parsing attributes - sai_attribute_t attribute; - for (uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_VLAN_MEMBER_ATTR_VLAN_ID: - vlan_member->vlan_oid = (sai_object_id_t)attribute.value.oid; - break; - case SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID: - vlan_member->bridge_port_id = (sai_object_id_t)attribute.value.oid; - break; - case SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE: - vlan_member->tagging_mode = (uint32_t)attribute.value.s32; - break; - default: - (*logger)->error( - "while parsing vlan member, attribute.id = {} was dumped in " - "sai_obj", - attribute.id); - break; - } - } - Vlan_obj *vlan = switch_metadata_ptr->vlans[vlan_member->vlan_oid]; - vlan_member->vid = vlan->vid; - vlan->vlan_members.push_back(vlan_member->sai_object_id); - uint32_t port_id = - switch_metadata_ptr->bridge_ports[vlan_member->bridge_port_id]->port_id; - uint32_t bridge_port = - switch_metadata_ptr->bridge_ports[vlan_member->bridge_port_id] - ->bridge_port; - uint32_t out_if; - if (switch_metadata_ptr->lags.find(port_id) != - switch_metadata_ptr->lags.end()) { - out_if = switch_metadata_ptr->lags[port_id]->l2_if; - } else { - out_if = switch_metadata_ptr->ports[port_id]->hw_port; - } - BmAddEntryOptions options; - BmMatchParams match_params; - BmActionData action_data; - if (vlan_member->tagging_mode == SAI_VLAN_TAGGING_MODE_TAGGED) { - uint32_t vlan_pcp = 0; - uint32_t vlan_cfi = 0; - match_params.push_back(parse_exact_match_param(out_if, 1)); - match_params.push_back(parse_exact_match_param(vlan_member->vid, 2)); - match_params.push_back(parse_valid_match_param(false)); - action_data.push_back(parse_param(vlan_pcp, 1)); - action_data.push_back(parse_param(vlan_cfi, 1)); - action_data.push_back(parse_param(vlan_member->vid, 2)); - vlan_member->handle_egress_vlan_tag = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_vlan_tag", match_params, - "action_forward_vlan_tag", action_data, options); - } else if (vlan_member->tagging_mode == - SAI_VLAN_TAGGING_MODE_PRIORITY_TAGGED) { - uint32_t vlan_pcp = 0; - uint32_t vlan_cfi = 0; - match_params.push_back(parse_exact_match_param(out_if, 1)); - match_params.push_back(parse_exact_match_param(vlan_member->vid, 2)); - match_params.push_back(parse_valid_match_param(false)); - action_data.push_back(parse_param(vlan_pcp, 1)); - action_data.push_back(parse_param(vlan_cfi, 1)); - action_data.push_back(parse_param(0, 2)); - vlan_member->handle_egress_vlan_tag = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_vlan_tag", match_params, - "action_forward_vlan_tag", action_data, options); - } else { - (*logger)->info("table_egress_vlan_tag debug. out_if = {}, vid = {}", - out_if, vlan_member->vid); - match_params.push_back(parse_exact_match_param(out_if, 1)); - match_params.push_back(parse_exact_match_param(vlan_member->vid, 2)); - match_params.push_back(parse_valid_match_param(true)); - action_data.clear(); - vlan_member->handle_egress_vlan_tag = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_vlan_tag", match_params, - "action_forward_vlan_untag", action_data, options); - } - match_params.clear(); - match_params.push_back(parse_exact_match_param(bridge_port, 1)); - match_params.push_back(parse_exact_match_param(vlan_member->vid, 2)); - action_data.clear(); - vlan_member->handle_egress_vlan_filtering = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_egress_vlan_filtering", match_params, "_nop", action_data, - options); - vlan_member->handle_ingress_vlan_filtering = bm_client_ptr->bm_mt_add_entry( - cxt_id, "table_ingress_vlan_filtering", match_params, "_nop", action_data, - options); - *vlan_member_id = vlan_member->sai_object_id; - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_adapter::remove_vlan_member(sai_object_id_t vlan_member_id) { - (*logger)->info("remove vlan_member: vlan_member_id = {}", vlan_member_id); - sai_status_t status = SAI_STATUS_SUCCESS; - Vlan_member_obj *vlan_member = - switch_metadata_ptr->vlan_members[vlan_member_id]; - try { - bm_client_ptr->bm_mt_delete_entry( - cxt_id, "table_egress_vlan_filtering", - vlan_member->handle_egress_vlan_filtering); - bm_client_ptr->bm_mt_delete_entry( - cxt_id, "table_ingress_vlan_filtering", - vlan_member->handle_ingress_vlan_filtering); - if (vlan_member->tagging_mode == SAI_VLAN_TAGGING_MODE_TAGGED) { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_egress_vlan_tag", - vlan_member->handle_egress_vlan_tag); - } else if (vlan_member->tagging_mode == - SAI_VLAN_TAGGING_MODE_PRIORITY_TAGGED) { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_egress_vlan_tag", - vlan_member->handle_egress_vlan_tag); - } else { - bm_client_ptr->bm_mt_delete_entry(cxt_id, "table_egress_vlan_tag", - vlan_member->handle_egress_vlan_tag); - } - } catch (...) { - (*logger)->warn(" Unable to delete vlan member tables."); - return SAI_STATUS_FAILURE; - }; - // get parent vlan member list, and remove the memeber by value - TODO - // consider map instead of vector. - std::vector *vlan_members = - &switch_metadata_ptr->vlans[vlan_member->vlan_oid]->vlan_members; - vlan_members->erase(std::remove(vlan_members->begin(), vlan_members->end(), - vlan_member->sai_object_id), - vlan_members->end()); - switch_metadata_ptr->vlan_members.erase(vlan_member->sai_object_id); - sai_id_map_ptr->free_id(vlan_member->sai_object_id); - return status; -} - -sai_status_t sai_adapter::set_vlan_attribute(sai_object_id_t vlan_id, - const sai_attribute_t *attr) { - (*logger)->info("TODO : set_vlan_attribute not implemened"); - return SAI_STATUS_NOT_IMPLEMENTED; - // implementation -} -sai_status_t sai_adapter::get_vlan_attribute(sai_object_id_t vlan_id, - const uint32_t attr_count, - sai_attribute_t *attr_list) { - (*logger)->info("TODO : get_vlan_attribute not implemened"); - return SAI_STATUS_NOT_IMPLEMENTED; - // implementation -} -sai_status_t -sai_adapter::set_vlan_member_attribute(sai_object_id_t vlan_member_id, - const sai_attribute_t *attr) { - (*logger)->info("TODO : set_vlan_member_attribute not implemened"); - return SAI_STATUS_NOT_IMPLEMENTED; - - // implementation -} -sai_status_t -sai_adapter::get_vlan_member_attribute(sai_object_id_t vlan_member_id, - const uint32_t attr_count, - sai_attribute_t *attr_list) { - (*logger)->info("TODO : get_vlan_member_attribute not implemened"); - return SAI_STATUS_NOT_IMPLEMENTED; - // implementation -} -sai_status_t sai_adapter::get_vlan_stats(sai_object_id_t vlan_id, - const sai_vlan_stat_t *counter_ids, - uint32_t number_of_counters, - uint64_t *counters) { - (*logger)->info("TODO : get_vlan_stats not implemened"); - return SAI_STATUS_NOT_IMPLEMENTED; - - // implementation -} -sai_status_t sai_adapter::clear_vlan_stats(sai_object_id_t vlan_id, - const sai_vlan_stat_t *counter_ids, - uint32_t number_of_counters) { - (*logger)->info("TODO : clear_vlan_stats not implemened"); - // implementation -} \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/port_map.ini b/bm/sai_adapter/test/ptf_tests/port_map.ini deleted file mode 100644 index 607c2915c..000000000 --- a/bm/sai_adapter/test/ptf_tests/port_map.ini +++ /dev/null @@ -1,8 +0,0 @@ -0@0 -1@1 -2@2 -3@3 -4@4 -5@5 -6@6 -7@7 \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/ptf/.gitignore b/bm/sai_adapter/test/ptf_tests/ptf/.gitignore deleted file mode 100644 index 6285f9673..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.pyc -profiles/*.pyc -*~ -*.log -*.pcap diff --git a/bm/sai_adapter/test/ptf_tests/ptf/.travis.yml b/bm/sai_adapter/test/ptf_tests/ptf/.travis.yml deleted file mode 100644 index 21147235d..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Config file for automatic testing at travis-ci.org - -sudo: required - -# workaround for a travis Python issue -# see https://github.com/travis-ci/travis-ci/issues/4948 -language: generic - -dist: trusty - -# My very smart trick to force inclusion of the veth kernel module -# (even though we do not use docker at all her) -services: - - docker - -addons: - apt: - packages: - - python-dev - - python-pip - - cmake - - libffi-dev - -before_install: - - sudo apt-get install ethtool - - sudo pip install --upgrade pip - - sudo apt-get remove python-scapy - - git clone https://github.com/p4lang/scapy-vxlan.git && cd scapy-vxlan && sudo python setup.py install && cd .. - - bash CI/travis/install-nanomsg.sh - - sudo ldconfig - - bash CI/travis/install-nnpy.sh - -install: - - sudo python setup.py install - -before_script: - - cd ptf_nn/; sudo ./veth_setup.sh; cd .. - -script: - - python CI/travis/check-nnpy.py - - ./CI/travis/run_tests.sh diff --git a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/check-nnpy.py b/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/check-nnpy.py deleted file mode 100755 index b6796328b..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/check-nnpy.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python - -import nnpy -import sys - -pub = nnpy.Socket(nnpy.AF_SP, nnpy.PUB) -pub.bind('inproc://foo') - -sub = nnpy.Socket(nnpy.AF_SP, nnpy.SUB) -sub.connect('inproc://foo') -sub.setsockopt(nnpy.SUB, nnpy.SUB_SUBSCRIBE, '') - -pub.send('hello, world') -recv = sub.recv() - -if recv != 'hello, world': - sys.exit(1) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/common.sh b/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/common.sh deleted file mode 100644 index 8db31c928..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/common.sh +++ /dev/null @@ -1,34 +0,0 @@ -force=0 -while [[ $# -gt 0 ]]; do -key="$1" -case $key in - -f|--force) - force=1 - ;; - *) - # unknown option - ;; -esac -shift # past argument or value -done - -function quit { - if [ $force == 0 ]; then - echo "skipping installation, you can force installation with '-f'" - exit 0 - fi -} - -function check_lib { - ldconfig -p | grep $2 &> /dev/null - if [ $? == 0 ]; then - echo "$2 found" - quit - fi - ldconfig -p | grep $1 &> /dev/null - if [ $? == 0 ]; then - echo "a version of $1 was found, but not $2" - echo "you may experience issues when using a different version" - quit - fi -} diff --git a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nanomsg.sh b/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nanomsg.sh deleted file mode 100755 index 63f8ff1c7..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nanomsg.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -source $THIS_DIR/common.sh - -# nanomsg is very confusing in how it manages SOVERSION vs VERSION, but this -# should be okay... (5.0.0 is the SOVERSION) -check_lib libnanomsg libnanomsg.so.5.0.0 - -set -e -wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz -O nanomsg-1.0.0.tar.gz -tar -xzvf nanomsg-1.0.0.tar.gz -cd nanomsg-1.0.0 -mkdir build -cd build -# I added -DCMAKE_INSTALL_PREFIX=/usr because on my Ubuntu 14.04 machine, the -# library is installed in /usr/local/lib/x86_64-linux-gnu/ by default, and for -# some reason ldconfig cannot find it -cmake .. -DCMAKE_INSTALL_PREFIX=/usr -cmake --build . -sudo cmake --build . --target install -cd .. diff --git a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nnpy.sh b/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nnpy.sh deleted file mode 100755 index 9a02edfbf..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/install-nnpy.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -e -git clone https://github.com/nanomsg/nnpy.git -cd nnpy -sudo pip install cffi -sudo pip install --upgrade cffi -sudo pip install . -cd .. diff --git a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/run_tests.sh b/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/run_tests.sh deleted file mode 100755 index 4fd508d01..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/CI/travis/run_tests.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -sudo python ptf_nn/ptf_nn_agent.py \ - --device-socket 0@tcp://127.0.0.1:10001 -i 0-1@veth0 \ - &>/dev/null & - -sleep 5 - -sudo python ptf_nn/ptf_nn_agent.py \ - --device-socket 1@tcp://127.0.0.1:10002 -i 1-1@veth3 \ - &>/dev/null & - -sleep 5 - -sudo python ptf_nn/ptf_nn_test_bridge.py -ifrom veth1 -ito veth2 \ - &>/dev/null & - -sleep 5 - -sudo ptf --test-dir ptf_nn/ptf_nn_test \ - --device-socket 0-{0-64}@tcp://127.0.0.1:10001 \ - --device-socket 1-{0-64}@tcp://127.0.0.1:10002 \ - --platform nn diff --git a/bm/sai_adapter/test/ptf_tests/ptf/LICENSE b/bm/sai_adapter/test/ptf_tests/ptf/LICENSE deleted file mode 100644 index 187edf867..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/bm/sai_adapter/test/ptf_tests/ptf/LICENSE.OFTest b/bm/sai_adapter/test/ptf_tests/ptf/LICENSE.OFTest deleted file mode 100644 index 44ebdddc1..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/LICENSE.OFTest +++ /dev/null @@ -1,36 +0,0 @@ -OpenFlow Test Framework - -Copyright (c) 2010 The Board of Trustees of The Leland Stanford -Junior University - -Except where otherwise noted, this software is distributed under -the OpenFlow Software License. See -http://www.openflowswitch.org/wp/legal/ for current details. - -We are making the OpenFlow specification and associated documentation -(Software) available for public use and benefit with the expectation -that others will use, modify and enhance the Software and contribute -those enhancements back to the community. However, since we would like -to make the Software available for broadest use, with as few -restrictions as possible permission is hereby granted, free of charge, -to any person obtaining a copy of this Software to deal in the -Software under the copyrights without restriction, including without -limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED -Y´AS IS¡, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -The name and trademarks of copyright holder(s) may NOT be used in -advertising or publicity pertaining to the Software or any derivatives -without specific, written prior permission. diff --git a/bm/sai_adapter/test/ptf_tests/ptf/NOTICE b/bm/sai_adapter/test/ptf_tests/ptf/NOTICE deleted file mode 100644 index fba233931..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/NOTICE +++ /dev/null @@ -1,9 +0,0 @@ -Packet Test Framework - -Copyright (c) 2015 Barefoot Networks Inc. - -Copyright (c) 2010 The Board of Trustees of The Leland Stanford Junior -University - -This product includes modifications done the following software: -OpenFlow Switch Test Framework (https://github.com/floodlight/oftest) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/README.md b/bm/sai_adapter/test/ptf_tests/ptf/README.md deleted file mode 100644 index 9a8fa40bd..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/README.md +++ /dev/null @@ -1,238 +0,0 @@ -PTF Packet Testing Framework - ---- - -# Introduction - -PTF is a Python based dataplane test framework. It is based on unittest, which -is included in the standard Python distribution. - -This document is meant to provide an introduction to the framework, discuss the -basics of running tests and to provide examples of how to add tests. - -Most of the code was taken from the [OFTest -framework](https://github.com/floodlight/oftest). However, PTF focuses on the -dataplane and is independent of OpenFlow. We also made a few additions to -oftest. - ---- - -# Longer Start - -## Configure Pre-requisites - -The following software is required to run OFTest: - - * Python 2.7 - * Scapy - * pypcap (optional - VLAN tests will fail without this) - * tcpdump (optional - Scapy will complain if it's missing) - -We recommend that you install your extension of Scapy, which you can obtain -[here](https://github.com/p4lang/scapy-vxlan). It adds support for additional -header types: `VXLAN`, `ERSPAN`, `GENEVE`, `MPLS` and `NVGRE`. - -Root/sudo privilege is required on the host, in order to run `ptf`. - -## Run PTF - -Once you have written tests and your switch is running, you can run 'ptf'. Use -`--help` to see command line switches. - -For example: - - sudo ./ptf --test-dir mytests/ --pypath $PWD \ - --interface 0@veth1 --interface 1@veth3 --interface 2@veth5 \ - --interface 3@veth7 --interface 4@veth9 --interface 5@veth11 \ - --interface 6@veth13 --interface 7@veth15 --interface 8@veth17 - -This will run all the tests included in the `mytests` directory. The `--pypath` -option can be used to easily add directories to the Python PATH. This is useful -if you use a Python interface to configure your data plane (as part of your -tests). The `--interface` option (or `-i`) can be used to specify the interfaces -on which to inject packets (along with the corresponding port number). - -## Install PTF - -PTF can be installed by running `sudo python setup.py install`. For more -information on the different options accepted by `setup.py` (e.g. installing in -a custom location), please refer to the [setuptools documentation] -(https://pythonhosted.org/setuptools/setuptools.html). - ---- - -# Writing tests for your switch - -Take a look at the `example` directory. This is not a working example as it is -(the switch is not included), but it will show you how to write tests. This -directory contains the following: - -* `run_client.sh`: a wrapper around `ptf` -* `switch_sai_thrift`: empty directory, this is where the Python bindings to - program the switch's control plane would be copied -* `mytests/sai_base_test.py`: a wrapper Python class around PTF's BaseTest - class. It is the base class for all the tests we added to `mytests/switch.py` -* `mytests/switch.py`: some example tests - -## Running the example - -If you want to run the example, you will need to obtain -[p4factory](https://github.com/p4lang/p4factory). For the following, I will -assume that you cloned the repository and installed the dependencies. I will -assume that environment variable `P4FACTORY` contains the path to the cloned -repository. - -First, you need to create the required veths: - - cd $P4FACTORY/tools/ - sudo ./veth_setup.sh - -The next step is to compile the target switch and to run it: - - cd $P4FACTORY/targets/switch/ - make bm-switchsai - sudo ./behavioral-model - -Finally, you can run the example tests: - - cd /example/ - sudo ../ptf --test-dir mytests/ \ - --pypath $P4FACTORY/targets/switch/tests/pd_thrift/ - --interface 0@veth1 --interface 1@veth3 --interface 2@veth5 \ - --interface 3@veth7 --interface 4@veth9 --interface 5@veth11 \ - --interface 6@veth13 --interface 7@veth15 --interface 8@veth17 - ---- - -# New features - -We added the following features to the base OFTest framework: - -## Filters - -They can be used to discard some of the packets received from the switch. Take a -look at [sai_base_test.py](example/mytests/sai_base_test.py) for an example. You -will see the following code `testutils.add_filter(testutils.not_ipv6_filter)` -which tells PTF to discard received IPv6 packets. You can add your own filters -(they have to be callable Python objects which take a Scapy packet as input). - -## Ternary matching - -A PTF test -just like an OFTest test- matches the received packets against -expected packets. This is an exact match. However, sometimes one does not care -about all the fields in the packets. PTF introduces the Mask class which lets -you specified some field you do not care about when performing the match. For -example: - - import mask - m = mask.Mask(expected_pkt) - m.set_do_not_care_scapy(IP, 'ttl') - verify_packets(, m, ) - -## Test timeout - -A timeout for test cases can be specified using the `--test-case-timeout` -command line option. This timeout must be expressed in seconds. A timeout of 0 -is the same as no timeout (the default). If the timeout expires before the test -is done executing, an exception will be raised and the test counts as an -error. A timeout can also be specified for each individual test case, using the -`@testtimeout` decorator, which needs to be imported from `ptf.testutils`. This -timeout takes precedence over the global timeout passed on the command line. - ---- - -# Configuring PTF - -## Platforms - -The "platform" is a configuration file (written in Python) that tells PTF how to -send packets to and receive packets from the dataplane of the switch. - -### `eth` - -The default platform, `eth`, uses Linux Ethernet interfaces and is configured -with the `-i` option (or `--interface`). Pass the option as `-i -ofport@interface`, for example `-i 1@eth1`. If no `-i` options are given the the -default configuration uses vEths. - -### `remote` - -Another common platform, `remote`, provides support for testing of switches on a -different host. This can be useful for cases where interfaces are not available -on one host (i.e. they're not bound to a Linux interface driver) or where PTF -cannot run on the same host (unsupported OS, missing software, etc.). - -This can be enable by modifying the `platforms/remote.py` file to point to 4 -NICs on the host running PTF, like so: - - remote_port_map = { - (0, 23) : "eth2", # port 23 of device 0 is connected to physical port on the server eth2 - (0, 24) : "eth3", # port 24 of device 0 is connected to physical port on the server eth3 - (0, 25) : "eth4", - (0, 26) : "eth5" - } - -### `nn` - -We introduce a new platform, `nn`, which uses [nanomsg] (http://nanomsg.org/) to -send and receive packet to the switch. We support IPC and TCP nanomsg -sockets. When using this platform, you need to make sure that the Python package -[nnpy] (https://github.com/nanomsg/nnpy) is installed. With `nn`, do not use -`--interface`, instead use `--device-socket`. For each device, you need to -provide a list of enabled ports and a nanomsg socket address. For example: - - --device-socket 0-{1,2,5-8}@ipc:///tmp/bmv2_packets_1.ipc - -This command will enable ports 1, 2, 5, 6, 7, 8 on device 0. Packets for device -0 will be captured and send on IPC socket `ipc:///tmp/bmv2_packets_1.ipc`. - -## Passing Parameters to Tests - -There is a facility for passing test-specific parameters into tests that works as follows. On the command line, give the parameter - - --test-params="key1=17;key2=True" - -You can then access these parameters in your tests' Pyhton code using the -following code: - - import ptf.testutils as testutils - # Returns a dictionary which includes all your parameters - test_params = testutils.test_params_get() - # Returns the value of the parameter "param", or None if not found - param_value = testutils.test_param_get("param") - -Take a look at [sai_base_test.py](example/mytests/sai_base_test.py) for an -example. - -## Grouping Tests together - -It is very easy to create groups of tests, using the provided `group` Python -decorator. Simply decorate your test with `@group()`. - -Take a look at [switch.py](example/mytests/switch.py) for an example. - -One given test can belong to several groups. You can choose to run only the -tests belonging to a given group using a command like this one: - - sudo ./ptf --test-dir mytests/ --pypath $PWD - -We also provide a convenient `disabled` decorator for tests. - -## Support for multidevice tests - -The original OFTest was meant to unit test a single OF-compliant switch. With -PTF, we tried to add support for testing a network of several devices. If you do -not intend to use this multi-device feature, you do not need to worry about it, -it should not impact you. If you want to leverage this feature, here is what you -need to do: - -* when adding interfaces, instead of writing `@`, - you need to write `-@` -* when sending a packet, the port number becomes a tuple (device, port): - `send_packet(self, (, ), pkt)` -* the `verify_*` functions where also updated to include device information. For - example: `verify_packets(self, pkt, device_number=, - ports=)`. For more information, you can take a look at these - functions in [src/ptf/dataplane.py](src/ptf/dataplane.py). - ---- diff --git a/bm/sai_adapter/test/ptf_tests/ptf/build/scripts-2.7/ptf b/bm/sai_adapter/test/ptf_tests/ptf/build/scripts-2.7/ptf deleted file mode 100755 index 04124fd26..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/build/scripts-2.7/ptf +++ /dev/null @@ -1,733 +0,0 @@ -#!/usr/bin/python -""" -@package ptf - -Packet Test Framework (ptf) top level script - -To add a new command line option, edit both the config_default dictionary and -the config_setup function. The option's result will end up in the global -oftest.config dictionary. -""" - -import sys -import argparse -from subprocess import Popen,PIPE -import logging -import unittest -import time -import os -import imp -import random -import signal -import fnmatch -import copy -from collections import OrderedDict - -root_dir = os.path.dirname(os.path.realpath(__file__)) - -pydir = os.path.join(root_dir, 'src') -if os.path.exists(os.path.join(pydir, 'ptf')): - # Running from source tree - sys.path.insert(0, pydir) - -import ptf -from ptf import config -import ptf.ptfutils - -##@var DEBUG_LEVELS -# Map from strings to debugging levels -DEBUG_LEVELS = { - 'debug' : logging.DEBUG, - 'verbose' : logging.DEBUG, - 'info' : logging.INFO, - 'warning' : logging.WARNING, - 'warn' : logging.WARNING, - 'error' : logging.ERROR, - 'critical' : logging.CRITICAL -} - -##@var config_default -# The default configuration dictionary for PTF -config_default = { - # Miscellaneous options - "list" : False, - "list_test_names" : False, - "allow_user" : False, - - # Test selection options - "test_spec" : "", - "test_file" : None, - "test_dir" : None, - "test_order" : "default", - "test_order_seed" : 0xaba, - - # Switch connection options - "platform" : "eth", - "platform_args" : None, - "platform_dir" : None, - "interfaces" : [], - "device_sockets" : [], # when using nanomsg - - # Logging options - "log_file" : "ptf.log", - "log_dir" : None, - "debug" : "verbose", - "profile" : False, - "profile_file" : "profile.out", - "xunit" : False, - "xunit_dir" : "xunit", - - # Test behavior options - "relax" : False, - "test_params" : "None", - "failfast" : False, - "fail_skipped" : False, - "default_timeout" : 2.0, - "default_negative_timeout" : 0.1, - "minsize" : 0, - "random_seed" : None, - "disable_ipv6" : False, - "disable_vxlan" : False, - "disable_erspan" : False, - "disable_geneve" : False, - "disable_mpls" : False, - "disable_nvgre" : False, - "qlen" : 100, - "test_case_timeout" : None, - - # Other configuration - "port_map" : {}, -} - -def config_setup(): - """ - Set up the configuration including parsing the arguments - - @return A pair (config, args) where config is an config - object and args is any additional arguments from the command line - """ - - usage = "usage: ptf [options] --test-dir TEST_DIR [tests]" - - description = """PTF (Packet Test Framework) is a framework and set of tests -to test a software switch. It is strongly inspired by the OFTest framework, but -it is not tied to OpenFlow. It does not provide any control plane features, but -it is targetted at helping you test a dataplane. - -The default configuration assumes that interfaces veth1, veth3, veth5, and veth7 -should be connected to the switch's dataplane. - -If no positional arguments are given then OFTest will run all tests found in the ---test-dir directory. Otherwise each positional argument is interpreted as -either a test name or a test group name. The union of these will be executed. To -see what groups each test belongs to use the --list option. Tests and groups can -be subtracted from the result by prefixing them with the '^' character. """ - - class ActionInterface(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - # Parse --interface - def check_interface(value): - try: - dev_and_port, interface = value.split('@', 1) - dev_and_port = dev_and_port.split("-") - if len(dev_and_port) == 1: - dev, port = 0, int(dev_and_port[0]) - elif len(dev_and_port) == 2: - dev, port = int(dev_and_port[0]), int(dev_and_port[1]) - else: - raise ValueError("") - except ValueError: - parser.error("incorrect interface syntax (got %s, expected 'port@interface' or 'device-port@interface')" % repr(value)) - return (dev, port, interface) - - assert(type(values) is str) - getattr(namespace, self.dest).append(check_interface(values)) - - class ActionDeviceSocket(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - # Parse --device-socket - def check_device_socket(value): - def parse_ports(ports): - port_set = set() - try: - ports = ports.strip("{}") - ports = ports.split(",") - except: - raise ValueError("") - for port in ports: - try: - p = int(port) - port_set.add(p) - continue - except: - pass - try: - p1, p2 = port.split("-", 1) - p1, p2 = int(p1), int(p2) - for p in xrange(p1, p2 + 1): # p2 included - port_set.add(p) - except: - raise ValueError("") - return port_set - - try: - dev_and_port, addr = value.split('@', 1) - if dev_and_port[0] == '{': - dev, ports = (0, parse_ports(dev_and_port)) - else: - dev_and_port = dev_and_port.split("-", 1) - if len(dev_and_port) != 2: - raise ValueError("") - dev, ports = (int(dev_and_port[0]), - parse_ports(dev_and_port[1])) - except ValueError: - parser.error("incorrect device-socket syntax (got %s, expected something of the form 0-{1,2,5-8}@)" % repr(value)) - return (dev, ports, addr) - - assert(type(values) is str) - getattr(namespace, self.dest).append(check_device_socket(values)) - - class ActionTestDir(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - assert(type(values) is str) - if not os.path.isdir(values): - parser.error("invalid value for --test-dir: directory %s does not exist" % values) - setattr(namespace, self.dest, values) - - parser = argparse.ArgumentParser(version="ptf 0.1", - usage=usage, - description=description) - - # Set up default values - parser.set_defaults(**config_default) - - parser.add_argument("test_specs", nargs="*", - help="Tests / Groups to run") - - parser.add_argument("--list", action="store_true", - help="List all tests and exit") - parser.add_argument("--list-test-names", action='store_true', - help="List test names matching the test spec and exit") - parser.add_argument("--allow-user", action="store_true", - help="Proceed even if ptf is not run as root") - - parser.add_argument("--pypath", dest="pypath", action="append") - - group = parser.add_argument_group("Test selection options") - group.add_argument("-f", "--test-file", help="File of tests to run, one per line") - group.add_argument("--test-dir", type=str, action=ActionTestDir, - required=True, help="Directory containing tests") - test_order_help = """Choose the order in which the tests will be run: - default (tests are run in the order in which they appear on command line), - lexico (use default string ordering on test names), - rand (random order, use --test-order-seed to specify a seed) - """ - group.add_argument("--test-order", - choices=["default", "lexico", "rand"], - help=test_order_help) - group.add_argument("--test-order-seed", type=int, - help="Specify seed to randomize test order") - - group = parser.add_argument_group("Switch connection options") - group.add_argument("-P", "--platform", help="Platform module name") - group.add_argument("-a", "--platform-args", help="Custom arguments for the platform") - group.add_argument("--platform-dir", type=str, help="Directory containing platform modules") - group.add_argument("--interface", "-i", type=str, dest="interfaces", metavar="INTERFACE", action=ActionInterface, - help="Specify a port number and the dataplane interface to use. May be given multiple times. Example: 1@eth1 or 0-1@eth2 (use eth2 as port 1 of device 0)") - group.add_argument("--device-socket", type=str, dest="device_sockets", metavar="DEVICE-SOCKET", action=ActionDeviceSocket, - help="Specify the nanomsg socket to use to send / receive packets for a given device, as well as the ports to enable on the device. May be given multiple times. Example: 0-{1,2,5-8}@") - - group = parser.add_argument_group("Logging options") - group.add_argument("--log-file", help="Name of log file") - group.add_argument("--log-dir", help="Name of log directory") - dbg_lvl_names = sorted(DEBUG_LEVELS.keys(), key=lambda x: DEBUG_LEVELS[x]) - group.add_argument("--debug", choices=dbg_lvl_names, - help="Debug lvl: debug, info, warning, error, critical") - group.add_argument("--verbose", action="store_const", dest="debug", - const="verbose", help="Shortcut for --debug=verbose") - group.add_argument("-q", "--quiet", action="store_const", dest="debug", - const="warning", help="Shortcut for --debug=warning") - group.add_argument("--profile", action="store_true", help="Enable Python profiling") - group.add_argument("--profile-file", help="Output file for Python profiler") - group.add_argument("--xunit", action="store_true", help="Enable xUnit-formatted results") - group.add_argument("--xunit-dir", help="Output directory for xUnit-formatted results") - - group = parser.add_argument_group("Test behavior options") - group.add_argument("--relax", action="store_true", - help="Relax packet match checks allowing other packets") - group.add_argument("--failfast", action="store_true", - help="Stop running tests as soon as one fails") - test_params_help = """Set test parameters: key=val;... (see --list) - """ - group.add_argument("-t", "--test-params", help=test_params_help) - group.add_argument("--fail-skipped", action="store_true", - help="Return failure if any test was skipped") - group.add_argument("--default-timeout", type=float, - help="Timeout in seconds for most operations") - group.add_argument("--default-negative-timeout", type=float, - help="Timeout in seconds for negative checks") - group.add_argument("--minsize", type=int, - help="Minimum allowable packet size on the dataplane.") - group.add_argument("--random-seed", type=int, - help="Random number generator seed") - group.add_argument("--disable-ipv6", action="store_true", - help="Disable IPv6 tests") - group.add_argument("--qlen", type=int, - help="Default queue length ") - group.add_argument("--test-case-timeout", type=int, - help="Timeout for each test case, 0 means no timeout") - - group.add_argument("--disable-vxlan", action="store_true", - help="Disable VXLAN (do not import from scapy even if supported)") - group.add_argument("--disable-geneve", action="store_true", - help="Disable GENEVE (do not import from scapy even if supported)") - group.add_argument("--disable-erspan", action="store_true", - help="Disable ERSPAN (do not import from scapy even if supported)") - group.add_argument("--disable-mpls", action="store_true", - help="Disable MPLS (do not import from scapy even if supported)") - group.add_argument("--disable-nvgre", action="store_true", - help="Disable NVGRE (do not import from scapy even if supported)") - - # Might need this if other parsers want command line - # parser.allow_interspersed_args = False - args = parser.parse_args() - if args.pypath: - for p in args.pypath: - sys.path.append(p) - - # Convert args from a Namespace to a plain dictionary - config = config_default.copy() - for key in config.keys(): - config[key] = getattr(args, key) - - return (config, args) - -def logging_setup(config): - """ - Set up logging based on config - """ - - logging.getLogger().setLevel(DEBUG_LEVELS[config["debug"]]) - - if config["log_dir"] != None: - if os.path.exists(config["log_dir"]): - import shutil - shutil.rmtree(config["log_dir"]) - os.makedirs(config["log_dir"]) - else: - if os.path.exists(config["log_file"]): - os.remove(config["log_file"]) - - ptf.open_logfile('main') - -def xunit_setup(config): - """ - Set up xUnit output based on config - """ - - if not config["xunit"]: - return - - if os.path.exists(config["xunit_dir"]): - import shutil - shutil.rmtree(config["xunit_dir"]) - os.makedirs(config["xunit_dir"]) - -def pcap_setup(config): - """ - Set up dataplane packet capturing based on config - """ - - if config["log_dir"] == None: - filename = os.path.splitext(config["log_file"])[0] + '.pcap' - ptf.dataplane_instance.start_pcap(filename) - else: - # start_pcap is called per-test in base_tests - pass - -def profiler_setup(config): - """ - Set up profiler based on config - """ - - if not config["profile"]: - return - - import cProfile - profiler = cProfile.Profile() - profiler.enable() - - return profiler - -def profiler_teardown(profiler): - """ - Tear down profiler based on config - """ - - if not config["profile"]: - return - - profiler.disable() - profiler.dump_stats(config["profile_file"]) - - -def load_test_modules(config): - """ - Load tests from the test_dir directory. - - Test cases are subclasses of unittest.TestCase - - Also updates the _groups member to include "standard" and - module test groups if appropriate. - - @param config The ptf configuration dictionary - @returns A dictionary from test module names to tuples of - (module, dictionary from test names to test classes). - """ - - result = OrderedDict() - - for root, dirs, filenames in os.walk(config["test_dir"]): - # Iterate over each python file - for filename in fnmatch.filter(filenames, '[!.]*.py'): - modname = os.path.splitext(os.path.basename(filename))[0] - - try: - if sys.modules.has_key(modname): - mod = sys.modules[modname] - else: - mod = imp.load_module(modname, *imp.find_module(modname, [root])) - except: - logging.warning("Could not import file " + filename) - raise - - - # Find all testcases defined in the module - tests = dict((k, v) for (k, v) in mod.__dict__.items() if type(v) == type and - issubclass(v, unittest.TestCase) and - hasattr(v, "runTest")) - if tests: - for (testname, test) in tests.items(): - # Set default annotation values - if not hasattr(test, "_groups"): - test._groups = [] - if not hasattr(test, "_nonstandard"): - test._nonstandard = False - if not hasattr(test, "_disabled"): - test._disabled = False - if not hasattr(test, "_testtimeout"): - test._testtimeout = None - - # Put test in its module's test group - if not test._disabled: - test._groups.append(modname) - - # Put test in the standard test group - if not test._disabled and not test._nonstandard: - test._groups.append("standard") - test._groups.append("all") # backwards compatibility - - result[modname] = (mod, tests) - - return result - -def prune_tests(test_specs, test_modules): - """ - Return tests matching the given test-specs. - @param test_specs A list of group names or test names. - @param test_modules Same format as the output of load_test_modules. - @returns Same format as the output of load_test_modules. - """ - result = OrderedDict() - for e in test_specs: - matched = False - - if e.startswith('^'): - negated = True - e = e[1:] - else: - negated = False - - for (modname, (mod, tests)) in test_modules.items(): - for (testname, test) in tests.items(): - if e in test._groups or e == "%s.%s" % (modname, testname): - result.setdefault(modname, (mod, OrderedDict())) - if not negated: - # if not hasattr(test, "_versions") or version in test._versions: - result[modname][1][testname] = test - else: - if modname in result and testname in result[modname][1]: - del result[modname][1][testname] - if not result[modname][1]: - del result[modname] - matched = True - - if not matched: - die("test-spec element %s did not match any tests" % e) - - return result - -def die(msg, exit_val=1): - print msg - logging.critical(msg) - sys.exit(exit_val) - -def _space_to(n, str): - """ - Generate a string of spaces to achieve width n given string str - If length of str >= n, return one space - """ - spaces = n - len(str) - if spaces > 0: - return " " * spaces - return " " - -# -# Main script -# - -# Setup global configuration -(new_config, args) = config_setup() -ptf.config.update(new_config) - -logging_setup(config) -xunit_setup(config) -logging.info("++++++++ " + time.asctime() + " ++++++++") - -# Allow tests to import each other -sys.path.append(config["test_dir"]) - -test_specs = args.test_specs -if config["test_file"] != None: - with open(config["test_file"], 'r') as f: - for line in f: - line, _, _ = line.partition('#') # remove comments - line = line.strip() - if line: - test_specs.append(line) -if test_specs == []: - test_specs = ["standard"] - -test_modules = load_test_modules(config) - -# Check if test list is requested; display and exit if so -if config["list"]: - mod_count = 0 - test_count = 0 - all_groups = set() - print """\ -Tests are shown grouped by module. If a test is in any groups beyond "standard" -and its module's group then they are shown in parentheses.""" - print - print """\ -Tests marked with '!' are disabled because they are experimental, special-purpose, -or are too long to be run normally. These are not part of the "standard" test -group or their module's test group.""" - print - print "Test List:" - for (modname, (mod, tests)) in test_modules.items(): - mod_count += 1 - desc = (mod.__doc__ or "No description").strip().split('\n')[0] - start_str = " Module " + mod.__name__ + ": " - print start_str + _space_to(22, start_str) + desc - for (testname, test) in tests.items(): - try: - desc = (test.__doc__ or "").strip() - desc = desc.split('\n')[0] - except: - desc = "No description" - groups = set(test._groups) - set(["all", "standard", modname]) - all_groups.update(test._groups) - if groups: - desc = "(%s) %s" % (",".join(groups), desc) - if hasattr(test, "_versions"): - desc = "(%s) %s" % (",".join(sorted(test._versions)), desc) - start_str = " %s%s %s:" % (test._nonstandard and "*" or " ", - test._disabled and "!" or " ", - testname) - if len(start_str) > 22: - desc = "\n" + _space_to(22, "") + desc - print start_str + _space_to(22, start_str) + desc - test_count += 1 - print - print "%d modules shown with a total of %d tests" % \ - (mod_count, test_count) - print - print "Test groups: %s" % (', '.join(sorted(all_groups))) - - sys.exit(0) - -test_modules = prune_tests(test_specs, test_modules) - -# Check if test list is requested; display and exit if so -if config["list_test_names"]: - for (modname, (mod, tests)) in test_modules.items(): - for (testname, test) in tests.items(): - print "%s.%s" % (modname, testname) - sys.exit(0) - -# Generate the test suite -test_suite = [] -for (modname, (mod, tests)) in test_modules.items(): - for (testname, test) in tests.items(): - test_suite.append(test()) -if config["test_order"] == "lexico": - test_suite.sort() -elif config["test_order"] == "rand": - seed = config["test_order_seed"] - random.seed(seed) - random.shuffle(test_suite) - - -if config["platform_dir"] is None: - from ptf import platforms - config["platform_dir"] = os.path.dirname(os.path.abspath(platforms.__file__)) - -# Allow platforms to import each other -sys.path.append(config["platform_dir"]) - -# Load the platform module -platform_name = config["platform"] -logging.info("Importing platform: " + platform_name) - -# TODO(antonin): put this check in platforms/nn.py ? -if platform_name == "nn": - try: - import nnpy - except: - die("Cannot use 'nn' platform if nnpy package is not installed") - -platform_mod = None -try: - platform_mod = imp.load_module(platform_name, *imp.find_module(platform_name, [config["platform_dir"]])) -except: - logging.warn("Failed to import " + platform_name + " platform module") - raise - -try: - platform_mod.platform_config_update(config) -except: - logging.warn("Could not run platform host configuration") - raise - -if not config["port_map"]: - die("Interface port map was not defined by the platform. Exiting.") - -logging.debug("Configuration: " + str(config)) -logging.info("port map: " + str(config["port_map"])) - -ptf.ptfutils.default_timeout = config["default_timeout"] -ptf.ptfutils.default_negative_timeout = config["default_negative_timeout"] -ptf.testutils.MINSIZE = config['minsize'] - -if os.getuid() != 0 and not config["allow_user"] and platform_name != "nn": - print "ERROR: Super-user privileges required. Please re-run with " \ - "sudo or as root." - sys.exit(1) - -if config["random_seed"] is not None: - logging.info("Random seed: %d" % config["random_seed"]) - random.seed(config["random_seed"]) -else: - # Generate random seed and report to log file - seed = random.randrange(100000000) - logging.info("Autogen random seed: %d" % seed) - random.seed(seed) - -# Remove python's signal handler which raises KeyboardError. Exiting from an -# exception waits for all threads to terminate which might not happen. -signal.signal(signal.SIGINT, signal.SIG_DFL) - -if __name__ == "__main__": - profiler = profiler_setup(config) - - # Set up the dataplane - ptf.dataplane_instance = ptf.dataplane.DataPlane(config) - pcap_setup(config) - for port_id, ifname in config["port_map"].items(): - device, port = port_id - ptf.dataplane_instance.port_add(ifname, device, port) - - logging.info("*** TEST RUN START: " + time.asctime()) - if config["xunit"]: - try: - import xmlrunner # fail-fast if module missing - except ImportError as ex: - ptf.dataplane_instance.kill() - profiler_teardown(profiler) - raise ex - runner = xmlrunner.XMLTestRunner(output=config["xunit_dir"], - outsuffix="", - verbosity=2) - else: - runner = unittest.TextTestRunner(verbosity=2) - test_case_timeout = config["test_case_timeout"] - run_failures = [] - run_errors = [] - run_timeouts = [] - from ptf.ptfutils import Timeout - for t in test_suite: - if t._testtimeout is not None: - this_test_timeout = t._testtimeout - else: - this_test_timeout = test_case_timeout - - if this_test_timeout: - with Timeout(this_test_timeout): - result = runner.run(t) - else: - result = runner.run(t) - - run_failures.extend(result.failures) - run_errors.extend(result.errors) - - if this_test_timeout: - for case in result.errors: - traceback_str = case[1] - # TODO: hacky? could not think of a better way - if "raise Timeout.TimeoutError()" in traceback_str: - logging.info("Test case failed because of timeout") - run_timeouts.append(case) - - if config["failfast"] and not result.wasSuccessful(): - logging.info("Test failed and failfast mode enabled, stopping") - break - - ptf.open_logfile('main') - if ptf.testutils.skipped_test_count > 0: - ts = " tests" - if ptf.testutils.skipped_test_count == 1: - ts = " test" - logging.info("Skipped " + str(ptf.testutils.skipped_test_count) + ts) - print("Skipped " + str(ptf.testutils.skipped_test_count) + ts) - logging.info("*** TEST RUN END : " + time.asctime()) - - # Shutdown the dataplane - ptf.dataplane_instance.stop_pcap() # no-op is pcap not started - ptf.dataplane_instance.kill() - ptf.dataplane_instance = None - - profiler_teardown(profiler) - - if run_failures or run_errors: - print - print "******************************************" - print "ATTENTION: SOME TESTS DID NOT PASS!!!" - if (not config["xunit"]) and run_failures: - print - print "The following tests failed:" - print ", ".join([f[0].__class__.__name__ for f in run_failures]) - if (not config["xunit"]) and run_errors: - print - print "The following tests errored:" - print ", ".join([f[0].__class__.__name__ for f in run_errors]) - if (not config["xunit"]) and run_timeouts: - print - print "The following tests errored because of a timeout:" - print ", ".join([f[0].__class__.__name__ for f in run_timeouts]) - print - print "******************************************" - # exit(1) hangs sometimes - os._exit(1) - if ptf.testutils.skipped_test_count > 0 and config["fail_skipped"]: - os._exit(1) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/debian/changelog b/bm/sai_adapter/test/ptf_tests/ptf/debian/changelog deleted file mode 100644 index 031bc3899..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -ptf (0.9-1) unstable; urgency=low - - * source package automatically created by stdeb 0.8.2 - - -- Guohan Lu Mon, 19 Oct 2015 12:49:43 -0700 diff --git a/bm/sai_adapter/test/ptf_tests/ptf/debian/compat b/bm/sai_adapter/test/ptf_tests/ptf/debian/compat deleted file mode 100644 index ec635144f..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/bm/sai_adapter/test/ptf_tests/ptf/debian/control b/bm/sai_adapter/test/ptf_tests/ptf/debian/control deleted file mode 100644 index 57ce1d7c5..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/debian/control +++ /dev/null @@ -1,19 +0,0 @@ -Source: ptf -Maintainer: Guohan Lu -Section: python -Priority: optional -Build-Depends: python-all (>= 2.6.6-3), debhelper (>= 9) -Standards-Version: 3.9.1 - -Package: python-ptf -Architecture: all -Depends: ${misc:Depends}, ${python:Depends}, python-scapy -Description: PTF is a Python based dataplane test framework. - . - PTF is a Python based dataplane test framework. It is based on unittest, which is included in the standard Python distribution. - . - This document is meant to provide an introduction to the framework, discuss the basics of running tests and to provide examples of how to add tests. - . - Most of the code was taken from the OFTest framework. However, PTF focuses on the dataplane and is independent of OpenFlow. We also made a few additions to oftest. - . - diff --git a/bm/sai_adapter/test/ptf_tests/ptf/debian/install b/bm/sai_adapter/test/ptf_tests/ptf/debian/install deleted file mode 100644 index b1f7519d4..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/debian/install +++ /dev/null @@ -1 +0,0 @@ -ptf /usr/bin/ diff --git a/bm/sai_adapter/test/ptf_tests/ptf/debian/rules b/bm/sai_adapter/test/ptf_tests/ptf/debian/rules deleted file mode 100755 index a6dd2783a..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/debian/rules +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/make -f - -# This file was automatically generated by stdeb 0.8.2 at -# Mon, 19 Oct 2015 12:49:43 -0700 -export PYBUILD_NAME=ptf -%: - dh $@ --with python2 --buildsystem=pybuild - -override_dh_auto_test: - diff --git a/bm/sai_adapter/test/ptf_tests/ptf/dist/ptf-0.9-py2.7.egg b/bm/sai_adapter/test/ptf_tests/ptf/dist/ptf-0.9-py2.7.egg deleted file mode 100644 index c8b9b4661af7a86f24296d0899f4d7bebacaa37d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 80844 zcmZU)Q*bCu6RsQEwrx9Ev2EM7ofX@*ZQHhO+fL5WaC9=Ev-gNr(uv(*K=7WeRlgUM zFQl+{+sDFHL0pyO*$P+PS}c!{?($bL>}(M@+Fgwqr}P%K5&nCaoqa!38b$|&BS(5@80YJCrpWRo_p4}zeJj8H6o zTo8r5l@|!SeyuPH@J%vqoUTs*&(y@Bq4#2q8Ld1Okuf-4nS-7ftZ4;^gC! zL7FA$e~gChQmF>v%WuLXpTABGwCjUQLNeghzYD;PyYX6?4>7ebp9V>S`YvL z(Eo=q8v`e+e~4A9@Y-!MAZ$NV*T8LvhaZwDDH7{yHt~l7;U+ z?d}u`OC(hR(8|NIx#P#iy2XkqC>Jxy-@Au`wSnP2USNPY%ruAKYu}~-&ZX)@ML|-+ z80C-fWCP<-sa{JjfvnALpwGZmvgx0#9H5S;7Q!?u7(gSz7Up=+AwhY`d*OIO6$r;X zKNHHZ+s_Aq;mSpakdh`A8!)P!ouybv#&B8(dmx67^X!=Q?PD$@lAzB*Y<2_EMo@`S z%o&>;fc6lOkU|(4=zCTDrtrQuDH9|BLqLKLAJfBZ+GP5*Wo_*GM*lM7PM`Sw?S#Bt z@z{;+(lJo4c9BIY&VkV$K(()q)R0Y*=zT7MHg|1!0x}Mbc|) z-AEbX!opl~SDB}aH1@Aj+$`hksOO~D989i2FB2XD&sh2NIy(uL5Y9h(JjsF~mmEs_ zY!$Pe*CTPoqOY`dT34`^$Xs_5Xwxz6!)g~PP{bKM(;uI5cK3I|sxE>8kS``Mm8REe zsFAu@$zF36nZ4kvFQmFY9k~7*0$cz+4r9aWuh(U^_a_XMh-Sa=^fRuWdQ&@m&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K!2{Lof#MkNCuC##tHLN*oE064vNDY&lbER3893M^ zGR-STrCn#kdCI$z6% za(>#28TZk53i^s_)X>Pg3C};KZXUEhjUJwVI}9Lz&Ft#b(IQv|o2Ei5mnoj@KvY&w zh<7frXJ^jB^1$}*H4+Zop_%L9UGvfk0 zygvm80)hj4`@0qRzy9|h`G>xP<7*~>x5(>`*uhBvQWH><5cW3=@LAw*1o-w9X|3;Q z`3CqZ6_Lzadv^x7U+#VPS7q(r*aCkYfD^AkeG@xtyk3*i4N+CbmYSogIm+H0NeKjE*&zuNEF(djD<({#gKbUg3X; zT>fR;d8{ri6M(D*n0ifg^1BuIHv)Wli?RP8i4|D%-ugx6HP5y7sUxQv|)0T`2u#O0rqVT`bfX@Pd z7@s$uzqP%{cj1>n0&v>t?M#ygERMJ1^{<$5Nr0wp04yT_`u$JKD22Z*|FyFI1*ND= zna>44rvOU}`5#Ubmi`6(#~l9${l9PR0)Z z$0Au9;jj{|2jd{}=p^p#97G z+v1FW6X^B-x9@;W>36BdKh3|6+1ngSf1_`X|3d$v$ zEyLS%Fn=?YpTA}JpJ4h=lGoMxHYv&9Bo-HMNq#4F_(vFDN!})`_?sl*>MhA1A^8W- zYe3)Tl=z#6f|7owf&fl%Tzx(Aa!5=~Wlje17-l{zRrn&zY&3`qYZz=v% zzP$=Xf42hv7hvGOwSRvq2H#S=6%77O!3OdN#UJv)w+w$e0eG(VzgFN+1^NfW|0TwI zOZ8TZ_nWK0-}Fza-^#qV@V9U6{)P{r{Nc$zUf#Xsc>C(^H^;F*5b7Tsf4sqylLQBB UvOqwTfIkSpCSSt@*t3EDA7IGSfB*mh diff --git a/bm/sai_adapter/test/ptf_tests/ptf/example/run_client.sh b/bm/sai_adapter/test/ptf_tests/ptf/example/run_client.sh deleted file mode 100755 index e27a058d6..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/example/run_client.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -sudo ../ptf --test-dir mytests/ --pypath $PWD \ - --interface 0@veth1 --interface 1@veth3 --interface 2@veth5 \ - --interface 3@veth7 --interface 4@veth9 --interface 5@veth11 \ - --interface 6@veth13 --interface 7@veth15 --interface 8@veth17 diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf b/bm/sai_adapter/test/ptf_tests/ptf/ptf deleted file mode 100755 index 3f7b01a38..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf +++ /dev/null @@ -1,733 +0,0 @@ -#!/usr/bin/env python -""" -@package ptf - -Packet Test Framework (ptf) top level script - -To add a new command line option, edit both the config_default dictionary and -the config_setup function. The option's result will end up in the global -oftest.config dictionary. -""" - -import sys -import argparse -from subprocess import Popen,PIPE -import logging -import unittest -import time -import os -import imp -import random -import signal -import fnmatch -import copy -from collections import OrderedDict - -root_dir = os.path.dirname(os.path.realpath(__file__)) - -pydir = os.path.join(root_dir, 'src') -if os.path.exists(os.path.join(pydir, 'ptf')): - # Running from source tree - sys.path.insert(0, pydir) - -import ptf -from ptf import config -import ptf.ptfutils - -##@var DEBUG_LEVELS -# Map from strings to debugging levels -DEBUG_LEVELS = { - 'debug' : logging.DEBUG, - 'verbose' : logging.DEBUG, - 'info' : logging.INFO, - 'warning' : logging.WARNING, - 'warn' : logging.WARNING, - 'error' : logging.ERROR, - 'critical' : logging.CRITICAL -} - -##@var config_default -# The default configuration dictionary for PTF -config_default = { - # Miscellaneous options - "list" : False, - "list_test_names" : False, - "allow_user" : False, - - # Test selection options - "test_spec" : "", - "test_file" : None, - "test_dir" : None, - "test_order" : "default", - "test_order_seed" : 0xaba, - - # Switch connection options - "platform" : "eth", - "platform_args" : None, - "platform_dir" : None, - "interfaces" : [], - "device_sockets" : [], # when using nanomsg - - # Logging options - "log_file" : "ptf.log", - "log_dir" : None, - "debug" : "verbose", - "profile" : False, - "profile_file" : "profile.out", - "xunit" : False, - "xunit_dir" : "xunit", - - # Test behavior options - "relax" : False, - "test_params" : "None", - "failfast" : False, - "fail_skipped" : False, - "default_timeout" : 2.0, - "default_negative_timeout" : 0.1, - "minsize" : 0, - "random_seed" : None, - "disable_ipv6" : False, - "disable_vxlan" : False, - "disable_erspan" : False, - "disable_geneve" : False, - "disable_mpls" : False, - "disable_nvgre" : False, - "qlen" : 100, - "test_case_timeout" : None, - - # Other configuration - "port_map" : {}, -} - -def config_setup(): - """ - Set up the configuration including parsing the arguments - - @return A pair (config, args) where config is an config - object and args is any additional arguments from the command line - """ - - usage = "usage: ptf [options] --test-dir TEST_DIR [tests]" - - description = """PTF (Packet Test Framework) is a framework and set of tests -to test a software switch. It is strongly inspired by the OFTest framework, but -it is not tied to OpenFlow. It does not provide any control plane features, but -it is targetted at helping you test a dataplane. - -The default configuration assumes that interfaces veth1, veth3, veth5, and veth7 -should be connected to the switch's dataplane. - -If no positional arguments are given then OFTest will run all tests found in the ---test-dir directory. Otherwise each positional argument is interpreted as -either a test name or a test group name. The union of these will be executed. To -see what groups each test belongs to use the --list option. Tests and groups can -be subtracted from the result by prefixing them with the '^' character. """ - - class ActionInterface(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - # Parse --interface - def check_interface(value): - try: - dev_and_port, interface = value.split('@', 1) - dev_and_port = dev_and_port.split("-") - if len(dev_and_port) == 1: - dev, port = 0, int(dev_and_port[0]) - elif len(dev_and_port) == 2: - dev, port = int(dev_and_port[0]), int(dev_and_port[1]) - else: - raise ValueError("") - except ValueError: - parser.error("incorrect interface syntax (got %s, expected 'port@interface' or 'device-port@interface')" % repr(value)) - return (dev, port, interface) - - assert(type(values) is str) - getattr(namespace, self.dest).append(check_interface(values)) - - class ActionDeviceSocket(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - # Parse --device-socket - def check_device_socket(value): - def parse_ports(ports): - port_set = set() - try: - ports = ports.strip("{}") - ports = ports.split(",") - except: - raise ValueError("") - for port in ports: - try: - p = int(port) - port_set.add(p) - continue - except: - pass - try: - p1, p2 = port.split("-", 1) - p1, p2 = int(p1), int(p2) - for p in xrange(p1, p2 + 1): # p2 included - port_set.add(p) - except: - raise ValueError("") - return port_set - - try: - dev_and_port, addr = value.split('@', 1) - if dev_and_port[0] == '{': - dev, ports = (0, parse_ports(dev_and_port)) - else: - dev_and_port = dev_and_port.split("-", 1) - if len(dev_and_port) != 2: - raise ValueError("") - dev, ports = (int(dev_and_port[0]), - parse_ports(dev_and_port[1])) - except ValueError: - parser.error("incorrect device-socket syntax (got %s, expected something of the form 0-{1,2,5-8}@)" % repr(value)) - return (dev, ports, addr) - - assert(type(values) is str) - getattr(namespace, self.dest).append(check_device_socket(values)) - - class ActionTestDir(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - assert(type(values) is str) - if not os.path.isdir(values): - parser.error("invalid value for --test-dir: directory %s does not exist" % values) - setattr(namespace, self.dest, values) - - parser = argparse.ArgumentParser(version="ptf 0.1", - usage=usage, - description=description) - - # Set up default values - parser.set_defaults(**config_default) - - parser.add_argument("test_specs", nargs="*", - help="Tests / Groups to run") - - parser.add_argument("--list", action="store_true", - help="List all tests and exit") - parser.add_argument("--list-test-names", action='store_true', - help="List test names matching the test spec and exit") - parser.add_argument("--allow-user", action="store_true", - help="Proceed even if ptf is not run as root") - - parser.add_argument("--pypath", dest="pypath", action="append") - - group = parser.add_argument_group("Test selection options") - group.add_argument("-f", "--test-file", help="File of tests to run, one per line") - group.add_argument("--test-dir", type=str, action=ActionTestDir, - required=True, help="Directory containing tests") - test_order_help = """Choose the order in which the tests will be run: - default (tests are run in the order in which they appear on command line), - lexico (use default string ordering on test names), - rand (random order, use --test-order-seed to specify a seed) - """ - group.add_argument("--test-order", - choices=["default", "lexico", "rand"], - help=test_order_help) - group.add_argument("--test-order-seed", type=int, - help="Specify seed to randomize test order") - - group = parser.add_argument_group("Switch connection options") - group.add_argument("-P", "--platform", help="Platform module name") - group.add_argument("-a", "--platform-args", help="Custom arguments for the platform") - group.add_argument("--platform-dir", type=str, help="Directory containing platform modules") - group.add_argument("--interface", "-i", type=str, dest="interfaces", metavar="INTERFACE", action=ActionInterface, - help="Specify a port number and the dataplane interface to use. May be given multiple times. Example: 1@eth1 or 0-1@eth2 (use eth2 as port 1 of device 0)") - group.add_argument("--device-socket", type=str, dest="device_sockets", metavar="DEVICE-SOCKET", action=ActionDeviceSocket, - help="Specify the nanomsg socket to use to send / receive packets for a given device, as well as the ports to enable on the device. May be given multiple times. Example: 0-{1,2,5-8}@") - - group = parser.add_argument_group("Logging options") - group.add_argument("--log-file", help="Name of log file") - group.add_argument("--log-dir", help="Name of log directory") - dbg_lvl_names = sorted(DEBUG_LEVELS.keys(), key=lambda x: DEBUG_LEVELS[x]) - group.add_argument("--debug", choices=dbg_lvl_names, - help="Debug lvl: debug, info, warning, error, critical") - group.add_argument("--verbose", action="store_const", dest="debug", - const="verbose", help="Shortcut for --debug=verbose") - group.add_argument("-q", "--quiet", action="store_const", dest="debug", - const="warning", help="Shortcut for --debug=warning") - group.add_argument("--profile", action="store_true", help="Enable Python profiling") - group.add_argument("--profile-file", help="Output file for Python profiler") - group.add_argument("--xunit", action="store_true", help="Enable xUnit-formatted results") - group.add_argument("--xunit-dir", help="Output directory for xUnit-formatted results") - - group = parser.add_argument_group("Test behavior options") - group.add_argument("--relax", action="store_true", - help="Relax packet match checks allowing other packets") - group.add_argument("--failfast", action="store_true", - help="Stop running tests as soon as one fails") - test_params_help = """Set test parameters: key=val;... (see --list) - """ - group.add_argument("-t", "--test-params", help=test_params_help) - group.add_argument("--fail-skipped", action="store_true", - help="Return failure if any test was skipped") - group.add_argument("--default-timeout", type=float, - help="Timeout in seconds for most operations") - group.add_argument("--default-negative-timeout", type=float, - help="Timeout in seconds for negative checks") - group.add_argument("--minsize", type=int, - help="Minimum allowable packet size on the dataplane.") - group.add_argument("--random-seed", type=int, - help="Random number generator seed") - group.add_argument("--disable-ipv6", action="store_true", - help="Disable IPv6 tests") - group.add_argument("--qlen", type=int, - help="Default queue length ") - group.add_argument("--test-case-timeout", type=int, - help="Timeout for each test case, 0 means no timeout") - - group.add_argument("--disable-vxlan", action="store_true", - help="Disable VXLAN (do not import from scapy even if supported)") - group.add_argument("--disable-geneve", action="store_true", - help="Disable GENEVE (do not import from scapy even if supported)") - group.add_argument("--disable-erspan", action="store_true", - help="Disable ERSPAN (do not import from scapy even if supported)") - group.add_argument("--disable-mpls", action="store_true", - help="Disable MPLS (do not import from scapy even if supported)") - group.add_argument("--disable-nvgre", action="store_true", - help="Disable NVGRE (do not import from scapy even if supported)") - - # Might need this if other parsers want command line - # parser.allow_interspersed_args = False - args = parser.parse_args() - if args.pypath: - for p in args.pypath: - sys.path.append(p) - - # Convert args from a Namespace to a plain dictionary - config = config_default.copy() - for key in config.keys(): - config[key] = getattr(args, key) - - return (config, args) - -def logging_setup(config): - """ - Set up logging based on config - """ - - logging.getLogger().setLevel(DEBUG_LEVELS[config["debug"]]) - - if config["log_dir"] != None: - if os.path.exists(config["log_dir"]): - import shutil - shutil.rmtree(config["log_dir"]) - os.makedirs(config["log_dir"]) - else: - if os.path.exists(config["log_file"]): - os.remove(config["log_file"]) - - ptf.open_logfile('main') - -def xunit_setup(config): - """ - Set up xUnit output based on config - """ - - if not config["xunit"]: - return - - if os.path.exists(config["xunit_dir"]): - import shutil - shutil.rmtree(config["xunit_dir"]) - os.makedirs(config["xunit_dir"]) - -def pcap_setup(config): - """ - Set up dataplane packet capturing based on config - """ - - if config["log_dir"] == None: - filename = os.path.splitext(config["log_file"])[0] + '.pcap' - ptf.dataplane_instance.start_pcap(filename) - else: - # start_pcap is called per-test in base_tests - pass - -def profiler_setup(config): - """ - Set up profiler based on config - """ - - if not config["profile"]: - return - - import cProfile - profiler = cProfile.Profile() - profiler.enable() - - return profiler - -def profiler_teardown(profiler): - """ - Tear down profiler based on config - """ - - if not config["profile"]: - return - - profiler.disable() - profiler.dump_stats(config["profile_file"]) - - -def load_test_modules(config): - """ - Load tests from the test_dir directory. - - Test cases are subclasses of unittest.TestCase - - Also updates the _groups member to include "standard" and - module test groups if appropriate. - - @param config The ptf configuration dictionary - @returns A dictionary from test module names to tuples of - (module, dictionary from test names to test classes). - """ - - result = OrderedDict() - - for root, dirs, filenames in os.walk(config["test_dir"]): - # Iterate over each python file - for filename in fnmatch.filter(filenames, '[!.]*.py'): - modname = os.path.splitext(os.path.basename(filename))[0] - - try: - if sys.modules.has_key(modname): - mod = sys.modules[modname] - else: - mod = imp.load_module(modname, *imp.find_module(modname, [root])) - except: - logging.warning("Could not import file " + filename) - raise - - - # Find all testcases defined in the module - tests = dict((k, v) for (k, v) in mod.__dict__.items() if type(v) == type and - issubclass(v, unittest.TestCase) and - hasattr(v, "runTest")) - if tests: - for (testname, test) in tests.items(): - # Set default annotation values - if not hasattr(test, "_groups"): - test._groups = [] - if not hasattr(test, "_nonstandard"): - test._nonstandard = False - if not hasattr(test, "_disabled"): - test._disabled = False - if not hasattr(test, "_testtimeout"): - test._testtimeout = None - - # Put test in its module's test group - if not test._disabled: - test._groups.append(modname) - - # Put test in the standard test group - if not test._disabled and not test._nonstandard: - test._groups.append("standard") - test._groups.append("all") # backwards compatibility - - result[modname] = (mod, tests) - - return result - -def prune_tests(test_specs, test_modules): - """ - Return tests matching the given test-specs. - @param test_specs A list of group names or test names. - @param test_modules Same format as the output of load_test_modules. - @returns Same format as the output of load_test_modules. - """ - result = OrderedDict() - for e in test_specs: - matched = False - - if e.startswith('^'): - negated = True - e = e[1:] - else: - negated = False - - for (modname, (mod, tests)) in test_modules.items(): - for (testname, test) in tests.items(): - if e in test._groups or e == "%s.%s" % (modname, testname): - result.setdefault(modname, (mod, OrderedDict())) - if not negated: - # if not hasattr(test, "_versions") or version in test._versions: - result[modname][1][testname] = test - else: - if modname in result and testname in result[modname][1]: - del result[modname][1][testname] - if not result[modname][1]: - del result[modname] - matched = True - - if not matched: - die("test-spec element %s did not match any tests" % e) - - return result - -def die(msg, exit_val=1): - print msg - logging.critical(msg) - sys.exit(exit_val) - -def _space_to(n, str): - """ - Generate a string of spaces to achieve width n given string str - If length of str >= n, return one space - """ - spaces = n - len(str) - if spaces > 0: - return " " * spaces - return " " - -# -# Main script -# - -# Setup global configuration -(new_config, args) = config_setup() -ptf.config.update(new_config) - -logging_setup(config) -xunit_setup(config) -logging.info("++++++++ " + time.asctime() + " ++++++++") - -# Allow tests to import each other -sys.path.append(config["test_dir"]) - -test_specs = args.test_specs -if config["test_file"] != None: - with open(config["test_file"], 'r') as f: - for line in f: - line, _, _ = line.partition('#') # remove comments - line = line.strip() - if line: - test_specs.append(line) -if test_specs == []: - test_specs = ["standard"] - -test_modules = load_test_modules(config) - -# Check if test list is requested; display and exit if so -if config["list"]: - mod_count = 0 - test_count = 0 - all_groups = set() - print """\ -Tests are shown grouped by module. If a test is in any groups beyond "standard" -and its module's group then they are shown in parentheses.""" - print - print """\ -Tests marked with '!' are disabled because they are experimental, special-purpose, -or are too long to be run normally. These are not part of the "standard" test -group or their module's test group.""" - print - print "Test List:" - for (modname, (mod, tests)) in test_modules.items(): - mod_count += 1 - desc = (mod.__doc__ or "No description").strip().split('\n')[0] - start_str = " Module " + mod.__name__ + ": " - print start_str + _space_to(22, start_str) + desc - for (testname, test) in tests.items(): - try: - desc = (test.__doc__ or "").strip() - desc = desc.split('\n')[0] - except: - desc = "No description" - groups = set(test._groups) - set(["all", "standard", modname]) - all_groups.update(test._groups) - if groups: - desc = "(%s) %s" % (",".join(groups), desc) - if hasattr(test, "_versions"): - desc = "(%s) %s" % (",".join(sorted(test._versions)), desc) - start_str = " %s%s %s:" % (test._nonstandard and "*" or " ", - test._disabled and "!" or " ", - testname) - if len(start_str) > 22: - desc = "\n" + _space_to(22, "") + desc - print start_str + _space_to(22, start_str) + desc - test_count += 1 - print - print "%d modules shown with a total of %d tests" % \ - (mod_count, test_count) - print - print "Test groups: %s" % (', '.join(sorted(all_groups))) - - sys.exit(0) - -test_modules = prune_tests(test_specs, test_modules) - -# Check if test list is requested; display and exit if so -if config["list_test_names"]: - for (modname, (mod, tests)) in test_modules.items(): - for (testname, test) in tests.items(): - print "%s.%s" % (modname, testname) - sys.exit(0) - -# Generate the test suite -test_suite = [] -for (modname, (mod, tests)) in test_modules.items(): - for (testname, test) in tests.items(): - test_suite.append(test()) -if config["test_order"] == "lexico": - test_suite.sort() -elif config["test_order"] == "rand": - seed = config["test_order_seed"] - random.seed(seed) - random.shuffle(test_suite) - - -if config["platform_dir"] is None: - from ptf import platforms - config["platform_dir"] = os.path.dirname(os.path.abspath(platforms.__file__)) - -# Allow platforms to import each other -sys.path.append(config["platform_dir"]) - -# Load the platform module -platform_name = config["platform"] -logging.info("Importing platform: " + platform_name) - -# TODO(antonin): put this check in platforms/nn.py ? -if platform_name == "nn": - try: - import nnpy - except: - die("Cannot use 'nn' platform if nnpy package is not installed") - -platform_mod = None -try: - platform_mod = imp.load_module(platform_name, *imp.find_module(platform_name, [config["platform_dir"]])) -except: - logging.warn("Failed to import " + platform_name + " platform module") - raise - -try: - platform_mod.platform_config_update(config) -except: - logging.warn("Could not run platform host configuration") - raise - -if not config["port_map"]: - die("Interface port map was not defined by the platform. Exiting.") - -logging.debug("Configuration: " + str(config)) -logging.info("port map: " + str(config["port_map"])) - -ptf.ptfutils.default_timeout = config["default_timeout"] -ptf.ptfutils.default_negative_timeout = config["default_negative_timeout"] -ptf.testutils.MINSIZE = config['minsize'] - -if os.getuid() != 0 and not config["allow_user"] and platform_name != "nn": - print "ERROR: Super-user privileges required. Please re-run with " \ - "sudo or as root." - sys.exit(1) - -if config["random_seed"] is not None: - logging.info("Random seed: %d" % config["random_seed"]) - random.seed(config["random_seed"]) -else: - # Generate random seed and report to log file - seed = random.randrange(100000000) - logging.info("Autogen random seed: %d" % seed) - random.seed(seed) - -# Remove python's signal handler which raises KeyboardError. Exiting from an -# exception waits for all threads to terminate which might not happen. -signal.signal(signal.SIGINT, signal.SIG_DFL) - -if __name__ == "__main__": - profiler = profiler_setup(config) - - # Set up the dataplane - ptf.dataplane_instance = ptf.dataplane.DataPlane(config) - pcap_setup(config) - for port_id, ifname in config["port_map"].items(): - device, port = port_id - ptf.dataplane_instance.port_add(ifname, device, port) - - logging.info("*** TEST RUN START: " + time.asctime()) - if config["xunit"]: - try: - import xmlrunner # fail-fast if module missing - except ImportError as ex: - ptf.dataplane_instance.kill() - profiler_teardown(profiler) - raise ex - runner = xmlrunner.XMLTestRunner(output=config["xunit_dir"], - outsuffix="", - verbosity=2) - else: - runner = unittest.TextTestRunner(verbosity=2) - test_case_timeout = config["test_case_timeout"] - run_failures = [] - run_errors = [] - run_timeouts = [] - from ptf.ptfutils import Timeout - for t in test_suite: - if t._testtimeout is not None: - this_test_timeout = t._testtimeout - else: - this_test_timeout = test_case_timeout - - if this_test_timeout: - with Timeout(this_test_timeout): - result = runner.run(t) - else: - result = runner.run(t) - - run_failures.extend(result.failures) - run_errors.extend(result.errors) - - if this_test_timeout: - for case in result.errors: - traceback_str = case[1] - # TODO: hacky? could not think of a better way - if "raise Timeout.TimeoutError()" in traceback_str: - logging.info("Test case failed because of timeout") - run_timeouts.append(case) - - if config["failfast"] and not result.wasSuccessful(): - logging.info("Test failed and failfast mode enabled, stopping") - break - - ptf.open_logfile('main') - if ptf.testutils.skipped_test_count > 0: - ts = " tests" - if ptf.testutils.skipped_test_count == 1: - ts = " test" - logging.info("Skipped " + str(ptf.testutils.skipped_test_count) + ts) - print("Skipped " + str(ptf.testutils.skipped_test_count) + ts) - logging.info("*** TEST RUN END : " + time.asctime()) - - # Shutdown the dataplane - ptf.dataplane_instance.stop_pcap() # no-op is pcap not started - ptf.dataplane_instance.kill() - ptf.dataplane_instance = None - - profiler_teardown(profiler) - - if run_failures or run_errors: - print - print "******************************************" - print "ATTENTION: SOME TESTS DID NOT PASS!!!" - if (not config["xunit"]) and run_failures: - print - print "The following tests failed:" - print ", ".join([f[0].__class__.__name__ for f in run_failures]) - if (not config["xunit"]) and run_errors: - print - print "The following tests errored:" - print ", ".join([f[0].__class__.__name__ for f in run_errors]) - if (not config["xunit"]) and run_timeouts: - print - print "The following tests errored because of a timeout:" - print ", ".join([f[0].__class__.__name__ for f in run_timeouts]) - print - print "******************************************" - # exit(1) hangs sometimes - os._exit(1) - if ptf.testutils.skipped_test_count > 0 and config["fail_skipped"]: - os._exit(1) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/README.md b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/README.md deleted file mode 100644 index cf0d4fad0..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# PTF Nanomsg Agent - ---- - -This agent is able to "bridge" a nanomsg socket with network interfaces. It can -be useful to enable PTF to send and receive packets on a remote host (i.e. not -the host running PTF). - ---- - -## Dependencies - -We rely on [nanomsg](http://nanomsg.org/) (a messaging library) to forward -packets between the PTF agent and the PTF test runner. You will therefore need -to install the following: - - - [nanomsg](https://github.com/nanomsg/nanomsg/releases): we recommend - installing the `1.0.0` production release. - - [nnpy](https://github.com/nanomsg/nnpy): these are the Python bindings for - nanomsg. You may use the provided (install-nnpy.sh)[install-nnpy.sh] script - to install nnpy. It will install a version of nnpy that we have tested. - -We provide a [check-nnpy.py](check-nnpy.py) script that you can run to check -that nanomsg and nnpy are running properly. - -## Overview - -![PTF nanomsg overview](resources/ptf_nn.png) - -In the above setup, we are able to capture and send packets on two different -machines (the PTF host and a remote host). Each agent acts as an intermediary -between a set of interfaces (connected to the switch) and the PTF -tester. Packets received on an interface (from the switch) will be tagged with -the port number and forwarded to the PTF tester. Packets received from the PTF -tester will be forwarded to the switch using the appropriate -interface. Communications between the PTF tester and each agent are done over -TCP using the nanomsg messaging library. - -## Demo - -Create the required 2 veth pairs (veth0-veth1 and veth2-veth3) with -`./veth_setup.sh`. - -All of the following 4 steps need to be done in separate terminals. We assume -that PTF has been installed in a system location (i.e. the `ptf` binary is in -the `PATH`). - -Start the first PTF agent with `sudo python ptf_nn_agent.py --device-socket -0@tcp://127.0.0.1:10001 -i 0-1@veth0`. - -Start the second PTF agent with `sudo python ptf_nn_agent.py --device-socket -1@tcp://127.0.0.1:10002 -i 1-1@veth3`. - -Start the dummy "test switch" with `sudo python ptf_nn_test_bridge.py -ifrom -veth1 -ito veth2`. This tool will "copy" any packet received on `veth1` to -`veth2`. - -Run the PTF test with `sudo ptf --test-dir ptf_nn_test --device-socket -0-{0-64}@tcp://127.0.0.1:10001 --device-socket 1-{0-64}@tcp://127.0.0.1:10002 ---platform nn`. - -Now let's explain what's happening. We can consider that the first PTF agent -runs on the PTF host. The second PTF agent runs on the remote host. For each -host we need to use a separate device id (0 for the PTF host, 1 for the remote -host). The "switch" is connected to the PTF host through veth0-veth1 and to the -remote host through veth2-veth3. When running `ptf`, we need to use the `nn` -platform and provide the nanomsg TCP address for each of the 2 devices. - -In our test, we send a packet to port 1 of device 0 and receive the exact same -packet on port 1 of device 1, as expected. - -Of course, the remote host needs to be reachable by the PTF host, or the TCP -connection is not possible. diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/check-nnpy.py b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/check-nnpy.py deleted file mode 120000 index 075a72dac..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/check-nnpy.py +++ /dev/null @@ -1 +0,0 @@ -../CI/travis/check-nnpy.py \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/install-nnpy.py b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/install-nnpy.py deleted file mode 120000 index e827d02b7..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/install-nnpy.py +++ /dev/null @@ -1 +0,0 @@ -../CI/travis/install-nnpy.sh \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_agent.py b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_agent.py deleted file mode 100644 index 9fa9c6a24..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_agent.py +++ /dev/null @@ -1,383 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Antonin Bas (antonin@barefootnetworks.com) -# -# - -import sys -import os -import argparse -import time -import struct -import socket -import Queue -try: - import nnpy -except ImportError: - print "Cannot find nnpy package, please install" - sys.exit(1) -import threading -import os -import logging -from fcntl import ioctl -from socket import AF_NETLINK, SOCK_DGRAM - -# copied from ptf.netutils -# From bits/ioctls.h -SIOCGIFHWADDR = 0x8927 # Get hardware address -SIOCGIFINDEX = 0x8933 # name -> if_index mapping -SIOCGIFFLAGS = 0x8913 # get the active flag word of the device -SIOCSIFFLAGS = 0x8914 # set the active flag word of the device -IFF_UP = 0x0001 - -def get_if(iff, cmd): - s = socket.socket() - ifreq = ioctl(s, cmd, struct.pack("16s16x",iff)) - s.close() - return ifreq - -def get_if_index(iff): - return int(struct.unpack("I", get_if(iff, SIOCGIFINDEX)[16:20])[0]) - -def get_mac(iff): - return ':'.join( - ['%02x' % ord(char) for char in get_if(iff, SIOCGIFHWADDR)[18:24]]) - -def set_if_status(iff, status): - s = socket.socket() - ifr = struct.pack('16sh', iff, 0) - result = ioctl(s, SIOCGIFFLAGS, ifr) - flags = struct.unpack('16sh', result)[1] - if status: - flags |= IFF_UP - else: - flags &= ~IFF_UP - ifr = struct.pack('16sh', iff, flags) - ioctl(s, SIOCSIFFLAGS, ifr) - s.close() - -def get_if_status(iff): - try: - s = socket.socket() - ifr = struct.pack('16sh', iff, 0) - result = ioctl(s, SIOCGIFFLAGS, ifr) - s.close() - except IOError: - return False - - flags = struct.unpack('16sh', result)[1] - - return flags & IFF_UP > 0 - -def if_exists(iff): - ifaces = os.listdir('/sys/class/net') - - return iff in ifaces - -# Taken from ptf parser -class ActionInterface(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - # Parse --interface - def check_interface(value): - try: - dev_and_port, interface = value.split('@', 1) - dev_and_port = dev_and_port.split("-") - if len(dev_and_port) == 1: - dev, port = 0, int(dev_and_port[0]) - elif len(dev_and_port) == 2: - dev, port = int(dev_and_port[0]), int(dev_and_port[1]) - else: - raise ValueError("") - except ValueError: - parser.error("incorrect interface syntax (got %s, expected 'port@interface' or 'device-port@interface')" % repr(value)) - return (dev, port, interface) - - assert(type(values) is str) - getattr(namespace, self.dest).append(check_interface(values)) - -class ActionDeviceSocket(argparse.Action): - def __init__(self, *args, **kwargs): - super(ActionDeviceSocket, self).__init__(*args, **kwargs) - self.devices_observed = set() - - def __call__(self, parser, namespace, values, option_string=None): - # Parse --device-socket - def check_device_socket(value): - try: - dev, addr = value.split('@', 1) - dev = int(dev) - except ValueError: - parser.error("incorrect device-socket syntax (got %s, expected something of the form @)" % repr(value)) - if dev in self.devices_observed: - parser.error("cannot specify the same device twice") - else: - self.devices_observed.add(dev) - if addr.startswith("ipc://"): - pass - elif addr.startswith("tcp://"): - pass - else: - parser.error("nanomsg address must start with 'ipc://' or 'tcp://'") - return (dev, addr) - - assert(type(values) is str) - getattr(namespace, self.dest).append(check_device_socket(values)) - -parser = argparse.ArgumentParser(description='PTF Nanomsg agent') -parser.add_argument( - "--device-socket", type=str, dest="device_sockets", - metavar="DEVICE-SOCKET", action=ActionDeviceSocket, default=[], - help="Specify the nanomsg socket to use to send / receive packets for a given device, as well as the ports to enable on the device.May be given multiple times. Example: 0@") -parser.add_argument( - "--interface", "-i", type=str, dest="interfaces", - metavar="INTERFACE", action=ActionInterface, default=[], - help="Specify a port number and the dataplane interface to use. May be given multiple times. Example: 0-1@eth2 (use eth2 as port 1 of device 0)") -parser.add_argument( - "--verbose", "-v", dest="verbose", action='store_true', - help="Specify if you need verbose output") -parser.add_argument( - "--set-nn-rcv-buffer", type=int, dest="nn_rcv_buf", - metavar="BUFFER_SIZE", default=0, - help="Specify a nanomsg socket receive buffer size") -parser.add_argument( - "--set-nn-snd-buffer", type=int, dest="nn_snd_buf", - metavar="BUFFER_SIZE", default=0, - help="Specify a nanomsg socket send buffer size") -parser.add_argument( - "--set-iface-rcv-buffer", type=int, dest="iface_rcv_buf", - metavar="BUFFER_SIZE", default=0, - help="Specify an interface socket receive buffer size") -parser.add_argument( - "--set-iface-snd-buffer", type=int, dest="iface_snd_buf", - metavar="BUFFER_SIZE", default=0, - help="Specify an interface socket send buffer size") - -args = parser.parse_args() - -iface_mgrs = {} -nano_mgrs = {} - -logging.basicConfig(format='%(message)s') -logger = logging.getLogger('ptf_nn_agent') - -class IfaceMgr(threading.Thread): - def __init__(self, dev, port, iface_name, iface_rcv_buf=0, iface_snd_buf=0): - threading.Thread.__init__(self) - self.daemon = True - self.rx_ctr = 0 - self.tx_ctr = 0 - self.dev = dev - self.port = port - self.iface_name = iface_name - self.iface_rcv_buf = iface_rcv_buf - self.iface_snd_buf = iface_snd_buf - - def forward(self, p): - # can that conflict with sniff? - self.socket.send(p) - self.tx_ctr += 1 - - def received(self, p): - logger.debug("IfaceMgr {}-{} ({}) received a packet".format( - self.dev, self.port, self.iface_name)) - if self.dev in nano_mgrs: - nano_mgr = nano_mgrs[self.dev] - nano_mgr.forward(str(p), self.port) - self.rx_ctr += 1 - - def get_mac(self): - try: - mac = get_mac(self.iface_name) - return mac - except: - # if not supported on platform - return None - - def get_ctrs(self): - return self.rx_ctr, self.tx_ctr - - def port_up(self): - set_if_status(self.iface_name, True) - logger.debug("IfaceMgr {}-{} ({}) status set to UP".format( - self.dev, self.port, self.iface_name)) - - def port_down(self): - set_if_status(self.iface_name, False) - logger.debug("IfaceMgr {}-{} ({}) status set to DOWN".format( - self.dev, self.port, self.iface_name)) - - def run(self): - # run this loop in case the interface goes down by external action - # or the interface disappears - while True: - # wait until the port goes up - while True: - if if_exists(self.iface_name) and get_if_status(self.iface_name): - break - time.sleep(1) - - logger.debug("IfaceMgr {}-{} ({}) status changed to UP".format( - self.dev, self.port, self.iface_name)) - try: - self.socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, - socket.htons(0x03)) - if self.iface_rcv_buf != 0: - self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, self.iface_rcv_buf) - - if self.iface_snd_buf != 0: - self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, self.iface_snd_buf) - - self.socket.bind((self.iface_name, 0)) - logger.debug("IfaceMgr {}-{} ({}) AF_PACKET socket is open".format( - self.dev, self.port, self.iface_name)) - while True: - msg = self.socket.recv(4096) - self.received(msg) - except socket.error as err: - logger.debug("IfaceMgr {}-{} ({}) Error reading from the socket.".format( - self.dev, self.port, self.iface_name)) - self.socket.close() - - -class NanomsgMgr(threading.Thread): - MSG_TYPE_PORT_ADD = 0 - MSG_TYPE_PORT_REMOVE = 1 - MSG_TYPE_PORT_SET_STATUS = 2 - MSG_TYPE_PACKET_IN = 3 - MSG_TYPE_PACKET_OUT = 4 - MSG_TYPE_INFO_REQ = 5 - MSG_TYPE_INFO_REP = 6 - - MSG_PORT_STATUS_UP = 0 - MSG_PORT_STATUS_DOWN = 1 - - MSG_INFO_TYPE_HWADDR = 0 - MSG_INFO_TYPE_CTRS = 1 - - MSG_INFO_STATUS_SUCCESS = 0 - MSG_INFO_STATUS_NOT_SUPPORTED = 1 - - def __init__(self, dev, socket_addr, nn_rcv_buf=0, nn_snd_buf=0): - threading.Thread.__init__(self) - self.daemon = True - self.dev = dev - self.socket_addr = socket_addr - self.socket = nnpy.Socket(nnpy.AF_SP, nnpy.PAIR) - if nn_rcv_buf != 0: - self.socket.setsockopt(nnpy.SOL_SOCKET, nnpy.RCVBUF, nn_rcv_buf) - if nn_snd_buf != 0: - self.socket.setsockopt(nnpy.SOL_SOCKET, nnpy.SNDBUF, nn_snd_buf) - self.socket.bind(socket_addr) - - def forward(self, p, port): - msg = struct.pack(" counters_01_b[1]) - self.assertTrue(counters_11_e[0] > counters_11_b[0]) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_bridge.py b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_bridge.py deleted file mode 100644 index 3d1314847..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_bridge.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Antonin Bas (antonin@barefootnetworks.com) -# -# - -import argparse -import threading -import scapy.all as sc -import time - -parser = argparse.ArgumentParser(description='PTF Nanomsg tester bridge') -parser.add_argument("-ifrom", type=str) -parser.add_argument("-ito", type=str) -args = parser.parse_args() - -forwarders = {} - -class Forwarder(threading.Thread): - def __init__(self, iface_name, other): - threading.Thread.__init__(self) - self.daemon = True - self.iface_name = iface_name - self.other = other - forwarders[iface_name] = self - - def forward(self, p): - print "forwarding", p, "---", self.other, "->", self.iface_name - sc.sendp(p, iface=self.iface_name, verbose=0) - - def run(self): - other_fwd = forwarders[self.other] - sc.sniff(iface=self.iface_name, prn=lambda x: other_fwd.forward(str(x))) - -def main(): - f1 = Forwarder(args.ifrom, args.ito) - f2 = Forwarder(args.ito, args.ifrom) - time.sleep(2) - f1.start() - print "READY" - try: - while True: - time.sleep(1) - except KeyboardInterrupt: - return - -if __name__ == '__main__': - main() diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_eth.py b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_eth.py deleted file mode 100644 index 594986952..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_eth.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Antonin Bas (antonin@barefootnetworks.com) -# -# - -import argparse -import scapy.all as sc - -parser = argparse.ArgumentParser(description='PTF Nanomsg tester 2') -parser.add_argument( - "--interface", type=str, dest="interface") -parser.add_argument( - "--receive", dest="receive", action='store_true', default=False) -args = parser.parse_args() - -def receive(interface): - def printp(p): - print "Received:", str(p) - sc.sniff(iface=interface, prn=lambda x: printp(x)) - -def main(): - if args.receive: - receive(args.interface) - else: # send one - p = "ab" * 20 - sc.sendp(p, iface=args.interface, verbose=0) - -if __name__ == '__main__': - main() diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_nn.py b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_nn.py deleted file mode 100644 index ddee463fc..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/ptf_nn_test_nn.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Antonin Bas (antonin@barefootnetworks.com) -# -# - -import nnpy -import struct -import argparse - -parser = argparse.ArgumentParser(description='PTF Nanomsg tester 1') -parser.add_argument( - "--socket", type=str, dest="socket") -parser.add_argument( - "--receive", dest="receive", action='store_true', default=False) -args = parser.parse_args() - -MSG_TYPE_PORT_ADD = 0 -MSG_TYPE_PORT_REMOVE = 1 -MSG_TYPE_PORT_SET_STATUS = 2 -MSG_TYPE_PACKET_IN = 3 -MSG_TYPE_PACKET_OUT = 4 - -def receive(socket): - while True: - msg = socket.recv() - fmt = " - - - - - - - - - - - - - - - - - - - - - - switch under test - - - - - - - - - - - - - - - - - - - - PTF host / host 0 - - - - - - - - - - Folder 1 - - - - - - - - - - - - - - - - eth1 -port 0 - - - - - - - - - - - - - - - - - eth2 -port 1 - - - - - - - - - - - - - - - - - eth3 -port 2 - - - - - - - - - - - - - - - - - eth0 -management - - - - - - - - - - - - - - - - - (1) -ptf --test-dir <TEST_DIR> --platform nn \ ---device-socket 0-{0-2}@tcp://localhost:PORT \ ---device-socket 1-{3}@tcp://REMOTE_IP:PORT - - - - - - - - - - - - - - - - - (2) -python ptf_nn_agent.py \ ---device-socket 0@tcp://localhost:PORT \ --i 0-0@eth1 -i 0-1@eth2 -i 0-2@eth3 - - - - - - - - - - - - - - - - - - - - - - Remote host / host 1 - - - - - - - - - - Folder 2 - - - - - - - - - - - - - - - - eth1 -port 3 - - - - - - - - - - - - - - - - - (3) -python ptf_nn_agent.py \ ---device-socket 1@tcp://REMOTE_IP:PORT \ --i 1-3@eth1 - - - - - - - - - - - - - - - - - eth0 -management -REMOTE_IP - - - - - - - - - - - - - - - - - - - - (3) starts an agent on the remote host. The agent binds to a TCP socket on the management interface and starts capturing traffic on host1:eth1 (port 3 of the switch). -(2) starts an agent on the local PTF host. The agent binds to a TCP socket locally and starts capturing traffic on host0:eth1 (port 0 of the switch), host0:eth2 (port 1) and host0:eth3 (port2 ). -(1) starts the PTF binary, using the nn (nanomsg) packet capturing platform. PTF connects to both TCP sockets (i.e. both agents). - As can be seens from the command line, PTF is told that the agent on host0 is in charge of switch ports 0 through 2 and that the agent on host1 is in charge of port 3. - PTF will then run all the tests included in the specified test directory. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TCP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TCP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/resources/ptf_nn.png b/bm/sai_adapter/test/ptf_tests/ptf/ptf_nn/resources/ptf_nn.png deleted file mode 100644 index 6f996b241e23c0bf34bcabf819b67a121dc49446..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 145931 zcmdSBXFS|p*9I!Ribx_7qofi9(L0d{(W8zoGP+@+M^BNEFuKu+=!7vCy#z6$cSeus zz4vzZAh~lt&-4Dy`Fj4JWXdjUU2CmtU3*VHK9dzEK1*?yh=_<-;;E zucc|r^+xJniJUz0(s0D{z1^L$-RczO)KTu^|E%I*LGC6Sdzy<3`uhxE5%NqAP7=nn1r*aK@h^TL;;9MG09chKu6N^JW!Y%YC4!%kB@;f(bAD3co81B6 zyLl4gg`Ks5eXsrPz;`1fbG5-Nr@C>dEJ|L>VPM;*0taAU$8B#cF!(E^J5j4T;$t;3_q!J%H(6pTLV-h;wfZO-# z>(4*kXGOtjCn)fBZEx#K_1f zcz^neeuBfRb*o0fvBBz7`D%q`JzNO%4`LF5`PWLE#w~Z$#TG__b;O=L;Vph&U^}C( zsye=W40?NwDCX}nKa>80#S~AlI{*#fEk*RM>R%{QMZcUVf!H$7BA9{-BqHf>5 zt$1EKN?;?(akkmH>=gB@pLL<^myXNX;y{>x{nTesMJ0Rgo?P>~dVtnY{t|@{*Q(!b zaV6!huC8paXKHF)vEn4k)oy1l+s<^`EDlSA*P|jLzVdgq7$bM>Vnh&e;_IB+2s&<)_H0JDm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-(D~YgI@1&w=ekS!mdhRErk>fVaubr)w)$&-)0J>yE%2fK4mbMTF-F#PVmw9bGURA%PtBZYe>XOUe=;UY^frN4lbGf`2N|~-yccT) zF&Tn5IcO^}rgkx5Eo4!st;LKp0fLHsJvawS!FR-eF>hSB;Cb5@_57Bgyh%Y)4+Mu! z9}wT{(@%N^66Phq6o(`%C#`i?BF)~zq4Uzn(xpowb=SGjW&K+5|2;O3|Bj59lVZMO zcoJKr;o@&iT@|$I7TPUK@zWOC^_YdhgwGdcU_8Hlc~I5wTlSHJgpK8Yx#^o0g>wM` zpS-_aDIvr_7@{-o$Ky99R$&A{rzU>Cv$-j_U>xp`ryo@QKfm4o)a8D5&3()Z1@A3n Pai>sLc9umJK9T /dev/null; then - ip link add name $intf0 type veth peer name $intf1 - ip link set dev $intf0 up - ip link set dev $intf1 up - fi - sysctl net.ipv6.conf.$intf0.disable_ipv6=1 - sysctl net.ipv6.conf.$intf1.disable_ipv6=1 -done diff --git a/bm/sai_adapter/test/ptf_tests/ptf/setup.py b/bm/sai_adapter/test/ptf_tests/ptf/setup.py deleted file mode 100755 index ad76c5c4b..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -from setuptools import setup - -with open('README.md') as readme_file: - readme = readme_file.read() - -setup( - name='ptf', - version='0.9', - description='PTF is a Python based dataplane test framework.', - long_description=readme, - author='Antonin Bas', - author_email='antonin@barefootnetworks.com', - url='https://github.com/p4lang/ptf', - packages=[ - 'ptf', 'ptf.platforms', - ], - package_dir={'': 'src'}, - scripts=['ptf'], - zip_safe=False, - license='Apache License', - keywords='ptf', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache License', - 'Natural Language :: English', - "Programming Language :: Python :: 2", - 'Programming Language :: Python :: 2.7', - ] -) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/PKG-INFO b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/PKG-INFO deleted file mode 100644 index b6044943c..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/PKG-INFO +++ /dev/null @@ -1,255 +0,0 @@ -Metadata-Version: 1.1 -Name: ptf -Version: 0.9 -Summary: PTF is a Python based dataplane test framework. -Home-page: https://github.com/p4lang/ptf -Author: Antonin Bas -Author-email: antonin@barefootnetworks.com -License: Apache License -Description: PTF Packet Testing Framework - - --- - - # Introduction - - PTF is a Python based dataplane test framework. It is based on unittest, which - is included in the standard Python distribution. - - This document is meant to provide an introduction to the framework, discuss the - basics of running tests and to provide examples of how to add tests. - - Most of the code was taken from the [OFTest - framework](https://github.com/floodlight/oftest). However, PTF focuses on the - dataplane and is independent of OpenFlow. We also made a few additions to - oftest. - - --- - - # Longer Start - - ## Configure Pre-requisites - - The following software is required to run OFTest: - - * Python 2.7 - * Scapy - * pypcap (optional - VLAN tests will fail without this) - * tcpdump (optional - Scapy will complain if it's missing) - - We recommend that you install your extension of Scapy, which you can obtain - [here](https://github.com/p4lang/scapy-vxlan). It adds support for additional - header types: `VXLAN`, `ERSPAN`, `GENEVE`, `MPLS` and `NVGRE`. - - Root/sudo privilege is required on the host, in order to run `ptf`. - - ## Run PTF - - Once you have written tests and your switch is running, you can run 'ptf'. Use - `--help` to see command line switches. - - For example: - - sudo ./ptf --test-dir mytests/ --pypath $PWD \ - --interface 0@veth1 --interface 1@veth3 --interface 2@veth5 \ - --interface 3@veth7 --interface 4@veth9 --interface 5@veth11 \ - --interface 6@veth13 --interface 7@veth15 --interface 8@veth17 - - This will run all the tests included in the `mytests` directory. The `--pypath` - option can be used to easily add directories to the Python PATH. This is useful - if you use a Python interface to configure your data plane (as part of your - tests). The `--interface` option (or `-i`) can be used to specify the interfaces - on which to inject packets (along with the corresponding port number). - - ## Install PTF - - PTF can be installed by running `sudo python setup.py install`. For more - information on the different options accepted by `setup.py` (e.g. installing in - a custom location), please refer to the [setuptools documentation] - (https://pythonhosted.org/setuptools/setuptools.html). - - --- - - # Writing tests for your switch - - Take a look at the `example` directory. This is not a working example as it is - (the switch is not included), but it will show you how to write tests. This - directory contains the following: - - * `run_client.sh`: a wrapper around `ptf` - * `switch_sai_thrift`: empty directory, this is where the Python bindings to - program the switch's control plane would be copied - * `mytests/sai_base_test.py`: a wrapper Python class around PTF's BaseTest - class. It is the base class for all the tests we added to `mytests/switch.py` - * `mytests/switch.py`: some example tests - - ## Running the example - - If you want to run the example, you will need to obtain - [p4factory](https://github.com/p4lang/p4factory). For the following, I will - assume that you cloned the repository and installed the dependencies. I will - assume that environment variable `P4FACTORY` contains the path to the cloned - repository. - - First, you need to create the required veths: - - cd $P4FACTORY/tools/ - sudo ./veth_setup.sh - - The next step is to compile the target switch and to run it: - - cd $P4FACTORY/targets/switch/ - make bm-switchsai - sudo ./behavioral-model - - Finally, you can run the example tests: - - cd /example/ - sudo ../ptf --test-dir mytests/ \ - --pypath $P4FACTORY/targets/switch/tests/pd_thrift/ - --interface 0@veth1 --interface 1@veth3 --interface 2@veth5 \ - --interface 3@veth7 --interface 4@veth9 --interface 5@veth11 \ - --interface 6@veth13 --interface 7@veth15 --interface 8@veth17 - - --- - - # New features - - We added the following features to the base OFTest framework: - - ## Filters - - They can be used to discard some of the packets received from the switch. Take a - look at [sai_base_test.py](example/mytests/sai_base_test.py) for an example. You - will see the following code `testutils.add_filter(testutils.not_ipv6_filter)` - which tells PTF to discard received IPv6 packets. You can add your own filters - (they have to be callable Python objects which take a Scapy packet as input). - - ## Ternary matching - - A PTF test -just like an OFTest test- matches the received packets against - expected packets. This is an exact match. However, sometimes one does not care - about all the fields in the packets. PTF introduces the Mask class which lets - you specified some field you do not care about when performing the match. For - example: - - import mask - m = mask.Mask(expected_pkt) - m.set_do_not_care_scapy(IP, 'ttl') - verify_packets(, m, ) - - ## Test timeout - - A timeout for test cases can be specified using the `--test-case-timeout` - command line option. This timeout must be expressed in seconds. A timeout of 0 - is the same as no timeout (the default). If the timeout expires before the test - is done executing, an exception will be raised and the test counts as an - error. A timeout can also be specified for each individual test case, using the - `@testtimeout` decorator, which needs to be imported from `ptf.testutils`. This - timeout takes precedence over the global timeout passed on the command line. - - --- - - # Configuring PTF - - ## Platforms - - The "platform" is a configuration file (written in Python) that tells PTF how to - send packets to and receive packets from the dataplane of the switch. - - ### `eth` - - The default platform, `eth`, uses Linux Ethernet interfaces and is configured - with the `-i` option (or `--interface`). Pass the option as `-i - ofport@interface`, for example `-i 1@eth1`. If no `-i` options are given the the - default configuration uses vEths. - - ### `remote` - - Another common platform, `remote`, provides support for testing of switches on a - different host. This can be useful for cases where interfaces are not available - on one host (i.e. they're not bound to a Linux interface driver) or where PTF - cannot run on the same host (unsupported OS, missing software, etc.). - - This can be enable by modifying the `platforms/remote.py` file to point to 4 - NICs on the host running PTF, like so: - - remote_port_map = { - (0, 23) : "eth2", # port 23 of device 0 is connected to physical port on the server eth2 - (0, 24) : "eth3", # port 24 of device 0 is connected to physical port on the server eth3 - (0, 25) : "eth4", - (0, 26) : "eth5" - } - - ### `nn` - - We introduce a new platform, `nn`, which uses [nanomsg] (http://nanomsg.org/) to - send and receive packet to the switch. We support IPC and TCP nanomsg - sockets. When using this platform, you need to make sure that the Python package - [nnpy] (https://github.com/nanomsg/nnpy) is installed. With `nn`, do not use - `--interface`, instead use `--device-socket`. For each device, you need to - provide a list of enabled ports and a nanomsg socket address. For example: - - --device-socket 0-{1,2,5-8}@ipc:///tmp/bmv2_packets_1.ipc - - This command will enable ports 1, 2, 5, 6, 7, 8 on device 0. Packets for device - 0 will be captured and send on IPC socket `ipc:///tmp/bmv2_packets_1.ipc`. - - ## Passing Parameters to Tests - - There is a facility for passing test-specific parameters into tests that works as follows. On the command line, give the parameter - - --test-params="key1=17;key2=True" - - You can then access these parameters in your tests' Pyhton code using the - following code: - - import ptf.testutils as testutils - # Returns a dictionary which includes all your parameters - test_params = testutils.test_params_get() - # Returns the value of the parameter "param", or None if not found - param_value = testutils.test_param_get("param") - - Take a look at [sai_base_test.py](example/mytests/sai_base_test.py) for an - example. - - ## Grouping Tests together - - It is very easy to create groups of tests, using the provided `group` Python - decorator. Simply decorate your test with `@group()`. - - Take a look at [switch.py](example/mytests/switch.py) for an example. - - One given test can belong to several groups. You can choose to run only the - tests belonging to a given group using a command like this one: - - sudo ./ptf --test-dir mytests/ --pypath $PWD - - We also provide a convenient `disabled` decorator for tests. - - ## Support for multidevice tests - - The original OFTest was meant to unit test a single OF-compliant switch. With - PTF, we tried to add support for testing a network of several devices. If you do - not intend to use this multi-device feature, you do not need to worry about it, - it should not impact you. If you want to leverage this feature, here is what you - need to do: - - * when adding interfaces, instead of writing `@`, - you need to write `-@` - * when sending a packet, the port number becomes a tuple (device, port): - `send_packet(self, (, ), pkt)` - * the `verify_*` functions where also updated to include device information. For - example: `verify_packets(self, pkt, device_number=, - ports=)`. For more information, you can take a look at these - functions in [src/ptf/dataplane.py](src/ptf/dataplane.py). - - --- - -Keywords: ptf -Platform: UNKNOWN -Classifier: Development Status :: 2 - Pre-Alpha -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Apache License -Classifier: Natural Language :: English -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/SOURCES.txt b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/SOURCES.txt deleted file mode 100644 index 37050627a..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/SOURCES.txt +++ /dev/null @@ -1,24 +0,0 @@ -ptf -setup.py -src/ptf/__init__.py -src/ptf/afpacket.py -src/ptf/base_tests.py -src/ptf/dataplane.py -src/ptf/mask.py -src/ptf/netutils.py -src/ptf/packet.py -src/ptf/parse.py -src/ptf/pcap_writer.py -src/ptf/ptfutils.py -src/ptf/testutils.py -src/ptf/thriftutils.py -src/ptf.egg-info/PKG-INFO -src/ptf.egg-info/SOURCES.txt -src/ptf.egg-info/dependency_links.txt -src/ptf.egg-info/not-zip-safe -src/ptf.egg-info/top_level.txt -src/ptf/platforms/__init__.py -src/ptf/platforms/eth.py -src/ptf/platforms/local.py -src/ptf/platforms/nn.py -src/ptf/platforms/remote.py \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/dependency_links.txt b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/dependency_links.txt deleted file mode 100644 index 8b1378917..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/not-zip-safe b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/not-zip-safe deleted file mode 100644 index 8b1378917..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/not-zip-safe +++ /dev/null @@ -1 +0,0 @@ - diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/top_level.txt b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/top_level.txt deleted file mode 100644 index ea34903a9..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -ptf diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/__init__.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/__init__.py deleted file mode 100644 index c78bb678f..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -'''Docstring to silence pylint; ignores --ignore option for __init__.py''' -import sys -import os -import logging - -# Global config dictionary -# Populated by oft. -config = {} - -# Global DataPlane instance used by all tests. -# Populated by oft. -dataplane_instance = None - -def open_logfile(name): - """ - (Re)open logfile - - When using a log directory a new logfile is created for each test. The same - code is used to implement a single logfile in the absence of --log-dir. - """ - - _format = "%(asctime)s.%(msecs)03d %(name)-10s: %(levelname)-8s: %(message)s" - _datefmt = "%H:%M:%S" - - if config["log_dir"] != None: - filename = os.path.join(config["log_dir"], name) + ".log" - else: - filename = config["log_file"] - - logger = logging.getLogger() - - # Remove any existing handlers - for handler in logger.handlers: - logger.removeHandler(handler) - handler.close() - - # Add a new handler - handler = logging.FileHandler(filename, mode='a') - handler.setFormatter(logging.Formatter(_format, _datefmt)) - logger.addHandler(handler) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/afpacket.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/afpacket.py deleted file mode 100644 index f2bf7c162..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/afpacket.py +++ /dev/null @@ -1,112 +0,0 @@ -""" -AF_PACKET receive support - -When VLAN offload is enabled on the NIC Linux will not deliver the VLAN tag -in the data returned by recv. Instead, it delivers the VLAN TCI in a control -message. Python 2.x doesn't have built-in support for recvmsg, so we have to -use ctypes to call it. The recv function exported by this module reconstructs -the VLAN tag if it was offloaded. -""" - -import socket -import struct -from ctypes import * - -ETH_P_8021Q = 0x8100 -SOL_PACKET = 263 -PACKET_AUXDATA = 8 -TP_STATUS_VLAN_VALID = 1 << 4 - -class struct_iovec(Structure): - _fields_ = [ - ("iov_base", c_void_p), - ("iov_len", c_size_t), - ] - -class struct_msghdr(Structure): - _fields_ = [ - ("msg_name", c_void_p), - ("msg_namelen", c_uint32), - ("msg_iov", POINTER(struct_iovec)), - ("msg_iovlen", c_size_t), - ("msg_control", c_void_p), - ("msg_controllen", c_size_t), - ("msg_flags", c_int), - ] - -class struct_cmsghdr(Structure): - _fields_ = [ - ("cmsg_len", c_size_t), - ("cmsg_level", c_int), - ("cmsg_type", c_int), - ] - -class struct_tpacket_auxdata(Structure): - _fields_ = [ - ("tp_status", c_uint), - ("tp_len", c_uint), - ("tp_snaplen", c_uint), - ("tp_mac", c_ushort), - ("tp_net", c_ushort), - ("tp_vlan_tci", c_ushort), - ("tp_padding", c_ushort), - ] - -libc = CDLL("libc.so.6") -recvmsg = libc.recvmsg -recvmsg.argtypes = [c_int, POINTER(struct_msghdr), c_int] -recvmsg.retype = c_int - -def enable_auxdata(sk): - """ - Ask the kernel to return the VLAN tag in a control message - - Must be called on the socket before afpacket.recv. - """ - sk.setsockopt(SOL_PACKET, PACKET_AUXDATA, 1) - -def recv(sk, bufsize): - """ - Receive a packet from an AF_PACKET socket - @sk Socket - @bufsize Maximum packet size - """ - buf = create_string_buffer(bufsize) - - ctrl_bufsize = sizeof(struct_cmsghdr) + sizeof(struct_tpacket_auxdata) + sizeof(c_size_t) - ctrl_buf = create_string_buffer(ctrl_bufsize) - - iov = struct_iovec() - iov.iov_base = cast(buf, c_void_p) - iov.iov_len = bufsize - - msghdr = struct_msghdr() - msghdr.msg_name = None - msghdr.msg_namelen = 0 - msghdr.msg_iov = pointer(iov) - msghdr.msg_iovlen = 1 - msghdr.msg_control = cast(ctrl_buf, c_void_p) - msghdr.msg_controllen = ctrl_bufsize - msghdr.msg_flags = 0 - - rv = recvmsg(sk.fileno(), byref(msghdr), 0) - if rv < 0: - raise RuntimeError("recvmsg failed: rv=%d" % rv) - - # The kernel only delivers control messages we ask for. We - # only enabled PACKET_AUXDATA, so we can assume it's the - # only control message. - assert msghdr.msg_controllen >= sizeof(struct_cmsghdr) - - cmsghdr = struct_cmsghdr.from_buffer(ctrl_buf) # pylint: disable=E1101 - assert cmsghdr.cmsg_level == SOL_PACKET - assert cmsghdr.cmsg_type == PACKET_AUXDATA - - auxdata = struct_tpacket_auxdata.from_buffer(ctrl_buf, sizeof(struct_cmsghdr)) # pylint: disable=E1101 - - if auxdata.tp_vlan_tci != 0 or auxdata.tp_status & TP_STATUS_VLAN_VALID: - # Insert VLAN tag - tag = struct.pack("!HH", ETH_P_8021Q, auxdata.tp_vlan_tci) - return buf.raw[:12] + tag + buf.raw[12:rv] - else: - return buf.raw[:rv] diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/base_tests.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/base_tests.py deleted file mode 100644 index 9338f9504..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/base_tests.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -Base classes for test cases - -Tests will usually inherit from one of these classes to have the controller -and/or dataplane automatically set up. -""" - -import logging -import unittest -import os - -import ptf -from ptf import config -import ptf.dataplane as dataplane - -class BaseTest(unittest.TestCase): - def __str__(self): - return self.id().replace('.runTest', '') - - def setUp(self): - ptf.open_logfile(str(self)) - logging.info("** START TEST CASE " + str(self)) - - def run(self, result=None): - unittest.TestCase.run(self, result) - - def tearDown(self): - logging.info("** END TEST CASE " + str(self)) - - def before_send(self, pkt, device_number=0, port_number=-1): - """ - This function is meant to be overwritten in children classes if - needed. It is called every time a packet is about to be send. - """ - # print ":".join("{:02x}".format(ord(c)) for c in pkt) - pass - - def at_receive(self, pkt, device_number=0, port_number=-1): - """ - This function is meant to be overwritten in children classes if - needed. It is called every time a packet has been received. - """ - # print ":".join("{:02x}".format(ord(c)) for c in pkt) - pass diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/dataplane.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/dataplane.py deleted file mode 100644 index 9a5bb1be9..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/dataplane.py +++ /dev/null @@ -1,801 +0,0 @@ -""" -OpenFlow Test Framework - -DataPlane and DataPlanePort classes - -Provide the interface to the control the set of ports being used -to stimulate the switch under test. - -See the class dataplaneport for more details. This class wraps -a set of those objects allowing general calls and parsing -configuration. - -@todo Add "filters" for matching packets. Actions supported -for filters should include a callback or a counter -""" - -import sys -import os -import socket -import time -import select -import logging -import struct -from collections import defaultdict -from threading import Thread -from threading import Lock -from threading import Condition -import ptfutils -import netutils -import mask -from pcap_writer import PcapWriter - -try: - import nnpy - with_nnpy = True -except ImportError: - with_nnpy = False - -if "linux" in sys.platform: - import afpacket -else: - import pcap - -have_pypcap = False -# See Jira issue TSW-13 -#try: -# import pcap -# if hasattr(pcap, "pcap"): -# # the incompatible pylibpcap library masquerades as pcap -# have_pypcap = True -#except: -# pass - -def match_exp_pkt(exp_pkt, pkt): - """ - Compare the string value of pkt with the string value of exp_pkt, - and return True iff they are identical. If the length of exp_pkt is - less than the minimum Ethernet frame size (60 bytes), then padding - bytes in pkt are ignored. - """ - if isinstance(exp_pkt, mask.Mask): - if not exp_pkt.is_valid(): - return False - return exp_pkt.pkt_match(pkt) - e = str(exp_pkt) - p = str(pkt) - if len(e) < 60: - p = p[:len(e)] - return e == p - - -class DataPlanePacketSourceIface: - """ - Interface for an object that can be passed to select and on which packets - can be received. This was introduced so that several ports can share the - same packet 'source' - """ - def fileno(self): - """ - Return an integer file descriptor that can be passed to select(2). - """ - raise NotImplementedError() - - def recv(self): - """ - Receive a packet from this port. - @retval (device, port, packet data, timestamp) - """ - raise NotImplementedError() - - -class DataPlanePortIface: - def get_packet_source(self): - """ - @retval An object implementing DataPlanePacketSourceIface - """ - raise NotImplementedError() - - def send(self, packet): - """ - Send a packet out this port. - @param packet The packet data to send to the port - @retval The number of bytes sent - """ - raise NotImplementedError() - - def down(self): - """ - Bring the physical link down. - """ - raise NotImplementedError() - - def up(self): - """ - Bring the physical link up. - """ - raise NotImplementedError() - - -class DataPlanePortLinux(DataPlanePortIface, DataPlanePacketSourceIface): - """ - Uses raw sockets to capture and send packets on a network interface. - """ - - RCV_SIZE_DEFAULT = 4096 - ETH_P_ALL = 0x03 - RCV_TIMEOUT = 10000 - - def __init__(self, interface_name, device_number, port_number): - """ - @param interface_name The name of the physical interface like eth1 - """ - self.interface_name = interface_name - self.device_number = device_number - self.port_number = port_number - self.socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 0) - afpacket.enable_auxdata(self.socket) - self.socket.bind((interface_name, self.ETH_P_ALL)) - netutils.set_promisc(self.socket, interface_name) - self.socket.settimeout(self.RCV_TIMEOUT) - - def __del__(self): - if self.socket: - self.socket.close() - - def fileno(self): - """ - Return an integer file descriptor that can be passed to select(2). - """ - return self.socket.fileno() - - def recv(self): - """ - Receive a packet from this port. - @retval (device, port, packet data, timestamp) - """ - pkt = afpacket.recv(self.socket, self.RCV_SIZE_DEFAULT) - return (self.device_number, self.port_number, pkt, time.time()) - - def get_packet_source(self): - """ - @retval An object implementing DataPlanePacketSourceIface - """ - return self - - def send(self, packet): - """ - Send a packet out this port. - @param packet The packet data to send to the port - @retval The number of bytes sent - """ - return self.socket.send(packet) - - def down(self): - """ - Bring the physical link down. - """ - os.system("ifconfig %s down" % self.interface_name) - - def up(self): - """ - Bring the physical link up. - """ - os.system("ifconfig %s up" % self.interface_name) - - def mac(self): - """ - Return mac address - """ - return netutils.get_mac(self.interface_name) - - -class DataPlanePacketSourceNN(DataPlanePacketSourceIface): - """ - Wrapper class around nnpy used to capture data packets, send data packets - and send port status messages. It implements DataPlanePacketSourceIface by - exposing nanomsg receive file descriptor (RCVFD). - Note that there has to be a 1-1 mapping between device and nanomsg - socket. This is because the device number is not included in the PACKET_OUT - messages. Maybe something to add in the future? - """ - - MSG_TYPE_PORT_ADD = 0 - MSG_TYPE_PORT_REMOVE = 1 - MSG_TYPE_PORT_SET_STATUS = 2 - MSG_TYPE_PACKET_IN = 3 - MSG_TYPE_PACKET_OUT = 4 - MSG_TYPE_INFO_REQ = 5 - MSG_TYPE_INFO_REP = 6 - - MSG_PORT_STATUS_UP = 0 - MSG_PORT_STATUS_DOWN = 1 - - MSG_INFO_TYPE_HWADDR = 0 - MSG_INFO_TYPE_CTRS = 1 - - MSG_INFO_STATUS_SUCCESS = 0 - MSG_INFO_STATUS_NOT_SUPPORTED = 1 - - def __init__(self, device_number, socket_addr, rcv_timeout): - self.device_number = device_number - self.socket_addr = socket_addr - self.socket = nnpy.Socket(nnpy.AF_SP, nnpy.PAIR) - self.socket.connect(socket_addr) - self.rcv_timeout = rcv_timeout - self.socket.setsockopt(nnpy.SOL_SOCKET, nnpy.RCVTIMEO, rcv_timeout) - self.buffers = defaultdict(list) - self.cvar = Condition() - self.mac_addresses = {} - self.nn_counters = {} - - def close(self): - # TODO(antonin): something to do? - pass - - def fileno(self): - """ - Return an integer file descriptor that can be passed to select(2). - """ - return self.socket.getsockopt(nnpy.SOL_SOCKET, nnpy.RCVFD) - - def __send_port_msg(self, msg_type, port_number, more): - hdr = struct.pack(" 0: - send_request(port_number) - self.cvar.wait(time_remaining) - time_remaining = end - time.time() - return cache.get(port_number, None) - - def get_mac(self, port_number, timeout=2): - return self.get_info(port_number, self.mac_addresses, self.__request_mac, timeout) - - def get_nn_counters(self, port_number, timeout=2): - if port_number in self.nn_counters: - del self.nn_counters[port_number] - return self.get_info(port_number, self.nn_counters, self.__request_ctrs, timeout) - - -class DataPlanePortNN(DataPlanePortIface): - """ - Uses nanomsg sockets to capture and send packets (through IPC or TCP) - """ - - RCV_TIMEOUT = 10000 - - # indexed by device_number, maps to a PacketInjectNN instance - packet_injecters = {} - - def __init__(self, interface_name, device_number, port_number): - """ - @param interface_name The addr of the socket (like ipc:// - or tcp://:) - """ - self.interface_name = interface_name - if device_number not in self.packet_injecters: - self.packet_injecters[device_number] = DataPlanePacketSourceNN( - device_number, interface_name, self.RCV_TIMEOUT) - self.packet_inject = self.packet_injecters[device_number] - self.port_number = port_number - self.device_number = device_number - self.packet_inject.port_add(port_number) - - def __del__(self): - if self.packet_inject: - self.packet_inject.port_remove(self.port_number) - - def get_packet_source(self): - """ - @retval An object implementing DataPlanePacketSourceIface - """ - return self.packet_injecters[self.device_number] - - def send(self, packet): - """ - Send a packet out this port. - @param packet The packet data to send to the port - @retval The number of bytes sent - """ - return self.packet_injecters[self.device_number].send( - self.port_number, packet) - - def down(self): - """ - Bring the physical link down. - """ - self.packet_injecters[self.device_number].port_bring_down( - self.port_number) - - def up(self): - """ - Bring the physical link up. - """ - self.packet_injecters[self.device_number].port_bring_up( - self.port_number) - - def mac(self): - """ - Return mac address - """ - return self.packet_injecters[self.device_number].get_mac( - self.port_number) - - def nn_counters(self): - """ - Return counters - """ - return self.packet_injecters[self.device_number].get_nn_counters( - self.port_number) - - -class DataPlanePort(DataPlanePortIface, DataPlanePacketSourceIface): - """ - Uses raw sockets to capture and send packets on a network interface. - """ - - RCV_SIZE_DEFAULT = 4096 - ETH_P_ALL = 0x03 - RCV_TIMEOUT = 10000 - - def __init__(self, interface_name, device_number, port_number): - """ - @param interface_name The name of the physical interface like eth1 - """ - self.interface_name = interface_name - self.device_number = device_number - self.port_number = port_number - self.socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, - socket.htons(self.ETH_P_ALL)) - self.socket.bind((interface_name, 0)) - netutils.set_promisc(self.socket, interface_name) - self.socket.settimeout(self.RCV_TIMEOUT) - - def __del__(self): - if self.socket: - self.socket.close() - - def fileno(self): - """ - Return an integer file descriptor that can be passed to select(2). - """ - return self.socket.fileno() - - def recv(self): - """ - Receive a packet from this port. - @retval (device, port, packet data, timestamp) - """ - pkt = self.socket.recv(self.RCV_SIZE_DEFAULT) - return (self.device_number, self.port_number, pkt, time.time()) - - def get_packet_source(self): - """ - @retval An object implementing DataPlanePacketSourceIface - """ - return self - - def send(self, packet): - """ - Send a packet out this port. - @param packet The packet data to send to the port - @retval The number of bytes sent - """ - return self.socket.send(packet) - - def down(self): - """ - Bring the physical link down. - """ - os.system("ifconfig %s down" % self.interface_name) - - def up(self): - """ - Bring the physical link up. - """ - os.system("ifconfig %s up" % self.interface_name) - - def mac(self): - """ - Return mac address - """ - return netutils.get_mac(self.interface_name) - -class DataPlanePortPcap: - """ - Alternate port implementation using libpcap. This is required for recent - versions of Linux (such as Linux 3.2 included in Ubuntu 12.04) which - offload the VLAN tag, so it isn't in the data returned from a read on a raw - socket. libpcap understands how to read the VLAN tag from the kernel. - """ - - def __init__(self, interface_name, device_number, port_number): - self.device_number = device_number - self.port_number = port_number - self.pcap = pcap.pcap(interface_name) - self.pcap.setnonblock() - - def fileno(self): - return self.pcap.fileno() - - def recv(self): - (timestamp, pkt) = next(self.pcap) - return (self.device_number, self.port_number, pkt[:], timestamp) - - def get_packet_source(self): - return self - - def send(self, packet): - return self.pcap.inject(packet, len(packet)) - - def down(self): - pass - - def up(self): - pass - -class DataPlane(Thread): - """ - This class provides methods to send and receive packets on the dataplane. - It uses the DataPlanePort class, or an alternative implementation of that - interface, to do IO on a particular port. A background thread is used to - read packets from the dataplane ports and enqueue them to be read by the - test. The kill() method must be called to shutdown this thread. - """ - - MAX_QUEUE_LEN = 100 - - def __init__(self, config=None): - Thread.__init__(self) - - # dict from device number, port number to port object - self.ports = {} - - # dict from device number, port number to list of (timestamp, packet) - self.packet_queues = {} - - # counters of received packets (may include packets which were dropped due to queue overflow) - self.rx_counters = defaultdict(int) - - # counters of transmited packets - self.tx_counters = defaultdict(int) - - # cvar serves double duty as a regular top level lock and - # as a condition variable - self.cvar = Condition() - - # Used to wake up the event loop from another thread - self.waker = ptfutils.EventDescriptor() - self.killed = False - - self.logger = logging.getLogger("dataplane") - self.pcap_writer = None - - - if config is None: - self.config = {} - else: - self.config = config; - - ############################################################ - # - # The platform/config can provide a custom DataPlanePort class - # here if you have a custom implementation with different - # behavior. - # - # Set config.dataplane.portclass = MyDataPlanePortClass - # where MyDataPlanePortClass has the same interface as the class - # DataPlanePort defined here. - # - if self.config["platform"] == "nn": - # assert is ok here because this is caught earlier in ptf - assert(with_nnpy == True) - self.dppclass = DataPlanePortNN - elif "dataplane" in self.config and "portclass" in self.config["dataplane"]: - self.dppclass = self.config["dataplane"]["portclass"] - elif "linux" in sys.platform: - self.dppclass = DataPlanePortLinux - elif have_pypcap: - self.dppclass = DataPlanePortPcap - else: - self.logger.warning("Missing pypcap, VLAN tests may fail. See README for installation instructions.") - self.dppclass = DataPlanePort - - if "qlen" in self.config: - self.qlen = self.config["qlen"] - else: - self.qlen = self.MAX_QUEUE_LEN - - self.start() - - def run(self): - """ - Activity function for class - """ - while not self.killed: - sockets = set([p.get_packet_source() for p in self.ports.values()]) - sockets.add(self.waker) - try: - sel_in, sel_out, sel_err = select.select(sockets, [], [], 1) - except: - print sys.exc_info() - self.logger.error("Select error, exiting") - break - - with self.cvar: - for sel in sel_in: - if sel == self.waker: - self.waker.wait() - continue - else: - # Enqueue packet - t = sel.recv() - if t is None: - continue - device_number, port_number, pkt, timestamp = t - self.logger.debug("Pkt len %d in on device %d, port %d", - len(pkt), device_number, port_number) - if self.pcap_writer: - self.pcap_writer.write(pkt, timestamp, - device_number, port_number) - queue = self.packet_queues[(device_number, port_number)] - if len(queue) >= self.qlen: - # Queue full, throw away oldest - queue.pop(0) - self.logger.debug("Discarding oldest packet to make room") - queue.append((pkt, timestamp)) - self.rx_counters[(device_number, port_number)] += 1 - self.cvar.notify_all() - - self.logger.info("Thread exit") - - def set_qlen(self, qlen): - self.qlen = qlen - - def port_add(self, interface_name, device_number, port_number): - """ - Add a port to the dataplane - @param interface_name The name of the physical interface like eth1 - @param device_number The device id used to refer to the device - @param port_number The port number used to refer to the port - Stashes the port number on the created port object. - """ - port_id = (device_number, port_number) - self.ports[port_id] = self.dppclass(interface_name, - device_number, port_number) - self.ports[port_id]._port_number = port_number - self.ports[port_id]._device_number = device_number - self.packet_queues[port_id] = [] - # Need to wake up event loop to change the sockets being selected on. - self.waker.notify() - - def send(self, device_number, port_number, packet): - """ - Send a packet to the given port - @param device_number, port_number The port to send the data to - @param packet Raw packet data to send to port - """ - self.logger.debug("Sending %d bytes to device %d, port %d" % - (len(packet), device_number, port_number)) - if self.pcap_writer: - self.pcap_writer.write(packet, time.time(), - device_number, port_number) - bytes = self.ports[(device_number, port_number)].send(packet) - self.tx_counters[(device_number, port_number)] += 1 - if bytes != len(packet): - self.logger.error("Unhandled send error, length mismatch %d != %d" % - (bytes, len(packet))) - return bytes - - def oldest_port_number(self, device): - """ - Returns the port number with the oldest packet, - or None if no packets are queued. - """ - min_port_number = None - min_time = float('inf') - for (port_id, queue) in self.packet_queues.items(): - if port_id[0] != device: - continue - if queue and queue[0][1] < min_time: - min_time = queue[0][1] - min_port_number = port_id[1] - return min_port_number - - # Dequeues and yields packets in the order they were received. - # Yields (port, packet, received time). - # If port is not specified yields packets from all ports. - def packets(self, device, port=None): - while True: - if port is None: - rcv_port = self.oldest_port_number(device) - else: - rcv_port = port - - if rcv_port == None: - self.logger.debug("Out of packets on all ports") - break - - queue = self.packet_queues[(device, rcv_port)] - - if len(queue) == 0: - self.logger.debug("Out of packets on device %d, port %d", - device, rcv_port) - break - - pkt, time = queue.pop(0) - yield (rcv_port, pkt, time) - - def poll(self, device_number=0, port_number=None, timeout=-1, exp_pkt=None, filters=[]): - """ - Poll one or all dataplane ports for a packet - - If port_number is given, get the oldest packet from that port (and for - that device). - Otherwise, find the port with the oldest packet and return - that packet. - - If exp_pkt is true, discard all packets until that one is found - - @param device_number Get packet from this device - @param port_number If set, get packet from this port - @param timeout If positive and no packet is available, block - until a packet is received or for this many seconds - @param exp_pkt If not None, look for this packet and ignore any - others received. Note that if port_number is None, all packets - from all ports will be discarded until the exp_pkt is found - @return The tuple device_number, port_number, packet, pkt_time where - packet is received from device_number, port_number at time pkt_time. If - a timeout occurs, return None, None, None, None - """ - - def filter_check(pkt): - for f in filters: - if not f(pkt): return False - return True - - if exp_pkt and (port_number is None): - self.logger.warn("Dataplane poll with exp_pkt but no port number") - - # Retrieve the packet. Returns (device number, port number, packet, time). - def grab(): - self.logger.debug("Grabbing packet") - for (rcv_port_number, pkt, time) in self.packets(device_number, port_number): - rcv_device_number = device_number - self.logger.debug("Checking packet from device %d, port %d", - rcv_device_number, rcv_port_number) - if not filter_check(pkt): - self.logger.debug("Paket does not match filter, discarding") - continue - if not exp_pkt or match_exp_pkt(exp_pkt, pkt): - return (rcv_device_number, rcv_port_number, pkt, time) - self.logger.debug("Did not find packet") - return None - - with self.cvar: - ret = ptfutils.timed_wait(self.cvar, grab, timeout=timeout) - - if ret != None: - return ret - else: - self.logger.debug("Poll time out, no packet from device %d, port %r", - device_number, port_number) - return (None, None, None, None) - - def kill(self): - """ - Stop the dataplane thread. - """ - self.killed = True - self.waker.notify() - self.join() - # Explicitly release ports to ensure we don't run out of sockets - # even if someone keeps holding a reference to the dataplane. - del self.ports - - def port_down(self, device_number, port_number): - """Brings the specified port down""" - self.ports[(device_number, port_number)].down() - - def port_up(self, device_number, port_number): - """Brings the specified port up""" - self.ports[(device_number, port_number)].up() - - def get_mac(self, device_number, port_number): - """Get the specified mac""" - return self.ports[(device_number, port_number)].mac() - - def get_counters(self, device_number, port_number): - """Get the counters mac""" - return self.rx_counters[(device_number, port_number)], \ - self.tx_counters[(device_number, port_number)] - - def get_nn_counters(self, device_number, port_number): - """Get the specified port counters from nn agent """ - return self.ports[(device_number, port_number)].nn_counters() - - def flush(self): - """ - Drop any queued packets. - """ - for port_id in self.packet_queues.keys(): - self.packet_queues[port_id] = [] - - def start_pcap(self, filename): - assert(self.pcap_writer == None) - self.pcap_writer = PcapWriter(filename) - - def stop_pcap(self): - if self.pcap_writer: - with self.cvar: - self.pcap_writer.close() - self.pcap_writer = None - self.cvar.notify_all() diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/mask.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/mask.py deleted file mode 100644 index 5fc101cff..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/mask.py +++ /dev/null @@ -1,72 +0,0 @@ -import packet as scapy - -class Mask: - def __init__(self, exp_pkt): - self.exp_pkt = exp_pkt - self.size = len(str(exp_pkt)) - self.valid = True - self.mask = [0xff] * self.size - - def set_do_not_care(self, offset, bitwidth): - # a very naive but simple method - # we do it bit by bit :) - for idx in xrange(offset, offset + bitwidth): - offsetB = idx / 8 - offsetb = idx % 8 - self.mask[offsetB] = self.mask[offsetB] & (~(1 << (7 - offsetb))) - - def set_do_not_care_scapy(self, hdr_type, field_name): - if hdr_type not in self.exp_pkt: - self.valid = False - print "Unknown header type" - return - try: - fields_desc = hdr_type.fields_desc - except: - self.valid = False - return - hdr_offset = self.size - len(self.exp_pkt[hdr_type]) - offset = 0 - bitwidth = 0 - for f in fields_desc: - try: - bits = f.size - except: - bits = 8 * f.sz - if f.name == field_name: - bitwidth = bits - break - else: - offset += bits - self.set_do_not_care(hdr_offset * 8 + offset, bitwidth) - - def is_valid(self): - return self.valid - - def pkt_match(self, pkt): - # just to be on the safe side - pkt = str(pkt) - if len(pkt) != self.size: - return False - exp_pkt = str(self.exp_pkt) - for i in xrange(self.size): - if (ord(exp_pkt[i]) & self.mask[i]) != (ord(pkt[i]) & self.mask[i]): - return False - return True - - def __str__(self): - assert(self.valid) - return ''.join([chr(b) for b in self.mask]) - -def utest(): - p = scapy.Ether() / scapy.IP() / scapy.TCP() - m = Mask(p) - assert(m.pkt_match(p)) - p1 = scapy.Ether() / scapy.IP() / scapy.TCP(sport=97) - assert(not m.pkt_match(p1)) - m.set_do_not_care_scapy(scapy.TCP, "sport") - assert(not m.pkt_match(p1)) - m.set_do_not_care_scapy(scapy.TCP, "chksum") - assert(m.pkt_match(p1)) - -utest() diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/netutils.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/netutils.py deleted file mode 100644 index f5f6273be..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/netutils.py +++ /dev/null @@ -1,64 +0,0 @@ - -""" -Network utilities for the OpenFlow test framework -""" - -########################################################################### -## ## -## Promiscuous mode enable/disable ## -## ## -## Based on code from Scapy by Phillippe Biondi ## -## ## -## ## -## This program is free software; you can redistribute it and/or modify it ## -## under the terms of the GNU General Public License as published by the ## -## Free Software Foundation; either version 2, or (at your option) any ## -## later version. ## -## ## -## This program is distributed in the hope that it will be useful, but ## -## WITHOUT ANY WARRANTY; without even the implied warranty of ## -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## -## General Public License for more details. ## -## ## -############################################################################# - -import socket -from fcntl import ioctl -import struct - -# From net/if_arp.h -ARPHDR_ETHER = 1 -ARPHDR_LOOPBACK = 772 - -# From bits/ioctls.h -SIOCGIFHWADDR = 0x8927 # Get hardware address -SIOCGIFINDEX = 0x8933 # name -> if_index mapping - -# From netpacket/packet.h -PACKET_ADD_MEMBERSHIP = 1 -PACKET_DROP_MEMBERSHIP = 2 -PACKET_MR_PROMISC = 1 - -# From bits/socket.h -SOL_PACKET = 263 - -def get_if(iff,cmd): - s=socket.socket() - ifreq = ioctl(s, cmd, struct.pack("16s16x",iff)) - s.close() - return ifreq - -def get_if_index(iff): - return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0]) - -def get_mac(iff): - return ':'.join(['%02x' % ord(char) for char in get_if(iff, SIOCGIFHWADDR)[18:24]]) - -def set_promisc(s,iff,val=1): - mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, "") - if val: - cmd = PACKET_ADD_MEMBERSHIP - else: - cmd = PACKET_DROP_MEMBERSHIP - s.setsockopt(SOL_PACKET, cmd, mreq) - diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/packet.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/packet.py deleted file mode 100644 index b2bdfab82..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/packet.py +++ /dev/null @@ -1,98 +0,0 @@ -# Distributed under the OpenFlow Software License (see LICENSE) -# Copyright (c) 2010 The Board of Trustees of The Leland Stanford Junior University -# Copyright (c) 2012, 2013 Big Switch Networks, Inc. -""" -Wrap scapy to satisfy pylint -""" -from ptf import config -import sys -import logging - -try: - import scapy.config - import scapy.route - import scapy.layers.l2 - import scapy.layers.inet - import scapy.layers.dhcp - import scapy.packet - import scapy.main - if not config["disable_ipv6"]: - import scapy.route6 - import scapy.layers.inet6 -except ImportError: - sys.exit("Need to install scapy for packet parsing") - -Ether = scapy.layers.l2.Ether -LLC = scapy.layers.l2.LLC -SNAP = scapy.layers.l2.SNAP -Dot1Q = scapy.layers.l2.Dot1Q -GRE = scapy.layers.l2.GRE -IP = scapy.layers.inet.IP -IPOption = scapy.layers.inet.IPOption -ARP = scapy.layers.inet.ARP -TCP = scapy.layers.inet.TCP -UDP = scapy.layers.inet.UDP -ICMP = scapy.layers.inet.ICMP -DHCP = scapy.layers.dhcp.DHCP -BOOTP = scapy.layers.dhcp.BOOTP -PADDING = scapy.packet.Padding - -if not config["disable_ipv6"]: - IPv6 = scapy.layers.inet6.IPv6 - IPv6ExtHdrRouting = scapy.layers.inet6.IPv6ExtHdrRouting - ICMPv6Unknown = scapy.layers.inet6.ICMPv6Unknown - ICMPv6EchoRequest = scapy.layers.inet6.ICMPv6EchoRequest - -VXLAN = None -if not config["disable_vxlan"]: - try: - scapy.main.load_contrib("vxlan") - VXLAN = scapy.contrib.vxlan.VXLAN - logging.info("VXLAN support found in Scapy") - except: - logging.warn("VXLAN support not found in Scapy") - pass - -ERSPAN = None -ERSPAN_III = None -PlatformSpecific = None -if not config["disable_erspan"]: - try: - scapy.main.load_contrib("erspan") - ERSPAN = scapy.contrib.erspan.ERSPAN - ERSPAN_III = scapy.contrib.erspan.ERSPAN_III - PlatformSpecific = scapy.contrib.erspan.PlatformSpecific - logging.info("ERSPAN support found in Scapy") - except: - logging.warn("ERSPAN support not found in Scapy") - pass - -GENEVE = None -if not config["disable_geneve"]: - try: - scapy.main.load_contrib("geneve") - GENEVE = scapy.contrib.geneve.GENEVE - logging.info("GENEVE support found in Scapy") - except: - logging.warn("GENEVE support not found in Scapy") - pass - -MPLS = None -if not config["disable_mpls"]: - try: - scapy.main.load_contrib("mpls") - MPLS = scapy.contrib.mpls.MPLS - logging.info("MPLS support found in Scapy") - except: - logging.warn("MPLS support not found in Scapy") - pass - -NVGRE = None -if not config["disable_nvgre"]: - try: - scapy.main.load_contrib("nvgre") - NVGRE = scapy.contrib.nvgre.NVGRE - logging.info("NVGRE support found in Scapy") - except: - logging.warn("NVGRE support not found in Scapy") - pass diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/parse.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/parse.py deleted file mode 100644 index 3bdad4089..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/parse.py +++ /dev/null @@ -1,74 +0,0 @@ -""" -Utility parsing functions -""" - -import sys -import socket -import packet as scapy - -def parse_mac(mac_str): - """ - Parse a MAC address - - Parse a MAC address ':' separated string of hex digits to an - array of integer values. '00:d0:05:5d:24:00' => [0, 208, 5, 93, 36, 0] - @param mac_str The string to convert - @return Array of 6 integer values - """ - return map(lambda val: int(val, 16), mac_str.split(":")) - -def parse_ip(ip_str): - """ - Parse an IP address - - Parse an IP address '.' separated string of decimal digits to an - host ordered integer. '172.24.74.77' => - @param ip_str The string to convert - @return Integer value - """ - array = map(lambda val: int(val), ip_str.split(".")) - val = 0 - for a in array: - val <<= 8 - val += a - return val - -def parse_ipv6(ip_str): - """ - Parse an IPv6 address - - Parse a textual IPv6 address and return a 16 byte binary string. - """ - return socket.inet_pton(socket.AF_INET6, ip_str) - -def packet_type_classify(ether): - try: - dot1q = ether[scapy.Dot1Q] - except: - dot1q = None - - try: - ip = ether[scapy.IP] - except: - ip = None - - try: - tcp = ether[scapy.TCP] - except: - tcp = None - - try: - udp = ether[scapy.UDP] - except: - udp = None - - try: - icmp = ether[scapy.ICMP] - except: - icmp = None - - try: - arp = ether[scapy.ARP] - except: - arp = None - return (dot1q, ip, tcp, udp, icmp, arp) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/pcap_writer.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/pcap_writer.py deleted file mode 100644 index ab1a7c36f..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/pcap_writer.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -Pcap file writer -""" - -import struct - -PcapHeader = struct.Struct(" -In this case, ports 1, 2 and 5 through 8 (included) are enabled on device 0. - -The socket address must be either: -ipc:// -tcp://: -""" - - -def platform_config_update(config): - """ - Update configuration for the nn platform - - @param config The configuration dictionary to use/update - """ - - port_map = {} - - for (device, ports, socket_addr) in config["device_sockets"]: - for port in ports: - port_map[(device, port)] = socket_addr - - # no default configuration for this platform - - config['port_map'] = port_map diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/remote.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/remote.py deleted file mode 100644 index a0acb00ce..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/platforms/remote.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -Remote platform - -This platform uses physical ethernet interfaces. -""" - -# Update this dictionary to suit your environment. -remote_port_map = { - (0, 0) : "eth0", - (0, 1) : "eth1", - (0, 2) : "eth2", - (0, 3) : "eth3", - (0, 4) : "eth4", - (0, 5) : "eth5", - (0, 6) : "eth6", - (0, 7) : "eth7", - (0, 8) : "eth8", - (0, 9) : "eth9", - (0, 10) : "eth10", - (0, 11) : "eth11", - (0, 12) : "eth12", - (0, 13) : "eth13", - (0, 14) : "eth14", - (0, 15) : "eth15", - (0, 16) : "eth16", - (0, 17) : "eth17", - (0, 18) : "eth18", - (0, 19) : "eth19", - (0, 20) : "eth20", - (0, 21) : "eth21", - (0, 22) : "eth22", - (0, 23) : "eth23", - (0, 24) : "eth24", - (0, 25) : "eth25", - (0, 26) : "eth26", - (0, 27) : "eth27", - (0, 28) : "eth28", - (0, 29) : "eth29", - (0, 30) : "eth30", - (0, 31) : "eth31" -} - -def platform_config_update(config): - """ - Update configuration for the remote platform - - @param config The configuration dictionary to use/update - """ - global remote_port_map - config["port_map"] = remote_port_map.copy() - config["caps_table_idx"] = 0 diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/ptfutils.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/ptfutils.py deleted file mode 100644 index 5a67d1905..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/ptfutils.py +++ /dev/null @@ -1,102 +0,0 @@ - -""" -Utilities for the OpenFlow test framework -""" - -import random -import time -import os -import fcntl -import logging -import signal - -default_timeout = None # set by ptf -default_negative_timeout = None # set by ptf - -def gen_xid(): - return random.randrange(1,0xffffffff) - -""" -Wait on a condition variable until the given function returns non-None or a timeout expires. -The condition variable must already be acquired. -The timeout value -1 means use the default timeout. -There is deliberately no support for an infinite timeout. -""" -def timed_wait(cv, fn, timeout=-1): - if timeout == -1: - timeout = default_timeout - - end_time = time.time() + timeout - while True: - val = fn() - if val != None: - return val - - remaining_time = end_time - time.time() - cv.wait(remaining_time) - - if time.time() > end_time: - return None - -class EventDescriptor(): - """ - Similar to a condition variable, but can be passed to select(). - Only supports one waiter. - """ - - def __init__(self): - self.pipe_rd, self.pipe_wr = os.pipe() - fcntl.fcntl(self.pipe_wr, fcntl.F_SETFL, os.O_NONBLOCK) - - def __del__(self): - os.close(self.pipe_rd) - os.close(self.pipe_wr) - - def notify(self): - try: - os.write(self.pipe_wr, "x") - except OSError as e: - logging.warn("Failed to notify EventDescriptor: %s", e) - - def wait(self): - os.read(self.pipe_rd, 1) - - def fileno(self): - return self.pipe_rd - -# inspired from http://stackoverflow.com/questions/8464391/what-should-i-do-if-socket-setdefaulttimeout-is-not-working -class Timeout(): - """Timeout class using ALARM signal""" - - class TimeoutError(Exception): - pass - - def __init__(self, sec): - try: - from signal import alarm - self.supported = True - except ImportError: - logging.warn("Your platform does not support alarm signals, " - "the Timeout feature is therefore not supported") - self.supported = False - return - self.sec = sec - if sec > 0: - self.valid = True - else: - self.valid = False - logging.warn("Invalid timeout requested") - - def __enter__(self): - if not self.supported or not self.valid: - return - signal.signal(signal.SIGALRM, self.raise_timeout) - signal.alarm(self.sec) - - def __exit__(self, *args): - if not self.supported or not self.valid: - return - signal.alarm(0) # disable alarm - - def raise_timeout(self, *args): - raise Timeout.TimeoutError() diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py deleted file mode 100644 index 98bf6502b..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py +++ /dev/null @@ -1,2390 +0,0 @@ -import sys -import copy -import logging -import types -import time -import re -import packet as scapy - -import ptf -import ptf.dataplane -import ptf.parse -import ptf.ptfutils - -global skipped_test_count -skipped_test_count = 0 - -_import_blacklist = set(locals().keys()) - -# Some useful defines -IP_ETHERTYPE = 0x800 -TCP_PROTOCOL = 0x6 -UDP_PROTOCOL = 0x11 - -MINSIZE = 0 - -_import_blacklist.add('FILTERS') -FILTERS = [] - -def reset_filters(): - FILTERS = [] - -# Needs to be a callable -def add_filter(my_filter): - FILTERS.append(my_filter) - -def get_filters(): - return FILTERS - -def ether_filter(pkt_str): - try: - pkt = scapy.Ether(pkt_str) - return True - except: - return False - -def ipv6_filter(pkt_str): - try: - pkt = scapy.Ether(pkt_str) - return (scapy.IPv6 in pkt) - except: - return False - -def not_ipv6_filter(pkt_str): - return not ipv6_filter(pkt_str) - -def ip_make_tos(tos, ecn, dscp): - if ecn is not None: - tos = (tos & ~(0x3)) | ecn - - if dscp is not None: - tos = (tos & ~(0xfc)) | (dscp << 2) - - return tos - -def simple_tcp_packet(pktlen=100, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_frag=0, - tcp_sport=1234, - tcp_dport=80, - tcp_flags="S", - ip_ihl=None, - ip_options=False, - with_tcp_chksum=True - ): - """ - Return a simple dataplane TCP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destinatino MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param tcp_dport TCP destination port - @param tcp_sport TCP source port - @param tcp_flags TCP Control flags - @param with_tcp_chksum Valid TCP checksum - - Generates a simple TCP request. Users - shouldn't assume anything about this packet other than that - it is a valid ethernet/IP/TCP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if with_tcp_chksum: - tcp_hdr = scapy.TCP(sport=tcp_sport, dport=tcp_dport, flags=tcp_flags) - else: - tcp_hdr = scapy.TCP(sport=tcp_sport, dport=tcp_dport, flags=tcp_flags, chksum=0) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - tcp_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, frag=ip_frag)/ \ - tcp_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, frag=ip_frag, options=ip_options)/ \ - tcp_hdr - - pkt = pkt/("".join([chr(x % 256) for x in xrange(pktlen - len(pkt))])) - - return pkt - -def simple_tcpv6_packet(pktlen=100, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - ipv6_src='2001:db8:85a3::8a2e:370:7334', - ipv6_dst='2001:db8:85a3::8a2e:370:7335', - ipv6_tc=0, - ipv6_ecn=None, - ipv6_dscp=None, - ipv6_hlim=64, - ipv6_fl=0, - tcp_sport=1234, - tcp_dport=80, - tcp_flags="S"): - """ - Return a simple IPv6/TCP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ipv6_src IPv6 source - @param ipv6_dst IPv6 destination - @param ipv6_tc IPv6 traffic class - @param ipv6_ecn IPv6 traffic class ECN - @param ipv6_dscp IPv6 traffic class DSCP - @param ipv6_ttl IPv6 hop limit - @param ipv6_fl IPv6 flow label - @param tcp_dport TCP destination port - @param tcp_sport TCP source port - @param tcp_flags TCP Control flags - - Generates a simple TCP request. Users shouldn't assume anything about this - packet other than that it is a valid ethernet/IPv6/TCP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ipv6_tc = ip_make_tos(ipv6_tc, ipv6_ecn, ipv6_dscp) - - pkt = scapy.Ether(dst=eth_dst, src=eth_src) - if dl_vlan_enable or vlan_vid or vlan_pcp: - pkt /= scapy.Dot1Q(vlan=vlan_vid, prio=vlan_pcp) - pkt /= scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim) - pkt /= scapy.TCP(sport=tcp_sport, dport=tcp_dport, flags=tcp_flags) - pkt /= ("D" * (pktlen - len(pkt))) - - return pkt - -def simple_udp_packet(pktlen=100, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - udp_sport=1234, - udp_dport=80, - ip_ihl=None, - ip_options=False, - with_udp_chksum=True, - udp_payload=None - ): - """ - Return a simple dataplane UDP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param udp_dport UDP destination port - @param udp_sport UDP source port - @param with_udp_chksum Valid UDP checksum - - Generates a simple UDP packet. Users shouldn't assume anything about - this packet other than that it is a valid ethernet/IP/UDP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if with_udp_chksum: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport) - else: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport, chksum=0) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \ - udp_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \ - udp_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl, options=ip_options)/ \ - udp_hdr - - if udp_payload: - pkt = pkt/udp_payload - - pkt = pkt/("".join([chr(x % 256) for x in xrange(pktlen - len(pkt))])) - - return pkt - -def simple_ipv6_sr_packet(eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - ipv6_src='2000::1', - ipv6_dst='2000::2', - ipv6_plen=None, - ipv6_tc=0, - ipv6_hlim=64, - ipv6_fl=0, - srh_seg_left=0, - srh_first_seg=0, - srh_flags=0, - srh_seg_list=[], - srh_nh=0, - inner_frame=None): - - """ - Return a simple dataplane IPv6 segment routing packet - - @param eth_dst Destination MAC - @param eth_src Source MAC - @param ipv6_src IPv6 source - @param ipv6_dst IPv6 destination - @param ipv6_tc IPv6 traffic class - @param ipv6_ttl IPv6 hop limit - @param ipv6_fl IPv6 flow label - @param srh_seg_left IPV6 SRH segment left - @param srh_first_seg IPV6 SRH first segment - @param srh_flags IPV6 SRH flags - @param srh_nh IPV6 SRH next header - """ - - pkt = scapy.Ether(dst=eth_dst, src=eth_src) - pkt /= scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, nh=43, - hlim=ipv6_hlim, plen=ipv6_plen) - reserved = (srh_first_seg << 24) + (srh_flags << 8) - pkt /= scapy.IPv6ExtHdrRouting(nh=srh_nh, type=4, segleft=srh_seg_left, - reserved=reserved, - addresses=srh_seg_list) - if inner_frame is not None: - pkt /= inner_frame - - return pkt - - -def simple_geneve_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - udp_sport=1234, - with_udp_chksum=True, - ip_ihl=None, - ip_options=False, - geneve_ver=0x0, - geneve_reserved = 0x0, - geneve_vni=0x1234, - geneve_reserved2=0x0, - geneve_proto=0x6558, - inner_frame = None): - """ - Return a simple dataplane GENEVE packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param udp_sport UDP source port - @param geneve_ver version - @param geneve_reserved reserved field - @param geneve_vni GENEVE Network Identifier - @param geneve_reserved2 reserved field - @param inner_frame The inner Ethernet frame - """ - if scapy.GENEVE is None: - logging.error("A GENEVE packet was requested but GENEVE is not supported by your Scapy. See README for more information") - return None - - udp_dport = 6081 # UDP port assigned by IANA for GENEVE - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if with_udp_chksum: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport) - else: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport, chksum=0) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - udp_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - udp_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options)/ \ - udp_hdr - - pkt = pkt / GENEVE(vni = geneve_vni, proto = geneve_proto ) - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / simple_tcp_packet(pktlen = pktlen - len(pkt)) - - return pkt - -def simple_nvgre_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - nvgre_version=0, - nvgre_tni=None, - nvgre_flowid=0, - inner_frame=None - ): - """ - Return a simple dataplane GRE packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param nvgre_version Version - @param nvgre_tni - @param nvgre_flowid - @param inner_frame payload of the GRE packet - - Generates a simple GRE packet. Users shouldn't assume anything about - this packet other than that it is a valid ethernet/IP/NVGRE frame. - """ - if scapy.NVGRE is None: - logging.error("A NVGRE packet was requested but NVGRE is not supported by your Scapy. See README for more information") - return None - - if MINSIZE > pktlen: - pktlen = MINSIZE - - nvgre_hdr = scapy.NVGRE(vsid=nvgre_tni, flowid=nvgre_flowid) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - nvgre_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - nvgre_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options)/ \ - nvgre_hdr - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - - return pkt - -def simple_vxlan_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - udp_sport=1234, - udp_dport=4789, - with_udp_chksum=True, - ip_ihl=None, - ip_options=False, - vxlan_reserved1=0x000000, - vxlan_vni = 0xaba, - vxlan_reserved2=0x00, - inner_frame = None): - """ - Return a simple dataplane VXLAN packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param udp_sport UDP source port - @param udp_dport UDP dest port (IANA) = 4789 (VxLAN) - @param vxlan_reserved1 reserved field (3B) - @param vxlan_vni VXLAN Network Identifier - @param vxlan_reserved2 reserved field (1B) - @param inner_frame The inner Ethernet frame - - Generates a simple VXLAN packet. Users shouldn't assume anything about - this packet other than that it is a valid ethernet/IP/UDP/VXLAN frame. - """ - if scapy.VXLAN is None: - logging.error("A VXLAN packet was requested but VXLAN is not supported by your Scapy. See README for more information") - return None - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if with_udp_chksum: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport) - else: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport, chksum=0) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - udp_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - udp_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options)/ \ - udp_hdr - - pkt = pkt / VXLAN(vni = vxlan_vni, reserved1 = vxlan_reserved1, reserved2 = vxlan_reserved2) - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / simple_tcp_packet(pktlen = pktlen - len(pkt)) - - return pkt - -def simple_vxlanv6_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ipv6_src='1::2', - ipv6_dst='3::4', - ipv6_fl=0, - ipv6_tc=0, - ipv6_ecn=None, - ipv6_dscp=None, - ipv6_hlim=64, - udp_sport=1234, - udp_dport=4789, - with_udp_chksum=True, - vxlan_reserved1=0x000000, - vxlan_vni = 0xaba, - vxlan_reserved2=0x00, - inner_frame = None): - """ - Return a simple dataplane VXLAN packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ipv6_src IPv6 source - @param ipv6_dst IPv6 destination - @param ipv6_fl IPv6 flowlabel - @param ipv6_tc IPv6 traffic class - @param ipv6_ecn IPv6 traffic class ECN - @param ipv6_dscp IPv6 traffic class DSCP - @param ipv6_hlim IPv6 hop limit - @param udp_sport UDP source port - @param udp_dport UDP dest port (IANA) = 4789 (VxLAN) - @param vxlan_reserved1 reserved field (3B) - @param vxlan_vni VXLAN Network Identifier - @param vxlan_reserved2 reserved field (1B) - @param inner_frame The inner Ethernet frame - - Generates a simple VXLAN packet. Users shouldn't assume anything about - this packet other than that it is a valid ethernet/IP/UDP/VXLAN frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if with_udp_chksum: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport) - else: - udp_hdr = scapy.UDP(sport=udp_sport, dport=udp_dport, chksum=0) - - ipv6_tc = ip_make_tos(ipv6_tc, ipv6_ecn, ipv6_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim)/ \ - udp_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim)/ \ - udp_hdr - - pkt = pkt / VXLAN(vni = vxlan_vni, reserved1 = vxlan_reserved1, reserved2 = vxlan_reserved2) - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / simple_tcp_packet(pktlen = pktlen - len(pkt)) - - return pkt - -def simple_gre_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - gre_chksum_present=0, - gre_routing_present=0, # begin reserved0 - gre_key_present=0, - gre_seqnum_present=0, - gre_strict_route_source=0, - gre_flags=0, # end reserved0 - gre_version=0, - gre_offset=None, # reserved1 - gre_key=None, - gre_sequence_number=None, - inner_frame=None - ): - """ - Return a simple dataplane GRE packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param gre_chkum_present with or without checksum - @param gre_routing_present - @param gre_key_present - @param gre_seqnum_present - @param gre_strict_route_source - @param gre_flags - @param gre_version Version - @param gre_offset - @param gre_key - @param gre_sequence_number - @param inner_frame payload of the GRE packet - - Generates a simple GRE packet. Users shouldn't assume anything about - this packet other than that it is a valid ethernet/IP/GRE frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - # proto (ethertype) is set by Scapy based on the payload - gre_hdr = scapy.GRE(chksum_present=gre_chksum_present, - routing_present=gre_routing_present, - key_present=gre_key_present, - seqnum_present=gre_seqnum_present, - strict_route_source=gre_strict_route_source, - flags=gre_flags, version=gre_version, - offset=gre_offset, key=gre_key, - seqence_number=gre_sequence_number) # typo in Scapy - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - gre_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - gre_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options)/ \ - gre_hdr - - if inner_frame: - pkt = pkt / inner_frame - if ((ord(str(inner_frame)[0]) & 0xF0) == 0x60): - pkt['GRE'].proto = 0x86DD - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - - return pkt - -def simple_grev6_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ipv6_src='1::2', - ipv6_dst='3::4', - ipv6_fl=0, - ipv6_tc=0, - ipv6_ecn=None, - ipv6_dscp=None, - ipv6_hlim=64, - gre_chksum_present=0, - gre_routing_present=0, # begin reserved0 - gre_key_present=0, - gre_seqnum_present=0, - gre_strict_route_source=0, - gre_flags=0, # end reserved0 - gre_version=0, - gre_offset=None, # reserved1 - gre_key=None, - gre_sequence_number=None, - inner_frame=None - ): - """ - Return a simple dataplane GRE packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ipv6_src IPv6 source - @param ipv6_dst IPv6 destination - @param ipv6_fl IPv6 flowlabel - @param ipv6_tc IPv6 traffic class - @param ipv6_ecn IPv6 traffic class ECN - @param ipv6_dscp IPv6 traffic class DSCP - @param ipv6_hlim IPv6 hop limit - @param gre_chkum_present with or without checksum - @param gre_routing_present - @param gre_key_present - @param gre_seqnum_present - @param gre_strict_route_source - @param gre_flags - @param gre_version Version - @param gre_offset - @param gre_key - @param gre_sequence_number - @param inner_frame payload of the GRE packet - - Generates a simple GRE packet. Users shouldn't assume anything about - this packet other than that it is a valid ethernet/IP/GRE frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - # proto (ethertype) is set by Scapy based on the payload - gre_hdr = scapy.GRE(chksum_present=gre_chksum_present, - routing_present=gre_routing_present, - key_present=gre_key_present, - seqnum_present=gre_seqnum_present, - strict_route_source=gre_strict_route_source, - flags=gre_flags, version=gre_version, - offset=gre_offset, key=gre_key, - seqence_number=gre_sequence_number) # typo in Scapy - - ipv6_tc = ip_make_tos(ipv6_tc, ipv6_ecn, ipv6_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim, nh=47)/ \ - gre_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim, nh=47)/ \ - gre_hdr - - if inner_frame: - pkt = pkt / inner_frame - if ((ord(str(inner_frame)[0]) & 0xF0) == 0x60): - pkt['GRE'].proto = 0x86DD - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - - return pkt - -def simple_gre_erspan_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - gre_chksum_present=0, - gre_routing_present=0, # begin reserved0 - gre_key_present=0, - gre_seqnum_present=0, - gre_strict_route_source=0, - gre_flags=0, # end reserved0 - gre_version=0, - gre_offset=None, # reserved1 - gre_key=None, - gre_sequence_number=None, - erspan_vlan=0, - erspan_priority=0, - erspan_direction=0, - erspan_truncated=0, - erspan_span_id=0, - erspan_unknown7=0, - inner_frame=None - ): - """ - Return a simple dataplane GRE/ERSPAN packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param gre_chkum_present with or without checksum - @param gre_routing_present - @param gre_key_present - @param gre_seqnum_present - @param gre_strict_route_source - @param gre_flags - @param gre_version Version - @param gre_offset - @param gre_key - @param gre_sequence_number - @param inner_frame payload of the GRE packet - @param erspan_vlan - @param erspan_priority - @param erspan_direction - @param erspan_truncated - @param erspan_span_id - @param erspan_unknown7 - - Generates a simple GRE/ERSPAN packet. Users shouldn't assume anything about - this packet other than that it is a valid ethernet/IP/GRE/ERSPAN frame. - """ - if scapy.GRE is None or scapy.ERSPAN is None: - logging.error("A GRE/ERSPAN packet was requested but GRE or ERSPAN is not supported by your Scapy. See README for more information") - return None - - if MINSIZE > pktlen: - pktlen = MINSIZE - - # proto (ethertype) is set by Scapy based on the payload - gre_hdr = scapy.GRE(chksum_present=gre_chksum_present, - routing_present=gre_routing_present, - key_present=gre_key_present, - seqnum_present=gre_seqnum_present, - strict_route_source=gre_strict_route_source, - flags=gre_flags, version=gre_version, - offset=gre_offset, key=gre_key, - seqence_number=gre_sequence_number) # typo in Scapy - - erspan_hdr = scapy.ERSPAN(vlan = erspan_vlan, - priority = erspan_priority, - direction = erspan_direction, - truncated = erspan_truncated, - span_id = erspan_span_id, - unknown7 = erspan_unknown7) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - gre_hdr / erspan_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - gre_hdr / erspan_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options)/ \ - gre_hdr / erspan_hdr - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - - return pkt - -def ipv4_erspan_pkt(pktlen=350, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - version=2, - mirror_id=0x3FF, - sgt_other=0, - inner_frame=None - ): - """ - Return a GRE ERSPAN packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param erspan version - @param span_id (mirror_session_id) - @param inner_frame payload of the GRE packet - """ - if scapy.GRE is None or scapy.ERSPAN is None or scapy.ERSPAN_III is None: - logging.error("A GRE/ERSPAN packet was requested but GRE or ERSPAN is not supported by your Scapy. See README for more information") - return None - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if version == 2: - erspan_hdr = scapy.GRE(proto=0x22eb)/scapy.ERSPAN_III(span_id=mirror_id, sgt_other = sgt_other) - else: - erspan_hdr = scapy.GRE(proto=0x88be)/scapy.ERSPAN(span_id=mirror_id) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - erspan_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - erspan_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options)/ \ - erspan_hdr - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - - return pkt - -def ipv4_erspan_platform_pkt(pktlen=350, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - version=2, - mirror_id=0x3FF, - sgt_other=1, - platf_id=0, - info1=0, - info2=0, - inner_frame=None - ): - """ - Return a GRE ERSPAN packet with Platform Specific Subheader - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param erspan version - @param span_id (mirror_session_id) - @param platf_id Specific Platform Subheader Platf Id - @param info1 Specific Platform Subheader 26 bit field - @param info2 Specific Platform Subheader 32 bit field - @param inner_frame payload of the GRE packet - """ - if scapy.GRE is None or scapy.ERSPAN is None or scapy.ERSPAN_III is None or scapy.PlatformSpecific is None: - logging.error("A GRE/ERSPAN packet was requested but GRE or ERSPAN is not supported by your Scapy. See README for more information") - return None - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if version == 2: - erspan_hdr = scapy.GRE(proto=0x22eb)/scapy.ERSPAN_III(span_id=mirror_id, sgt_other=sgt_other) - if sgt_other == 1: - erspan_hdr = erspan_hdr/scapy.PlatformSpecific(platf_id=platf_id, info1=info1, info2=info2) - else: - erspan_hdr = scapy.GRE(proto=0x88be)/scapy.ERSPAN(span_id=mirror_id) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - erspan_hdr - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl)/ \ - erspan_hdr - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options)/ \ - erspan_hdr - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - - return pkt - -def simple_udpv6_packet(pktlen=100, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - ipv6_src='2001:db8:85a3::8a2e:370:7334', - ipv6_dst='2001:db8:85a3::8a2e:370:7335', - ipv6_tc=0, - ipv6_ecn=None, - ipv6_dscp=None, - ipv6_hlim=64, - ipv6_fl=0, - udp_sport=1234, - udp_dport=80): - """ - Return a simple IPv6/UDP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ipv6_src IPv6 source - @param ipv6_dst IPv6 destination - @param ipv6_tc IPv6 traffic class - @param ipv6_ecn IPv6 traffic class ECN - @param ipv6_dscp IPv6 traffic class DSCP - @param ipv6_ttl IPv6 hop limit - @param ipv6_fl IPv6 flow label - @param udp_dport UDP destination port - @param udp_sport UDP source port - - Generates a simple UDP request. Users shouldn't assume anything about this - packet other than that it is a valid ethernet/IPv6/UDP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ipv6_tc = ip_make_tos(ipv6_tc, ipv6_ecn, ipv6_dscp) - - pkt = scapy.Ether(dst=eth_dst, src=eth_src) - if dl_vlan_enable or vlan_vid or vlan_pcp: - pkt /= scapy.Dot1Q(vlan=vlan_vid, prio=vlan_pcp) - pkt /= scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim) - pkt /= scapy.UDP(sport=udp_sport, dport=udp_dport) - pkt /= ("D" * (pktlen - len(pkt))) - - return pkt - -def simple_ipv4ip_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - inner_frame=None - ): - """ - Return a simple dataplane IPv4 encapsulated packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - @param inner_frame payload of the packet - - Generates a simple IPv4 encapsulated packet. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl) - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl) - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options) - - if inner_frame: - pkt = pkt / inner_frame - if ((ord(str(inner_frame)[0]) & 0xF0) == 0x40): - pkt['IP'].proto = 4 - elif ((ord(str(inner_frame)[0]) & 0xF0) == 0x60): - pkt['IP'].proto = 41 - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - pkt['IP'].proto = 4 - - return pkt - -def simple_ipv6ip_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ipv6_src='1::2', - ipv6_dst='3::4', - ipv6_fl=0, - ipv6_tc=0, - ipv6_ecn=None, - ipv6_dscp=None, - ipv6_hlim=64, - inner_frame=None - ): - """ - Return a simple dataplane IPv6 encapsulated packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ipv6_src IPv6 source - @param ipv6_dst IPv6 destination - @param ipv6_fl IPv6 flowlabel - @param ipv6_tc IPv6 traffic class - @param ipv6_ecn IPv6 traffic class ECN - @param ipv6_dscp IPv6 traffic class DSCP - @param ipv6_hlim IPv6 hop limit - @param inner_frame payload of the GRE packet - - Generates a simple IPv6 encapsulated packet. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ipv6_tc = ip_make_tos(ipv6_tc, ipv6_ecn, ipv6_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim) - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim) - - if inner_frame: - pkt = pkt / inner_frame - if ((ord(str(inner_frame)[0]) & 0xF0) == 0x40): - pkt['IPv6'].nh = 4 - elif ((ord(str(inner_frame)[0]) & 0xF0) == 0x60): - pkt['IPv6'].nh = 41 - else: - pkt = pkt / scapy.IP() - pkt = pkt/("D" * (pktlen - len(pkt))) - pkt['IPv6'].nh = 4 - - return pkt - -def simple_icmp_packet(pktlen=60, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=1, - icmp_type=8, - icmp_code=0, - icmp_data=''): - """ - Return a simple ICMP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destinatino MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP Identification - @param icmp_type ICMP type - @param icmp_code ICMP code - @param icmp_data ICMP data - - Generates a simple ICMP ECHO REQUEST. Users - shouldn't assume anything about this packet other than that - it is a valid ethernet/ICMP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=0, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, ttl=ip_ttl, tos=ip_tos, id=ip_id)/ \ - scapy.ICMP(type=icmp_type, code=icmp_code)/ icmp_data - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, ttl=ip_ttl, tos=ip_tos, id=ip_id)/ \ - scapy.ICMP(type=icmp_type, code=icmp_code)/ icmp_data - - pkt = pkt/("0" * (pktlen - len(pkt))) - - return pkt - -def simple_icmpv6_packet(pktlen=100, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - ipv6_src='2001:db8:85a3::8a2e:370:7334', - ipv6_dst='2001:db8:85a3::8a2e:370:7335', - ipv6_tc=0, - ipv6_ecn=None, - ipv6_dscp=None, - ipv6_hlim=64, - ipv6_fl=0, - icmp_type=8, - icmp_code=0): - """ - Return a simple ICMPv6 packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ipv6_src IPv6 source - @param ipv6_dst IPv6 destination - @param ipv6_tc IPv6 traffic class - @param ipv6_ecn IPv6 traffic class ECN - @param ipv6_dscp IPv6 traffic class DSCP - @param ipv6_ttl IPv6 hop limit - @param ipv6_fl IPv6 flow label - @param icmp_type ICMP type - @param icmp_code ICMP code - - Generates a simple ICMP ECHO REQUEST. Users shouldn't assume anything - about this packet other than that it is a valid ethernet/IPv6/ICMP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ipv6_tc = ip_make_tos(ipv6_tc, ipv6_ecn, ipv6_dscp) - - pkt = scapy.Ether(dst=eth_dst, src=eth_src) - if dl_vlan_enable or vlan_vid or vlan_pcp: - pkt /= scapy.Dot1Q(vlan=vlan_vid, prio=vlan_pcp) - pkt /= scapy.IPv6(src=ipv6_src, dst=ipv6_dst, fl=ipv6_fl, tc=ipv6_tc, hlim=ipv6_hlim) - pkt /= scapy.ICMPv6Unknown(type=icmp_type, code=icmp_code) - pkt /= ("D" * (pktlen - len(pkt))) - - return pkt - -def simple_arp_packet(pktlen=60, - eth_dst='ff:ff:ff:ff:ff:ff', - eth_src='00:06:07:08:09:0a', - vlan_vid=0, - vlan_pcp=0, - arp_op=1, - ip_snd='192.168.0.1', - ip_tgt='192.168.0.2', - hw_snd='00:06:07:08:09:0a', - hw_tgt='00:00:00:00:00:00', - ): - """ - Return a simple ARP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destinatino MAC - @param eth_src Source MAC - @param arp_op Operation (1=request, 2=reply) - @param ip_snd Sender IP - @param ip_tgt Target IP - @param hw_snd Sender hardware address - @param hw_tgt Target hardware address - - Generates a simple ARP REQUEST. Users - shouldn't assume anything about this packet other than that - it is a valid ethernet/ARP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - pkt = scapy.Ether(dst=eth_dst, src=eth_src) - if vlan_vid or vlan_pcp: - pkt /= scapy.Dot1Q(vlan=vlan_vid, prio=vlan_pcp) - pkt /= scapy.ARP(hwsrc=hw_snd, hwdst=hw_tgt, pdst=ip_tgt, psrc=ip_snd, op=arp_op) - - pkt = pkt/("\0" * (pktlen - len(pkt))) - - return pkt - -def simple_eth_packet(pktlen=60, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - eth_type=0x88cc): - - if MINSIZE > pktlen: - pktlen = MINSIZE - - pkt = scapy.Ether(dst=eth_dst, src=eth_src, type=eth_type) - - pkt = pkt/("0" * (pktlen - len(pkt))) - - return pkt - -def simple_ip_packet(pktlen=100, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - ip_proto=0 - ): - """ - Return a simple dataplane IP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destinatino MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - - Generates a simple IP packet. Users - shouldn't assume anything about this packet other than that - it is a valid ethernet/IP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - if (dl_vlan_enable): - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, proto=ip_proto) - else: - if not ip_options: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, proto=ip_proto) - else: - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, proto=ip_proto, options=ip_options) - - pkt = pkt/("".join([chr(x % 256) for x in xrange(pktlen - len(pkt))])) - - return pkt - -def simple_ip_only_packet(pktlen=100, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - ip_id=0x0001, - ip_ihl=None, - ip_options=False, - tcp_sport=1234, - tcp_dport=80, - tcp_flags="S", - with_tcp_chksum=True - ): - """ - Return a simple dataplane IP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param ip_ttl IP TTL - @param ip_id IP ID - - Generates a simple IP packet. Users - shouldn't assume anything about this packet other than that - it is a valid IP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - if with_tcp_chksum: - tcp_hdr = scapy.TCP(sport=tcp_sport, dport=tcp_dport, flags=tcp_flags) - else: - tcp_hdr = scapy.TCP(sport=tcp_sport, dport=tcp_dport, flags=tcp_flags, chksum=0) - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - if not ip_options: - pkt = scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl) / tcp_hdr - else: - pkt = scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, id=ip_id, ihl=ip_ihl, options=ip_options) / tcp_hdr - - pkt = pkt/("".join([chr(x % 256) for x in xrange(pktlen - len(pkt))])) - - return pkt - -def simple_mpls_packet(pktlen=300, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - mpls_type=0x8847, - mpls_tags=[], - dl_vlan_cfi=0, - inner_frame = None): - """ - Return a simple dataplane MPLS packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destination MAC - @param eth_src Source MAC - @param dl_vlan_enable True if the packet is with vlan, False otherwise - @param vlan_vid VLAN ID - @param vlan_pcp VLAN priority - @param mpls_tags mpls tag stack - @param inner_frame The inner frame - - """ - if scapy.MPLS is None: - logging.error("A MPLS packet was requested but MPLS is not supported by your Scapy. See README for more information") - return None - - if MINSIZE > pktlen: - pktlen = MINSIZE - - pkt = scapy.Ether(dst=eth_dst, src=eth_src) - pkt[Ether].setfieldval('type', mpls_type) - - if (dl_vlan_enable): - pkt / scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid) - pkt[Dot1Q].setfieldval('type', mpls_type) - - mpls_tags = list(mpls_tags) - while len(mpls_tags): - tag = mpls_tags.pop(0) - mpls = MPLS() - if 'label' in tag: - mpls.label = tag['label'] - if 'tc' in tag: - mpls.cos = tag['tc'] - if 'ttl' in tag: - mpls.ttl = tag['ttl'] - if 's' in tag: - mpls.s = tag['s'] - pkt = pkt / mpls - - if inner_frame: - pkt = pkt / inner_frame - else: - pkt = pkt / simple_tcp_packet(pktlen = pktlen - len(pkt)) - - return pkt - -def simple_qinq_tcp_packet(pktlen=100, - eth_dst='00:01:02:03:04:05', - eth_src='00:06:07:08:09:0a', - dl_vlan_outer=20, - dl_vlan_pcp_outer=0, - dl_vlan_cfi_outer=0, - vlan_vid=10, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='192.168.0.1', - ip_dst='192.168.0.2', - ip_tos=0, - ip_ecn=None, - ip_dscp=None, - ip_ttl=64, - tcp_sport=1234, - tcp_dport=80, - ip_ihl=None, - ip_options=False - ): - """ - Return a doubly tagged dataplane TCP packet - - Supports a few parameters: - @param len Length of packet in bytes w/o CRC - @param eth_dst Destinatino MAC - @param eth_src Source MAC - @param dl_vlan_outer Outer VLAN ID - @param dl_vlan_pcp_outer Outer VLAN priority - @param dl_vlan_cfi_outer Outer VLAN cfi bit - @param vlan_vid Inner VLAN ID - @param vlan_pcp VLAN priority - @param dl_vlan_cfi VLAN cfi bit - @param ip_src IP source - @param ip_dst IP destination - @param ip_tos IP ToS - @param ip_ecn IP ToS ECN - @param ip_dscp IP ToS DSCP - @param tcp_dport TCP destination port - @param ip_sport TCP source port - - Generates a TCP request. Users - shouldn't assume anything about this packet other than that - it is a valid ethernet/IP/TCP frame. - """ - - if MINSIZE > pktlen: - pktlen = MINSIZE - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - # Note Dot1Q.id is really CFI - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.Dot1Q(prio=dl_vlan_pcp_outer, id=dl_vlan_cfi_outer, vlan=dl_vlan_outer)/ \ - scapy.Dot1Q(prio=vlan_pcp, id=dl_vlan_cfi, vlan=vlan_vid)/ \ - scapy.IP(src=ip_src, dst=ip_dst, tos=ip_tos, ttl=ip_ttl, ihl=ip_ihl)/ \ - scapy.TCP(sport=tcp_sport, dport=tcp_dport) - - pkt = pkt/("".join([chr(x % 256) for x in xrange(pktlen - len(pkt))])) - - return pkt - -def dhcp_discover_packet(eth_dst='ff:ff:ff:ff:ff:ff', - eth_src='00:01:02:03:04:05', - ip_src='0.0.0.0', - ip_dst='255.255.255.255', - src_port=68, - dst_port=67, - bootp_chaddr='00:01:02:03:04:05', - ): - """ - Return a dhcp discover packet - - Supports a few parameters: - @param eth_dst Destination MAC, should be broadcast - @param eth_src Source MAC - @param ip_src Source IP, should be 0.0.0.0 - @param ip_dst Destination IP, should be broadcast address - @param src_port Source Port, 68 for DHCP Client - @param dst_port Destination Port, 67 for DHCP Server - @param bootp_chaddr MAC Address of client - - """ - - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst)/ \ - scapy.UDP(sport=src_port, dport=dst_port)/ \ - scapy.BOOTP(chaddr=bootp_chaddr)/ \ - scapy.DHCP(options=[('message-type', 'discover'), ('end')]) - return pkt - -def dhcp_offer_packet(eth_dst='00:01:02:03:04:05', - eth_src='06:07:08:09:10:11', - ip_src='0.0.0.0', - ip_dst='255.255.255.255', - ip_len=308, - ip_tos=16, - ip_ecn=None, - ip_dscp=None, - ip_ttl=128, - ip_id=0, - src_port=67, - dst_port=68, - udp_len=308, - bootp_op=2, - bootp_htype=1, - bootp_hlen=6, - bootp_hops=1, - bootp_xid=00000000, - bootp_secs=0, - bootp_flags=0000, - bootp_ciaddr='0.0.0.0', - bootp_yiaddr='1.2.3.4', - bootp_siaddr='0.0.0.0', - bootp_chaddr='00:01:02:03:04:05', - bootp_giaddr='9.8.7.6', - dhcp_serverip='1.2.3.4', - dhcp_lease=256, - dhcp_netmask='255.255.255.0', - padding=None): - """ - Return a dhcp offer packet - - Supports a few parameters: - @param eth_dst Destination MAC, should be address of client - @param eth_src Source MAC, address of DHCP server or relay - @param ip_src Source IP, should be DHCP server IP - @param ip_dst Destination IP, should be client address - @param src_port Source Port, 67 for DHCP Server - @param dst_port Destination Port, 68 for DHCP Client - @param bootp_op Operation Code, 2 indicates reply - @param bootp_htype Hardware Type, 1 indicates ethernet - @param bootp_hlen Hardware Address Len, 6 is value for Ethernet - @param bootp_hops Hops, used by relay agent to forward messages - @param bootp_xid Transaction Identifier, 32 bit field that identifies transaction - @param bootp_secs Seconds, time elapsed since client started trying to boot - @param bootp_flags Flags, 16 bits (1 bit is broadcast flag) - @param bootp_ciaddr Client IP Address, if client has a current IP address otherwise set to zeros - @param bootp_yiaddr Your IP Address, address that server is assigning to client - @param bootp_siaddr Server IP Address, address of server - @param bootp_giaddr Gateway IP Address, address of relay agent if used - @param bootp_chaddr MAC Address of client - @param dhcp_serverip IP address of DHCP server - @param dhcp_lease Time in seconds of DHCP lease - @param dhcp_netmask Subnet mask of client - @param padding '\x00' padding inserted at end of packet, '\x00'*n where n is number of bytes - """ - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst, len=ip_len, tos=ip_tos, ttl=ip_ttl, id=0)/ \ - scapy.UDP(sport=src_port, dport=dst_port, len=udp_len)/ \ - scapy.BOOTP(op=bootp_op, htype=bootp_htype, hlen=bootp_hlen, hops=bootp_hops, xid=bootp_xid, - secs=bootp_secs, flags=bootp_flags, ciaddr=bootp_ciaddr, yiaddr=bootp_yiaddr, siaddr=bootp_siaddr, - giaddr=bootp_giaddr, chaddr=bootp_chaddr)/ \ - scapy.DHCP(options=[('message-type', 'offer'), ('server_id', dhcp_serverip), ('lease_time', int(dhcp_lease)), - ('subnet_mask', dhcp_netmask), ('end')])/ \ - scapy.PADDING(padding) - return pkt - -def dhcp_request_packet(eth_dst='ff:ff:ff:ff:ff:ff', - eth_src='00:01:02:03:04:05', - ip_src='0.0.0.0', - ip_dst='255.255.255.255', - src_port=68, - dst_port=67, - bootp_chaddr='00:01:02:03:04:05', - dhcp_request_ip='1.2.3.4'): - """ - Return a dhcp request packet - - Supports a few parameters: - @param eth_dst Destination MAC, should be broadcast address - @param eth_src Source MAC, address of client - @param ip_src Source IP, should be default route IP Address (0.0.0.0) - @param ip_dst Destination IP, should be broadcast address - @param src_port Source Port, 68 for DHCP Client - @param dst_port Destination Port, 67 for DHCP Server - @param bootp_chaddr MAC Address of DHCP Client - @param dhcp_request_ip IP Address, address of client (found in DHCP Offer) - """ - - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst)/ \ - scapy.UDP(sport=src_port, dport=dst_port)/ \ - scapy.BOOTP(chaddr=bootp_chaddr)/ \ - scapy.DHCP(options=[('message-type', 'request'), ('requested_addr', dhcp_request_ip), ('end')]) - return pkt - -def dhcp_ack_packet(eth_dst='00:01:02:03:04:05', - eth_src='06:07:08:09:10:11', - ip_src='1.2.3.4', - ip_dst='255.255.255.255', - ip_len=328, - ip_tos=16, - ip_ecn=None, - ip_dscp=None, - ip_ttl=128, - ip_id=0, - src_port=67, - dst_port=68, - udp_len=308, - bootp_op=2, - bootp_htype=1, - bootp_hlen=6, - bootp_hops=1, - bootp_xid=00000000, - bootp_secs=0, - bootp_flags=0000, - bootp_ciaddr='0.0.0.0', - bootp_yiaddr='1.2.3.4', - bootp_siaddr='0.0.0.0', - bootp_chaddr='00:01:02:03:04:05', - bootp_giaddr='9.8.7.6', - dhcp_serverip='1.2.3.4', - dhcp_lease=256, - dhcp_netmask='255.255.255.0', - padding=None): - """ - Return a dhcp ack packet - - Supports a few parameters: - @param eth_dst Destination MAC, should be address of client - @param eth_src Source MAC, address of DHCP server or relay - @param ip_src Source IP, should be DHCP server IP - @param ip_dst Destination IP, should be client address - @param src_port Source Port, 67 for DHCP Server - @param dst_port Destination Port, 68 for DHCP Client - @param bootp_op Operation Code, 2 indicates reply - @param bootp_htype Hardware Type, 1 indicates ethernet - @param bootp_hlen Hardware Address Len, 6 is value for Ethernet - @param bootp_hops Hops, used by relay agent to forward messages - @param bootp_xid Transaction Identifier, 32 bit field that identifies transaction - @param bootp_secs Seconds, time elapsed since client started trying to boot - @param bootp_flags Flags, 16 bits (1 bit is broadcast flag) - @param bootp_ciaddr Client IP Address, if client has a current IP address otherwise set to zeros - @param bootp_yiaddr Your IP Address, address that server is assigning to client - @param bootp_siaddr Server IP Address, address of server - @param bootp_giaddr Gateway IP Address, address of relay agent if used - @param bootp_chaddr MAC Address of client - @param dhcp_serverip IP address of DHCP server - @param dhcp_lease Time in seconds of DHCP lease - @param dhcp_netmask Subnet mask of client - @param padding '\x00' padding inserted at end of packet, '\x00'*n where n is number of bytes - """ - - ip_tos = ip_make_tos(ip_tos, ip_ecn, ip_dscp) - - pkt = scapy.Ether(dst=eth_dst, src=eth_src) / \ - scapy.IP(src=ip_src, dst=ip_dst, len=ip_len, tos=ip_tos, ttl=ip_ttl, id=ip_id) / \ - scapy.UDP(sport=src_port, dport=dst_port, len=udp_len) / \ - scapy.BOOTP(op=bootp_op, htype=bootp_htype, hlen=bootp_hlen, hops=bootp_hops, xid=bootp_xid, - flags=bootp_flags, ciaddr=bootp_ciaddr, yiaddr=bootp_yiaddr, siaddr=bootp_siaddr, - giaddr=bootp_giaddr, chaddr=bootp_chaddr) / \ - scapy.DHCP(options=[('message-type', 'ack'), ('server_id', dhcp_serverip), ('lease_time', int(dhcp_lease)), - ('subnet_mask', dhcp_netmask), ('end')]) / \ - scapy.PADDING(padding) - return pkt - -def dhcp_release_packet(eth_dst='ff:ff:ff:ff:ff:ff', - eth_src='00:01:02:03:04:05', - ip_src='0.0.0.0', - ip_dst='255.255.255.255', - src_port=68, - dst_port=67, - bootp_chaddr='00:01:02:03:04:05', - bootp_ciaddr='1.2.3.4', - dhcp_server_ip='1.2.3.4'): - """ - Return a dhcp release packet - - Supports a few parameters: - @param eth_dst Destination MAC, should be broadcast address - @param eth_src Source MAC, should be address of client - @param ip_src Source IP, should be default route IP address - @param ip_dst Destination IP, broadcast IP address - @param src_port Source Port, 68 for DHCP client - @param dst_port Destination Port, 67 for DHCP Server - @param bootp_chaddr MAC Address of client - @param bootp_ciaddr Client IP Address - @param dhcp_server_ip IP address of DHCP server - """ - - pkt = scapy.Ether(dst=eth_dst, src=eth_src)/ \ - scapy.IP(src=ip_src, dst=ip_dst)/ \ - scapy.UDP(sport=src_port, dport=dst_port)/ \ - scapy.BOOTP(chaddr=bootp_chaddr, ciaddr=bootp_ciaddr)/ \ - scapy.DHCP(options=[('message-type', 'release'), ('server_id', dhcp_server_ip), ('end')]) - return pkt - -def get_egr_list(parent, ports, how_many, exclude_list=[]): - """ - Generate a list of ports avoiding those in the exclude list - @param parent Supplies logging - @param ports List of OF port numbers - @param how_many Number of ports to be added to the list - @param exclude_list List of ports not to be used - @returns An empty list if unable to find enough ports - """ - - if how_many == 0: - return [] - - count = 0 - egr_ports = [] - for egr_idx in range(len(ports)): - if ports[egr_idx] not in exclude_list: - egr_ports.append(ports[egr_idx]) - count += 1 - if count >= how_many: - return egr_ports - logging.debug("Could not generate enough egress ports for test") - return [] - -def test_params_get(default={}): - """ - Return all the values passed via test-params if present - - @param default Default dictionary to use if no valid params found - - WARNING: TEST PARAMETERS MUST BE PYTHON IDENTIFIERS; - AND CANNOT START WITH "__"; - eg egr_count, not egr-count. - """ - test_params = ptf.config["test_params"] - params_str = "class _TestParams:\n " + test_params - try: - exec params_str - except: - return default - - params = {} - for k, v in vars(_TestParams).items(): - if k[:2] != "__": - params[k] = v - return params - -def test_param_get(key, default=None): - """ - Return value passed via test-params if present - - @param key The lookup key - @param default Default value to use if not found - - WARNING: TEST PARAMETERS MUST BE PYTHON IDENTIFIERS; - eg egr_count, not egr-count. - """ - params = test_params_get() - - try: - return params[key] - except: - return default - -_import_blacklist.add('FILTER') -FILTER = ''.join([(len(repr(chr(x)))==3) and chr(x) or '.' - for x in range(256)]) - -def hex_dump_buffer(src, length=16): - """ - Convert src to a hex dump string and return the string - @param src The source buffer - @param length The number of bytes shown in each line - @returns A string showing the hex dump - """ - result = ["\n"] - for i in xrange(0, len(src), length): - chars = src[i:i+length] - hex = ' '.join(["%02X" % ord(x) for x in chars]) - printable = ''.join(["%s" % ((ord(x) <= 127 and - FILTER[ord(x)]) or '.') for x in chars]) - result.append("%04x %-*s %s\n" % (i, length*3, hex, printable)) - return ''.join(result) - -def format_packet(pkt): - return "Packet length %d \n%s" % (len(str(pkt)), - hex_dump_buffer(str(pkt))) - -def inspect_packet(pkt): - """ - Wrapper around scapy's show() method. - @returns A string showing the dissected packet. - """ - from cStringIO import StringIO - out = None - backup = sys.stdout - try: - tmp = StringIO() - sys.stdout = tmp - pkt.show2() - out = tmp.getvalue() - tmp.close() - finally: - sys.stdout = backup - return out - -def nonstandard(cls): - """ - Testcase decorator that marks the test as being non-standard. - These tests are not automatically added to the "standard" group. - """ - cls._nonstandard = True - return cls - -def disabled(cls): - """ - Testcase decorator that marks the test as being disabled. - These tests are not automatically added to the "standard" group or - their module's group. - """ - cls._disabled = True - return cls - -def group(name): - """ - Testcase decorator that adds the test to a group. - """ - def fn(cls): - if not hasattr(cls, "_groups"): - cls._groups = [] - cls._groups.append(name) - return cls - return fn - -def testtimeout(seconds): - """ - Testcase decorator that adds a timeout to the test. - """ - def fn(cls): - cls._testtimeout = seconds - return cls - return fn - -def ptf_ports(num=None): - """ - Return a list of 'num' port ids (device_number, port_number) - - If 'num' is None, return all available ports. Otherwise, limit the length - of the result to 'num' and raise an exception if not enough ports are - available. - """ - ports = sorted(ptf.config["port_map"].keys()) - if num != None and len(ports) < num: - raise Exception("test requires %d ports but only %d are available" % (num, len(ports))) - return ports[:num] - -def port_to_tuple(port): - if type(port) is int: - return 0, port - if type(port) is tuple: - return port - if type(port) is str: - try: - return 0, int(port) - except: - pass - return None - -def send_packet(test, port_id, pkt, count=1): - """ - Send a packet (or a number of packets) out of port_id - port_id can either be a single integer (port_number on default device 0) - or a tuple of 2 integers (device_number, port_number) - """ - device, port = port_to_tuple(port_id) - pkt = str(pkt) - sent = 0 - - for n in range(count): - test.before_send(pkt, device_number=device, port_number=port) - sent += test.dataplane.send(device, port, pkt) - - return sent - -def send(test, port_id, pkt, count=1): - """ - See send_packet. - """ - return send_packet(test, port_id, pkt, count=count) - -def dp_poll(test, device_number=0, port_number=None, timeout=-1, exp_pkt=None): - """ - Wrapper function around dataplane.poll - """ - t = test.dataplane.poll( - device_number=device_number, port_number=port_number, - timeout=timeout, exp_pkt=exp_pkt, filters=FILTERS - ) - (rcv_device, rcv_port, rcv_pkt, pkt_time) = t - if rcv_pkt is not None: - test.at_receive(rcv_pkt, device_number=rcv_device, port_number=rcv_port) - return t - -def verify_packet(test, pkt, port_id): - """ - Check that an expected packet is received - port_id can either be a single integer (port_number on default device 0) - or a tuple of 2 integers (device_number, port_number) - """ - device, port = port_to_tuple(port_id) - logging.debug("Checking for pkt on device %d, port %d", device, port) - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll( - test, device_number=device, port_number=port, timeout=2, exp_pkt=pkt - ) - test.assertTrue(rcv_pkt != None, "Did not receive expected pkt on device %d, port %r" % (device, port)) - -def verify_no_packet(test, pkt, port_id, timeout=None): - """ - Check that a particular packet is not received - port_id can either be a single integer (port_number on default device 0) - or a tuple of 2 integers (device_number, port_number) - """ - if timeout is None: - timeout = ptf.ptfutils.default_negative_timeout - device, port = port_to_tuple(port_id) - logging.debug("Negative check for pkt on device %d, port %d", device, port) - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll( - test, device_number=device, port_number=port, exp_pkt=pkt, - timeout=timeout - ) - test.assertTrue(rcv_pkt == None, "Received packet on device %d, port %r" % (device, port)) - -def verify_no_other_packets(test, device_number=0, timeout=None): - """ - Check that no unexpected packets are received on specified device - - This is a no-op if the --relax option is in effect. - """ - if ptf.config["relax"]: - return - if timeout is None: - timeout = ptf.ptfutils.default_negative_timeout - logging.debug("Checking for unexpected packets on all ports of device %d" % device_number) - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll( - test, device_number=device_number, - timeout=timeout - ) - if rcv_pkt != None: - logging.debug("Received unexpected packet on device %d, port %r: %s", device_number, rcv_port, format_packet(rcv_pkt)) - test.assertTrue(rcv_pkt == None, "Unexpected packet on device %d, port %r" % (device_number, rcv_port)) - -def verify_packets(test, pkt, ports=[], device_number=0): - """ - Check that a packet is received on each of the specified port numbers for a - given device (default device number is 0). - - Also verifies that the packet is not received on any other ports for this - device, and that no other packets are received on the device (unless --relax - is in effect). - - This covers the common and simplest cases for checking dataplane outputs. - For more complex usage, like multiple different packets being output, or - multiple packets on the same port, use the primitive verify_packet, - verify_no_packet, and verify_no_other_packets functions directly. - """ - for device, port in ptf_ports(): - if device != device_number: - continue - if port in ports: - verify_packet(test, pkt, (device, port)) - else: - verify_no_packet(test, pkt, (device, port)) - verify_no_other_packets(test, device_number=device_number) - -def verify_no_packet_any(test, pkt, ports=[], device_number=0): - """ - Check that a packet is NOT received on _any_ of the specified ports belonging to - the given device (default device_number is 0). - """ - test.assertTrue(len(ports) != 0, "No port available to validate receiving packet on device %d, " % device_number) - for device, port in ptf_ports(): - if device != device_number: - continue - if port in ports: - print 'verifying packet on port device', device_number, 'port', port - verify_no_packet(test, pkt, (device, port)) - -def verify_packets_any(test, pkt, ports=[], device_number=0): - """ - Check that a packet is received on _any_ of the specified ports belonging to - the given device (default device_number is 0). - - Also verifies that the packet is not received on any other ports for this - device, and that no other packets are received on the device (unless --relax - is in effect). - """ - received = False - for device, port in ptf_ports(): - if device != device_number: - continue - if port in ports: - logging.debug("Checking for pkt on device %d, port %d", device_number, port) - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll( - test, device_number=device, port_number=port, exp_pkt=pkt - ) - if rcv_pkt != None: - received = True - else: - verify_no_packet(test, pkt, (device, port)) - verify_no_other_packets(test) - - test.assertTrue(received == True, "Did not receive expected pkt on any of ports %r for device %d" % (ports, device_number)) - -def verify_packet_any_port(test, pkt, ports=[], device_number=0): - """ - Check that the packet is received on _any_ of the specified ports belonging to - the given device (default device_number is 0). - - The function returns when either the expected packet is received or timeout (1 second). - - Also verifies that the packet is or received on any other ports for this - device, and that no other packets are received on the device (unless --relax - is in effect). - - Returns the index of the port on which the packet is received and the packet. - """ - received = False - match_index = 0 - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll( - test, - device_number=device_number, - exp_pkt=pkt, - timeout=1 - ) - - logging.debug("Checking for pkt on device %d, port %r", device_number, ports) - if rcv_port in ports: - match_index = ports.index(rcv_port) - received = True - verify_no_other_packets(test, device_number=device_number) - - test.assertTrue(received == True, "Did not receive expected pkt(s) on any of ports %r for device %d" % (ports, device_number)) - return (match_index, rcv_pkt) - -def verify_any_packet_any_port(test, pkts=[], ports=[], device_number=0): - """ - Check that _any_ of the packet is received on _any_ of the specified ports belonging to - the given device (default device_number is 0). - - Also verifies that the packet is not received on any other ports for this - device, and that no other packets are received on the device (unless --relax - is in effect). - - Returns the index of the port on which the packet is received. - """ - received = False - match_index = 0 - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll( - test, - device_number=device_number, - timeout=1 - ) - - logging.debug("Checking for pkt on device %d, port %r", device_number, ports) - if rcv_port in ports: - for pkt in pkts: - if str(pkt) == str(rcv_pkt): - match_index = ports.index(rcv_port) - received = True - verify_no_other_packets(test, device_number=device_number) - - test.assertTrue(received == True, "Did not receive expected pkt(s) on any of ports %r for device %d" % (ports, device_number)) - return match_index - -def verify_each_packet_on_each_port(test, pkts=[], ports=[], device_number=0): - """ - Check that each packet is received on corresponding port in the port list belonging to - the given device (default device_number is 0). - - Also verifies that the packet is not received on any other ports for this - device, and that no other packets are received on the device (unless --relax - is in effect). - """ - pkt_cnt = 0 - test.assertTrue(len(pkts) == len(ports), "packet list count does not match port list count") - for port, pkt in zip(ports, pkts): - logging.debug("Checking for pkt on device %d, port %d", device_number, port) - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll( - test, - device_number=device_number, - port_number=port, - exp_pkt=pkt - ) - test.assertTrue(rcv_pkt != None, "Did not receive expected pkt(s) on port %d for device %d" %(port, device_number)) - - verify_no_other_packets(test, device_number=device_number) - -def verify_packet_prefix(test, pkt, port, len, device_number=0): - """ - Check that an expected packet is received - """ - logging.debug("Checking for pkt on port %r", port) - (rcv_device, rcv_port, rcv_pkt, pkt_time) = test.dataplane.poll(port_number=port, timeout=2, exp_pkt=str(pkt)[:len]) - test.assertTrue(rcv_pkt != None, "Did not receive expected pkt on %r" % port) - -def count_matched_packets(test, exp_packet, port, device_number=0, timeout=1): - """ - Receive all packets on the port and count how many expected packets were received. - As soon as the packets stop arriving, the function waits for the timeout value and returns the counter - """ - total_rcv_pkt_cnt = 0 - while True: - (rcv_device, rcv_port, rcv_pkt, pkt_time) = dp_poll(test, device_number=device_number, port_number=port, timeout=timeout) - if rcv_pkt is not None: - if ptf.dataplane.match_exp_pkt(exp_packet, rcv_pkt): - total_rcv_pkt_cnt += 1 - else: - break - - return total_rcv_pkt_cnt - - -__all__ = list(set(locals()) - _import_blacklist) diff --git a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/thriftutils.py b/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/thriftutils.py deleted file mode 100644 index 668351aa3..000000000 --- a/bm/sai_adapter/test/ptf_tests/ptf/src/ptf/thriftutils.py +++ /dev/null @@ -1,64 +0,0 @@ -import struct - -# thrift does not support unsigned integers -def hex_to_i16(h): - x = int(h) - if (x > 0x7FFF): x-= 0x10000 - return x -def i16_to_hex(h): - x = int(h) - if (x & 0x8000): x+= 0x10000 - return x -def hex_to_i32(h): - x = int(h) - if (x > 0x7FFFFFFF): x-= 0x100000000 - return x -def i32_to_hex(h): - x = int(h) - if (x & 0x80000000): x+= 0x100000000 - return x -def hex_to_byte(h): - x = int(h) - if (x > 0x7F): x-= 0x100 - return x -def byte_to_hex(h): - x = int(h) - if (x & 0x80): x+= 0x100 - return x -def uint_to_i32(u): - if (u > 0x7FFFFFFF): u-= 0x100000000 - return u -def i32_to_uint(u): - if (u & 0x80000000): u+= 0x100000000 - return u -def char_to_uchar(x): - if (x >= 0): - return x - return 256 + x - -def bytes_to_string(byte_array): - form = 'B' * len(byte_array) - return struct.pack(form, *byte_array) - -def string_to_bytes(string): - form = 'B' * len(string) - return list(struct.unpack(form, string)) - -def macAddr_to_string(addr): - byte_array = [int(b, 16) for b in addr.split(':')] - return bytes_to_string(byte_array) - -def ipv4Addr_to_i32(addr): - byte_array = [int(b) for b in addr.split('.')] - res = 0 - for b in byte_array: res = res * 256 + b - return uint_to_i32(res) - -def stringify_macAddr(addr): - return ':'.join('%02x' % char_to_uchar(x) for x in addr) - -def i32_to_ipv4Addr(addr): - return socket.inet_ntoa(struct.pack("!I", addr)) - -def ipv6Addr_to_string(addr): - return (str(socket.inet_pton(socket.AF_INET6, addr))) diff --git a/bm/sai_adapter/test/ptf_tests/run_ptf.sh b/bm/sai_adapter/test/ptf_tests/run_ptf.sh deleted file mode 100755 index 4853e9a7f..000000000 --- a/bm/sai_adapter/test/ptf_tests/run_ptf.sh +++ /dev/null @@ -1,7 +0,0 @@ -sudo ./ptf/ptf --test-dir tests/ --pypath sai_thrift_src/gen-py --test-params port_map_file=\"port_map.ini\" --interface 0@sw_port0 --interface 1@sw_port1 --interface 2@sw_port2 \ - --interface 3@sw_port3 --interface 4@sw_port4 --interface 5@sw_port5 --interface 6@sw_port6 --interface 7@sw_port7 \ - sail2_new.L2AcceptedFrameType sail2_new.L21DBridgeBasicTest sail2_new.L21QBridgeAccess2AccessTest sail2_new.L21QBridgeAccess2TrunkTest sail2_new.L21QBridgeTrunk2AccessTest sail2_new.L21QBridgeTrunk2TrunkTest sail2_new.L21DLagTest sail2_new.L21QLagTest - # sail2_new.L21DLagTest - # sail2_new.L21QLagTest - # sail2_new.L21QBridgeAccess2AccessTest - \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/run_ptf_1Q_B_A2A_test.sh b/bm/sai_adapter/test/ptf_tests/run_ptf_1Q_B_A2A_test.sh deleted file mode 100755 index c1722ef84..000000000 --- a/bm/sai_adapter/test/ptf_tests/run_ptf_1Q_B_A2A_test.sh +++ /dev/null @@ -1,7 +0,0 @@ -sudo ./ptf/ptf --test-dir tests/ --pypath sai_thrift_src/gen-py --test-params port_map_file=\"port_map.ini\" --interface 0@sw_port0 --interface 1@sw_port1 --interface 2@sw_port2 \ - --interface 3@sw_port3 --interface 4@sw_port4 --interface 5@sw_port5 --interface 6@sw_port6 --interface 7@sw_port7 \ - sail2_new.L21QBridgeAccess2AccessTest - #sail2_new.L2AcceptedFrameType sail2_new.L21DBridgeBasicTest sail2_new.L21QBridgeAccess2AccessTest sail2_new.L21QBridgeAccess2TrunkTest sail2_new.L21QBridgeTrunk2AccessTest sail2_new.L21QBridgeTrunk2TrunkTest sail2_new.L21DLagTest sail2_new.L21QLagTest - #sail2_new.L2AcceptedFrameType - #sail2_new.L21QLagTest - \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/run_ptf_c.sh b/bm/sai_adapter/test/ptf_tests/run_ptf_c.sh deleted file mode 100755 index fe2043a04..000000000 --- a/bm/sai_adapter/test/ptf_tests/run_ptf_c.sh +++ /dev/null @@ -1,4 +0,0 @@ -sudo ./ptf/ptf --test-dir tests/ --pypath sai_thrift_src/gen-py --test-params port_map_file=\"port_map.ini\" --interface 0@sw_port0 --interface 1@sw_port1 --interface 2@sw_port2 \ - --interface 3@sw_port3 --interface 4@sw_port4 --interface 5@sw_port5 --interface 6@sw_port6 --interface 7@sw_port7 \ - sail2_new.L2AcceptedFrameType sail2_new.L21DBridgeBasicTest sail2_new.L21QBridgeAccess2AccessTest sail2_new.L21QBridgeAccess2TrunkTest sail2_new.L21QBridgeTrunk2AccessTest sail2_new.L21QBridgeTrunk2TrunkTest sail2_new.L21DLagTest - # sail2_new.L21QLagTest \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/run_ptf_l2_tests.sh b/bm/sai_adapter/test/ptf_tests/run_ptf_l2_tests.sh deleted file mode 100755 index 613cdb92e..000000000 --- a/bm/sai_adapter/test/ptf_tests/run_ptf_l2_tests.sh +++ /dev/null @@ -1,3 +0,0 @@ -sudo ./ptf/ptf --test-dir tests/ --pypath sai_thrift_src/gen-py --test-params port_map_file=\"port_map.ini\" --interface 0@sw_port0 --interface 1@sw_port1 --interface 2@sw_port2 \ - --interface 3@sw_port3 --interface 4@sw_port4 --interface 5@sw_port5 --interface 6@sw_port6 --interface 7@sw_port7 \ - sail2_new.L2AcceptedFrameType sail2_new.L21DBridgeBasicTest sail2_new.L21QBridgeAccess2AccessTest sail2_new.L21QBridgeAccess2TrunkTest sail2_new.L21QBridgeTrunk2AccessTest sail2_new.L21QBridgeTrunk2TrunkTest sail2_new.L21DLagTest sail2_new.L21QLagTest \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/run_ptf_wip_test.sh b/bm/sai_adapter/test/ptf_tests/run_ptf_wip_test.sh deleted file mode 100755 index ee7250d92..000000000 --- a/bm/sai_adapter/test/ptf_tests/run_ptf_wip_test.sh +++ /dev/null @@ -1,5 +0,0 @@ -sudo ./ptf/ptf --test-dir wip_tests/ --pypath sai_thrift_src/gen-py --test-params port_map_file=\"port_map.ini\" --interface 0@sw_port0 --interface 1@sw_port1 --interface 2@sw_port2 \ - --interface 3@sw_port3 --interface 4@sw_port4 --interface 5@sw_port5 --interface 6@sw_port6 --interface 7@sw_port7 \ - sail2_wip.L2WIP - - \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/tests/README.txt b/bm/sai_adapter/test/ptf_tests/tests/README.txt deleted file mode 100644 index 037d5e66e..000000000 --- a/bm/sai_adapter/test/ptf_tests/tests/README.txt +++ /dev/null @@ -1,97 +0,0 @@ -List of Tests with brief description -==================================== - -L2AccessToAccessVlanTest - Create a VLAN(10) and add two untagged interfaces for port1 and port2 as members - Setup static FDB entries for port1 and port2 - Send a simple untagged packet on port 2 and verify packet on port 1 - -L2TrunkToTrunkVlanTest - Create a VLAN(10) and add two tagged interfaces for port1 and port2 as members - Setup static FDB entries for port1 and port2 - Send a simple vlan tag (10) packet on port 2 and verify packet on port 1 - [Note: Test packet recieved are checked w/o VLAN tag as the kernel strips the tag before senidn it in. The tag can be validated with PCAP files captured to validate the actual packet format] - -L2AccessToTrunkVlanTest - Create a VLAN(10) and add a tagged interfaces for port1 and untagged interface for port2 as members - Setup static FDB entries for port1 and port2 - Send a simple untagged packet on port 2 and verify packet on port 1 (w/ Vlan 10) - -L2TrunkToAccessVlanTest - Create a VLAN(10) and add a tagged interfaces for port2 and untagged interface for port1 as members - Setup static FDB entries for port1 and port2 - Send a simple tagged packet on port 2 and verify packet on port 1(untagged) - -L2StpTest - Create a VLAN(10) and add two untagged interfaces for port1 and port2 as members - Setup static FDB entries for port1 and port2 - Set the STP states for the VLAN in forwarding state on both the ports - Send a packet on port 2 and verify the packet on port 1 - Set the STP state on port 2 to blocking - Send a packet on port 2 and verify that the packet is dropped - -L3IPv4HostTest - Create a VRF with IPv4 and IPv6 enabled - Create two router interfaces in the same VRF - Create a nhop, route (/32 mask) and neighbor entry for destination - Send a packet on port 2 to the destination IP address and verify packet on port 1( changed destination and source mac address) - -L3IPv4LpmTest - Create a VRF with IPv4 and IPv6 enabled - Create two router interfaces in the same VRF - Create a nhop, route (/24 mask) and neighbor entry for destination - Send a packet on port 2 to the destination IP address and verify packet on port 1( changed destination and source mac address) - -L3IPv6HostTest - Same as L3IPv4HostTest except the IP destination addresses are IPv6 addresses and the mask is /128. Test packets sent are IPv6 packets - -L3IPv6LpmTest - Same as L3IPv4LpmTest except the IP destination addresses are IPv6 addresses and the mask is /120. Test packets sent are IPv6 packets - -L3IPv4EcmpHostTest - Same as L3IPv4HostTest with the addition of another router interface and corresponding nexthop and neighbor entry. Packets are with different source IP addresses and verified to be recived on the two configured outgoing interfaces. - -L3IPv6EcmpHostTest - Same as L3IPv4EcmpHostTest for the IPv6 packets. - -L3IPv4EcmpLpmTest - Same as L3IPv4EcmpHostTest with a route prefix set - -L3IPv6EcmpLpmTest - Same as L3IPv6EcmpHostTest with a route prefix set - -L2FloodTest - Create a VLAN (10) - Add three ports as untagged members to the VLAN - Send packet on each port and verify that it only shows up on the other two ports - -L2LagTest - Create a LAG group with 4 ports 1 through 4 - Setup static FDB entries for port 5 and the LAG with unique MAC addresses - Send packets (100)a with varying and check count of packets recieved in ports 1 through 4 - verify that the counts are around divided equally amonst them with a margin of error 10% - Send packets from each of the members and check they are recieved on port 5 (with port 5's destination MAC) - -L3IPv4LagTest - Same as L3Ipv4HostTest with the additon of adding interfaces on a LAG (with ports 1 and 2 as its members) - Send packets on port 3 and ensure all are recieved on ports 1 and 2 - -L3IPv6LagTest - Same as L3IPv4LagTest for IPv6 hosts - -L3EcmpLagTest - Same as L3IPv4EcmpLpmTest with two of the interfaces on LAG groups - -IPAclTest - Deny packets from a IPv4 Source address - -IngressLocalMirrorTest - Mirror incoming packets froma port to an alternate port. This uses ACL to send to a mirrror port - -IngressERSpanMirrorTest - Span incoming packets from one port onto an ERSPAN port - -EgressLocalMirrorTest - Mirror outgoing packets to a port to an alternate port - -EgressERSpanMirrorTest - Span outgoing packets to a port onto an ERSPAN port diff --git a/bm/sai_adapter/test/ptf_tests/tests/sai_base_test.py b/bm/sai_adapter/test/ptf_tests/tests/sai_base_test.py deleted file mode 100644 index ba250462c..000000000 --- a/bm/sai_adapter/test/ptf_tests/tests/sai_base_test.py +++ /dev/null @@ -1,111 +0,0 @@ -""" -Base classes for test cases - -Tests will usually inherit from one of these classes to have the controller -and/or dataplane automatically set up. -""" - -import os -import logging -import unittest - - -import ptf -from ptf.base_tests import BaseTest -from ptf import config -import ptf.dataplane as dataplane -import ptf.testutils as testutils - -################################################################ -# -# Thrift interface base tests -# -################################################################ -import sys -sys.path.append('../sai_thrift_src/gen-py') -import switch_sai.switch_sai_rpc as switch_sai_rpc -from thrift.transport import TSocket -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol - -sys.path.append('../sai_thrift_src/gen-py/') -from switch_sai.ttypes import * -sys.path.append('../') -from sai_types import * - -interface_to_front_mapping = {} -port_map_loaded=0 - -class ThriftInterface(BaseTest): - - def loadPortMap(self): - global port_map_loaded - if port_map_loaded: - print 'port_map already loaded' - return - - if self.test_params.has_key("port_map"): - user_input = self.test_params['port_map'] - splitted_map = user_input.split(",") - for item in splitted_map: - interface_front_pair = item.split("@") - interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1] - elif self.test_params.has_key("port_map_file"): - user_input = self.test_params['port_map_file'] - f = open(user_input, 'r') - for line in f: - if (len(line) > 0 and (line[0] == '#' or line[0] == ';' or line[0]=='/')): - continue; - interface_front_pair = line.split("@") - interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1].strip() - else: - exit("No ptf interface<-> switch front port mapping, please specify as parameter or in external file") - return - - def createRpcClient(self): - # Set up thrift client and contact server - - if self.test_params.has_key("server"): - server = self.test_params['server'] - else: - server = 'localhost' - - self.transport = TSocket.TSocket(server, 9092) - self.transport = TTransport.TBufferedTransport(self.transport) - self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport) - - self.client = switch_sai_rpc.Client(self.protocol) - self.transport.open() - return - - def setUp(self): - global interface_to_front_mapping - BaseTest.setUp(self) - self.test_params = testutils.test_params_get() - self.loadPortMap() - self.createRpcClient() - return - - def tearDown(self): - if config["log_dir"] != None: - self.dataplane.stop_pcap() - BaseTest.tearDown(self) - self.transport.close() - -class ThriftInterfaceDataPlane(ThriftInterface): - """ - Root class that sets up the thrift interface and dataplane - """ - def setUp(self): - ThriftInterface.setUp(self) - self.dataplane = ptf.dataplane_instance - if self.dataplane != None: - self.dataplane.flush() - if config["log_dir"] != None: - filename = os.path.join(config["log_dir"], str(self)) + ".pcap" - self.dataplane.start_pcap(filename) - - def tearDown(self): - if config["log_dir"] != None: - self.dataplane.stop_pcap() - ThriftInterface.tearDown(self) diff --git a/bm/sai_adapter/test/ptf_tests/tests/sail2_new.py b/bm/sai_adapter/test/ptf_tests/tests/sail2_new.py deleted file mode 100644 index 3a3672cb7..000000000 --- a/bm/sai_adapter/test/ptf_tests/tests/sail2_new.py +++ /dev/null @@ -1,702 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface L2 tests -""" -import sys -# sys.path.append('../') -# from sai_types import * -import socket -from switch import * -import sai_base_test -import random - -@group('l2') -class L2AcceptedFrameType(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - vlan_id = 1 - hw_port1 = 0 - hw_port2 = 1 - - switch_init2(self.client) - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - - # port2 drops tagged. port1 drops untagged - attr_value = sai_thrift_attribute_value_t(booldata=True) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_UNTAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_TAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port2, attr) - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - sai_thrift_create_fdb(self.client, mac1, default_bridge_type, vlan_id, None, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, default_bridge_type, vlan_id, None, bridge_port2, mac_action, fdb_entry_type) - - untagged_pkt1 = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - tagged_pkt1 = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64, - pktlen=104) - untagged_pkt2 = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - tagged_pkt2 = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64, - pktlen=104) - - try: - print "Sending tagged packet port 0 -> port 1" - send_packet(self, hw_port1, str(tagged_pkt1)) - verify_packets(self, tagged_pkt1, [hw_port2]) - print "Sending tagged packet port 1 -> port 0" - send_packet(self, hw_port2, str(tagged_pkt2)) - verify_no_packet_any(self, tagged_pkt2, port_list.keys()) - print "Sending untagged packet port 0 -> port 1" - send_packet(self, hw_port1, str(untagged_pkt1)) - verify_no_packet_any(self, untagged_pkt1, port_list.keys()) - print "Sending untagged packet port 1 -> port 0" - send_packet(self, hw_port2, str(untagged_pkt2)) - verify_packets(self, untagged_pkt2, [hw_port1]) - finally: - sai_thrift_delete_fdb(self.client, mac1, vlan_id, default_bridge_type, None) - sai_thrift_delete_fdb(self.client, mac2, vlan_id, default_bridge_type, None) - attr_value = sai_thrift_attribute_value_t(booldata=False) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_UNTAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_TAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port2, attr) - -@group('l2') -class L21DBridgeBasicTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending L2 packet port 0 -> port 1" - vlan_id = 10 - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - hw_port1 = 0 - hw_port2 = 1 - - switch_init2(self.client) - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - - bind_mode = SAI_PORT_BIND_MODE_SUB_PORT - attr_value = sai_thrift_attribute_value_t(s32=bind_mode) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_BIND_MODE, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - # Create 1D Bridge - bridge_type = SAI_BRIDGE_TYPE_1D - bridge_attr_value = sai_thrift_attribute_value_t(s32=bridge_type) - bridge_attr = sai_thrift_attribute_t(id=SAI_BRIDGE_ATTR_TYPE, value=bridge_attr_value) - bridge = self.client.sai_thrift_create_bridge([bridge_attr]) - - # Create Bridge ports - bridge_port_type = SAI_BRIDGE_PORT_TYPE_SUB_PORT - self.client.sai_thrift_remove_bridge_port(bridge_port1) - self.client.sai_thrift_remove_bridge_port(bridge_port2) - bridge_port1 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port1, vlan_id, bridge) - bridge_port2 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port2, vlan_id, bridge) - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - sai_thrift_create_fdb(self.client, mac1, bridge_type, None, bridge, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, bridge_type, None, bridge, bridge_port2, mac_action, fdb_entry_type) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - - try: - send_packet(self, hw_port1, str(pkt)) - verify_packets(self, pkt, [hw_port2]) - finally: - sai_thrift_delete_fdb(self.client, mac1, None, bridge_type, bridge) - sai_thrift_delete_fdb(self.client, mac2, None, bridge_type, bridge) - bind_mode = SAI_PORT_BIND_MODE_PORT - vlan_id = 1 - attr_value = sai_thrift_attribute_value_t(s32=bind_mode) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_BIND_MODE, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - bridge_port_type = SAI_BRIDGE_PORT_TYPE_PORT - self.client.sai_thrift_remove_bridge_port(bridge_port1) - self.client.sai_thrift_remove_bridge_port(bridge_port2) - bridge_port1 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port1, None, default_bridge) - bridge_port2 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port2, None, default_bridge) - self.client.sai_thrift_remove_bridge(bridge) - br_port_list[port1] = bridge_port1 - br_port_list[port2] = bridge_port2 - -@group('l2') -class L21QBridgeAccess2AccessTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending L2 packet port 0 -> port 1" - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - vlan_id = 10 - - # Set HW ports - hw_port1 = 0 - hw_port2 = 1 - - switch_init2(self.client) - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - # Create VLAN - vlan_attr_value = sai_thrift_attribute_value_t(u16= vlan_id) - vlan_attr = sai_thrift_attribute_t(id=SAI_VLAN_ATTR_VLAN_ID, value=vlan_attr_value) - vlan_oid = self.client.sai_thrift_create_vlan([vlan_attr]) - - # tagging_mode = SAI_VLAN_TAGGING_MODE_TAGGED - tagging_mode = SAI_VLAN_TAGGING_MODE_UNTAGGED - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port1, tagging_mode) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port2, tagging_mode) - # SAI_VLAN_ATTR_MEMBER_LIST - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - bridge_type = SAI_BRIDGE_TYPE_1Q - sai_thrift_create_fdb(self.client, mac1, bridge_type, vlan_id, None, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, bridge_type, vlan_id, None, bridge_port2, mac_action, fdb_entry_type) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - - try: - send_packet(self, hw_port1, str(pkt)) - verify_packets(self, pkt, [hw_port2]) - finally: - sai_thrift_delete_fdb(self.client, mac1, vlan_id, bridge_type, None) - sai_thrift_delete_fdb(self.client, mac2, vlan_id, bridge_type, None) - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_remove_vlan(vlan_oid) - vlan_id = 1 - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - -@group('l2') -class L21QBridgeAccess2TrunkTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - # switch_init(self.client) - vlan_id = 11 - trunk_pvid = 20 - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - - # Set HW ports - hw_port1 = 0 - hw_port2 = 1 - print "Sending L2 packet Access(%d) -> Trunk(%d) (trunk vlan=%d)" % (hw_port1, hw_port2, vlan_id) - - switch_init2(self.client) - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - # Create VLAN - vlan_attr_value = sai_thrift_attribute_value_t(u16= vlan_id) - vlan_attr = sai_thrift_attribute_t(id=SAI_VLAN_ATTR_VLAN_ID, value=vlan_attr_value) - vlan_oid = self.client.sai_thrift_create_vlan([vlan_attr]) - - # tagging_mode = SAI_VLAN_TAGGING_MODE_TAGGED - tagging_mode = SAI_VLAN_TAGGING_MODE_UNTAGGED - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port1, tagging_mode) - tagging_mode = SAI_VLAN_TAGGING_MODE_TAGGED - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port2, tagging_mode) - # SAI_VLAN_ATTR_MEMBER_LIST - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - bridge_type = SAI_BRIDGE_TYPE_1Q - sai_thrift_create_fdb(self.client, mac1, bridge_type, vlan_id, None, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, bridge_type, vlan_id, None, bridge_port2, mac_action, fdb_entry_type) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64, - pktlen=104) - try: - send_packet(self, hw_port1, str(pkt)) - verify_packets(self, exp_pkt, [hw_port2]) - finally: - sai_thrift_delete_fdb(self.client, mac1, vlan_id, bridge_type, None) - sai_thrift_delete_fdb(self.client, mac2, vlan_id, bridge_type, None) - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_remove_vlan(vlan_oid) - vlan_id = 1 - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - -@group('l2') -class L21QBridgeTrunk2TrunkTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - # switch_init(self.client) - vlan_id = 12 - trunk_pvid = 20 - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - - # Set HW ports - hw_port1 = 0 - hw_port2 = 1 - print "Sending L2 packet Trunk(%d) -> Trunk(%d) (trunk vlan=%d)" % (hw_port1, hw_port2, vlan_id) - - switch_init2(self.client) - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - # Create VLAN - vlan_attr_value = sai_thrift_attribute_value_t(u16= vlan_id) - vlan_attr = sai_thrift_attribute_t(id=SAI_VLAN_ATTR_VLAN_ID, value=vlan_attr_value) - vlan_oid = self.client.sai_thrift_create_vlan([vlan_attr]) - - tagging_mode = SAI_VLAN_TAGGING_MODE_TAGGED - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port1, tagging_mode) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port2, tagging_mode) - # SAI_VLAN_ATTR_MEMBER_LIST - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - bridge_type = SAI_BRIDGE_TYPE_1Q - sai_thrift_create_fdb(self.client, mac1, bridge_type, vlan_id, None, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, bridge_type, vlan_id, None, bridge_port2, mac_action, fdb_entry_type) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64) - try: - send_packet(self, hw_port1, str(pkt)) - verify_packets(self, exp_pkt, [hw_port2]) - finally: - sai_thrift_delete_fdb(self.client, mac1, vlan_id, bridge_type, None) - sai_thrift_delete_fdb(self.client, mac2, vlan_id, bridge_type, None) - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_remove_vlan(vlan_oid) - vlan_id = 1 - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - -@group('l2') -class L21QBridgeTrunk2AccessTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - # switch_init(self.client) - vlan_id = 13 - trunk_pvid = 20 - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - - - # Set HW ports - hw_port1 = 0 - hw_port2 = 1 - print "Sending L2 packet Trunk(%d) -> Access(%d) (trunk vlan=%d)" % (hw_port1, hw_port2, vlan_id) - - switch_init2(self.client) - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - # Create VLAN - vlan_attr_value = sai_thrift_attribute_value_t(u16= vlan_id) - vlan_attr = sai_thrift_attribute_t(id=SAI_VLAN_ATTR_VLAN_ID, value=vlan_attr_value) - vlan_oid = self.client.sai_thrift_create_vlan([vlan_attr]) - - tagging_mode = SAI_VLAN_TAGGING_MODE_TAGGED - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port1, tagging_mode) - tagging_mode = SAI_VLAN_TAGGING_MODE_UNTAGGED - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port2, tagging_mode) - # SAI_VLAN_ATTR_MEMBER_LIST - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - bridge_type = SAI_BRIDGE_TYPE_1Q - sai_thrift_create_fdb(self.client, mac1, bridge_type, vlan_id, None, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, bridge_type, vlan_id, None, bridge_port2, mac_action, fdb_entry_type) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64, - pktlen=96) - try: - send_packet(self, hw_port1, str(pkt)) - verify_packets(self, exp_pkt, [hw_port2]) - finally: - sai_thrift_delete_fdb(self.client, mac1, vlan_id, bridge_type, None) - sai_thrift_delete_fdb(self.client, mac2, vlan_id, bridge_type, None) - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_remove_vlan(vlan_oid) - vlan_id = 1 - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - -@group('l2') -class L21DLagTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending 3 L2 (1D) Lag packets port 0 -> port 1/2/3" - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - - - # Set HW ports - hw_port1 = 0 - hw_port2 = 1 - hw_port3 = 2 - hw_port4 = 3 - hw_port5 = 4 - - switch_init2(self.client) - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - port3 = port_list[hw_port3] - port4 = port_list[hw_port4] - port5 = port_list[hw_port5] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - bridge_port3 = br_port_list[port3] - bridge_port4 = br_port_list[port4] - bridge_port5 = br_port_list[port5] - - vlan_id = 15 - bind_mode = SAI_PORT_BIND_MODE_SUB_PORT - attr_value = sai_thrift_attribute_value_t(s32=bind_mode) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_BIND_MODE, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - self.client.sai_thrift_set_port_attribute(port4, attr) - self.client.sai_thrift_set_port_attribute(port5, attr) - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - self.client.sai_thrift_set_port_attribute(port4, attr) - self.client.sai_thrift_set_port_attribute(port5, attr) - - # Create LAG - lag = self.client.sai_thrift_create_lag([]) - lag_member1 = sai_thrift_create_lag_member(self.client, port2, lag) - # lag_member2 = sai_thrift_create_lag_member(self.client, port3, lag) - lag_member3 = sai_thrift_create_lag_member(self.client, port4, lag) - lag_member4 = sai_thrift_create_lag_member(self.client, port5, lag) - # self.client.sai_thrift_remove_lag_member(lag_member2) # Check remove_lag_member from middle of list. shouldn't mess with hash. - - # Set LAG Vlan attr - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(lag, attr) - - # Create 1D Bridge - bridge_type = SAI_BRIDGE_TYPE_1D - bridge_attr_value = sai_thrift_attribute_value_t(s32= bridge_type) - bridge_attr = sai_thrift_attribute_t(id=SAI_BRIDGE_ATTR_TYPE, value=bridge_attr_value) - bridge = self.client.sai_thrift_create_bridge([bridge_attr]) - - # Create Bridge ports - bridge_port_type = SAI_BRIDGE_PORT_TYPE_SUB_PORT - self.client.sai_thrift_remove_bridge_port(bridge_port1) - self.client.sai_thrift_remove_bridge_port(bridge_port2) - self.client.sai_thrift_remove_bridge_port(bridge_port4) - self.client.sai_thrift_remove_bridge_port(bridge_port5) - bridge_port1 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port1, vlan_id, bridge) - bridge_port2 = sai_thrift_create_bridge_port(self.client, bridge_port_type, lag, vlan_id, bridge) - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - fdb_bridge_type = SAI_FDB_ENTRY_BRIDGE_TYPE_1D - sai_thrift_create_fdb(self.client, mac1, fdb_bridge_type, None, bridge, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, fdb_bridge_type, None, bridge, bridge_port2, mac_action, fdb_entry_type) - - pkt = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - try: - send_packet(self, hw_port2, str(pkt)) - verify_packets(self, pkt, [hw_port1]) - for ip_id in [101,103,105,107]: - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=ip_id, - ip_ttl=64) - send_packet(self, hw_port1, str(pkt)) - verify_packets_any(self, pkt, [hw_port2, hw_port4, hw_port5]) - finally: - sai_thrift_delete_fdb(self.client, mac1, None, bridge_type, bridge) - sai_thrift_delete_fdb(self.client, mac2, None, bridge_type, bridge) - vlan_id = 1 - bind_mode = SAI_PORT_BIND_MODE_PORT - attr_value = sai_thrift_attribute_value_t(s32=bind_mode) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_BIND_MODE, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - self.client.sai_thrift_set_port_attribute(port4, attr) - self.client.sai_thrift_set_port_attribute(port5, attr) - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - self.client.sai_thrift_set_port_attribute(port4, attr) - self.client.sai_thrift_set_port_attribute(port5, attr) - self.client.sai_thrift_remove_lag_member(lag_member1) - self.client.sai_thrift_remove_lag_member(lag_member4) - self.client.sai_thrift_remove_lag_member(lag_member3) - self.client.sai_thrift_remove_lag(lag) - bridge_port_type = SAI_BRIDGE_PORT_TYPE_PORT - self.client.sai_thrift_remove_bridge_port(bridge_port1) - self.client.sai_thrift_remove_bridge_port(bridge_port2) - self.client.sai_thrift_remove_bridge(bridge) - bridge_port1 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port1, None, default_bridge) - bridge_port2 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port2, None, default_bridge) - bridge_port4 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port4, None, default_bridge) - bridge_port5 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port5, None, default_bridge) - br_port_list[port1] = bridge_port1 - br_port_list[port2] = bridge_port2 - br_port_list[port4] = bridge_port4 - br_port_list[port5] = bridge_port5 - -@group('l2') -class L21QLagTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - switch_init2(self.client) - - print "Sending 3 L2 (1Q Access2Access) Lag packets port 0 -> port 1/2/3" - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - - # Set HW ports - hw_port1 = 0 - hw_port2 = 1 - hw_port3 = 2 - hw_port4 = 3 - - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - port3 = port_list[hw_port3] - port4 = port_list[hw_port4] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - bridge_port3 = br_port_list[port3] - bridge_port4 = br_port_list[port4] - - vlan_id = 15 - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - self.client.sai_thrift_set_port_attribute(port4, attr) - - # Create LAG - lag = self.client.sai_thrift_create_lag([]) - lag_member1 = sai_thrift_create_lag_member(self.client, port4, lag) - lag_member2 = sai_thrift_create_lag_member(self.client, port2, lag) - lag_member3 = sai_thrift_create_lag_member(self.client, port3, lag) - - # Set LAG Vlan attr - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(lag, attr) - - # Create Lag Bridge port - bridge_port_type = SAI_BRIDGE_PORT_TYPE_PORT - self.client.sai_thrift_remove_bridge_port(bridge_port2) - self.client.sai_thrift_remove_bridge_port(bridge_port3) - self.client.sai_thrift_remove_bridge_port(bridge_port4) - bridge_port2 = sai_thrift_create_bridge_port(self.client, bridge_port_type, lag, None, default_bridge) - - # Create VLAN - vlan_attr_value = sai_thrift_attribute_value_t(u16= vlan_id) - vlan_attr = sai_thrift_attribute_t(id=SAI_VLAN_ATTR_VLAN_ID, value=vlan_attr_value) - vlan_oid = self.client.sai_thrift_create_vlan([vlan_attr]) - - # tagging_mode = SAI_VLAN_TAGGING_MODE_TAGGED - tagging_mode = SAI_VLAN_TAGGING_MODE_UNTAGGED - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port1, tagging_mode) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_oid, bridge_port2, tagging_mode) - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - bridge_type = SAI_BRIDGE_TYPE_1Q - sai_thrift_create_fdb(self.client, mac1, bridge_type, vlan_id, None, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, bridge_type, vlan_id, None, bridge_port2, mac_action, fdb_entry_type) - - pkt = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - try: - send_packet(self, hw_port3, str(pkt)) - verify_packets(self, pkt, [hw_port1]) - for ip_id in [101,103,105]: - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=ip_id, - ip_ttl=64) - send_packet(self, hw_port1, str(pkt)) - verify_packets_any(self, pkt, [hw_port2, hw_port3, hw_port4]) - finally: - sai_thrift_delete_fdb(self.client, mac1, vlan_id, bridge_type, None) - sai_thrift_delete_fdb(self.client, mac2, vlan_id, bridge_type, None) - vlan_id = 1 - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_remove_vlan(vlan_oid) - self.client.sai_thrift_remove_bridge_port(bridge_port2) - bridge_port2 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port2, None, default_bridge) - bridge_port3 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port3, None, default_bridge) - bridge_port4 = sai_thrift_create_bridge_port(self.client, bridge_port_type, port4, None, default_bridge) - br_port_list[port2] = bridge_port2 - br_port_list[port3] = bridge_port3 - br_port_list[port4] = bridge_port4 - self.client.sai_thrift_remove_lag_member(lag_member1) - self.client.sai_thrift_remove_lag_member(lag_member2) - self.client.sai_thrift_remove_lag_member(lag_member3) - self.client.sai_thrift_remove_lag(lag) - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - self.client.sai_thrift_set_port_attribute(port4, attr) - diff --git a/bm/sai_adapter/test/ptf_tests/tests/switch.py b/bm/sai_adapter/test/ptf_tests/tests/switch.py deleted file mode 100644 index 860c75622..000000000 --- a/bm/sai_adapter/test/ptf_tests/tests/switch.py +++ /dev/null @@ -1,868 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface basic tests -""" - -#import switch_sai_thrift -from sai_base_test import * -import time -import sys -sys.path.append('../sai_thrift_src/gen-py') -from switch_sai.ttypes import * -import logging - -import unittest -import random - -import sai_base_test - -from ptf import config -from ptf.testutils import * -from ptf.thriftutils import * -# sys.path.append('../../') -# from sai_types import * -import os - -#from switch_sai_thrift.ttypes import * - -# from switch_sai_thrift.sai_headers import * - - -this_dir = os.path.dirname(os.path.abspath(__file__)) - -switch_inited=0 -port_list = {} -br_port_list = {} -sai_port_list = [] -front_port_list = [] -table_attr_list = [] -router_mac='00:77:66:55:44:00' -rewrite_mac1='00:77:66:55:44:01' -rewrite_mac2='00:77:66:55:44:02' -default_bridge = 0 -default_bridge_type = None - - -is_bmv2 = ('BMV2_TEST' in os.environ) and (int(os.environ['BMV2_TEST']) == 1) - -def switch_init(client): - global switch_inited - if switch_inited: - return - - switch_attr_list = client.sai_thrift_get_switch_attribute() - attr_list = switch_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_SWITCH_ATTR_PORT_NUMBER: - print "max ports: " + attribute.value.u32 - elif attribute.id == SAI_SWITCH_ATTR_PORT_LIST: - for port_id in attribute.value.objlist.object_id_list: - attr_value = sai_thrift_attribute_value_t(booldata=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_ADMIN_STATE, value=attr_value) - client.sai_thrift_set_port_attribute(port_id, attr) - sai_port_list.append(port_id) - else: - print "unknown switch attribute" - attr_value = sai_thrift_attribute_value_t(mac=router_mac) - attr = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_SRC_MAC_ADDRESS, value=attr_value) - client.sai_thrift_set_switch_attribute(attr) - all_ports_are_up = True - for num_of_tries in range(200): - time.sleep(1) - # wait till the port are up - for port in sai_port_list: - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_OPER_STATUS: - if attribute.value.s32 != SAI_PORT_OPER_STATUS_UP: - all_ports_are_up = False - print "port 0x%x is down" % port - if all_ports_are_up: - break - else: - all_ports_are_up = True - if not all_ports_are_up: - raise RuntimeError('Not all of the ports are up') - - thrift_attr = client.sai_thrift_get_port_list_by_front_port() - if thrift_attr.id == SAI_SWITCH_ATTR_PORT_LIST: - for port_id in thrift_attr.value.objlist.object_id_list: - front_port_list.append(port_id) - for interface,front in interface_to_front_mapping.iteritems(): - sai_port_id = client.sai_thrift_get_port_id_by_front_port(front); - port_list[int(interface)]=sai_port_id - switch_inited = 1 - -def switch_init2(client): - global switch_inited - if switch_inited: - return - # client.sai_thrift_create_switch([]) - attr_value = sai_thrift_attribute_value_t(oid=0) - attr = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID, value=attr_value) - # attr_value2 = sai_thrift_attribute_value_t(objlist=0) - # attr2 = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_PORT_LIST, value=attr_value) - # attr_list = client.sai_thrift_get_switch_attribute(thrift_attr_list=[attr, attr2]) - attr_list = client.sai_thrift_get_switch_attribute(thrift_attr_list=[attr]) - default_bridge = attr_list.attr_list[0].value.oid - for interface,front in interface_to_front_mapping.iteritems(): - sai_port_id = client.sai_thrift_get_port_id_by_front_port(front) - port_list[int(interface)]=sai_port_id - - - attr_list = [] - attr_value = sai_thrift_attribute_value_t(objlist=None) - attr_list.append(sai_thrift_attribute_t(id= SAI_BRIDGE_ATTR_PORT_LIST, value=attr_value)) - attr_value = sai_thrift_attribute_value_t(s32=None) - attr_list.append(sai_thrift_attribute_t(id= SAI_BRIDGE_ATTR_TYPE, value=attr_value)) - attr_list = client.sai_thirft_get_bridge_attribute(default_bridge, attr_list) - default_bridge_type = attr_list.attr_list[1].value.s32 - for br_port in attr_list.attr_list[0].value.objlist.object_id_list: - attr_value = sai_thrift_attribute_value_t(oid=None) - attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_PORT_ID, value=attr_value) - port_id = client.sai_thirft_get_bridge_port_attribute(br_port,[attr]).attr_list[0].value.oid - br_port_list[port_id] = br_port - - switch_inited = 1 - # attr_list = [] - # attr_value = sai_thrift_attribute_value_t(u32list=None) - # attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_HW_LANE_LIST, value=attr_value) - # attr_list.append(attr) - # attr_list = client.sai_thrift_get_port_attribute(port1, attr_list) - # hw_port1 = attr_list.attr_list[0].value.u32list.u32list[0] - # attr_list = [] - # attr_value = sai_thrift_attribute_value_t(u32list=None) - # attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_HW_LANE_LIST, value=attr_value) - # attr_list.append(attr) - # attr_list = client.sai_thrift_get_port_attribute(port2, attr_list) - # hw_port2 = attr_list.attr_list[0].value.u32list.u32list[0] - -def sai_thrift_get_cpu_port_id(client): - cpu_port = client.sai_thrift_get_cpu_port_id() - return cpu_port - -def sai_thrift_get_default_router_id(client): - default_router_id = client.sai_thrift_get_default_router_id() - return default_router_id - -def sai_thrift_create_bridge_port(client, bridge_port_type, port_id, vlan_id, bridge_id): - vport_attr_list = [] - - vport_attr_value = sai_thrift_attribute_value_t(s32=bridge_port_type) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_TYPE, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - vport_attr_value = sai_thrift_attribute_value_t(oid=port_id) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_PORT_ID, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - if (bridge_port_type == SAI_BRIDGE_PORT_TYPE_SUB_PORT): - vport_attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_VLAN_ID, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - vport_attr_value = sai_thrift_attribute_value_t(oid=bridge_id) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_BRIDGE_ID, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - return client.sai_thrift_create_bridge_port(vport_attr_list) - -def sai_thrift_create_fdb(client, mac, bridge_type, vlan_id, bridge_id, bridge_port, mac_action, fdb_entry_type): - if bridge_type == SAI_BRIDGE_TYPE_1Q: - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, bridge_type=SAI_FDB_ENTRY_BRIDGE_TYPE_1Q, vlan_id=vlan_id) - else: - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, bridge_type=SAI_FDB_ENTRY_BRIDGE_TYPE_1D, bridge_id=bridge_id) - - #value 0 represents static entry, id=0, represents entry type - fdb_attribute1_value = sai_thrift_attribute_value_t(s32=fdb_entry_type) - fdb_attribute1 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_TYPE, - value=fdb_attribute1_value) - #value oid represents object id, id=1 represents port id - fdb_attribute2_value = sai_thrift_attribute_value_t(oid=bridge_port) - fdb_attribute2 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID, - value=fdb_attribute2_value) - #value oid represents object id, id=1 represents port id - fdb_attribute3_value = sai_thrift_attribute_value_t(s32=mac_action) - fdb_attribute3 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_PACKET_ACTION, - value=fdb_attribute3_value) - fdb_attr_list = [fdb_attribute1, fdb_attribute2, fdb_attribute3] - client.sai_thrift_create_fdb_entry(thrift_fdb_entry=fdb_entry, thrift_attr_list=fdb_attr_list) - -def sai_thrift_delete_fdb(client, mac, vlan_id, bridge_type, bridge_id): - if bridge_type == SAI_BRIDGE_TYPE_1Q: - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, bridge_type=SAI_FDB_ENTRY_BRIDGE_TYPE_1Q, vlan_id=vlan_id) - else: - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, bridge_type=SAI_FDB_ENTRY_BRIDGE_TYPE_1D, bridge_id=bridge_id) - client.sai_thrift_delete_fdb_entry(thrift_fdb_entry=fdb_entry) - -def sai_thrift_flush_fdb_by_vlan(client, vlan_id): - fdb_attribute1_value = sai_thrift_attribute_value_t(u16=vlan_id) - fdb_attribute1 = sai_thrift_attribute_t(id=SAI_FDB_FLUSH_ATTR_VLAN_ID, - value=fdb_attribute1_value) - fdb_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_FDB_FLUSH_ENTRY_DYNAMIC) - fdb_attribute2 = sai_thrift_attribute_t(id=SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, - value=fdb_attribute2_value) - fdb_attr_list = [fdb_attribute1, fdb_attribute2] - client.sai_thrift_flush_fdb_entries(thrift_attr_list=fdb_attr_list) - -def sai_thrift_create_virtual_router(client, v4_enabled, v6_enabled): - #v4 enabled - vr_attribute1_value = sai_thrift_attribute_value_t(booldata=v4_enabled) - vr_attribute1 = sai_thrift_attribute_t(id=SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE, - value=vr_attribute1_value) - #v6 enabled - vr_attribute2_value = sai_thrift_attribute_value_t(booldata=v6_enabled) - vr_attribute2 = sai_thrift_attribute_t(id=SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE, - value=vr_attribute2_value) - vr_attr_list = [vr_attribute1, vr_attribute2] - vr_id = client.sai_thrift_create_virtual_router(thrift_attr_list=vr_attr_list) - return vr_id - -def sai_thrift_create_router_interface(client, vr_id, is_port, port_id, vlan_id, v4_enabled, v6_enabled, mac): - #vrf attribute - rif_attr_list = [] - rif_attribute1_value = sai_thrift_attribute_value_t(oid=vr_id) - rif_attribute1 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID, - value=rif_attribute1_value) - rif_attr_list.append(rif_attribute1) - if is_port: - #port type and port id - rif_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_ROUTER_INTERFACE_TYPE_PORT) - rif_attribute2 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_TYPE, - value=rif_attribute2_value) - rif_attr_list.append(rif_attribute2) - rif_attribute3_value = sai_thrift_attribute_value_t(oid=port_id) - rif_attribute3 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_PORT_ID, - value=rif_attribute3_value) - rif_attr_list.append(rif_attribute3) - else: - #vlan type and vlan id - rif_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_ROUTER_INTERFACE_TYPE_VLAN) - rif_attribute2 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_TYPE, - value=rif_attribute2_value) - rif_attr_list.append(rif_attribute2) - rif_attribute3_value = sai_thrift_attribute_value_t(u16=vlan_id) - rif_attribute3 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_VLAN_ID, - value=rif_attribute3_value) - rif_attr_list.append(rif_attribute3) - - #v4_enabled - rif_attribute4_value = sai_thrift_attribute_value_t(booldata=v4_enabled) - rif_attribute4 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE, - value=rif_attribute4_value) - rif_attr_list.append(rif_attribute4) - #v6_enabled - rif_attribute5_value = sai_thrift_attribute_value_t(booldata=v6_enabled) - rif_attribute5 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE, - value=rif_attribute5_value) - rif_attr_list.append(rif_attribute5) - - if mac: - rif_attribute6_value = sai_thrift_attribute_value_t(mac=mac) - rif_attribute6 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS, - value=rif_attribute6_value) - rif_attr_list.append(rif_attribute6) - - rif_id = client.sai_thrift_create_router_interface(rif_attr_list) - return rif_id - -def sai_thrift_create_route(client, vr_id, addr_family, ip_addr, ip_mask, nhop, packet_action=None): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - mask = sai_thrift_ip_t(ip4=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr, mask=mask) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - mask = sai_thrift_ip_t(ip6=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr, mask=mask) - route_attribute1_value = sai_thrift_attribute_value_t(oid=nhop) - route_attribute1 = sai_thrift_attribute_t(id=SAI_ROUTE_ATTR_NEXT_HOP_ID, - value=route_attribute1_value) - - route = sai_thrift_unicast_route_entry_t(vr_id, ip_prefix) - route_attr_list = [route_attribute1] - - if packet_action != None: - route_packet_action_value = sai_thrift_attribute_value_t(s32=packet_action) - route_packet_action_attr = sai_thrift_attribute_t(id=SAI_ROUTE_ATTR_PACKET_ACTION, value=route_packet_action_value) - route_attr_list.append(route_packet_action_attr) - - client.sai_thrift_create_route(thrift_unicast_route_entry=route, thrift_attr_list=route_attr_list) - return - -def sai_thrift_remove_route(client, vr_id, addr_family, ip_addr, ip_mask, nhop): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - mask = sai_thrift_ip_t(ip4=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr, mask=mask) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - mask = sai_thrift_ip_t(ip6=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr, mask=mask) - route = sai_thrift_unicast_route_entry_t(vr_id, ip_prefix) - client.sai_thrift_remove_route(thrift_unicast_route_entry=route) - -def sai_thrift_create_nhop(client, addr_family, ip_addr, rif_id): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - nhop_attribute1_value = sai_thrift_attribute_value_t(ipaddr=ipaddr) - nhop_attribute1 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_IP, - value=nhop_attribute1_value) - nhop_attribute2_value = sai_thrift_attribute_value_t(oid=rif_id) - nhop_attribute2 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID, - value=nhop_attribute2_value) - nhop_attribute3_value = sai_thrift_attribute_value_t(s32=SAI_NEXT_HOP_IP) - nhop_attribute3 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_TYPE, - value=nhop_attribute3_value) - nhop_attr_list = [nhop_attribute1, nhop_attribute2, nhop_attribute3] - nhop = client.sai_thrift_create_next_hop(thrift_attr_list=nhop_attr_list) - return nhop - -def sai_thrift_create_neighbor(client, addr_family, rif_id, ip_addr, dmac): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - neighbor_attribute1_value = sai_thrift_attribute_value_t(mac=dmac) - neighbor_attribute1 = sai_thrift_attribute_t(id=SAI_NEIGHBOR_ATTR_DST_MAC_ADDRESS, - value=neighbor_attribute1_value) - neighbor_attr_list = [neighbor_attribute1] - neighbor_entry = sai_thrift_neighbor_entry_t(rif_id=rif_id, ip_address=ipaddr) - client.sai_thrift_create_neighbor_entry(neighbor_entry, neighbor_attr_list) - -def sai_thrift_remove_neighbor(client, addr_family, rif_id, ip_addr, dmac): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - neighbor_entry = sai_thrift_neighbor_entry_t(rif_id=rif_id, ip_address=ipaddr) - client.sai_thrift_remove_neighbor_entry(neighbor_entry) - -def sai_thrift_create_next_hop_group(client, nhop_list): - nhop_group_attribute1_value = sai_thrift_attribute_value_t(s32=SAI_NEXT_HOP_GROUP_ECMP) - nhop_group_attribute1 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_GROUP_ATTR_TYPE, - value=nhop_group_attribute1_value) - nhop_objlist = sai_thrift_object_list_t(count=len(nhop_list), object_id_list=nhop_list) - nhop_group_attribute2_value = sai_thrift_attribute_value_t(objlist=nhop_objlist) - nhop_group_attribute2 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_LIST, - value=nhop_group_attribute2_value) - nhop_group_attr_list = [nhop_group_attribute1, nhop_group_attribute2] - nhop_group = client.sai_thrift_create_next_hop_group(thrift_attr_list=nhop_group_attr_list) - return nhop_group - -def sai_thrift_create_lag(client, port_list): - lag_port_list = sai_thrift_object_list_t(count=len(port_list), object_id_list=port_list) - lag1_attr_value = sai_thrift_attribute_value_t(objlist=lag_port_list) - lag1_attr = sai_thrift_attribute_t(id=SAI_LAG_ATTR_PORT_LIST, - value=lag1_attr_value) - lag_attr_list = [lag1_attr] - lag = client.sai_thrift_create_lag(lag_attr_list) - return lag - -def sai_thrift_create_lag_member(client, lag_id, port_id): - lag_member_attr1_value = sai_thrift_attribute_value_t(oid=lag_id) - lag_member_attr1 = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_LAG_ID, - value=lag_member_attr1_value) - lag_member_attr2_value = sai_thrift_attribute_value_t(oid=port_id) - lag_member_attr2 = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_PORT_ID, - value=lag_member_attr2_value) - lag_member_attr_list = [lag_member_attr1, lag_member_attr2] - lag_member_id = client.sai_thrift_create_lag_member(lag_member_attr_list) - return lag_member_id - -def sai_thrift_create_stp_entry(client, vlan_list): - vlanlist=sai_thrift_vlan_list_t(vlan_count=len(vlan_list), vlan_list=vlan_list) - stp_attribute1_value = sai_thrift_attribute_value_t(vlanlist=vlanlist) - stp_attribute1 = sai_thrift_attribute_t(id=SAI_STP_ATTR_VLAN_LIST, - value=stp_attribute1_value) - stp_attr_list = [stp_attribute1] - stp_id = client.sai_thrift_create_stp_entry(stp_attr_list) - return stp_id - - -def sai_thrift_set_hostif_trap_group(client, trap_group_id, policer_id): - policer_attr_value = sai_thrift_attribute_value_t(oid=policer_id) - policer_attr = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER, value=policer_attr_value) - status = client.sai_thrift_set_hostif_trap_group(trap_group_id, thrift_attr=policer_attr) - return status - -def sai_thrift_create_hostif_trap_group(client, queue_id, policer_id=None): - attr_list = [] - attribute_value = sai_thrift_attribute_value_t(u32=queue_id) - attribute = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE, value=attribute_value) - attr_list.append(attribute) - - if policer_id != None: - policer_attr_value = sai_thrift_attribute_value_t(oid=policer_id) - policer_attr = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER, value=policer_attr_value) - attr_list.append(policer_attr) - - trap_group_id = client.sai_thrift_create_hostif_trap_group(thrift_attr_list=attr_list) - return trap_group_id - -def sai_thrift_create_port(client, bind_mode, hw_port, vlan_id=None): - attr_list = [] - bind_attr_value = sai_thrift_attribute_value_t(s32=bind_mode) - bind_attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_BIND_MODE, value=bind_attr_value) - attr_list.append(bind_attr) - hw_port_list = sai_thrift_u32_list_t(u32list=[hw_port], count=1) - hw_lane_attr_value = sai_thrift_attribute_value_t(u32list=hw_port_list) - hw_lane_attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_HW_LANE_LIST, value=hw_lane_attr_value) - attr_list.append(hw_lane_attr) - if vlan_id: - vlan_attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - vlan_attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=vlan_attr_value) - attr_list.append(vlan_attr) - return client.sai_thrift_create_port(thrift_attr_list=attr_list) - -def sai_thrift_create_lag_member(client, port_id, lag_id): - attr_list = [] - port_attr_value = sai_thrift_attribute_value_t(oid=port_id) - port_attr = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_PORT_ID, value=port_attr_value) - attr_list.append(port_attr) - lag_attr_value = sai_thrift_attribute_value_t(oid=lag_id) - lag_attr = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_LAG_ID, value=lag_attr_value) - attr_list.append(lag_attr) - return client.sai_thrift_create_lag_member(thrift_attr_list=attr_list) - -def sai_thrift_create_policer(client, meter_type, mode, cir, red_action): - attr_list = [] - - meter_attr_value = sai_thrift_attribute_value_t(s32=meter_type) - meter_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_METER_TYPE, value=meter_attr_value) - - mode_attr_value = sai_thrift_attribute_value_t(s32=mode) - mode_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_MODE, value=mode_attr_value) - - cir_attr_value = sai_thrift_attribute_value_t(u64=cir) - cir_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_CIR, value=cir_attr_value) - - red_action_attr_val = sai_thrift_attribute_value_t(s32=red_action) - red_action_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_RED_PACKET_ACTION, value=red_action_attr_val) - - attr_list.append(meter_attr) - attr_list.append(mode_attr) - attr_list.append(cir_attr) - attr_list.append(red_action_attr) - policer_id = client.sai_thrift_create_policer(attr_list) - - return policer_id - -def sai_thrift_set_hostif_trap(client, trap_id, action, priority=None, channel=None, trap_group_id=None): - - if channel != None: - attribute3_value = sai_thrift_attribute_value_t(s32=channel) - attribute3 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_CHANNEL, value=attribute3_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute3) - - if trap_group_id != None: - attribute4_value = sai_thrift_attribute_value_t(oid=trap_group_id) - attribute4 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP, value=attribute4_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute4) - - attribute1_value = sai_thrift_attribute_value_t(s32=action) - attribute1 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION, value=attribute1_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute1) - - if priority != None: - attribute2_value = sai_thrift_attribute_value_t(u32=priority) - attribute2 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY, value=attribute2_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute2) - -def sai_thrift_create_hostif(client, rif_or_port_id, intf_name): - attribute1_value = sai_thrift_attribute_value_t(s32=SAI_HOSTIF_TYPE_NETDEV) - attribute1 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_TYPE, - value=attribute1_value) - attribute2_value = sai_thrift_attribute_value_t(oid=rif_or_port_id) - attribute2 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_RIF_OR_PORT_ID, - value=attribute2_value) - attribute3_value = sai_thrift_attribute_value_t(chardata=intf_name) - attribute3 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_NAME, - value=attribute3_value) - attr_list = [attribute1, attribute2, attribute3] - hif_id = client.sai_thrift_create_hostif(attr_list) - return hif_id - -def sai_thrift_create_acl_table(client, addr_family, - ip_src, ip_dst, - ip_proto, - in_ports, out_ports, - in_port, out_port): - #print "aaa" - acl_attr_list = [] - if ip_src != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_SRC_IP, - value=attribute_value) - acl_attr_list.append(attribute) - if ip_dst != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_DST_IP, - value=attribute_value) - acl_attr_list.append(attribute) - if ip_proto != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL, - value=attribute_value) - acl_attr_list.append(attribute) - if in_ports: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - if out_ports: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - if in_port != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IN_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - if out_port != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=0) #TODO: Expose stage as function parameter - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_STAGE, value=attribute_value) - acl_attr_list.append(attribute) - - #print "bbb" - acl_table_id = client.sai_thrift_create_acl_table(acl_attr_list) - #print acl_table_id - return acl_table_id - -def sai_thrift_create_acl_entry(client, acl_table_id, - action, addr_family, - ip_src, ip_src_mask, - ip_dst, ip_dst_mask, - ip_proto, - in_port_list, out_port_list, - in_port, out_port, - ingress_mirror, egress_mirror): - acl_attr_list = [] - - #OID - attribute_value = sai_thrift_attribute_value_t(oid=acl_table_id) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_TABLE_ID, - value=attribute_value) - acl_attr_list.append(attribute) - - #Priority - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(u32=10))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_PRIORITY, - value=attribute_value) - acl_attr_list.append(attribute) - - #Ip source - if ip_src != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(ip4=ip_src), mask =sai_thrift_acl_mask_t(ip4=ip_src_mask))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP, - value=attribute_value) - acl_attr_list.append(attribute) - - #Input ports - if in_port_list: - acl_port_list = sai_thrift_object_list_t(count=len(in_port_list), object_id_list=in_port_list) - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(objlist=acl_port_list))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - - #Output ports - if out_port_list: - acl_port_list = sai_thrift_object_list_t(count=len(out_port_list), object_id_list=out_port_list) - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(objlist=acl_port_list))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - - if in_port != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(oid=in_port))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - if out_port != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(oid=out_port))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - #Packet action - if action == 1: - #Drop - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(u32=0))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_PACKET_ACTION, - value=attribute_value) - acl_attr_list.append(attribute) - elif action == 2: - #Ingress mirroring - if ingress_mirror != None: - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(oid=ingress_mirror))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS, value=attribute_value) - acl_attr_list.append(attribute) - elif egress_mirror != None: - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(oid=egress_mirror))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS, value=attribute_value) - acl_attr_list.append(attribute) - - acl_entry_id = client.sai_thrift_create_acl_entry(acl_attr_list) - return acl_entry_id - -def sai_thrift_create_mirror_session(client, mirror_type, port, - vlan, vlan_priority, vlan_tpid, - src_mac, dst_mac, - addr_family, src_ip, dst_ip, - encap_type, protocol, ttl, tos): - mirror_attr_list = [] - - #Mirror type - attribute1_value = sai_thrift_attribute_value_t(u8=mirror_type) - attribute1 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_TYPE, - value=attribute1_value) - mirror_attr_list.append(attribute1) - - #Monitor port - attribute2_value = sai_thrift_attribute_value_t(oid=port) - attribute2 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_MONITOR_PORT, - value=attribute2_value) - mirror_attr_list.append(attribute2) - - if mirror_type == SAI_MIRROR_TYPE_LOCAL: - attribute4_value = sai_thrift_attribute_value_t(u16=vlan) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_ID, - value=attribute4_value) - mirror_attr_list.append(attribute4) - elif mirror_type == SAI_MIRROR_TYPE_REMOTE: - #vlan tpid - attribute3_value = sai_thrift_attribute_value_t(u16=vlan_tpid) - attribute3 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_TPID, - value=attribute3_value) - mirror_attr_list.append(attribute3) - - #vlan - attribute4_value = sai_thrift_attribute_value_t(u16=vlan) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_ID, - value=attribute4_value) - mirror_attr_list.append(attribute4) - - #vlan priority - attribute5_value = sai_thrift_attribute_value_t(u16=vlan_priority) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_PRI, - value=attribute5_value) - mirror_attr_list.append(attribute5) - elif mirror_type == SAI_MIRROR_TYPE_ENHANCED_REMOTE: - #encap type - attribute3_value = sai_thrift_attribute_value_t(u8=encap_type) - attribute3 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_ENCAP_TYPE, - value=attribute3_value) - mirror_attr_list.append(attribute3) - - #source ip - addr = sai_thrift_ip_t(ip4=src_ip) - src_ip_addr = sai_thrift_ip_address_t(addr_family=addr_family, addr=addr) - attribute4_value = sai_thrift_attribute_value_t(ipaddr=src_ip_addr) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS, - value=attribute4_value) - mirror_attr_list.append(attribute4) - - #dst ip - addr = sai_thrift_ip_t(ip4=dst_ip) - dst_ip_addr = sai_thrift_ip_address_t(addr_family=addr_family, addr=addr) - attribute5_value = sai_thrift_attribute_value_t(ipaddr=dst_ip_addr) - attribute5 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS, - value=attribute5_value) - mirror_attr_list.append(attribute5) - - #source mac - attribute6_value = sai_thrift_attribute_value_t(mac=src_mac) - attribute6 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS, - value=attribute6_value) - mirror_attr_list.append(attribute6) - - #dst mac - attribute7_value = sai_thrift_attribute_value_t(mac=dst_mac) - attribute7 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS, - value=attribute7_value) - mirror_attr_list.append(attribute7) - - mirror_id = client.sai_thrift_create_mirror_session(mirror_attr_list) - return mirror_id - -def sai_thrift_create_scheduler_profile(client, max_rate, algorithm=0): - scheduler_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(u64=max_rate) - attribute = sai_thrift_attribute_t(id=SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE , - value=attribute_value) - scheduler_attr_list.append(attribute) - attribute_value = sai_thrift_attribute_value_t(s32=algorithm) - attribute = sai_thrift_attribute_t(id=SAI_SCHEDULER_ATTR_SCHEDULING_ALGORITHM , - value=attribute_value) - scheduler_attr_list.append(attribute) - scheduler_profile_id = client.sai_thrift_create_scheduler_profile(scheduler_attr_list) - return scheduler_profile_id - -def sai_thrift_create_buffer_profile(client, pool_id, size, threshold, xoff_th, xon_th): - buffer_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(oid=pool_id) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_POOL_ID , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=size) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u8=threshold) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=xoff_th) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_XOFF_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=xon_th) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_XON_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - buffer_profile_id = client.sai_thrift_create_buffer_profile(buffer_attr_list) - return buffer_profile_id - -def sai_thrift_create_pool_profile(client, pool_type, size, threshold_mode): - pool_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(s32=pool_type) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_TYPE , - value=attribute_value) - pool_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=size) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_SIZE , - value=attribute_value) - pool_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(s32=threshold_mode) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_TH_MODE , - value=attribute_value) - pool_attr_list.append(attribute) - pool_id = client.sai_thrift_create_pool_profile(pool_attr_list) - return pool_id - -def sai_thrift_clear_all_counters(client): - for port in sai_port_list: - queue_list=[] - client.sai_thrift_clear_port_all_stats(port) - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_QOS_QUEUE_LIST: - for queue_id in attribute.value.objlist.object_id_list: - queue_list.append(queue_id) - - cnt_ids=[] - cnt_ids.append(SAI_QUEUE_STAT_PACKETS) - for queue in queue_list: - client.sai_thrift_clear_queue_stats(queue,cnt_ids,len(cnt_ids)) - -def sai_thrift_read_port_counters(client,port): - port_cnt_ids=[] - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_DISCARDS) - port_cnt_ids.append(SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_0_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_1_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_2_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_3_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_4_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_5_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_6_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_7_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_OCTETS) - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_UCAST_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_IF_IN_UCAST_PKTS) - counters_results=[] - counters_results = client.sai_thrift_get_port_stats(port,port_cnt_ids,len(port_cnt_ids)) - queue_list=[] - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_QOS_QUEUE_LIST: - for queue_id in attribute.value.objlist.object_id_list: - queue_list.append(queue_id) - cnt_ids=[] - thrift_results=[] - queue_counters_results=[] - cnt_ids.append(SAI_QUEUE_STAT_PACKETS) - queue1=0 - for queue in queue_list: - if queue1 <= 7: - thrift_results=client.sai_thrift_get_queue_stats(queue,cnt_ids,len(cnt_ids)) - queue_counters_results.append(thrift_results[0]) - queue1+=1 - return (counters_results, queue_counters_results) - -def sai_thrift_create_vlan_member(client, vlan_oid, bridge_port, tagging_mode): - vlan_member_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(oid=vlan_oid) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_VLAN_ID, - value=attribute_value) - vlan_member_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(oid=bridge_port) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID, - value=attribute_value) - vlan_member_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(s32=tagging_mode) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE, - value=attribute_value) - vlan_member_attr_list.append(attribute) - vlan_member_id = client.sai_thrift_create_vlan_member(vlan_member_attr_list) - return vlan_member_id - -def sai_thrift_vlan_remove_all_ports(client, vid): - vlan_members_list = [] - - vlan_attr_list = client.sai_thrift_get_vlan_attribute(vid) - attr_list = vlan_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_VLAN_ATTR_MEMBER_LIST: - for vlan_member in attribute.value.objlist.object_id_list: - vlan_members_list.append(vlan_member) - - for vlan_member in vlan_members_list: - client.sai_thrift_remove_vlan_member(vlan_member) - -def sai_thrift_set_port_shaper(client, port_id, max_rate): - sched_prof_id=sai_thrift_create_scheduler_profile(client, max_rate) - attr_value = sai_thrift_attribute_value_t(oid=sched_prof_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID, value=attr_value) - client.sai_thrift_set_port_attribute(port_id,attr) diff --git a/bm/sai_adapter/test/ptf_tests/unopened_tests/sai_base_test.py b/bm/sai_adapter/test/ptf_tests/unopened_tests/sai_base_test.py deleted file mode 100644 index 29cfe6ea0..000000000 --- a/bm/sai_adapter/test/ptf_tests/unopened_tests/sai_base_test.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -Base classes for test cases - -Tests will usually inherit from one of these classes to have the controller -and/or dataplane automatically set up. -""" - -import os -import logging -import unittest - - -import ptf -from ptf.base_tests import BaseTest -from ptf import config -import ptf.dataplane as dataplane -import ptf.testutils as testutils - -################################################################ -# -# Thrift interface base tests -# -################################################################ -sys.path.append('../src/gen-py') -import switch_sai.switch_sai_rpc as switch_sai_rpc -from thrift.transport import TSocket -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol - -interface_to_front_mapping = {} -port_map_loaded=0 - -class ThriftInterface(BaseTest): - - def loadPortMap(self): - global port_map_loaded - if port_map_loaded: - print 'port_map already loaded' - return - - if self.test_params.has_key("port_map"): - user_input = self.test_params['port_map'] - splitted_map = user_input.split(",") - for item in splitted_map: - interface_front_pair = item.split("@") - interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1] - elif self.test_params.has_key("port_map_file"): - user_input = self.test_params['port_map_file'] - f = open(user_input, 'r') - for line in f: - if (len(line) > 0 and (line[0] == '#' or line[0] == ';' or line[0]=='/')): - continue; - interface_front_pair = line.split("@") - interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1].strip() - else: - exit("No ptf interface<-> switch front port mapping, please specify as parameter or in external file") - return - - def createRpcClient(self): - # Set up thrift client and contact server - - if self.test_params.has_key("server"): - server = self.test_params['server'] - else: - server = 'localhost' - - self.transport = TSocket.TSocket(server, 9092) - self.transport = TTransport.TBufferedTransport(self.transport) - self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport) - - self.client = switch_sai_rpc.Client(self.protocol) - self.transport.open() - return - - def setUp(self): - global interface_to_front_mapping - BaseTest.setUp(self) - self.test_params = testutils.test_params_get() - self.loadPortMap() - self.createRpcClient() - return - - def tearDown(self): - if config["log_dir"] != None: - self.dataplane.stop_pcap() - BaseTest.tearDown(self) - self.transport.close() - -class ThriftInterfaceDataPlane(ThriftInterface): - """ - Root class that sets up the thrift interface and dataplane - """ - def setUp(self): - ThriftInterface.setUp(self) - self.dataplane = ptf.dataplane_instance - if self.dataplane != None: - self.dataplane.flush() - if config["log_dir"] != None: - filename = os.path.join(config["log_dir"], str(self)) + ".pcap" - self.dataplane.start_pcap(filename) - - def tearDown(self): - if config["log_dir"] != None: - self.dataplane.stop_pcap() - ThriftInterface.tearDown(self) diff --git a/bm/sai_adapter/test/ptf_tests/unopened_tests/saiacl.py b/bm/sai_adapter/test/ptf_tests/unopened_tests/saiacl.py deleted file mode 100644 index 9e1462f3f..000000000 --- a/bm/sai_adapter/test/ptf_tests/unopened_tests/saiacl.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface ACL tests -""" - -from switch import * -import sai_base_test - -@group('acl') -class IPAclTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print '----------------------------------------------------------------------------------------------' - print "Sending packet ptf_intf 2 -> ptf_intf 1 (192.168.0.1 ---> 10.10.10.1 [id = 105])" - - switch_init(self.client) - port1 = port_list[1] - port2 = port_list[2] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.10.1' - ip_mask1 = '255.255.255.255' - dmac1 = '00:11:22:33:44:55' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, rif_id1) - - # send the test packet(s) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=63) - try: - print '#### NO ACL Applied ####' - print '#### Sending ', router_mac, '| 00:22:22:22:22:22 | 10.10.10.1 | 192.168.0.1 | @ ptf_intf 2' - send_packet(self, 2, str(pkt)) - print '#### Expecting 00:11:22:33:44:55 |', router_mac, '| 10.10.10.1 | 192.168.0.1 | @ ptf_intf 1' - verify_packets(self, exp_pkt, [1]) - finally: - print '----------------------------------------------------------------------------------------------' - - print "Sending packet ptf_intf 2 -[acl]-> ptf_intf 1 (192.168.0.1 -[acl]-> 10.10.10.1 [id = 105])" - print 'ACL \'DROP, src 192.168.0.1/255.255.255.0, in_ports[ptf_intf_1,2]\' Applied ' - # setup ACL to block based on Source IP - - action = 1 #Drop - in_ports = [port1, port2] - ip_src = "192.168.0.1" - ip_src_mask = "255.255.255.0" - ip_dst = None - ip_dst_mask = None - ip_proto = None - in_port = None - out_port = None - out_ports = None - ingress_mirror_id = None - egress_mirror_id = None - - acl_table_id = sai_thrift_create_acl_table(self.client, - addr_family, - ip_src, - ip_dst, - ip_proto, - in_ports, - out_ports, - in_port, - out_port) - acl_entry_id = sai_thrift_create_acl_entry(self.client, acl_table_id, - action, addr_family, - ip_src, ip_src_mask, - ip_dst, ip_dst_mask, - ip_proto, - in_ports, out_ports, - in_port, out_port, - ingress_mirror_id, - egress_mirror_id) - try: - assert acl_table_id > 0, 'acl_entry_id is <= 0' - assert acl_entry_id > 0, 'acl_entry_id is <= 0' - - print '#### ACL \'DROP, src 192.168.0.1/255.255.255.0, in_ports[ptf_intf_1,2]\' Applied ####' - print '#### Sending ', router_mac, '| 00:22:22:22:22:22 | 10.10.10.1 | 192.168.0.1 | @ ptf_intf 2' - # send the same packet - send_packet(self, 2, str(pkt)) - # ensure packet is dropped - # check for absence of packet here! - print '#### NOT Expecting 00:11:22:33:44:55 |', router_mac, '| 10.10.10.1 | 192.168.0.1 | @ ptf_intf 1' - verify_no_packet(self, exp_pkt, 1) - #verify_packets(self, exp_pkt, [1]) - finally: - # cleanup ACL - self.client.sai_thrift_delete_acl_entry(acl_entry_id) - self.client.sai_thrift_delete_acl_table(acl_table_id) - # cleanup - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_virtual_router(vr_id) diff --git a/bm/sai_adapter/test/ptf_tests/unopened_tests/saihostif.py b/bm/sai_adapter/test/ptf_tests/unopened_tests/saihostif.py deleted file mode 100644 index e8dc71b2d..000000000 --- a/bm/sai_adapter/test/ptf_tests/unopened_tests/saihostif.py +++ /dev/null @@ -1,603 +0,0 @@ -# saihostif.${name_test} -# -# ARPTest -# DHCPTest -# LLDPTest -# BGPTest -# LACPTest -# SNMPTest -# SSHTest -# IP2METest -# TTLErrorTest -#ptf --test-dir PTF_TEST_CASES saihostif.DHCPTest --qlen=10000 --platform nn -t "server='10.3.147.47';test_port=3;port_map_file='default_interface_to_front_map.ini';verbose=True;" --device-socket 0-3@tcp://127.0.0.1:10900 --device-socket 1-3@tcp://10.3.147.47:10900 - -import ptf -from ptf.base_tests import BaseTest -from ptf import config -import ptf.testutils as testutils -from ptf.testutils import * -from ptf.dataplane import match_exp_pkt -import datetime -import subprocess -from switch import * -import sai_base_test - -import switch_sai_thrift.switch_sai_rpc as switch_sai_rpc -from thrift.transport import TSocket -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -import time - - - -import pprint - -class ControlPlaneBaseTest(sai_base_test.ThriftInterfaceDataPlane): - MAX_PORTS = 32 - POLICER_CIR = 10 - PKT_TX_COUNT = 150 - - my_ip = "10.0.0.1" - peer_ip = "10.0.0.0" - src_mac_uc = '00:55:55:55:55:00' - - trap_list = [ - SAI_HOSTIF_TRAP_ID_TTL_ERROR, - SAI_HOSTIF_TRAP_ID_BGP, - SAI_HOSTIF_TRAP_ID_LACP, - SAI_HOSTIF_TRAP_ID_ARP_REQUEST, - SAI_HOSTIF_TRAP_ID_ARP_RESPONSE, - SAI_HOSTIF_TRAP_ID_LLDP, - SAI_HOSTIF_TRAP_ID_DHCP, - SAI_HOSTIF_TRAP_ID_IP2ME - ] - - myip = '' - peerip = '' - hostif_id={} - trap_groups=[] - policers=[] - routes=[] - next_hops=[] - rifs=[] - v_routers=[] - neighbors=[] - test_port_ind = 1 - - def create_host_interfaces(self): - for interface,front in interface_to_front_mapping.iteritems(): - port_id = port_list[int(interface)] - hif_id = sai_thrift_create_hostif(self.client, port_id, front) - self.hostif_id[front]=hif_id - return - - def init_interfaces(self): - self.loadPortMap() - self.createRpcClient() - switch_init(self.client) - self.create_host_interfaces() - return - - def __init__(self): - - BaseTest.__init__(self) - - self.test_params = testutils.test_params_get() - - - self.myip = self.my_ip - self.peerip = self.peer_ip - self.init_interfaces() - return - - def setup_test_port_rif(self, port_ind): - port = port_list[port_ind] - v4_enabled = 1 - v6_enabled = 1 - - vr_id = sai_thrift_get_default_router_id(self.client) - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port, 0, v4_enabled, v6_enabled, router_mac) - self.rifs.append(rif_id1) - return (vr_id, rif_id1) - - def setup_direct_route(self, vr_id, rif_id1, ip_addr): - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = ip_addr - ip_addr1_subnet = ip_addr - ip_mask1 = '255.255.255.254' - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - route_data=[vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1] - self.routes.append(route_data) - - return - - def setup_ip2me_route(self, ip_addr): - - default_router_id = sai_thrift_get_default_router_id(self.client) - router_packet_action = SAI_PACKET_ACTION_FORWARD - cpu_port_next_hop = sai_thrift_get_cpu_port_id(self.client) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1_subnet = ip_addr - ip_mask1 = '255.255.255.255' - sai_thrift_create_route(self.client, default_router_id, addr_family, ip_addr1_subnet, ip_mask1, cpu_port_next_hop, router_packet_action) - route_data=[default_router_id, addr_family, ip_addr1_subnet, ip_mask1, cpu_port_next_hop] - self.routes.append(route_data) - return - - def create_routes(self): - self.setup_ip2me_route(self.peerip) - vr_id, rif_id = self.setup_test_port_rif(self.test_port_ind) - self.setup_direct_route(vr_id, rif_id, self.peerip) - return - - def setUp(self): - - ThriftInterfaceDataPlane.setUp(self) - self.policers=[] - self.trap_groups=[] - self.routes=[] - self.next_hops=[] - self.rifs=[] - self.v_routers=[] - self.neighbors=[] - - if self.test_params['test_port'] != None: - self.test_port_ind = self.test_params['test_port'] - - self.dataplane.port_up(1, self.test_port_ind) - time.sleep(10) - - return - - def tearDown(self): - if config["log_dir"] != None: - self.dataplane.stop_pcap() - - for trap_gr in self.trap_groups: - self.client.sai_thrift_remove_hostif_trap_group(trap_group_id=trap_gr) - - for trapid in self.trap_list: - sai_thrift_set_hostif_trap(self.client, trap_id=trapid, action=SAI_PACKET_ACTION_FORWARD) - - for policer in self.policers: - self.client.sai_thrift_remove_policer(policer_id=policer) - - for route_data in self.routes: - sai_thrift_remove_route(self.client,route_data[0],route_data[1],route_data[2],route_data[3],route_data[4]) - - for nhop in self.next_hops: - self.client.sai_thrift_remove_next_hop(nhop) - - for neighbor_data in self.neighbors: - sai_thrift_remove_neighbor(self.client, neighbor_data[0], neighbor_data[1], neighbor_data[2], neighbor_data[3]) - - for rif in self.rifs: - self.client.sai_thrift_remove_router_interface(rif) - - for v_router in self.v_routers: - self.client.sai_thrift_remove_virtual_router(v_router) - - self.dataplane.port_down(1, self.test_port_ind) - return - - def copp_test(self, packet, count, send_intf, recv_intf): - - start_time=datetime.datetime.now() - for i in xrange(count): - testutils.send_packet(self, send_intf, packet) - - end_time=datetime.datetime.now() - total_rcv_pkt_cnt = count_matched_packets(self, packet, recv_intf[1], recv_intf[0], timeout=1) - time_delta = end_time - start_time - time_delta_ms = (time_delta.microseconds + time_delta.seconds * 10**6) / 10**3 - if time_delta_ms == 0: - time_delta_ms = 1 - - tx_pps = int(count/(float(time_delta_ms)/1000)) - rx_pps = int(total_rcv_pkt_cnt/(float(time_delta_ms)/1000)) - return total_rcv_pkt_cnt, time_delta, time_delta_ms, tx_pps, rx_pps - - def contruct_packet(self): - raise NotImplemented - - def check_constraints(self, total_rcv_pkt_cnt, time_delta_ms, rx_pps): - raise NotImplemented - - def one_port_test(self, port_number, packet_count): - - packet = self.contruct_packet() - total_rcv_pkt_cnt, time_delta, time_delta_ms, tx_pps, rx_pps = self.copp_test(packet, packet_count, (0, port_number), (1, port_number)) - self.printStats(packet_count, total_rcv_pkt_cnt, time_delta, tx_pps, rx_pps) - self.check_constraints(total_rcv_pkt_cnt) - return - - def run_suite(self): - raise NotImplemented - - def printStats(self, pkt_send_count, total_rcv_pkt_cnt, time_delta, tx_pps, rx_pps): - if not(('verbose' in self.test_params) and (self.test_params['verbose'] == True)): - return - print 'test stats' - print 'Packet sent = %10d' % pkt_send_count - print 'Packet rcvd = %10d' % total_rcv_pkt_cnt - print 'Test time = %s' % str(time_delta) - print 'TX PPS = %d' % tx_pps - print 'RX PPS = %d' % rx_pps - - return - -class NoPolicyTest(ControlPlaneBaseTest): - def __init__(self): - ControlPlaneBaseTest.__init__(self) - - def run_suite(self): - self.one_port_test(self.test_port_ind, 1) - - def check_constraints(self, total_rcv_pkt_cnt): - assert(total_rcv_pkt_cnt == 1) - -class PolicyTest(ControlPlaneBaseTest): - def __init__(self): - ControlPlaneBaseTest.__init__(self) - - def check_constraints(self, total_rcv_pkt_cnt): - assert(self.POLICER_CIR*0.5 <= total_rcv_pkt_cnt <= self.POLICER_CIR*1.5) - - def run_suite(self): - self.one_port_test(self.test_port_ind, self.PKT_TX_COUNT) - -class ARPTest(PolicyTest): - def __init__(self): - PolicyTest.__init__(self) - - def runTest(self): - self.run_suite() - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - self.setup_test_port_rif(self.test_port_ind) - - sai_policer_id = sai_thrift_create_policer(self.client, - meter_type=SAI_POLICER_MODE_Sr_TCM, - mode=SAI_METER_TYPE_PACKETS, - cir=self.POLICER_CIR, - red_action=SAI_PACKET_ACTION_DROP) - self.policers.append(sai_policer_id) - - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4, policer_id=sai_policer_id) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_ARP_REQUEST, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_ARP_RESPONSE, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - return - - def contruct_packet(self): - src_mac = self.src_mac_uc - src_ip = self.myip - dst_ip = self.peerip - - packet = simple_arp_packet( - eth_dst='ff:ff:ff:ff:ff:ff', - eth_src=src_mac, - arp_op=1, - ip_snd=src_ip, - ip_tgt=dst_ip, - hw_snd=src_mac, - hw_tgt='ff:ff:ff:ff:ff:ff') - - return packet - -class DHCPTest(NoPolicyTest): - def __init__(self): - NoPolicyTest.__init__(self) - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - self.setup_test_port_rif(self.test_port_ind) - - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_DHCP, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - return - - def runTest(self): - self.run_suite() - - def contruct_packet(self): - src_mac = self.src_mac_uc - packet = simple_udp_packet(pktlen=100, - eth_dst='ff:ff:ff:ff:ff:ff', - eth_src=src_mac, - dl_vlan_enable=False, - vlan_vid=0, - vlan_pcp=0, - dl_vlan_cfi=0, - ip_src='0.0.0.0', - ip_dst='255.255.255.255', - ip_tos=0, - ip_ttl=64, - udp_sport=68, - udp_dport=67, - ip_ihl=None, - ip_options=False, - with_udp_chksum=True - ) - - return packet - - -class LLDPTest(NoPolicyTest): - def __init__(self): - NoPolicyTest.__init__(self) - return - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_LLDP, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - - return - - def runTest(self): - self.run_suite() - return - - def contruct_packet(self): - - src_mac = self.src_mac_uc - packet = simple_eth_packet( - eth_dst='01:80:c2:00:00:0e', - eth_src=src_mac, - eth_type=0x88cc - ) - return packet - - -class LACPTest(NoPolicyTest): - def __init__(self): - NoPolicyTest.__init__(self) - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_LACP, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - return - - def runTest(self): - self.run_suite() - - def contruct_packet(self): - packet = simple_eth_packet( - pktlen=14, - eth_dst='01:80:c2:00:00:02', - eth_type=0x8809 - ) / (chr(0x01)+(chr(0x01))) - - return packet - -class SNMPTest(NoPolicyTest): - def __init__(self): - NoPolicyTest.__init__(self) - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - self.setup_test_port_rif(self.test_port_ind) - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_SNMP, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - return - - def runTest(self): - self.run_suite() - - def contruct_packet(self): - src_mac = self.src_mac_uc - packet = simple_udp_packet( - eth_dst=router_mac, - ip_dst=self.peerip, - eth_src=src_mac, - udp_dport=161 - ) - return packet - -class SSHTest(NoPolicyTest): - def __init__(self): - NoPolicyTest.__init__(self) - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_SSH, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - return - - def runTest(self): - self.run_suite() - - def contruct_packet(self): - src_ip = self.myip - dst_ip = self.peerip - - packet = simple_tcp_packet( - eth_dst=router_mac, - ip_dst=dst_ip, - ip_src=src_ip, - tcp_sport=22, - tcp_dport=22) - - return packet - -class IP2METest(NoPolicyTest): - - def __init__(self): - NoPolicyTest.__init__(self) - - def setUpIp2Me(self): - self.create_routes() - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_IP2ME, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - return - - def setUp(self): - - ControlPlaneBaseTest.setUp(self) - self.setUpIp2Me() - return - - def tearDown(self): - - ControlPlaneBaseTest.tearDown(self) - return - - def runTest(self): - self.run_suite() - - def contruct_packet(self): - src_mac = self.src_mac_uc - dst_ip = self.peerip - - packet = simple_tcp_packet( - eth_src=src_mac, - eth_dst=router_mac, - ip_dst=dst_ip - ) - - return packet - -class TTLErrorTest(NoPolicyTest): - def __init__(self): - NoPolicyTest.__init__(self) - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - - port1 = port_list[0] - port2 = port_list[self.test_port_ind] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - self.src_ip = '192.168.0.1' - self.ip_addr1 = '10.10.10.1' - - - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_TTL_ERROR, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - self.v_routers.append(vr_id) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - self.rifs.append(rif_id1) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 2, port2, 0, v4_enabled, v6_enabled, mac) - self.rifs.append(rif_id2) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1_subnet = '10.10.10.0' - ip_mask1 = '255.255.255.0' - dmac1 = '00:11:22:33:44:55' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, self.ip_addr1, dmac1) - neighbor_data=[addr_family, rif_id1, self.ip_addr1, dmac1] - self.neighbors.append(neighbor_data) - - nhop1 = sai_thrift_create_nhop(self.client, addr_family, self.ip_addr1, rif_id1) - self.next_hops.append(nhop1) - - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - route_data=[vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1] - self.routes.append(route_data) - return - - def runTest(self): - self.run_suite() - - def contruct_packet(self): - - packet = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst=self.ip_addr1, - ip_src=self.src_ip, - ip_id=105, - ip_ttl=1) - return packet - -class BGPTest(NoPolicyTest): - def __init__(self): - NoPolicyTest.__init__(self) - return - - def setUp(self): - ControlPlaneBaseTest.setUp(self) - self.create_routes() - - trap_group = sai_thrift_create_hostif_trap_group(self.client, queue_id=4) - self.trap_groups.append(trap_group) - sai_thrift_set_hostif_trap( - client=self.client, - trap_id=SAI_HOSTIF_TRAP_ID_BGP, - action=SAI_PACKET_ACTION_TRAP, - channel=SAI_HOSTIF_TRAP_CHANNEL_NETDEV, - trap_group_id=trap_group) - - def runTest(self): - self.run_suite() - - def contruct_packet(self): - dst_ip = self.peerip - packet = simple_tcp_packet( - eth_dst=router_mac, - ip_dst=dst_ip, - tcp_dport=179 - ) - return packet diff --git a/bm/sai_adapter/test/ptf_tests/unopened_tests/sail2.py b/bm/sai_adapter/test/ptf_tests/unopened_tests/sail2.py deleted file mode 100644 index d681ccd13..000000000 --- a/bm/sai_adapter/test/ptf_tests/unopened_tests/sail2.py +++ /dev/null @@ -1,466 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface L2 tests -""" -import socket -from switch import * -import sai_base_test -import sys -sys.path.append('../sai_thrift_src/gen-py/') -from switch_sai.ttypes import * -# from sai_enums import * - -@group('l2') -class L2AccessToAccessVlanTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending L2 packet port 0 -> port 1 [access vlan=10])" - #switch_init(self.client) - vlan_id = 10 - #port1 = port_list[0] - #port2 = port_list[1] - port1=0 - port2=1 - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - mac_action = sai_packet_action.SAI_PACKET_ACTION_FORWARD - - self.client.sai_thrift_create_vlan(vlan_id) - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, port1, sai_vlan_tagging_mode.SAI_VLAN_TAGGING_MODE_UNTAGGED) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_id, port2, sai_vlan_tagging_mode.SAI_VLAN_TAGGING_MODE_UNTAGGED) - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=sai_port_attr.SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action) - sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - - try: - send_packet(self, port1, str(pkt)) - verify_packets(self, pkt, [port2]) - finally: - sai_thrift_delete_fdb(self.client, vlan_id, mac1, port1) - sai_thrift_delete_fdb(self.client, vlan_id, mac2, port2) - - attr_value = sai_thrift_attribute_value_t(u16=1) - attr = sai_thrift_attribute_t(id=sai_port_attr.SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_delete_vlan(vlan_id) - -@group('l2') -class L2TrunkToTrunkVlanTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending L2 packet - port 2 -> port 3 [trunk vlan=10])" - # switch_init(self.client) - vlan_id = 10 - # port1 = port_list[0] - # port2 = port_list[1] - port1 = 2 - port2 = 3 - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - mac_action = sai_packet_action.SAI_PACKET_ACTION_FORWARD - - self.client.sai_thrift_create_vlan(vlan_id) - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, port1, sai_vlan_tagging_mode.SAI_VLAN_TAGGING_MODE_TAGGED) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_id, port2, sai_vlan_tagging_mode.SAI_VLAN_TAGGING_MODE_TAGGED) - - - sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action) - sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - dl_vlan_enable=True, - vlan_vid=10, - ip_dst='10.0.0.1', - ip_id=102, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=102, - dl_vlan_enable=True, - vlan_vid=10, - ip_ttl=64) - - try: - send_packet(self, port1, str(pkt)) - verify_packets(self, exp_pkt, [port2]) - finally: - sai_thrift_delete_fdb(self.client, vlan_id, mac1, port1) - sai_thrift_delete_fdb(self.client, vlan_id, mac2, port2) - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_delete_vlan(vlan_id) - -@group('l2') -class L2AccessToTrunkVlanTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending L2 packet - port 2 -> port 5 [trunk vlan=10])" - # switch_init(self.client) - vlan_id = 10 - port1 = 2 # port_list[0] - port2 = 5 # port_list[1] - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - mac_action = sai_packet_action.SAI_PACKET_ACTION_FORWARD - - self.client.sai_thrift_create_vlan(vlan_id) - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, port1, sai_vlan_tagging_mode.SAI_VLAN_TAGGING_MODE_UNTAGGED) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_id, port2, sai_vlan_tagging_mode.SAI_VLAN_TAGGING_MODE_TAGGED) - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=sai_port_attr.SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - - sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action) - sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=102, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - dl_vlan_enable=True, - vlan_vid=10, - ip_id=102, - ip_ttl=64, - pktlen=104) - try: - send_packet(self, port1, str(pkt)) - verify_packets(self, exp_pkt, [port2]) - finally: - sai_thrift_delete_fdb(self.client, vlan_id, mac1, port1) - sai_thrift_delete_fdb(self.client, vlan_id, mac2, port2) - - attr_value = sai_thrift_attribute_value_t(u16=1) - attr = sai_thrift_attribute_t(id=sai_port_attr.SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port2, attr) - - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_delete_vlan(vlan_id) - -@group('l2') -class L2TrunkToAccessVlanTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending L2 packet - port 1 -> port 2 [trunk vlan=10])" - switch_init(self.client) - vlan_id = 10 - port1 = port_list[0] - port2 = port_list[1] - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - mac_action = SAI_PACKET_ACTION_FORWARD - - self.client.sai_thrift_create_vlan(vlan_id) - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, port1, SAI_VLAN_PORT_TAGGED) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_id, port2, SAI_VLAN_PORT_UNTAGGED) - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - - sai_thrift_create_fdb(self.client, vlan_id, mac1, port1, mac_action) - sai_thrift_create_fdb(self.client, vlan_id, mac2, port2, mac_action) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - dl_vlan_enable=True, - vlan_vid=10, - ip_dst='10.0.0.1', - ip_id=102, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=102, - ip_ttl=64, - pktlen=96) - try: - send_packet(self, 0, str(pkt)) - verify_packets(self, exp_pkt, [1]) - finally: - sai_thrift_delete_fdb(self.client, vlan_id, mac1, port1) - sai_thrift_delete_fdb(self.client, vlan_id, mac2, port2) - - attr_value = sai_thrift_attribute_value_t(u16=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port2, attr) - - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - - self.client.sai_thrift_delete_vlan(vlan_id) - -@group('l2') -class L2FloodTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print 'Flood test on ports 1, 2 and 3' - switch_init(self.client) - vlan_id = 10 - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - - self.client.sai_thrift_create_vlan(vlan_id) - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, port1, SAI_VLAN_PORT_UNTAGGED) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_id, port2, SAI_VLAN_PORT_UNTAGGED) - vlan_member3 = sai_thrift_create_vlan_member(self.client, vlan_id, port3, SAI_VLAN_PORT_UNTAGGED) - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - - pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=107, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=107, - ip_ttl=64) - try: - send_packet(self, 0, str(pkt)) - verify_packets(self, exp_pkt, [1, 2]) - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [0, 2]) - send_packet(self, 2, str(pkt)) - verify_packets(self, exp_pkt, [0, 1]) - finally: - sai_thrift_flush_fdb_by_vlan(self.client, vlan_id) - - attr_value = sai_thrift_attribute_value_t(u16=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) - self.client.sai_thrift_set_port_attribute(port3, attr) - - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_remove_vlan_member(vlan_member3) - self.client.sai_thrift_delete_vlan(vlan_id) - -@group('l2') -@group('lag') -class L2LagTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - switch_init(self.client) - default_vlan = 1 - vlan_id = 10 - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - port4 = port_list[3] - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - mac_action = SAI_PACKET_ACTION_FORWARD - - self.client.sai_thrift_create_vlan(vlan_id) - - lag_id1 = self.client.sai_thrift_create_lag([]) - - sai_thrift_vlan_remove_all_ports(self.client, default_vlan) - - lag_member_id1 = sai_thrift_create_lag_member(self.client, lag_id1, port1) - lag_member_id2 = sai_thrift_create_lag_member(self.client, lag_id1, port2) - lag_member_id3 = sai_thrift_create_lag_member(self.client, lag_id1, port3) - - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, lag_id1, SAI_VLAN_PORT_UNTAGGED) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_id, port4, SAI_VLAN_PORT_UNTAGGED) - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(lag_id1, attr) - self.client.sai_thrift_set_port_attribute(port4, attr) - - sai_thrift_create_fdb(self.client, vlan_id, mac1, lag_id1, mac_action) - sai_thrift_create_fdb(self.client, vlan_id, mac2, port4, mac_action) - - try: - count = [0, 0, 0] - dst_ip = int(socket.inet_aton('10.10.10.1').encode('hex'),16) - max_itrs = 200 - for i in range(0, max_itrs): - dst_ip_addr = socket.inet_ntoa(hex(dst_ip)[2:].zfill(8).decode('hex')) - pkt = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=109, - ip_ttl=64) - - exp_pkt = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=109, - ip_ttl=64) - - send_packet(self, 3, str(pkt)) - rcv_idx = verify_any_packet_any_port(self, [exp_pkt], [0, 1, 2]) - count[rcv_idx] += 1 - dst_ip += 1 - - print count - for i in range(0, 3): - self.assertTrue((count[i] >= ((max_itrs / 3) * 0.8)), - "Not all paths are equally balanced") - - pkt = simple_tcp_packet(eth_src='00:11:11:11:11:11', - eth_dst='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=109, - ip_ttl=64) - exp_pkt = simple_tcp_packet(eth_src='00:11:11:11:11:11', - eth_dst='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=109, - ip_ttl=64) - print "Sending packet port 1 (lag member) -> port 4" - send_packet(self, 0, str(pkt)) - verify_packets(self, exp_pkt, [3]) - print "Sending packet port 2 (lag member) -> port 4" - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [3]) - print "Sending packet port 3 (lag member) -> port 4" - send_packet(self, 2, str(pkt)) - verify_packets(self, exp_pkt, [3]) - finally: - - sai_thrift_delete_fdb(self.client, vlan_id, mac1, lag_id1) - sai_thrift_delete_fdb(self.client, vlan_id, mac2, port4) - - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - - self.client.sai_thrift_remove_lag_member(lag_member_id1) - self.client.sai_thrift_remove_lag_member(lag_member_id2) - self.client.sai_thrift_remove_lag_member(lag_member_id3) - self.client.sai_thrift_remove_lag(lag_id1) - self.client.sai_thrift_delete_vlan(vlan_id) - - for port in sai_port_list: - sai_thrift_create_vlan_member(self.client, default_vlan, port, SAI_VLAN_PORT_UNTAGGED) - - attr_value = sai_thrift_attribute_value_t(u16=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port4, attr) - -@group('l2') -@group('sonic') -class L2VlanBcastUcastTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - """ - For SONiC - Vlan broadcast and known unicast test. Verify the broacast packet reaches all ports in the vlan and unicast packet reach specific port. - Steps: - 1. remove all ports from default vlan - 2. create vlan 10 - 3. add n-1 ports to vlan 10 - 4. add mac for each port - 5. send untagged broadcast packet from port 1, verify all n-1 ports receive the packet except the last port - 6. send untagged unicast packets from port 1 to the rest of the vlan members ports. Verify only one port at a time receives the packet and port n does not. - 7. clean up. - """ - - switch_init(self.client) - default_vlan = 1 - vlan_id = 10 - mac_list = [] - vlan_member_list = [] - ingress_port = 0 - - for i in range (1, len(port_list)): - mac_list.append("00:00:00:00:00:%02x" %(i+1)) - mac_action = SAI_PACKET_ACTION_FORWARD - - sai_thrift_vlan_remove_all_ports(self.client, default_vlan) - - self.client.sai_thrift_create_vlan(vlan_id) - for i in range (0, len(port_list)-1): - vlan_member_list.append(sai_thrift_create_vlan_member(self.client, vlan_id, port_list[i], SAI_VLAN_PORT_UNTAGGED)) - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - for i in range (0, len(port_list)-1): - self.client.sai_thrift_set_port_attribute(port_list[i], attr) - sai_thrift_create_fdb(self.client, vlan_id, mac_list[i], port_list[i], mac_action) - - bcast_pkt = simple_tcp_packet(eth_dst='ff:ff:ff:ff:ff:ff', - eth_src='00:00:00:00:00:01', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - - try: - expected_ports = [] - for i in range (1, len(port_list)-1): - expected_ports.append(i) - - send_packet(self, ingress_port, str(bcast_pkt)) - verify_packets(self, bcast_pkt, expected_ports) - - for i in range (1, len(port_list)-1): - ucast_pkt = simple_tcp_packet(eth_dst=mac_list[i], - eth_src='00:00:00:00:00:01', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - send_packet(self, ingress_port, str(ucast_pkt)) - verify_packets(self, ucast_pkt, [i]) - - finally: - attr_value = sai_thrift_attribute_value_t(u16=default_vlan) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - - for i in range (0, len(port_list)-1): - sai_thrift_delete_fdb(self.client, vlan_id, mac_list[i], port_list[i]) - self.client.sai_thrift_set_port_attribute(port_list[i], attr) - - for vlan_member in vlan_member_list: - self.client.sai_thrift_remove_vlan_member(vlan_member) - - self.client.sai_thrift_delete_vlan(vlan_id) - - for port in sai_port_list: - sai_thrift_create_vlan_member(self.client, default_vlan, port, SAI_VLAN_PORT_UNTAGGED) - diff --git a/bm/sai_adapter/test/ptf_tests/unopened_tests/sail3.py b/bm/sai_adapter/test/ptf_tests/unopened_tests/sail3.py deleted file mode 100644 index 22360b69d..000000000 --- a/bm/sai_adapter/test/ptf_tests/unopened_tests/sail3.py +++ /dev/null @@ -1,1749 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface L3 tests -""" -import socket -import sys -from struct import pack, unpack - -from switch import * - -import sai_base_test -from ptf.mask import Mask - -@group('l3') -class L3IPv4HostTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - v4_enabled = 1 - v6_enabled = 1 - mac_valid = 0 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.10.1' - ip_addr1_subnet = '10.10.10.0' - ip_mask1 = '255.255.255.0' - dmac1 = '00:11:22:33:44:55' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - - # send the test packet(s) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=63) - try: - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [0]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -class L3IPv4LpmTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.10.0' - ip_mask1 = '255.255.255.0' - dmac1 = '00:11:22:33:44:55' - nhop_ip1 = '20.20.20.1' - nhop_ip1_subnet = '20.20.20.0' - ip_mask2 = '255.255.255.0' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop1) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - - # send the test packet(s) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=63) - try: - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [0]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop1) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -class L3IPv6HostTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (2000::1 -> 3000::1)" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV6 - ip_addr1 = '1234:5678:9abc:def0:4422:1133:5577:99aa' - ip_addr1_subnet = '1234:5678:9abc:def0:4422:1133:5577:0' - ip_mask1 = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:0' - dmac1 = '00:11:22:33:44:55' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - - # send the test packet(s) - pkt = simple_tcpv6_packet( eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ipv6_dst='1234:5678:9abc:def0:4422:1133:5577:99aa', - ipv6_src='2000::1', - ipv6_hlim=64) - exp_pkt = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ipv6_dst='1234:5678:9abc:def0:4422:1133:5577:99aa', - ipv6_src='2000::1', - ipv6_hlim=63) - try: - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [0]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -def ip6_to_integer(ip6): - ip6 = socket.inet_pton(socket.AF_INET6, ip6) - a, b = unpack(">QQ", ip6) - return (a << 64) | b - -def integer_to_ip6(ip6int): - a = (ip6int >> 64) & ((1 << 64) - 1) - b = ip6int & ((1 << 64) - 1) - return socket.inet_ntop(socket.AF_INET6, pack(">QQ", a, b)) - -@group('l3') -class L3IPv6PrefixTest(sai_base_test.ThriftInterfaceDataPlane): - #Test packet forwarding for all IPv6 prefix lenghs (from 127 to 1) - def runTest(self): - print - switch_init(self.client) - port1 = port_list[1] - port2 = port_list[2] - port3 = port_list[3] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - addr_family = SAI_IP_ADDR_FAMILY_IPV6 - - #Create default route - sai_thrift_create_route(self.client, vr_id, addr_family, '::', '::', rif_id2, SAI_PACKET_ACTION_DROP) - - #Create neighbor and neighbor subnet - ip_addr1 = '2000:aaaa::1' - dmac1 = '00:11:22:33:44:55' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, '2000:aaaa::', 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0', rif_id1) - - dest = '1234:5678:9abc:def0:4422:1133:5577:99aa' - dest_int = ip6_to_integer(dest) - try: - for i in range(128): - mask_int = ( ( 1 << (128-i) ) - 1 ) << i - net_int = dest_int & mask_int - mask = integer_to_ip6(mask_int) - net = integer_to_ip6(net_int) - - pkt = simple_tcpv6_packet( - eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ipv6_dst=dest, - ipv6_src='2000:bbbb::1', - ipv6_hlim=64) - exp_pkt = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ipv6_dst=dest, - ipv6_src='2000:bbbb::1', - ipv6_hlim=63) - - print "Test packet with dstaddr " + dest + ' sent to ' + net + '/' + str(128-i) - sai_thrift_create_route(self.client, vr_id, addr_family, net, mask, nhop1) - send_packet(self, 2, str(pkt)) - verify_packets(self, exp_pkt, [1]) - sai_thrift_remove_route(self.client, vr_id, addr_family, net, mask, None) - mask="" - send_packet(self, 2, str(pkt)) - verify_no_packet(self, exp_pkt, 1) - finally: - if mask!="": - sai_thrift_remove_route(self.client, vr_id, addr_family, net, mask, None) - sai_thrift_remove_route(self.client, vr_id, addr_family, '2000:aaaa::', 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0', None) - sai_thrift_remove_route(self.client, vr_id, addr_family, '::', '::', None) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -class L3IPv6LpmTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "IPv6 Lpm Test" - print "Sending packet port 1 -> port 2 (2000::1 -> 3000::1, routing with 3000::0/120 route" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV6 - ip_addr1 = '1234:5678:9abc:def0:0000:0000:0000:0000' - ip_mask1 = 'ffff:ffff:ffff:ffff:0000:0000:0000:0000' - ip_mask2 = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:0000' - dmac1 = '00:11:22:33:44:55' - nhop_ip1 = '3000::1' - nhop_ip1_subnet = '3000::0' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop1) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - - # send the test packet(s) - pkt = simple_tcpv6_packet( eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ipv6_dst='1234:5678:9abc:def0:4422:1133:5577:99aa', - ipv6_src='2000::1', - ipv6_hlim=64) - exp_pkt = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ipv6_dst='1234:5678:9abc:def0:4422:1133:5577:99aa', - ipv6_src='2000::1', - ipv6_hlim=63) - try: - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [0]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop1) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -@group('ecmp') -class L3IPv4EcmpHostTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - rif_id3 = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.10.1' - ip_addr1_subnet = '10.10.10.0' - ip_mask1 = '255.255.255.0' - dmac1 = '00:11:22:33:44:55' - dmac2 = '00:11:22:33:44:56' - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - sai_thrift_create_neighbor(self.client, addr_family, rif_id2, ip_addr1, dmac2) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - nhop2 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id2) - nhop_group1 = sai_thrift_create_next_hop_group(self.client, [nhop1, nhop2]) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id2) - - # send the test packet(s) - try: - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=106, - ip_ttl=64) - - exp_pkt1 = simple_tcp_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=106, - #ip_tos=3, - ip_ttl=63) - exp_pkt2 = simple_tcp_packet( - eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=106, - #ip_tos=3, - ip_ttl=63) - - send_packet(self, 2, str(pkt)) - verify_any_packet_any_port(self, [exp_pkt1, exp_pkt2], [0, 1]) - - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst='10.10.10.1', - ip_src='192.168.100.3', - ip_id=106, - ip_ttl=64) - - exp_pkt1 = simple_tcp_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.100.3', - ip_id=106, - #ip_tos=3, - ip_ttl=63) - exp_pkt2 = simple_tcp_packet( - eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.100.3', - ip_id=106, - #ip_tos=3, - ip_ttl=63) - send_packet(self, 2, str(pkt)) - verify_any_packet_any_port(self, [exp_pkt1, exp_pkt2], [0, 1]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id2) - self.client.sai_thrift_remove_next_hop_from_group(nhop_group1, [nhop1, nhop2]) - self.client.sai_thrift_remove_next_hop_group(nhop_group1) - self.client.sai_thrift_remove_next_hop(nhop1) - self.client.sai_thrift_remove_next_hop(nhop2) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id2, ip_addr1, dmac2) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_router_interface(rif_id3) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -@group('ecmp') -class L3IPv6EcmpHostTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - rif_id3 = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV6 - ip_addr1 = '5000:1:1:0:0:0:0:1' - ip_mask1 = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' - dmac1 = '00:11:22:33:44:55' - dmac2 = '00:11:22:33:44:56' - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - sai_thrift_create_neighbor(self.client, addr_family, rif_id2, ip_addr1, dmac2) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - nhop2 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id2) - nhop_group1 = sai_thrift_create_next_hop_group(self.client, [nhop1, nhop2]) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - - # send the test packet(s) - try: - pkt = simple_tcpv6_packet( - eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ipv6_dst='5000:1:1:0:0:0:0:1', - ipv6_src='2000:1:1:0:0:0:0:1', - tcp_sport=0x1234, - ipv6_hlim=64) - - exp_pkt1 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ipv6_dst='5000:1:1:0:0:0:0:1', - ipv6_src='2000:1:1:0:0:0:0:1', - tcp_sport=0x1234, - ipv6_hlim=63) - exp_pkt2 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ipv6_dst='5000:1:1:0:0:0:0:1', - ipv6_src='2000:1:1:0:0:0:0:1', - tcp_sport=0x1234, - ipv6_hlim=63) - - send_packet(self, 2, str(pkt)) - verify_any_packet_any_port(self, [exp_pkt1, exp_pkt2], [0, 1]) - - pkt = simple_tcpv6_packet( - eth_dst=router_mac, - eth_src='00:22:22:22:22:45', - ipv6_dst='5000:1:1:0:0:0:0:1', - ipv6_src='2000:1:1:0:0:0:0:1', - tcp_sport=0x1248, - ipv6_hlim=64) - - exp_pkt1 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ipv6_dst='5000:1:1:0:0:0:0:1', - ipv6_src='2000:1:1:0:0:0:0:1', - tcp_sport=0x1248, - ipv6_hlim=63) - exp_pkt2 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ipv6_dst='5000:1:1:0:0:0:0:1', - ipv6_src='2000:1:1:0:0:0:0:1', - tcp_sport=0x1248, - ipv6_hlim=63) - - send_packet(self, 2, str(pkt)) - verify_any_packet_any_port(self, [exp_pkt1, exp_pkt2], [0, 1]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - self.client.sai_thrift_remove_next_hop_from_group(nhop_group1, [nhop1, nhop2]) - self.client.sai_thrift_remove_next_hop_group(nhop_group1) - self.client.sai_thrift_remove_next_hop(nhop1) - self.client.sai_thrift_remove_next_hop(nhop2) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id2, ip_addr1, dmac2) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_router_interface(rif_id3) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -@group('ecmp') -class L3IPv4EcmpLpmTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 3 -> port [0,1,2] (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - port4 = port_list[3] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.0.0' - ip_mask1 = '255.255.0.0' - ip_mask2 = '255.255.255.0' - nhop_ip1 = '11.11.11.11' - nhop_ip1_subnet = '11.11.11.0' - nhop_ip2 = '22.22.22.22' - nhop_ip2_subnet = '22.22.22.0' - nhop_ip3 = '33.33.33.33' - nhop_ip3_subnet = '33.33.33.0' - dmac1 = '00:11:22:33:44:55' - dmac2 = '00:11:22:33:44:56' - dmac3 = '00:11:22:33:44:57' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - rif_id3 = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac) - rif_id4 = sai_thrift_create_router_interface(self.client, vr_id, 1, port4, 0, v4_enabled, v6_enabled, mac) - - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - sai_thrift_create_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - sai_thrift_create_neighbor(self.client, addr_family, rif_id3, nhop_ip3, dmac3) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip1, rif_id1) - nhop2 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip2, rif_id2) - nhop3 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip3, rif_id3) - nhop_group1 = sai_thrift_create_next_hop_group(self.client, [nhop1, nhop2, nhop3]) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip2_subnet, ip_mask2, rif_id2) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip3_subnet, ip_mask2, rif_id3) - - # send the test packet(s) - try: - count = [0, 0, 0] - dst_ip = int(socket.inet_aton('10.10.10.1').encode('hex'),16) - max_itrs = 200 - for i in range(0, max_itrs): - dst_ip_addr = socket.inet_ntoa(hex(dst_ip)[2:].zfill(8).decode('hex')) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=64) - - exp_pkt1 = simple_tcp_packet(eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=63) - exp_pkt2 = simple_tcp_packet(eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=63) - exp_pkt3 = simple_tcp_packet(eth_dst='00:11:22:33:44:57', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=63) - - send_packet(self, 3, str(pkt)) - rcv_idx = verify_any_packet_any_port(self, - [exp_pkt1, exp_pkt2, exp_pkt3], - [0, 1, 2]) - count[rcv_idx] += 1 - dst_ip += 1 - - for i in range(0, 3): - self.assertTrue((count[i] >= ((max_itrs / 3) * 0.8)), - "Not all paths are equally balanced, %s" % count) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip2_subnet, ip_mask2, rif_id2) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip3_subnet, ip_mask2, rif_id3) - self.client.sai_thrift_remove_next_hop_from_group(nhop_group1, [nhop1, nhop2, nhop3]) - self.client.sai_thrift_remove_next_hop_group(nhop_group1) - self.client.sai_thrift_remove_next_hop(nhop1) - self.client.sai_thrift_remove_next_hop(nhop2) - self.client.sai_thrift_remove_next_hop(nhop3) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id3, nhop_ip3, dmac3) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_router_interface(rif_id3) - self.client.sai_thrift_remove_router_interface(rif_id4) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -@group('ecmp') -class L3IPv6EcmpLpmTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - port4 = port_list[3] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac) - rif_id3 = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac) - rif_id4 = sai_thrift_create_router_interface(self.client, vr_id, 1, port4, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV6 - ip_addr1 = '6000:1:1:0:0:0:0:0' - ip_mask1 = 'ffff:ffff:ffff:ffff:0:0:0:0' - nhop_ip1 = '2000:1:1:0:0:0:0:1' - nhop_ip2 = '3000:1:1:0:0:0:0:1' - nhop_ip3 = '4000:1:1:0:0:0:0:1' - dmac1 = '00:11:22:33:44:55' - dmac2 = '00:11:22:33:44:56' - dmac3 = '00:11:22:33:44:57' - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - sai_thrift_create_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - sai_thrift_create_neighbor(self.client, addr_family, rif_id3, nhop_ip3, dmac3) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip1, rif_id1) - nhop2 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip2, rif_id2) - nhop3 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip3, rif_id3) - nhop_group1 = sai_thrift_create_next_hop_group(self.client, [nhop1, nhop2, nhop3]) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - - # send the test packet(s) - try: - count = [0, 0, 0] - dst_ip = socket.inet_pton(socket.AF_INET6, '6000:1:1:0:0:0:0:1') - dst_ip_arr = list(dst_ip) - max_itrs = 200 - sport = 0x1234 - dport = 0x50 - for i in range(0, max_itrs): - dst_ip_addr = socket.inet_ntop(socket.AF_INET6, dst_ip) - #HACK: sport is a hack for hashing since the ecmp hash does not - #include ipv6 sa and da. - pkt = simple_tcpv6_packet( - eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ipv6_dst=dst_ip_addr, - ipv6_src='1001:1:1:0:0:0:0:2', - tcp_sport=sport, - tcp_dport=dport, - ipv6_hlim=64) - exp_pkt1 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ipv6_dst=dst_ip_addr, - ipv6_src='1001:1:1:0:0:0:0:2', - tcp_sport=sport, - tcp_dport=dport, - ipv6_hlim=63) - exp_pkt2 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ipv6_dst=dst_ip_addr, - ipv6_src='1001:1:1:0:0:0:0:2', - tcp_sport=sport, - tcp_dport=dport, - ipv6_hlim=63) - exp_pkt3 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:57', - eth_src=router_mac, - ipv6_dst=dst_ip_addr, - ipv6_src='1001:1:1:0:0:0:0:2', - tcp_sport=sport, - tcp_dport=dport, - ipv6_hlim=63) - exp_pkt4 = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:58', - eth_src=router_mac, - ipv6_dst=dst_ip_addr, - ipv6_src='1001:1:1:0:0:0:0:2', - tcp_sport=sport, - tcp_dport=dport, - ipv6_hlim=63) - - send_packet(self, 3, str(pkt)) - rcv_idx = verify_any_packet_any_port(self, - [exp_pkt1, exp_pkt2, exp_pkt3], - [0, 1, 2]) - count[rcv_idx] += 1 - dst_ip_arr[15] = chr(ord(dst_ip_arr[15]) + 1) - dst_ip = ''.join(dst_ip_arr) - sport += 15 - dport += 20 - - print "Count = %s" % str(count) - for i in range(0, 3): - self.assertTrue((count[i] >= ((max_itrs / 3) * 0.75)), - "Not all paths are equally balanced") - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - self.client.sai_thrift_remove_next_hop_from_group(nhop_group1, [nhop1, nhop2, nhop3]) - self.client.sai_thrift_remove_next_hop_group(nhop_group1) - self.client.sai_thrift_remove_next_hop(nhop1) - self.client.sai_thrift_remove_next_hop(nhop2) - self.client.sai_thrift_remove_next_hop(nhop3) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id3, nhop_ip3, dmac3) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_router_interface(rif_id3) - self.client.sai_thrift_remove_router_interface(rif_id4) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -@group('lag') -class L3IPv4LagTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.10.1' - ip_addr1_subnet = '10.10.10.0' - ip_mask1 = '255.255.255.0' - dmac1 = '00:11:22:33:44:55' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - lag_id1 = self.client.sai_thrift_create_lag([]) - lag_member_id1 = sai_thrift_create_lag_member(self.client, lag_id1, port1) - lag_member_id2 = sai_thrift_create_lag_member(self.client, lag_id1, port2) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, lag_id1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac) - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - - # send the test packet(s) - try: - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=110, - ip_ttl=64) - - exp_pkt = simple_tcp_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=110, - ip_ttl=63) - send_packet(self, 2, str(pkt)) - verify_packets_any(self, exp_pkt, [0, 1]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - - self.client.sai_thrift_remove_lag_member(lag_member_id1) - self.client.sai_thrift_remove_lag_member(lag_member_id2) - self.client.sai_thrift_remove_lag(lag_id1) - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -@group('lag') -class L3IPv6LagTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - lag_id1 = self.client.sai_thrift_create_lag([]) - lag_member_id1 = sai_thrift_create_lag_member(self.client, lag_id1, port1) - lag_member_id2 = sai_thrift_create_lag_member(self.client, lag_id1, port2) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, lag_id1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV6 - ip_addr1 = '4001::1' - ip_addr1_subnet = '4001::0' - ip_mask1 = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:0' - dmac1 = '00:11:22:33:44:55' - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - - # send the test packet(s) - try: - pkt = simple_tcpv6_packet(eth_dst=router_mac, - eth_src='00:22:22:22:22:22', - ipv6_dst='4001::1', - ipv6_src='5001::1', - ipv6_hlim=64) - - exp_pkt = simple_tcpv6_packet( - eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ipv6_dst='4001::1', - ipv6_src='5001::1', - ipv6_hlim=63) - send_packet(self, 2, str(pkt)) - verify_packets_any(self, exp_pkt, [0, 1]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - - self.client.sai_thrift_remove_lag_member(lag_member_id1) - self.client.sai_thrift_remove_lag_member(lag_member_id2) - self.client.sai_thrift_remove_lag(lag_id1) - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -@group('ecmp') -@group('lag') -class L3EcmpLagTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - port4 = port_list[3] - port5 = port_list[4] - port6 = port_list[5] - port7 = port_list[6] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.0.0' - ip_mask1 = '255.255.0.0' - nhop_ip1 = '11.11.11.11' - nhop_ip2 = '22.22.22.22' - nhop_ip3 = '33.33.33.33' - dmac1 = '00:11:22:33:44:55' - dmac2 = '00:11:22:33:44:56' - dmac3 = '00:11:22:33:44:57' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - lag_id1 = self.client.sai_thrift_create_lag([]) - lag_id2 = self.client.sai_thrift_create_lag([]) - lag_member_id1 = sai_thrift_create_lag_member(self.client, lag_id1, port1) - lag_member_id2 = sai_thrift_create_lag_member(self.client, lag_id1, port2) - lag_member_id3 = sai_thrift_create_lag_member(self.client, lag_id1, port3) - lag_member_id4 = sai_thrift_create_lag_member(self.client, lag_id2, port4) - lag_member_id5 = sai_thrift_create_lag_member(self.client, lag_id2, port5) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, lag_id1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, lag_id2, 0, v4_enabled, v6_enabled, mac) - rif_id3 = sai_thrift_create_router_interface(self.client, vr_id, 1, port6, 0, v4_enabled, v6_enabled, mac) - rif_id4 = sai_thrift_create_router_interface(self.client, vr_id, 1, port7, 0, v4_enabled, v6_enabled, mac) - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - sai_thrift_create_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - sai_thrift_create_neighbor(self.client, addr_family, rif_id3, nhop_ip3, dmac3) - - nhop1 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip1, rif_id1) - nhop2 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip2, rif_id2) - nhop3 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip3, rif_id3) - - nhop_group1 = sai_thrift_create_next_hop_group(self.client, [nhop1, nhop2, nhop3]) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - - try: - count = [0, 0, 0, 0, 0, 0] - dst_ip = int(socket.inet_aton('10.10.10.1').encode('hex'), 16) - src_mac_start = '00:22:22:22:23:' - max_itrs = 500 - for i in range(0, max_itrs): - dst_ip_addr = socket.inet_ntoa(hex(dst_ip)[2:].zfill(8).decode('hex')) - src_mac = src_mac_start + str(i%99).zfill(2) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src=src_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=64) - - exp_pkt1 = simple_tcp_packet(eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=63) - exp_pkt2 = simple_tcp_packet(eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=63) - exp_pkt3 = simple_tcp_packet(eth_dst='00:11:22:33:44:57', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - ip_ttl=63) - - send_packet(self, 6, str(pkt)) - rcv_idx = verify_any_packet_any_port(self, - [exp_pkt1, exp_pkt2, exp_pkt3], - [0, 1, 2, 3, 4, 5]) - count[rcv_idx] += 1 - dst_ip += 1 - - print count - ecmp_count = [count[0]+count[1]+count[2], count[3]+count[4], - count[5]] - for i in range(0, 3): - self.assertTrue((ecmp_count[i] >= ((max_itrs / 3) * 0.75)), - "Ecmp paths are not equally balanced") - for i in range(0, 3): - self.assertTrue((count[i] >= ((max_itrs / 9) * 0.75)), - "Lag path1 is not equally balanced") - for i in range(3, 5): - self.assertTrue((count[i] >= ((max_itrs / 6) * 0.75)), - "Lag path2 is not equally balanced") - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - - self.client.sai_thrift_remove_next_hop_from_group(nhop_group1, [nhop1, nhop2, nhop3]) - self.client.sai_thrift_remove_next_hop_group(nhop_group1) - - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - - self.client.sai_thrift_remove_next_hop(nhop2) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - - self.client.sai_thrift_remove_next_hop(nhop3) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id3, nhop_ip3, dmac3) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_router_interface(rif_id3) - self.client.sai_thrift_remove_router_interface(rif_id4) - - self.client.sai_thrift_remove_lag_member(lag_member_id1) - self.client.sai_thrift_remove_lag_member(lag_member_id2) - self.client.sai_thrift_remove_lag_member(lag_member_id3) - self.client.sai_thrift_remove_lag_member(lag_member_id4) - self.client.sai_thrift_remove_lag_member(lag_member_id5) - self.client.sai_thrift_remove_lag(lag_id1) - self.client.sai_thrift_remove_lag(lag_id2) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -class L3EcmpLagTestMini(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - port4 = port_list[3] - v4_enabled = 1 - v6_enabled = 1 - mac = '' - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - lag_id1 = self.client.sai_thrift_create_lag([]) - lag_member11 = sai_thrift_create_lag_member(self.client, lag_id1, port1) - lag_member12 = sai_thrift_create_lag_member(self.client, lag_id1, port2) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, lag_id1, 0, v4_enabled, v6_enabled, mac) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac) - rif_id3 = sai_thrift_create_router_interface(self.client, vr_id, 1, port4, 0, v4_enabled, v6_enabled, mac) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.0.0' - ip_mask1 = '255.255.0.0' - ip_mask2 = '255.255.255.0' - nhop_ip1 = '11.11.11.11' - nhop_ip1_subnet = '11.11.11.0' - nhop_ip2 = '22.22.22.22' - nhop_ip2_subnet = '22.22.22.0' - dmac1 = '00:11:22:33:44:55' - dmac2 = '00:11:22:33:44:56' - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - sai_thrift_create_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - - nhop1 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip1, rif_id1) - nhop2 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip2, rif_id2) - - nhop_group1 = sai_thrift_create_next_hop_group(self.client, [nhop1, nhop2]) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip2_subnet, ip_mask2, rif_id2) - - try: - count = [0, 0, 0] - dst_ip = int(socket.inet_aton('10.10.10.1').encode('hex'), 16) - src_mac_start = '00:22:22:22:23:' - max_itrs = 500 - dport = 0x50 - for i in range(0, max_itrs): - dst_ip_addr = socket.inet_ntoa(hex(dst_ip)[2:].zfill(8).decode('hex')) - src_mac = src_mac_start + str(i%99).zfill(2) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src=src_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - tcp_dport=dport, - ip_ttl=64) - - exp_pkt1 = simple_tcp_packet(eth_dst='00:11:22:33:44:55', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - tcp_dport=dport, - ip_ttl=63) - exp_pkt2 = simple_tcp_packet(eth_dst='00:11:22:33:44:56', - eth_src=router_mac, - ip_dst=dst_ip_addr, - ip_src='192.168.8.1', - ip_id=106, - tcp_dport=dport, - ip_ttl=63) - - send_packet(self, 3, str(pkt)) - rcv_idx = verify_any_packet_any_port(self, - [exp_pkt1, exp_pkt2], - [0, 1, 2]) - count[rcv_idx] += 1 - dst_ip += 1 - dport += 20 - - print count - ecmp_count = [count[0] + count[1], count[2]] - for i in range(0, 2): - self.assertTrue((ecmp_count[i] >= ((max_itrs / 2) * 0.75)), - "Ecmp paths are not equally balanced") - for i in range(0, 2): - self.assertTrue((count[i] >= ((max_itrs / 4) * 0.75)), - "Lag path1 is not equally balanced") - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop_group1) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip1_subnet, ip_mask2, rif_id1) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip2_subnet, ip_mask2, rif_id2) - - self.client.sai_thrift_remove_next_hop_from_group(nhop_group1, [nhop1, nhop2]) - self.client.sai_thrift_remove_next_hop_group(nhop_group1) - - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - - self.client.sai_thrift_remove_next_hop(nhop2) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id2, nhop_ip2, dmac2) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_router_interface(rif_id3) - - self.client.sai_thrift_remove_lag_member(lag_member11) - self.client.sai_thrift_remove_lag_member(lag_member12) - self.client.sai_thrift_remove_lag(lag_id1) - - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -class L3VIIPv4HostTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - v4_enabled = 1 - v6_enabled = 1 - vlan_id = 10 - mac_action = SAI_PACKET_ACTION_FORWARD - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1 = '10.10.10.1' - ip_addr1_subnet = '10.10.10.0' - ip_mask1 = '255.255.255.0' - dmac1 = '00:0a:00:00:00:01' - ip_addr2 = '11.11.11.1' - ip_addr2_subnet = '11.11.11.0' - ip_mask2 = '255.255.255.0' - dmac2 = '00:0b:00:00:00:01' - mac1 = '' - mac2 = '' - - self.client.sai_thrift_create_vlan(vlan_id) - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, port1, SAI_VLAN_PORT_UNTAGGED) - - attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 0, 0, vlan_id, v4_enabled, v6_enabled, mac1) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac2) - - sai_thrift_create_fdb(self.client, vlan_id, dmac1, port1, mac_action) - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - - sai_thrift_create_neighbor(self.client, addr_family, rif_id2, ip_addr2, dmac2) - nhop2 = sai_thrift_create_nhop(self.client, addr_family, ip_addr2, rif_id2) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr2_subnet, ip_mask2, rif_id2) - - try: - # send the test packet(s) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:0a:00:00:00:01', - ip_dst='11.11.11.1', - ip_src='10.10.10.1', - ip_id=105, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst='00:0b:00:00:00:01', - eth_src=router_mac, - ip_dst='11.11.11.1', - ip_src='10.10.10.1', - ip_id=105, - ip_ttl=63) - send_packet(self, 0, str(pkt)) - verify_packets(self, exp_pkt, [1]) - - # send the test packet(s) - pkt = simple_tcp_packet(eth_dst=router_mac, - eth_src='00:0b:00:00:00:01', - ip_dst='10.10.10.1', - ip_src='11.11.11.1', - ip_id=105, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst='00:0a:00:00:00:01', - eth_src=router_mac, - ip_dst='10.10.10.1', - ip_src='11.11.11.1', - ip_id=105, - ip_ttl=63) - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [0]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_id1) - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr2_subnet, ip_mask2, rif_id2) - self.client.sai_thrift_remove_next_hop(nhop1) - self.client.sai_thrift_remove_next_hop(nhop2) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id2, ip_addr2, dmac2) - sai_thrift_delete_fdb(self.client, vlan_id, dmac1, port1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_delete_vlan(vlan_id) - self.client.sai_thrift_remove_virtual_router(vr_id) - - attr_value = sai_thrift_attribute_value_t(u16=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - -@group('l3') -class L3IPv4MacRewriteTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - print "Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])" - switch_init(self.client) - port1 = port_list[0] - port2 = port_list[1] - v4_enabled = 1 - v6_enabled = 1 - - mac1 = rewrite_mac1 - mac2 = rewrite_mac2 - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - - rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac1) - rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac2) - - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - nhop_ip1 = '11.11.11.11' - nhop_ip1_subnet = '11.11.11.0' - nhop_ip1_mask = '255.255.255.0' - ip_mask1 = '255.255.255.255' - ip_addr1 = '10.10.10.1' - dmac1 = '00:11:22:33:44:55' - - sai_thrift_create_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - nhop1 = sai_thrift_create_nhop(self.client, addr_family, nhop_ip1, rif_id1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop1) - sai_thrift_create_route(self.client, vr_id, addr_family, nhop_ip1_subnet, nhop_ip1_mask, rif_id1) - - # send the test packet(s) - pkt = simple_tcp_packet(eth_dst=rewrite_mac2, - eth_src='00:22:22:22:22:22', - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst='00:11:22:33:44:55', - eth_src=rewrite_mac1, - ip_dst='10.10.10.1', - ip_src='192.168.0.1', - ip_id=105, - ip_ttl=63) - try: - send_packet(self, 1, str(pkt)) - verify_packets(self, exp_pkt, [0]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1, ip_mask1, nhop1) - sai_thrift_remove_route(self.client, vr_id, addr_family, nhop_ip1_subnet, nhop_ip1_mask, rif_id1) - self.client.sai_thrift_remove_next_hop(nhop1) - sai_thrift_remove_neighbor(self.client, addr_family, rif_id1, nhop_ip1, dmac1) - - self.client.sai_thrift_remove_router_interface(rif_id1) - self.client.sai_thrift_remove_router_interface(rif_id2) - self.client.sai_thrift_remove_virtual_router(vr_id) - -@group('l3') -class L3VlanNeighborMacUpdateTest(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - """ - For sai server for testing learning inside vlan and fwd packet to vlan through l3 - Steps - 1. Create VLAN - 2. Create two VLAN members - 3. Set port VLAN IDs - 4. Create virtual router - 5. Create router interface for VLAN and an extra port 3 - 6. Set SAI PORT LEARN MODE HW - 7. Send packet from one port of the VLAN to the DUT to update the FDB entry - 8. Create neighbor and route - 9. Send L3 packet from port to the VLAN with the destination IP and verify that only the targeted port receives the packet and the MAC in the packet is updated - 10. clean up. - """ - - print - print "Sending packet port 1 -> switch (for learning purpuse)" - print "and then sending packet from port 3 -> port 1 (through the router)" - switch_init(self.client) - sai_thrift_clear_all_counters(self.client) - v4_enabled = 1 - v6_enabled = 1 - vlan_id = 10 - port1 = port_list[0] - port2 = port_list[1] - port3 = port_list[2] - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - ip_addr1_subnet = '10.10.10.0' - ip_mask1 = '255.255.255.0' - mac_port1 = '00:0a:00:00:00:01' - ip_port1 = '10.10.10.2' - mac_port3 = '00:0b:00:00:00:01' - mac1 = '' - mac2 = '' - self.client.sai_thrift_create_vlan(vlan_id) - - vlan_member1 = sai_thrift_create_vlan_member(self.client, vlan_id, port1, SAI_VLAN_PORT_TAGGED) - vlan_member2 = sai_thrift_create_vlan_member(self.client, vlan_id, port2, SAI_VLAN_PORT_TAGGED) - attr_value1 = sai_thrift_attribute_value_t(u16=vlan_id) - attr1 = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value1) - self.client.sai_thrift_set_port_attribute(port1, attr1) - self.client.sai_thrift_set_port_attribute(port2, attr1) - - vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled) - rif_vlan_id = sai_thrift_create_router_interface(self.client, vr_id, 0, 0, vlan_id, v4_enabled, v6_enabled, mac1) - rif_port_id = sai_thrift_create_router_interface(self.client, vr_id, 1, port3, 0, v4_enabled, v6_enabled, mac2) - - attr_value2 = sai_thrift_attribute_value_t(s32=SAI_PORT_LEARN_MODE_HW) - attr2 = sai_thrift_attribute_t(id=SAI_PORT_ATTR_FDB_LEARNING, value=attr_value2) - self.client.sai_thrift_set_port_attribute(port1, attr2) - self.client.sai_thrift_set_port_attribute(port2, attr2) - - sai_thrift_create_neighbor(self.client, addr_family, rif_vlan_id, ip_port1, mac_port1) - sai_thrift_create_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_vlan_id) - - - local_pkt = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src=mac_port1, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_dst='10.0.0.1', - ip_src=ip_port1, - ip_id=102, - ip_ttl=64) - - - try: - #sending unkown UC for learning the ports mac and expecting flooding only on the vlan - send_packet(self, 0, str(local_pkt)) - verify_packets(self, local_pkt, [1]) - #sending L3 packet from port 3 through router to port 1 that update the fdb with is MAC - L3_pkt = simple_tcp_packet(pktlen=100, - eth_dst=router_mac, - eth_src=mac_port3, - ip_src='11.11.11.1', - ip_dst=ip_port1, - ip_id=105, - ip_ttl=64) - exp_pkt = simple_tcp_packet(pktlen=104,#additional 4bytes because of the vlan - eth_dst=mac_port1, - eth_src=router_mac, - ip_dst=ip_port1, - ip_src='11.11.11.1', - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_id=105, - ip_ttl=63) - send_packet(self, 2, str(L3_pkt)) - verify_packets(self, exp_pkt, [0]) - finally: - sai_thrift_remove_route(self.client, vr_id, addr_family, ip_addr1_subnet, ip_mask1, rif_vlan_id) - sai_thrift_remove_neighbor(self.client, addr_family, rif_vlan_id, ip_port1, mac_port1) - - self.client.sai_thrift_remove_router_interface(rif_vlan_id) - self.client.sai_thrift_remove_router_interface(rif_port_id) - - self.client.sai_thrift_remove_vlan_member(vlan_member1) - self.client.sai_thrift_remove_vlan_member(vlan_member2) - self.client.sai_thrift_delete_vlan(vlan_id) - - self.client.sai_thrift_remove_virtual_router(vr_id) - - attr_value = sai_thrift_attribute_value_t(u16=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - self.client.sai_thrift_set_port_attribute(port2, attr) -@group('lag') -@group('l3') -class L3MultipleLagTest(sai_base_test.ThriftInterfaceDataPlane): - total_lag_port = 16 - v4_enabled = 1 - v6_enabled = 1 - ip_mask = '255.255.255.0' - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - lag_members = [] - lags = [] - lags_rifs = [] - neighbors = [] - routes = [] - vr_id = 0 - mac_action = SAI_PACKET_ACTION_FORWARD - src_port = 0 - mac_pool = ['00:11:22:33:44:50', - '00:11:23:33:44:51', - '00:11:24:33:44:52', - '00:11:25:33:44:53', - '00:11:26:33:44:54', - '00:11:27:33:44:55', - '00:11:28:33:44:56', - '00:11:29:33:44:57', - '00:11:30:33:44:58', - '00:11:31:33:44:59', - '00:11:32:33:44:60', - '00:11:33:33:44:61', - '00:11:34:33:44:62', - '00:11:35:33:44:63', - '00:11:36:33:44:64', - '00:11:37:33:44:65', - '00:11:38:33:44:66'] - - - def setup_lags(self, num_of_lags, port_list): - for i in xrange(num_of_lags): - self.lags.append(self.client.sai_thrift_create_lag([])) - for i in xrange(self.total_lag_port): - self.lag_members.append(sai_thrift_create_lag_member(self.client, self.lags[i % num_of_lags], port_list[i])) - for i in xrange(num_of_lags): - self.lags_rifs.append(sai_thrift_create_router_interface(self.client, self.vr_id, 1, self.lags[i], 0, self.v4_enabled, self.v6_enabled, '')) - for i in xrange(num_of_lags): - sai_thrift_create_neighbor(self.client, self.addr_family, self.lags_rifs[i], "10.10.%s.1" % str(i+1), self.mac_pool[i]) - sai_thrift_create_route(self.client, self.vr_id, self.addr_family, "10.10.%s.0" % str(i+1), self.ip_mask, self.lags_rifs[i]) - - def teardown_lags(self, num_of_lags, port_list): - if (num_of_lags == 0 ): return - for i in xrange(num_of_lags): - sai_thrift_remove_neighbor(self.client, self.addr_family, self.lags_rifs[i], "10.10.%s.1" % str(i+1), self.mac_pool[i]) - sai_thrift_remove_route(self.client, self.vr_id, self.addr_family, "10.10.%s.0" % str(i+1), self.ip_mask, self.lags_rifs[i]) - for rif in self.lags_rifs: - self.client.sai_thrift_remove_router_interface(rif) - del self.lags_rifs[:] - for lag_member in self.lag_members: - self.client.sai_thrift_remove_lag_member(lag_member) - del self.lag_members[:] - for lag in self.lags: - self.client.sai_thrift_remove_lag(lag) - del self.lags[:] - - def send_and_verify_packets(self, num_of_lags, port_list): - exp_pkts = [0]*self.total_lag_port - pkt_counter = [0] * self.total_lag_port - destanation_ports = range(self.total_lag_port) - sport = 0x1234 - dport = 0x50 - src_mac = self.dataplane.get_mac(0, 16) - NUM_OF_PKT_TO_EACH_PORT = 254 - NUM_OF_PKTS_TO_SEND = NUM_OF_PKT_TO_EACH_PORT * self.total_lag_port - for i in xrange(NUM_OF_PKTS_TO_SEND): - ip_src = '10.0.' + str(i % 255) + '.' + str(i % 255) - ip_dst = '10.10.' + str((i % num_of_lags) + 1) + '.1' - pkt = simple_tcp_packet( - eth_dst=router_mac, - eth_src=src_mac, - ip_src=ip_src, - ip_dst=ip_dst, - ip_id=i, - tcp_sport=sport, - tcp_dport=dport, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst=self.mac_pool[i % num_of_lags], - eth_src=router_mac, - ip_src=ip_src, - ip_dst=ip_dst, - ip_id=i, - tcp_sport=sport, - tcp_dport=dport, - ip_ttl=63) - - send_packet(self, self.total_lag_port, str(pkt)) - (match_index,rcv_pkt) = verify_packet_any_port(self,exp_pkt,destanation_ports) - logging.debug("found expected packet from port %d" % destanation_ports[match_index]) - pkt_counter[match_index] += 1 - sport = random.randint(0,0xffff) - dport = random.randint(0,0xffff) - - #final uniform distribution check - for stat_port in xrange(self.total_lag_port): - logging.debug( "PORT #"+str(hex(port_list[stat_port]))+":") - logging.debug(str(pkt_counter[stat_port])) - self.assertTrue((pkt_counter[stat_port] >= ((NUM_OF_PKT_TO_EACH_PORT ) * 0.8)), - "Not all paths are equally balanced, %s" % pkt_counter[stat_port]) - self.assertTrue((pkt_counter[stat_port] <= ((NUM_OF_PKT_TO_EACH_PORT ) * 1.2)), - "Not all paths are equally balanced, %s" % pkt_counter[stat_port]) - - def runTest(self): - """ - For sai server, testing different lags with router - ---- Test for 17 ports minimun ---- - Steps - 1. Create virtual router - 2. Reserve port 16 for sending packets - 3. Create router interfaces 1-for all the lags, 2-for the source port - 4. Create sixteen LAGs with each hash one member - 5. Config neighbors and routes - 6. Send packet and check for arrivals balanced traffic - 7. Repeat steps 3-6 with 8 lags with each has 2 members, 4 lags with 4 members, 2 lags with 8 members and 1 lag with 16 members - 8. clean up. - """ - - - print - print "L3MultipleLagTest" - #general configuration - random.seed(1) - switch_init(self.client) - self.src_port = port_list[self.total_lag_port] - if (len(port_list) < (self.total_lag_port + 1) ) : - print "skip this test as it requires 17 ports" - return - - self.vr_id = sai_thrift_create_virtual_router(self.client, self.v4_enabled, self.v6_enabled) - rif_port_id = sai_thrift_create_router_interface(self.client, self.vr_id, 1, self.src_port, 0, self.v4_enabled, self.v6_enabled, '') - num_of_lags = self.total_lag_port - try: - while (num_of_lags > 0): - print "testing with " +str(num_of_lags) + " lags" - self.setup_lags(num_of_lags,port_list) - self.send_and_verify_packets(num_of_lags,port_list) - self.teardown_lags(num_of_lags,port_list) - num_of_lags /= 2 - - finally: - - #in case of an exception in the send_and_verify_packets - self.teardown_lags(num_of_lags,port_list) - self.client.sai_thrift_remove_router_interface(rif_port_id) - self.client.sai_thrift_remove_virtual_router(self.vr_id) - print "END OF TEST" -@group('lag') -@group('l3') -class L3MultipleEcmpLagTest(sai_base_test.ThriftInterfaceDataPlane): - # ports that will change from rif to lag member - total_changing_ports = 15 - #the first port that will start as rif, that means that the first iteratio will only have port #1 - first_changing_port = 2 - total_dst_port = 16 - v4_enabled = 1 - v6_enabled = 1 - ip_mask = '255.255.0.0' - addr_family = SAI_IP_ADDR_FAMILY_IPV4 - lag_members = [] - nhop_group = 0 - lag = 0 - lag_rif = 0 - port_rifs = [] - neighbors = [] - nhops = [] - routes = [] - vr_id = 0 - mac_action = SAI_PACKET_ACTION_FORWARD - src_port = 0 - mac_pool = [] - - - def setup_ecmp_lag_group(self, first_rif_port): - self.lag = self.client.sai_thrift_create_lag([]) - #adding lag members - sai_thrift_create_lag_member(self.client, self.lag, port_list[1]) - for i in range(self.first_changing_port,first_rif_port): - self.lag_members.append(sai_thrift_create_lag_member(self.client, self.lag, port_list[i])) - self.lag_rif = sai_thrift_create_router_interface(self.client, self.vr_id, 1, self.lag, 0, self.v4_enabled, self.v6_enabled, '') - sai_thrift_create_neighbor(self.client, self.addr_family, self.lag_rif, "10.10.0.1", self.mac_pool[15]) - sai_thrift_create_route(self.client, self.vr_id,self.addr_family, "10.10.0.1", '255.255.255.0', self.lag_rif) - self.nhops.append(sai_thrift_create_nhop(self.client, self.addr_family, "10.10.0.1" , self.lag_rif)) - for i in range(first_rif_port,self.total_changing_ports): - self.port_rifs.append(sai_thrift_create_router_interface(self.client, self.vr_id, 1, port_list[i], 0, self.v4_enabled, self.v6_enabled, '')) - for i in range(len(self.port_rifs)): - sai_thrift_create_neighbor(self.client, self.addr_family, self.port_rifs[i], "10.10.%s.1" % str(i+1), self.mac_pool[i]) - self.nhops.append(sai_thrift_create_nhop(self.client, self.addr_family, "10.10.%s.1" % str(i+1), self.port_rifs[i])) - sai_thrift_create_route(self.client, self.vr_id, self.addr_family, "10.10.%s.1" % str(i+1), '255.255.255.0', self.port_rifs[i]) - self.nhop_group = sai_thrift_create_next_hop_group(self.client, self.nhops) - sai_thrift_create_route(self.client, self.vr_id, self.addr_family, "10.20.0.0", self.ip_mask, self.nhop_group) - - - - def teardown_ecmp_lag_group(self, first_rif_port): - sai_thrift_remove_route(self.client, self.vr_id, self.addr_family, "10.20.0.0", self.ip_mask, self.nhop_group) - sai_thrift_remove_route(self.client, self.vr_id, self.addr_family, "10.10.0.1", '255.255.255.0', self.lag_rif) - for i in range(self.total_changing_ports - first_rif_port): - sai_thrift_remove_route(self.client, self.vr_id, self.addr_family, "10.10.%s.1" % str(i+1), '255.255.255.0', self.port_rifs[i]) - self.client.sai_thrift_remove_next_hop_from_group(self.nhop_group, self.nhops) - self.client.sai_thrift_remove_next_hop_group(self.nhop_group) - for nhop in self.nhops: - self.client.sai_thrift_remove_next_hop(nhop) - del self.nhops[:] - for i in range(self.total_changing_ports - first_rif_port): - sai_thrift_remove_neighbor(self.client, self.addr_family, self.port_rifs[i], "10.10.%s.1" % str(i+1), self.mac_pool[i]) - print self.port_rifs - for rif in self.port_rifs: - self.client.sai_thrift_remove_router_interface(rif) - del self.port_rifs[:] - for lag_member in self.lag_members: - self.client.sai_thrift_remove_lag_member(lag_member) - del self.lag_members[:] - sai_thrift_remove_neighbor(self.client, self.addr_family, self.lag_rif, "10.10.0.1", self.mac_pool[15]) - self.client.sai_thrift_remove_router_interface(self.lag_rif) - self.client.sai_thrift_remove_lag(self.lag) - - - - - def polarizationCheck(self,packets,avg): - if (avg < 150): - self.assertTrue((packets >= (avg * 0.65)),"Not all paths are equally balanced, %s" % packets) - self.assertTrue((packets <= (avg * 1.35)),"Not all paths are equally balanced, %s" % packets) - else: - self.assertTrue((packets >= (avg * 0.8)),"Not all paths are equally balanced, %s" % packets) - self.assertTrue((packets <= (avg * 1.2)),"Not all paths are equally balanced, %s" % packets) - - def send_and_verify_packets(self, first_rif_port): - exp_pkts = [0]*self.total_dst_port - pkt_counter = [0] * self.total_dst_port - destanation_ports = range(self.total_dst_port + 1) - router_mac = '00:02:03:04:05:00' - sport = 0x1234 - dport = 0x50 - src_mac = self.dataplane.get_mac(0, 0) - IP_LAST_WORD_RANGE = 254 - IP_2ND_LAST_WORD_RANGE = 16 - for i in xrange(IP_LAST_WORD_RANGE): - for j in xrange(IP_2ND_LAST_WORD_RANGE): - ip_src = '10.0.' + str(j) + '.' + str(i+1) - ip_dst = '10.20.' + str(j+1) + '.1' - pkt = simple_tcp_packet( - eth_dst=router_mac, - eth_src=src_mac, - ip_src=ip_src, - ip_dst=ip_dst, - ip_id=i, - tcp_sport=sport, - tcp_dport=dport, - ip_ttl=64) - exp_pkt = simple_tcp_packet( - eth_dst=self.mac_pool[0], - eth_src=router_mac, - ip_src=ip_src, - ip_dst=ip_dst, - ip_id=i, - tcp_sport=sport, - tcp_dport=dport, - ip_ttl=63) - masked_exp_pkt = Mask(exp_pkt) - masked_exp_pkt.set_do_not_care_scapy(ptf.packet.Ether,"dst") - - send_packet(self, 0, str(pkt)) - (match_index,rcv_pkt) = verify_packet_any_port(self,masked_exp_pkt,destanation_ports) - logging.debug("found expected packet from port %d" % destanation_ports[match_index]) - pkt_counter[match_index] += 1 - sport = random.randint(0,0xffff) - dport = random.randint(0,0xffff) - - #final uniform distribution check - logging.debug(pkt_counter) - logging.debug(first_rif_port) - lag_packets = sum(pkt_counter[1:first_rif_port]) - lag_average = lag_packets/(len(self.lag_members) + 1) - logging.debug("the sum of packets through the lag is " + str(lag_packets)) - logging.debug("the lag average for the lag is " + str(lag_average)) - for stat_port in range(1,first_rif_port): - logging.debug( "PORT #"+str(stat_port)+":") - logging.debug(str(pkt_counter[stat_port])) - self.polarizationCheck(pkt_counter[stat_port],lag_average) - rifs_average = sum(pkt_counter)/(len(self.port_rifs) + 1) - logging.debug("lag average " + str(lag_average)) - self.polarizationCheck(lag_packets,rifs_average) - for stat_port in range(first_rif_port,self.total_changing_ports): - logging.debug( "PORT #"+str(stat_port)+":") - logging.debug(str(pkt_counter[stat_port])) - self.polarizationCheck(pkt_counter[stat_port],rifs_average) - - - def runTest(self): - """ - For sai server, testing different lags with router - ---- Test for 16 ports minimun ---- - Steps - 1. Create virtual router, and rif for src port - 2. create a lag and lag rif,add ports to the lag and the rest of the ports connect to rifs - 3. configure neighbors, nhops for all of the rifs - 4. make ecmp route with all of the nhops - 5. send packets from src port - 6. check polarization check in the lag and in the ecmp - 7. remove rifs, neighbors, nhops, lag members, lag and route - 8. repeat steps 3-7 with differnt numbers of lag members and rifs - 8. clean up. - """ - - - print - print "L3MultipleEcmpLagTest" - #general configuration - random.seed(1) - switch_init(self.client) - self.src_port = port_list[0] - for i in range (self.total_dst_port+1): - self.mac_pool.append('00:11:22:33:44:'+str(50+i)) - - self.vr_id = sai_thrift_create_virtual_router(self.client, self.v4_enabled, self.v6_enabled) - rif_port_id = sai_thrift_create_router_interface(self.client, self.vr_id, 1, self.src_port, 0, self.v4_enabled, self.v6_enabled, '') - - try: - # the first iteration will configure port #1 as a lag with only one member - #and will configure port #2 to port #15 as rifs, - #the rif will advance until all of the ports will be in lag and only one if port - for first_rif_port in range(self.first_changing_port,self.total_changing_ports): - print "testing with " +str(first_rif_port - 1) + " lag members" - self.setup_ecmp_lag_group(first_rif_port) - self.send_and_verify_packets(first_rif_port) - self.teardown_ecmp_lag_group(first_rif_port) - finally: - - #in case of an exception in the send_and_verify_packets - self.teardown_ecmp_lag_group(self.total_dst_port)#check what number to send for tear down - self.client.sai_thrift_remove_router_interface(rif_port_id) - self.client.sai_thrift_remove_virtual_router(self.vr_id) - print "END OF TEST" diff --git a/bm/sai_adapter/test/ptf_tests/unopened_tests/switch.py b/bm/sai_adapter/test/ptf_tests/unopened_tests/switch.py deleted file mode 100644 index 59685c7d0..000000000 --- a/bm/sai_adapter/test/ptf_tests/unopened_tests/switch.py +++ /dev/null @@ -1,763 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface basic tests -""" - -#import switch_sai_thrift -from sai_base_test import * -import time -import sys -import logging - -import unittest -import random - -import sai_base_test - -from ptf import config -from ptf.testutils import * -from ptf.thriftutils import * - -import os - -#from switch_sai_thrift.ttypes import * - -# from switch_sai_thrift.sai_headers import * - - -this_dir = os.path.dirname(os.path.abspath(__file__)) - -switch_inited=0 -port_list = {} -sai_port_list = [] -front_port_list = [] -table_attr_list = [] -router_mac='00:77:66:55:44:00' -rewrite_mac1='00:77:66:55:44:01' -rewrite_mac2='00:77:66:55:44:02' - -is_bmv2 = ('BMV2_TEST' in os.environ) and (int(os.environ['BMV2_TEST']) == 1) - -def switch_init(client): - global switch_inited - if switch_inited: - return - - switch_attr_list = client.sai_thrift_get_switch_attribute() - attr_list = switch_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_SWITCH_ATTR_PORT_NUMBER: - print "max ports: " + attribute.value.u32 - elif attribute.id == SAI_SWITCH_ATTR_PORT_LIST: - for port_id in attribute.value.objlist.object_id_list: - attr_value = sai_thrift_attribute_value_t(booldata=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_ADMIN_STATE, value=attr_value) - client.sai_thrift_set_port_attribute(port_id, attr) - sai_port_list.append(port_id) - else: - print "unknown switch attribute" - attr_value = sai_thrift_attribute_value_t(mac=router_mac) - attr = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_SRC_MAC_ADDRESS, value=attr_value) - client.sai_thrift_set_switch_attribute(attr) - all_ports_are_up = True - for num_of_tries in range(200): - time.sleep(1) - # wait till the port are up - for port in sai_port_list: - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_OPER_STATUS: - if attribute.value.s32 != SAI_PORT_OPER_STATUS_UP: - all_ports_are_up = False - print "port 0x%x is down" % port - if all_ports_are_up: - break - else: - all_ports_are_up = True - if not all_ports_are_up: - raise RuntimeError('Not all of the ports are up') - - thrift_attr = client.sai_thrift_get_port_list_by_front_port() - if thrift_attr.id == SAI_SWITCH_ATTR_PORT_LIST: - for port_id in thrift_attr.value.objlist.object_id_list: - front_port_list.append(port_id) - for interface,front in interface_to_front_mapping.iteritems(): - sai_port_id = client.sai_thrift_get_port_id_by_front_port(front); - port_list[int(interface)]=sai_port_id - switch_inited = 1 - -def sai_thrift_get_cpu_port_id(client): - cpu_port = client.sai_thrift_get_cpu_port_id() - return cpu_port - -def sai_thrift_get_default_router_id(client): - default_router_id = client.sai_thrift_get_default_router_id() - return default_router_id - -def sai_thrift_create_fdb(client, vlan_id, mac, port, mac_action): - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, vlan_id=vlan_id) - #value 0 represents static entry, id=0, represents entry type - fdb_attribute1_value = sai_thrift_attribute_value_t(s32=SAI_FDB_ENTRY_STATIC) - fdb_attribute1 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_TYPE, - value=fdb_attribute1_value) - #value oid represents object id, id=1 represents port id - fdb_attribute2_value = sai_thrift_attribute_value_t(oid=port) - fdb_attribute2 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_PORT_ID, - value=fdb_attribute2_value) - #value oid represents object id, id=1 represents port id - fdb_attribute3_value = sai_thrift_attribute_value_t(s32=mac_action) - fdb_attribute3 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_PACKET_ACTION, - value=fdb_attribute3_value) - fdb_attr_list = [fdb_attribute1, fdb_attribute2, fdb_attribute3] - client.sai_thrift_create_fdb_entry(thrift_fdb_entry=fdb_entry, thrift_attr_list=fdb_attr_list) - -def sai_thrift_delete_fdb(client, vlan_id, mac, port): - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, vlan_id=vlan_id) - client.sai_thrift_delete_fdb_entry(thrift_fdb_entry=fdb_entry) - -def sai_thrift_flush_fdb_by_vlan(client, vlan_id): - fdb_attribute1_value = sai_thrift_attribute_value_t(u16=vlan_id) - fdb_attribute1 = sai_thrift_attribute_t(id=SAI_FDB_FLUSH_ATTR_VLAN_ID, - value=fdb_attribute1_value) - fdb_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_FDB_FLUSH_ENTRY_DYNAMIC) - fdb_attribute2 = sai_thrift_attribute_t(id=SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, - value=fdb_attribute2_value) - fdb_attr_list = [fdb_attribute1, fdb_attribute2] - client.sai_thrift_flush_fdb_entries(thrift_attr_list=fdb_attr_list) - -def sai_thrift_create_virtual_router(client, v4_enabled, v6_enabled): - #v4 enabled - vr_attribute1_value = sai_thrift_attribute_value_t(booldata=v4_enabled) - vr_attribute1 = sai_thrift_attribute_t(id=SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE, - value=vr_attribute1_value) - #v6 enabled - vr_attribute2_value = sai_thrift_attribute_value_t(booldata=v6_enabled) - vr_attribute2 = sai_thrift_attribute_t(id=SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE, - value=vr_attribute2_value) - vr_attr_list = [vr_attribute1, vr_attribute2] - vr_id = client.sai_thrift_create_virtual_router(thrift_attr_list=vr_attr_list) - return vr_id - -def sai_thrift_create_router_interface(client, vr_id, is_port, port_id, vlan_id, v4_enabled, v6_enabled, mac): - #vrf attribute - rif_attr_list = [] - rif_attribute1_value = sai_thrift_attribute_value_t(oid=vr_id) - rif_attribute1 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID, - value=rif_attribute1_value) - rif_attr_list.append(rif_attribute1) - if is_port: - #port type and port id - rif_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_ROUTER_INTERFACE_TYPE_PORT) - rif_attribute2 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_TYPE, - value=rif_attribute2_value) - rif_attr_list.append(rif_attribute2) - rif_attribute3_value = sai_thrift_attribute_value_t(oid=port_id) - rif_attribute3 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_PORT_ID, - value=rif_attribute3_value) - rif_attr_list.append(rif_attribute3) - else: - #vlan type and vlan id - rif_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_ROUTER_INTERFACE_TYPE_VLAN) - rif_attribute2 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_TYPE, - value=rif_attribute2_value) - rif_attr_list.append(rif_attribute2) - rif_attribute3_value = sai_thrift_attribute_value_t(u16=vlan_id) - rif_attribute3 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_VLAN_ID, - value=rif_attribute3_value) - rif_attr_list.append(rif_attribute3) - - #v4_enabled - rif_attribute4_value = sai_thrift_attribute_value_t(booldata=v4_enabled) - rif_attribute4 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE, - value=rif_attribute4_value) - rif_attr_list.append(rif_attribute4) - #v6_enabled - rif_attribute5_value = sai_thrift_attribute_value_t(booldata=v6_enabled) - rif_attribute5 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE, - value=rif_attribute5_value) - rif_attr_list.append(rif_attribute5) - - if mac: - rif_attribute6_value = sai_thrift_attribute_value_t(mac=mac) - rif_attribute6 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS, - value=rif_attribute6_value) - rif_attr_list.append(rif_attribute6) - - rif_id = client.sai_thrift_create_router_interface(rif_attr_list) - return rif_id - -def sai_thrift_create_route(client, vr_id, addr_family, ip_addr, ip_mask, nhop, packet_action=None): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - mask = sai_thrift_ip_t(ip4=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr, mask=mask) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - mask = sai_thrift_ip_t(ip6=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr, mask=mask) - route_attribute1_value = sai_thrift_attribute_value_t(oid=nhop) - route_attribute1 = sai_thrift_attribute_t(id=SAI_ROUTE_ATTR_NEXT_HOP_ID, - value=route_attribute1_value) - - route = sai_thrift_unicast_route_entry_t(vr_id, ip_prefix) - route_attr_list = [route_attribute1] - - if packet_action != None: - route_packet_action_value = sai_thrift_attribute_value_t(s32=packet_action) - route_packet_action_attr = sai_thrift_attribute_t(id=SAI_ROUTE_ATTR_PACKET_ACTION, value=route_packet_action_value) - route_attr_list.append(route_packet_action_attr) - - client.sai_thrift_create_route(thrift_unicast_route_entry=route, thrift_attr_list=route_attr_list) - return - -def sai_thrift_remove_route(client, vr_id, addr_family, ip_addr, ip_mask, nhop): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - mask = sai_thrift_ip_t(ip4=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr, mask=mask) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - mask = sai_thrift_ip_t(ip6=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr, mask=mask) - route = sai_thrift_unicast_route_entry_t(vr_id, ip_prefix) - client.sai_thrift_remove_route(thrift_unicast_route_entry=route) - -def sai_thrift_create_nhop(client, addr_family, ip_addr, rif_id): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - nhop_attribute1_value = sai_thrift_attribute_value_t(ipaddr=ipaddr) - nhop_attribute1 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_IP, - value=nhop_attribute1_value) - nhop_attribute2_value = sai_thrift_attribute_value_t(oid=rif_id) - nhop_attribute2 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID, - value=nhop_attribute2_value) - nhop_attribute3_value = sai_thrift_attribute_value_t(s32=SAI_NEXT_HOP_IP) - nhop_attribute3 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_TYPE, - value=nhop_attribute3_value) - nhop_attr_list = [nhop_attribute1, nhop_attribute2, nhop_attribute3] - nhop = client.sai_thrift_create_next_hop(thrift_attr_list=nhop_attr_list) - return nhop - -def sai_thrift_create_neighbor(client, addr_family, rif_id, ip_addr, dmac): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - neighbor_attribute1_value = sai_thrift_attribute_value_t(mac=dmac) - neighbor_attribute1 = sai_thrift_attribute_t(id=SAI_NEIGHBOR_ATTR_DST_MAC_ADDRESS, - value=neighbor_attribute1_value) - neighbor_attr_list = [neighbor_attribute1] - neighbor_entry = sai_thrift_neighbor_entry_t(rif_id=rif_id, ip_address=ipaddr) - client.sai_thrift_create_neighbor_entry(neighbor_entry, neighbor_attr_list) - -def sai_thrift_remove_neighbor(client, addr_family, rif_id, ip_addr, dmac): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - neighbor_entry = sai_thrift_neighbor_entry_t(rif_id=rif_id, ip_address=ipaddr) - client.sai_thrift_remove_neighbor_entry(neighbor_entry) - -def sai_thrift_create_next_hop_group(client, nhop_list): - nhop_group_attribute1_value = sai_thrift_attribute_value_t(s32=SAI_NEXT_HOP_GROUP_ECMP) - nhop_group_attribute1 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_GROUP_ATTR_TYPE, - value=nhop_group_attribute1_value) - nhop_objlist = sai_thrift_object_list_t(count=len(nhop_list), object_id_list=nhop_list) - nhop_group_attribute2_value = sai_thrift_attribute_value_t(objlist=nhop_objlist) - nhop_group_attribute2 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_LIST, - value=nhop_group_attribute2_value) - nhop_group_attr_list = [nhop_group_attribute1, nhop_group_attribute2] - nhop_group = client.sai_thrift_create_next_hop_group(thrift_attr_list=nhop_group_attr_list) - return nhop_group - -def sai_thrift_create_lag(client, port_list): - lag_port_list = sai_thrift_object_list_t(count=len(port_list), object_id_list=port_list) - lag1_attr_value = sai_thrift_attribute_value_t(objlist=lag_port_list) - lag1_attr = sai_thrift_attribute_t(id=SAI_LAG_ATTR_PORT_LIST, - value=lag1_attr_value) - lag_attr_list = [lag1_attr] - lag = client.sai_thrift_create_lag(lag_attr_list) - return lag - -def sai_thrift_create_lag_member(client, lag_id, port_id): - lag_member_attr1_value = sai_thrift_attribute_value_t(oid=lag_id) - lag_member_attr1 = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_LAG_ID, - value=lag_member_attr1_value) - lag_member_attr2_value = sai_thrift_attribute_value_t(oid=port_id) - lag_member_attr2 = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_PORT_ID, - value=lag_member_attr2_value) - lag_member_attr_list = [lag_member_attr1, lag_member_attr2] - lag_member_id = client.sai_thrift_create_lag_member(lag_member_attr_list) - return lag_member_id - -def sai_thrift_create_stp_entry(client, vlan_list): - vlanlist=sai_thrift_vlan_list_t(vlan_count=len(vlan_list), vlan_list=vlan_list) - stp_attribute1_value = sai_thrift_attribute_value_t(vlanlist=vlanlist) - stp_attribute1 = sai_thrift_attribute_t(id=SAI_STP_ATTR_VLAN_LIST, - value=stp_attribute1_value) - stp_attr_list = [stp_attribute1] - stp_id = client.sai_thrift_create_stp_entry(stp_attr_list) - return stp_id - - -def sai_thrift_set_hostif_trap_group(client, trap_group_id, policer_id): - policer_attr_value = sai_thrift_attribute_value_t(oid=policer_id) - policer_attr = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER, value=policer_attr_value) - status = client.sai_thrift_set_hostif_trap_group(trap_group_id, thrift_attr=policer_attr) - return status - -def sai_thrift_create_hostif_trap_group(client, queue_id, policer_id=None): - attr_list = [] - attribute_value = sai_thrift_attribute_value_t(u32=queue_id) - attribute = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE, value=attribute_value) - attr_list.append(attribute) - - if policer_id != None: - policer_attr_value = sai_thrift_attribute_value_t(oid=policer_id) - policer_attr = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER, value=policer_attr_value) - attr_list.append(policer_attr) - - trap_group_id = client.sai_thrift_create_hostif_trap_group(thrift_attr_list=attr_list) - return trap_group_id - -def sai_thrift_create_policer(client, meter_type, mode, cir, red_action): - attr_list = [] - - meter_attr_value = sai_thrift_attribute_value_t(s32=meter_type) - meter_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_METER_TYPE, value=meter_attr_value) - - mode_attr_value = sai_thrift_attribute_value_t(s32=mode) - mode_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_MODE, value=mode_attr_value) - - cir_attr_value = sai_thrift_attribute_value_t(u64=cir) - cir_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_CIR, value=cir_attr_value) - - red_action_attr_val = sai_thrift_attribute_value_t(s32=red_action) - red_action_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_RED_PACKET_ACTION, value=red_action_attr_val) - - attr_list.append(meter_attr) - attr_list.append(mode_attr) - attr_list.append(cir_attr) - attr_list.append(red_action_attr) - policer_id = client.sai_thrift_create_policer(attr_list) - - return policer_id - -def sai_thrift_set_hostif_trap(client, trap_id, action, priority=None, channel=None, trap_group_id=None): - - if channel != None: - attribute3_value = sai_thrift_attribute_value_t(s32=channel) - attribute3 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_CHANNEL, value=attribute3_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute3) - - if trap_group_id != None: - attribute4_value = sai_thrift_attribute_value_t(oid=trap_group_id) - attribute4 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP, value=attribute4_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute4) - - attribute1_value = sai_thrift_attribute_value_t(s32=action) - attribute1 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION, value=attribute1_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute1) - - if priority != None: - attribute2_value = sai_thrift_attribute_value_t(u32=priority) - attribute2 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY, value=attribute2_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute2) - -def sai_thrift_create_hostif(client, rif_or_port_id, intf_name): - attribute1_value = sai_thrift_attribute_value_t(s32=SAI_HOSTIF_TYPE_NETDEV) - attribute1 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_TYPE, - value=attribute1_value) - attribute2_value = sai_thrift_attribute_value_t(oid=rif_or_port_id) - attribute2 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_RIF_OR_PORT_ID, - value=attribute2_value) - attribute3_value = sai_thrift_attribute_value_t(chardata=intf_name) - attribute3 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_NAME, - value=attribute3_value) - attr_list = [attribute1, attribute2, attribute3] - hif_id = client.sai_thrift_create_hostif(attr_list) - return hif_id - -def sai_thrift_create_acl_table(client, addr_family, - ip_src, ip_dst, - ip_proto, - in_ports, out_ports, - in_port, out_port): - #print "aaa" - acl_attr_list = [] - if ip_src != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_SRC_IP, - value=attribute_value) - acl_attr_list.append(attribute) - if ip_dst != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_DST_IP, - value=attribute_value) - acl_attr_list.append(attribute) - if ip_proto != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL, - value=attribute_value) - acl_attr_list.append(attribute) - if in_ports: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - if out_ports: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - if in_port != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IN_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - if out_port != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=0) #TODO: Expose stage as function parameter - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_STAGE, value=attribute_value) - acl_attr_list.append(attribute) - - #print "bbb" - acl_table_id = client.sai_thrift_create_acl_table(acl_attr_list) - #print acl_table_id - return acl_table_id - -def sai_thrift_create_acl_entry(client, acl_table_id, - action, addr_family, - ip_src, ip_src_mask, - ip_dst, ip_dst_mask, - ip_proto, - in_port_list, out_port_list, - in_port, out_port, - ingress_mirror, egress_mirror): - acl_attr_list = [] - - #OID - attribute_value = sai_thrift_attribute_value_t(oid=acl_table_id) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_TABLE_ID, - value=attribute_value) - acl_attr_list.append(attribute) - - #Priority - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(u32=10))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_PRIORITY, - value=attribute_value) - acl_attr_list.append(attribute) - - #Ip source - if ip_src != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(ip4=ip_src), mask =sai_thrift_acl_mask_t(ip4=ip_src_mask))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP, - value=attribute_value) - acl_attr_list.append(attribute) - - #Input ports - if in_port_list: - acl_port_list = sai_thrift_object_list_t(count=len(in_port_list), object_id_list=in_port_list) - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(objlist=acl_port_list))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - - #Output ports - if out_port_list: - acl_port_list = sai_thrift_object_list_t(count=len(out_port_list), object_id_list=out_port_list) - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(objlist=acl_port_list))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - - if in_port != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(oid=in_port))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - if out_port != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(oid=out_port))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - #Packet action - if action == 1: - #Drop - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(u32=0))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_PACKET_ACTION, - value=attribute_value) - acl_attr_list.append(attribute) - elif action == 2: - #Ingress mirroring - if ingress_mirror != None: - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(oid=ingress_mirror))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS, value=attribute_value) - acl_attr_list.append(attribute) - elif egress_mirror != None: - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(oid=egress_mirror))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS, value=attribute_value) - acl_attr_list.append(attribute) - - acl_entry_id = client.sai_thrift_create_acl_entry(acl_attr_list) - return acl_entry_id - -def sai_thrift_create_mirror_session(client, mirror_type, port, - vlan, vlan_priority, vlan_tpid, - src_mac, dst_mac, - addr_family, src_ip, dst_ip, - encap_type, protocol, ttl, tos): - mirror_attr_list = [] - - #Mirror type - attribute1_value = sai_thrift_attribute_value_t(u8=mirror_type) - attribute1 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_TYPE, - value=attribute1_value) - mirror_attr_list.append(attribute1) - - #Monitor port - attribute2_value = sai_thrift_attribute_value_t(oid=port) - attribute2 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_MONITOR_PORT, - value=attribute2_value) - mirror_attr_list.append(attribute2) - - if mirror_type == SAI_MIRROR_TYPE_LOCAL: - attribute4_value = sai_thrift_attribute_value_t(u16=vlan) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_ID, - value=attribute4_value) - mirror_attr_list.append(attribute4) - elif mirror_type == SAI_MIRROR_TYPE_REMOTE: - #vlan tpid - attribute3_value = sai_thrift_attribute_value_t(u16=vlan_tpid) - attribute3 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_TPID, - value=attribute3_value) - mirror_attr_list.append(attribute3) - - #vlan - attribute4_value = sai_thrift_attribute_value_t(u16=vlan) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_ID, - value=attribute4_value) - mirror_attr_list.append(attribute4) - - #vlan priority - attribute5_value = sai_thrift_attribute_value_t(u16=vlan_priority) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_PRI, - value=attribute5_value) - mirror_attr_list.append(attribute5) - elif mirror_type == SAI_MIRROR_TYPE_ENHANCED_REMOTE: - #encap type - attribute3_value = sai_thrift_attribute_value_t(u8=encap_type) - attribute3 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_ENCAP_TYPE, - value=attribute3_value) - mirror_attr_list.append(attribute3) - - #source ip - addr = sai_thrift_ip_t(ip4=src_ip) - src_ip_addr = sai_thrift_ip_address_t(addr_family=addr_family, addr=addr) - attribute4_value = sai_thrift_attribute_value_t(ipaddr=src_ip_addr) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS, - value=attribute4_value) - mirror_attr_list.append(attribute4) - - #dst ip - addr = sai_thrift_ip_t(ip4=dst_ip) - dst_ip_addr = sai_thrift_ip_address_t(addr_family=addr_family, addr=addr) - attribute5_value = sai_thrift_attribute_value_t(ipaddr=dst_ip_addr) - attribute5 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS, - value=attribute5_value) - mirror_attr_list.append(attribute5) - - #source mac - attribute6_value = sai_thrift_attribute_value_t(mac=src_mac) - attribute6 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS, - value=attribute6_value) - mirror_attr_list.append(attribute6) - - #dst mac - attribute7_value = sai_thrift_attribute_value_t(mac=dst_mac) - attribute7 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS, - value=attribute7_value) - mirror_attr_list.append(attribute7) - - mirror_id = client.sai_thrift_create_mirror_session(mirror_attr_list) - return mirror_id - -def sai_thrift_create_scheduler_profile(client, max_rate, algorithm=0): - scheduler_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(u64=max_rate) - attribute = sai_thrift_attribute_t(id=SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE , - value=attribute_value) - scheduler_attr_list.append(attribute) - attribute_value = sai_thrift_attribute_value_t(s32=algorithm) - attribute = sai_thrift_attribute_t(id=SAI_SCHEDULER_ATTR_SCHEDULING_ALGORITHM , - value=attribute_value) - scheduler_attr_list.append(attribute) - scheduler_profile_id = client.sai_thrift_create_scheduler_profile(scheduler_attr_list) - return scheduler_profile_id - -def sai_thrift_create_buffer_profile(client, pool_id, size, threshold, xoff_th, xon_th): - buffer_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(oid=pool_id) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_POOL_ID , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=size) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u8=threshold) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=xoff_th) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_XOFF_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=xon_th) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_XON_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - buffer_profile_id = client.sai_thrift_create_buffer_profile(buffer_attr_list) - return buffer_profile_id - -def sai_thrift_create_pool_profile(client, pool_type, size, threshold_mode): - pool_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(s32=pool_type) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_TYPE , - value=attribute_value) - pool_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=size) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_SIZE , - value=attribute_value) - pool_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(s32=threshold_mode) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_TH_MODE , - value=attribute_value) - pool_attr_list.append(attribute) - pool_id = client.sai_thrift_create_pool_profile(pool_attr_list) - return pool_id - -def sai_thrift_clear_all_counters(client): - for port in sai_port_list: - queue_list=[] - client.sai_thrift_clear_port_all_stats(port) - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_QOS_QUEUE_LIST: - for queue_id in attribute.value.objlist.object_id_list: - queue_list.append(queue_id) - - cnt_ids=[] - cnt_ids.append(SAI_QUEUE_STAT_PACKETS) - for queue in queue_list: - client.sai_thrift_clear_queue_stats(queue,cnt_ids,len(cnt_ids)) - -def sai_thrift_read_port_counters(client,port): - port_cnt_ids=[] - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_DISCARDS) - port_cnt_ids.append(SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_0_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_1_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_2_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_3_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_4_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_5_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_6_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_7_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_OCTETS) - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_UCAST_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_IF_IN_UCAST_PKTS) - counters_results=[] - counters_results = client.sai_thrift_get_port_stats(port,port_cnt_ids,len(port_cnt_ids)) - queue_list=[] - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_QOS_QUEUE_LIST: - for queue_id in attribute.value.objlist.object_id_list: - queue_list.append(queue_id) - cnt_ids=[] - thrift_results=[] - queue_counters_results=[] - cnt_ids.append(SAI_QUEUE_STAT_PACKETS) - queue1=0 - for queue in queue_list: - if queue1 <= 7: - thrift_results=client.sai_thrift_get_queue_stats(queue,cnt_ids,len(cnt_ids)) - queue_counters_results.append(thrift_results[0]) - queue1+=1 - return (counters_results, queue_counters_results) - -def sai_thrift_create_vlan_member(client, vlan_id, port_id, tagging_mode): - vlan_member_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(s32=vlan_id) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_VLAN_ID, - value=attribute_value) - vlan_member_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(oid=port_id) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_PORT_ID, - value=attribute_value) - vlan_member_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(s32=tagging_mode) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_TAGGING_MODE, - value=attribute_value) - vlan_member_attr_list.append(attribute) - vlan_member_id = client.sai_thrift_create_vlan_member(vlan_member_attr_list) - return vlan_member_id - -def sai_thrift_vlan_remove_all_ports(client, vid): - vlan_members_list = [] - - vlan_attr_list = client.sai_thrift_get_vlan_attribute(vid) - attr_list = vlan_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_VLAN_ATTR_MEMBER_LIST: - for vlan_member in attribute.value.objlist.object_id_list: - vlan_members_list.append(vlan_member) - - for vlan_member in vlan_members_list: - client.sai_thrift_remove_vlan_member(vlan_member) - -def sai_thrift_set_port_shaper(client, port_id, max_rate): - sched_prof_id=sai_thrift_create_scheduler_profile(client, max_rate) - attr_value = sai_thrift_attribute_value_t(oid=sched_prof_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID, value=attr_value) - client.sai_thrift_set_port_attribute(port_id,attr) diff --git a/bm/sai_adapter/test/ptf_tests/wip_tests/sai_base_test.py b/bm/sai_adapter/test/ptf_tests/wip_tests/sai_base_test.py deleted file mode 100644 index a027eb2c0..000000000 --- a/bm/sai_adapter/test/ptf_tests/wip_tests/sai_base_test.py +++ /dev/null @@ -1,106 +0,0 @@ -""" -Base classes for test cases - -Tests will usually inherit from one of these classes to have the controller -and/or dataplane automatically set up. -""" - -import os -import logging -import unittest - - -import ptf -from ptf.base_tests import BaseTest -from ptf import config -import ptf.dataplane as dataplane -import ptf.testutils as testutils - -################################################################ -# -# Thrift interface base tests -# -################################################################ -import sys -sys.path.append('../sai_thrift_src/gen-py') -import switch_sai.switch_sai_rpc as switch_sai_rpc -from thrift.transport import TSocket -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol - -interface_to_front_mapping = {} -port_map_loaded=0 - -class ThriftInterface(BaseTest): - - def loadPortMap(self): - global port_map_loaded - if port_map_loaded: - print 'port_map already loaded' - return - - if self.test_params.has_key("port_map"): - user_input = self.test_params['port_map'] - splitted_map = user_input.split(",") - for item in splitted_map: - interface_front_pair = item.split("@") - interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1] - elif self.test_params.has_key("port_map_file"): - user_input = self.test_params['port_map_file'] - f = open(user_input, 'r') - for line in f: - if (len(line) > 0 and (line[0] == '#' or line[0] == ';' or line[0]=='/')): - continue; - interface_front_pair = line.split("@") - interface_to_front_mapping[interface_front_pair[0]] = interface_front_pair[1].strip() - else: - exit("No ptf interface<-> switch front port mapping, please specify as parameter or in external file") - return - - def createRpcClient(self): - # Set up thrift client and contact server - - if self.test_params.has_key("server"): - server = self.test_params['server'] - else: - server = 'localhost' - - self.transport = TSocket.TSocket(server, 9092) - self.transport = TTransport.TBufferedTransport(self.transport) - self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport) - - self.client = switch_sai_rpc.Client(self.protocol) - self.transport.open() - return - - def setUp(self): - global interface_to_front_mapping - BaseTest.setUp(self) - self.test_params = testutils.test_params_get() - self.loadPortMap() - self.createRpcClient() - return - - def tearDown(self): - if config["log_dir"] != None: - self.dataplane.stop_pcap() - BaseTest.tearDown(self) - self.transport.close() - -class ThriftInterfaceDataPlane(ThriftInterface): - """ - Root class that sets up the thrift interface and dataplane - """ - def setUp(self): - ThriftInterface.setUp(self) - self.dataplane = ptf.dataplane_instance - if self.dataplane != None: - self.dataplane.flush() - if config["log_dir"] != None: - filename = os.path.join(config["log_dir"], str(self)) + ".pcap" - self.dataplane.start_pcap(filename) - - def tearDown(self): - if config["log_dir"] != None: - self.dataplane.stop_pcap() - ThriftInterface.tearDown(self) diff --git a/bm/sai_adapter/test/ptf_tests/wip_tests/sai_types.py b/bm/sai_adapter/test/ptf_tests/wip_tests/sai_types.py deleted file mode 100644 index 42ef9fea6..000000000 --- a/bm/sai_adapter/test/ptf_tests/wip_tests/sai_types.py +++ /dev/null @@ -1,6645 +0,0 @@ -'''Wrapper for saiacl.h - -Generated with: -/usr/local/bin/ctypesgen.py /usr/include/sai/saiacl.h /usr/include/sai/saibridge.h /usr/include/sai/saibuffer.h /usr/include/sai/saifdb.h /usr/include/sai/sai.h /usr/include/sai/saihash.h /usr/include/sai/saihostintf.h /usr/include/sai/saiipmcgroup.h /usr/include/sai/saiipmc.h /usr/include/sai/sail2mcgroup.h /usr/include/sai/sail2mc.h /usr/include/sai/sailag.h /usr/include/sai/saimcfdb.h /usr/include/sai/saimirror.h /usr/include/sai/saineighbor.h /usr/include/sai/sainexthopgroup.h /usr/include/sai/sainexthop.h /usr/include/sai/saiobject.h /usr/include/sai/saipolicer.h /usr/include/sai/saiport.h /usr/include/sai/saiqosmaps.h /usr/include/sai/saiqueue.h /usr/include/sai/sairoute.h /usr/include/sai/sairouter.h /usr/include/sai/sairouterintf.h /usr/include/sai/sairpfgroup.h /usr/include/sai/saisamplepacket.h /usr/include/sai/saischedulergroup.h /usr/include/sai/saischeduler.h /usr/include/sai/saistatus.h /usr/include/sai/saistp.h /usr/include/sai/saiswitch.h /usr/include/sai/saitunnel.h /usr/include/sai/saitypes.h /usr/include/sai/saiudf.h /usr/include/sai/saivlan.h /usr/include/sai/saiwred.h -o sai_types.py -I /usr/include/sai/ - -Do not modify this file. -''' - -__docformat__ = 'restructuredtext' - -# Begin preamble - -import ctypes, os, sys -from ctypes import * - -_int_types = (c_int16, c_int32) -if hasattr(ctypes, 'c_int64'): - # Some builds of ctypes apparently do not have c_int64 - # defined; it's a pretty good bet that these builds do not - # have 64-bit pointers. - _int_types += (c_int64,) -for t in _int_types: - if sizeof(t) == sizeof(c_size_t): - c_ptrdiff_t = t -del t -del _int_types - -class c_void(Structure): - # c_void_p is a buggy return type, converting to int, so - # POINTER(None) == c_void_p is actually written as - # POINTER(c_void), so it can be treated as a real pointer. - _fields_ = [('dummy', c_int)] - -def POINTER(obj): - p = ctypes.POINTER(obj) - - # Convert None to a real NULL pointer to work around bugs - # in how ctypes handles None on 64-bit platforms - if not isinstance(p.from_param, classmethod): - def from_param(cls, x): - if x is None: - return cls() - else: - return x - p.from_param = classmethod(from_param) - - return p - -class UserString: - def __init__(self, seq): - if isinstance(seq, basestring): - self.data = seq - elif isinstance(seq, UserString): - self.data = seq.data[:] - else: - self.data = str(seq) - def __str__(self): return str(self.data) - def __repr__(self): return repr(self.data) - def __int__(self): return int(self.data) - def __long__(self): return long(self.data) - def __float__(self): return float(self.data) - def __complex__(self): return complex(self.data) - def __hash__(self): return hash(self.data) - - def __cmp__(self, string): - if isinstance(string, UserString): - return cmp(self.data, string.data) - else: - return cmp(self.data, string) - def __contains__(self, char): - return char in self.data - - def __len__(self): return len(self.data) - def __getitem__(self, index): return self.__class__(self.data[index]) - def __getslice__(self, start, end): - start = max(start, 0); end = max(end, 0) - return self.__class__(self.data[start:end]) - - def __add__(self, other): - if isinstance(other, UserString): - return self.__class__(self.data + other.data) - elif isinstance(other, basestring): - return self.__class__(self.data + other) - else: - return self.__class__(self.data + str(other)) - def __radd__(self, other): - if isinstance(other, basestring): - return self.__class__(other + self.data) - else: - return self.__class__(str(other) + self.data) - def __mul__(self, n): - return self.__class__(self.data*n) - __rmul__ = __mul__ - def __mod__(self, args): - return self.__class__(self.data % args) - - # the following methods are defined in alphabetical order: - def capitalize(self): return self.__class__(self.data.capitalize()) - def center(self, width, *args): - return self.__class__(self.data.center(width, *args)) - def count(self, sub, start=0, end=sys.maxint): - return self.data.count(sub, start, end) - def decode(self, encoding=None, errors=None): # XXX improve this? - if encoding: - if errors: - return self.__class__(self.data.decode(encoding, errors)) - else: - return self.__class__(self.data.decode(encoding)) - else: - return self.__class__(self.data.decode()) - def encode(self, encoding=None, errors=None): # XXX improve this? - if encoding: - if errors: - return self.__class__(self.data.encode(encoding, errors)) - else: - return self.__class__(self.data.encode(encoding)) - else: - return self.__class__(self.data.encode()) - def endswith(self, suffix, start=0, end=sys.maxint): - return self.data.endswith(suffix, start, end) - def expandtabs(self, tabsize=8): - return self.__class__(self.data.expandtabs(tabsize)) - def find(self, sub, start=0, end=sys.maxint): - return self.data.find(sub, start, end) - def index(self, sub, start=0, end=sys.maxint): - return self.data.index(sub, start, end) - def isalpha(self): return self.data.isalpha() - def isalnum(self): return self.data.isalnum() - def isdecimal(self): return self.data.isdecimal() - def isdigit(self): return self.data.isdigit() - def islower(self): return self.data.islower() - def isnumeric(self): return self.data.isnumeric() - def isspace(self): return self.data.isspace() - def istitle(self): return self.data.istitle() - def isupper(self): return self.data.isupper() - def join(self, seq): return self.data.join(seq) - def ljust(self, width, *args): - return self.__class__(self.data.ljust(width, *args)) - def lower(self): return self.__class__(self.data.lower()) - def lstrip(self, chars=None): return self.__class__(self.data.lstrip(chars)) - def partition(self, sep): - return self.data.partition(sep) - def replace(self, old, new, maxsplit=-1): - return self.__class__(self.data.replace(old, new, maxsplit)) - def rfind(self, sub, start=0, end=sys.maxint): - return self.data.rfind(sub, start, end) - def rindex(self, sub, start=0, end=sys.maxint): - return self.data.rindex(sub, start, end) - def rjust(self, width, *args): - return self.__class__(self.data.rjust(width, *args)) - def rpartition(self, sep): - return self.data.rpartition(sep) - def rstrip(self, chars=None): return self.__class__(self.data.rstrip(chars)) - def split(self, sep=None, maxsplit=-1): - return self.data.split(sep, maxsplit) - def rsplit(self, sep=None, maxsplit=-1): - return self.data.rsplit(sep, maxsplit) - def splitlines(self, keepends=0): return self.data.splitlines(keepends) - def startswith(self, prefix, start=0, end=sys.maxint): - return self.data.startswith(prefix, start, end) - def strip(self, chars=None): return self.__class__(self.data.strip(chars)) - def swapcase(self): return self.__class__(self.data.swapcase()) - def title(self): return self.__class__(self.data.title()) - def translate(self, *args): - return self.__class__(self.data.translate(*args)) - def upper(self): return self.__class__(self.data.upper()) - def zfill(self, width): return self.__class__(self.data.zfill(width)) - -class MutableString(UserString): - """mutable string objects - - Python strings are immutable objects. This has the advantage, that - strings may be used as dictionary keys. If this property isn't needed - and you insist on changing string values in place instead, you may cheat - and use MutableString. - - But the purpose of this class is an educational one: to prevent - people from inventing their own mutable string class derived - from UserString and than forget thereby to remove (override) the - __hash__ method inherited from UserString. This would lead to - errors that would be very hard to track down. - - A faster and better solution is to rewrite your program using lists.""" - def __init__(self, string=""): - self.data = string - def __hash__(self): - raise TypeError("unhashable type (it is mutable)") - def __setitem__(self, index, sub): - if index < 0: - index += len(self.data) - if index < 0 or index >= len(self.data): raise IndexError - self.data = self.data[:index] + sub + self.data[index+1:] - def __delitem__(self, index): - if index < 0: - index += len(self.data) - if index < 0 or index >= len(self.data): raise IndexError - self.data = self.data[:index] + self.data[index+1:] - def __setslice__(self, start, end, sub): - start = max(start, 0); end = max(end, 0) - if isinstance(sub, UserString): - self.data = self.data[:start]+sub.data+self.data[end:] - elif isinstance(sub, basestring): - self.data = self.data[:start]+sub+self.data[end:] - else: - self.data = self.data[:start]+str(sub)+self.data[end:] - def __delslice__(self, start, end): - start = max(start, 0); end = max(end, 0) - self.data = self.data[:start] + self.data[end:] - def immutable(self): - return UserString(self.data) - def __iadd__(self, other): - if isinstance(other, UserString): - self.data += other.data - elif isinstance(other, basestring): - self.data += other - else: - self.data += str(other) - return self - def __imul__(self, n): - self.data *= n - return self - -class String(MutableString, Union): - - _fields_ = [('raw', POINTER(c_char)), - ('data', c_char_p)] - - def __init__(self, obj=""): - if isinstance(obj, (str, unicode, UserString)): - self.data = str(obj) - else: - self.raw = obj - - def __len__(self): - return self.data and len(self.data) or 0 - - def from_param(cls, obj): - # Convert None or 0 - if obj is None or obj == 0: - return cls(POINTER(c_char)()) - - # Convert from String - elif isinstance(obj, String): - return obj - - # Convert from str - elif isinstance(obj, str): - return cls(obj) - - # Convert from c_char_p - elif isinstance(obj, c_char_p): - return obj - - # Convert from POINTER(c_char) - elif isinstance(obj, POINTER(c_char)): - return obj - - # Convert from raw pointer - elif isinstance(obj, int): - return cls(cast(obj, POINTER(c_char))) - - # Convert from object - else: - return String.from_param(obj._as_parameter_) - from_param = classmethod(from_param) - -def ReturnString(obj, func=None, arguments=None): - return String.from_param(obj) - -# As of ctypes 1.0, ctypes does not support custom error-checking -# functions on callbacks, nor does it support custom datatypes on -# callbacks, so we must ensure that all callbacks return -# primitive datatypes. -# -# Non-primitive return values wrapped with UNCHECKED won't be -# typechecked, and will be converted to c_void_p. -def UNCHECKED(type): - if (hasattr(type, "_type_") and isinstance(type._type_, str) - and type._type_ != "P"): - return type - else: - return c_void_p - -# ctypes doesn't have direct support for variadic functions, so we have to write -# our own wrapper class -class _variadic_function(object): - def __init__(self,func,restype,argtypes): - self.func=func - self.func.restype=restype - self.argtypes=argtypes - def _as_parameter_(self): - # So we can pass this variadic function as a function pointer - return self.func - def __call__(self,*args): - fixed_args=[] - i=0 - for argtype in self.argtypes: - # Typecheck what we can - fixed_args.append(argtype.from_param(args[i])) - i+=1 - return self.func(*fixed_args+list(args[i:])) - -# End preamble - -_libs = {} -_libdirs = [] - -# Begin loader - -# ---------------------------------------------------------------------------- -# Copyright (c) 2008 David James -# Copyright (c) 2006-2008 Alex Holkner -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of pyglet nor the names of its -# contributors may be used to endorse or promote products -# derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# ---------------------------------------------------------------------------- - -import os.path, re, sys, glob -import platform -import ctypes -import ctypes.util - -def _environ_path(name): - if name in os.environ: - return os.environ[name].split(":") - else: - return [] - -class LibraryLoader(object): - def __init__(self): - self.other_dirs=[] - - def load_library(self,libname): - """Given the name of a library, load it.""" - paths = self.getpaths(libname) - - for path in paths: - if os.path.exists(path): - return self.load(path) - - raise ImportError("%s not found." % libname) - - def load(self,path): - """Given a path to a library, load it.""" - try: - # Darwin requires dlopen to be called with mode RTLD_GLOBAL instead - # of the default RTLD_LOCAL. Without this, you end up with - # libraries not being loadable, resulting in "Symbol not found" - # errors - if sys.platform == 'darwin': - return ctypes.CDLL(path, ctypes.RTLD_GLOBAL) - else: - return ctypes.cdll.LoadLibrary(path) - except OSError,e: - raise ImportError(e) - - def getpaths(self,libname): - """Return a list of paths where the library might be found.""" - if os.path.isabs(libname): - yield libname - else: - # FIXME / TODO return '.' and os.path.dirname(__file__) - for path in self.getplatformpaths(libname): - yield path - - path = ctypes.util.find_library(libname) - if path: yield path - - def getplatformpaths(self, libname): - return [] - -# Darwin (Mac OS X) - -class DarwinLibraryLoader(LibraryLoader): - name_formats = ["lib%s.dylib", "lib%s.so", "lib%s.bundle", "%s.dylib", - "%s.so", "%s.bundle", "%s"] - - def getplatformpaths(self,libname): - if os.path.pathsep in libname: - names = [libname] - else: - names = [format % libname for format in self.name_formats] - - for dir in self.getdirs(libname): - for name in names: - yield os.path.join(dir,name) - - def getdirs(self,libname): - '''Implements the dylib search as specified in Apple documentation: - - http://developer.apple.com/documentation/DeveloperTools/Conceptual/ - DynamicLibraries/Articles/DynamicLibraryUsageGuidelines.html - - Before commencing the standard search, the method first checks - the bundle's ``Frameworks`` directory if the application is running - within a bundle (OS X .app). - ''' - - dyld_fallback_library_path = _environ_path("DYLD_FALLBACK_LIBRARY_PATH") - if not dyld_fallback_library_path: - dyld_fallback_library_path = [os.path.expanduser('~/lib'), - '/usr/local/lib', '/usr/lib'] - - dirs = [] - - if '/' in libname: - dirs.extend(_environ_path("DYLD_LIBRARY_PATH")) - else: - dirs.extend(_environ_path("LD_LIBRARY_PATH")) - dirs.extend(_environ_path("DYLD_LIBRARY_PATH")) - - dirs.extend(self.other_dirs) - dirs.append(".") - dirs.append(os.path.dirname(__file__)) - - if hasattr(sys, 'frozen') and sys.frozen == 'macosx_app': - dirs.append(os.path.join( - os.environ['RESOURCEPATH'], - '..', - 'Frameworks')) - - dirs.extend(dyld_fallback_library_path) - - return dirs - -# Posix - -class PosixLibraryLoader(LibraryLoader): - _ld_so_cache = None - - def _create_ld_so_cache(self): - # Recreate search path followed by ld.so. This is going to be - # slow to build, and incorrect (ld.so uses ld.so.cache, which may - # not be up-to-date). Used only as fallback for distros without - # /sbin/ldconfig. - # - # We assume the DT_RPATH and DT_RUNPATH binary sections are omitted. - - directories = [] - for name in ("LD_LIBRARY_PATH", - "SHLIB_PATH", # HPUX - "LIBPATH", # OS/2, AIX - "LIBRARY_PATH", # BE/OS - ): - if name in os.environ: - directories.extend(os.environ[name].split(os.pathsep)) - directories.extend(self.other_dirs) - directories.append(".") - directories.append(os.path.dirname(__file__)) - - try: directories.extend([dir.strip() for dir in open('/etc/ld.so.conf')]) - except IOError: pass - - unix_lib_dirs_list = ['/lib', '/usr/lib', '/lib64', '/usr/lib64'] - if sys.platform.startswith('linux'): - # Try and support multiarch work in Ubuntu - # https://wiki.ubuntu.com/MultiarchSpec - bitage = platform.architecture()[0] - if bitage.startswith('32'): - # Assume Intel/AMD x86 compat - unix_lib_dirs_list += ['/lib/i386-linux-gnu', '/usr/lib/i386-linux-gnu'] - elif bitage.startswith('64'): - # Assume Intel/AMD x86 compat - unix_lib_dirs_list += ['/lib/x86_64-linux-gnu', '/usr/lib/x86_64-linux-gnu'] - else: - # guess... - unix_lib_dirs_list += glob.glob('/lib/*linux-gnu') - directories.extend(unix_lib_dirs_list) - - cache = {} - lib_re = re.compile(r'lib(.*)\.s[ol]') - ext_re = re.compile(r'\.s[ol]$') - for dir in directories: - try: - for path in glob.glob("%s/*.s[ol]*" % dir): - file = os.path.basename(path) - - # Index by filename - if file not in cache: - cache[file] = path - - # Index by library name - match = lib_re.match(file) - if match: - library = match.group(1) - if library not in cache: - cache[library] = path - except OSError: - pass - - self._ld_so_cache = cache - - def getplatformpaths(self, libname): - if self._ld_so_cache is None: - self._create_ld_so_cache() - - result = self._ld_so_cache.get(libname) - if result: yield result - - path = ctypes.util.find_library(libname) - if path: yield os.path.join("/lib",path) - -# Windows - -class _WindowsLibrary(object): - def __init__(self, path): - self.cdll = ctypes.cdll.LoadLibrary(path) - self.windll = ctypes.windll.LoadLibrary(path) - - def __getattr__(self, name): - try: return getattr(self.cdll,name) - except AttributeError: - try: return getattr(self.windll,name) - except AttributeError: - raise - -class WindowsLibraryLoader(LibraryLoader): - name_formats = ["%s.dll", "lib%s.dll", "%slib.dll"] - - def load_library(self, libname): - try: - result = LibraryLoader.load_library(self, libname) - except ImportError: - result = None - if os.path.sep not in libname: - for name in self.name_formats: - try: - result = getattr(ctypes.cdll, name % libname) - if result: - break - except WindowsError: - result = None - if result is None: - try: - result = getattr(ctypes.cdll, libname) - except WindowsError: - result = None - if result is None: - raise ImportError("%s not found." % libname) - return result - - def load(self, path): - return _WindowsLibrary(path) - - def getplatformpaths(self, libname): - if os.path.sep not in libname: - for name in self.name_formats: - dll_in_current_dir = os.path.abspath(name % libname) - if os.path.exists(dll_in_current_dir): - yield dll_in_current_dir - path = ctypes.util.find_library(name % libname) - if path: - yield path - -# Platform switching - -# If your value of sys.platform does not appear in this dict, please contact -# the Ctypesgen maintainers. - -loaderclass = { - "darwin": DarwinLibraryLoader, - "cygwin": WindowsLibraryLoader, - "win32": WindowsLibraryLoader -} - -loader = loaderclass.get(sys.platform, PosixLibraryLoader)() - -def add_library_search_dirs(other_dirs): - loader.other_dirs = other_dirs - -load_library = loader.load_library - -del loaderclass - -# End loader - -add_library_search_dirs([]) - -# No libraries - -# No modules - -sai_status_t = c_int32 # /usr/include/sai/saitypes.h: 84 - -sai_switch_profile_id_t = c_uint32 # /usr/include/sai/saitypes.h: 85 - -sai_vlan_id_t = c_uint16 # /usr/include/sai/saitypes.h: 86 - -sai_attr_id_t = c_uint32 # /usr/include/sai/saitypes.h: 87 - -sai_cos_t = c_uint8 # /usr/include/sai/saitypes.h: 88 - -sai_queue_index_t = c_uint8 # /usr/include/sai/saitypes.h: 89 - -sai_mac_t = c_uint8 * 6 # /usr/include/sai/saitypes.h: 90 - -sai_ip4_t = c_uint32 # /usr/include/sai/saitypes.h: 91 - -sai_ip6_t = c_uint8 * 16 # /usr/include/sai/saitypes.h: 92 - -sai_switch_hash_seed_t = c_uint32 # /usr/include/sai/saitypes.h: 93 - -sai_uint64_t = c_uint64 # /usr/include/sai/saitypes.h: 107 - -sai_int64_t = c_int64 # /usr/include/sai/saitypes.h: 108 - -sai_uint32_t = c_uint32 # /usr/include/sai/saitypes.h: 109 - -sai_int32_t = c_int32 # /usr/include/sai/saitypes.h: 110 - -sai_uint16_t = c_uint16 # /usr/include/sai/saitypes.h: 111 - -sai_int16_t = c_int16 # /usr/include/sai/saitypes.h: 112 - -sai_uint8_t = c_uint8 # /usr/include/sai/saitypes.h: 113 - -sai_int8_t = c_int8 # /usr/include/sai/saitypes.h: 114 - -sai_size_t = c_size_t # /usr/include/sai/saitypes.h: 115 - -sai_object_id_t = c_uint64 # /usr/include/sai/saitypes.h: 116 - -sai_pointer_t = POINTER(None) # /usr/include/sai/saitypes.h: 117 - -# /usr/include/sai/saitypes.h: 143 -class struct__sai_object_list_t(Structure): - pass - -struct__sai_object_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_object_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_object_id_t)), -] - -sai_object_list_t = struct__sai_object_list_t # /usr/include/sai/saitypes.h: 143 - -enum__sai_common_api_t = c_int # /usr/include/sai/saitypes.h: 154 - -SAI_COMMON_API_CREATE = 0 # /usr/include/sai/saitypes.h: 154 - -SAI_COMMON_API_REMOVE = 1 # /usr/include/sai/saitypes.h: 154 - -SAI_COMMON_API_SET = 2 # /usr/include/sai/saitypes.h: 154 - -SAI_COMMON_API_GET = 3 # /usr/include/sai/saitypes.h: 154 - -SAI_COMMON_API_MAX = 4 # /usr/include/sai/saitypes.h: 154 - -sai_common_api_t = enum__sai_common_api_t # /usr/include/sai/saitypes.h: 154 - -enum__sai_object_type_t = c_int # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_NULL = 0 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_PORT = 1 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_LAG = 2 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_VIRTUAL_ROUTER = 3 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_NEXT_HOP = 4 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_NEXT_HOP_GROUP = 5 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ROUTER_INTERFACE = 6 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ACL_TABLE = 7 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ACL_ENTRY = 8 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ACL_COUNTER = 9 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ACL_RANGE = 10 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ACL_TABLE_GROUP = 11 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ACL_TABLE_GROUP_MEMBER = 12 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_HOSTIF = 13 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_MIRROR_SESSION = 14 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_SAMPLEPACKET = 15 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_STP = 16 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_HOSTIF_TRAP_GROUP = 17 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_POLICER = 18 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_WRED = 19 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_QOS_MAP = 20 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_QUEUE = 21 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_SCHEDULER = 22 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_SCHEDULER_GROUP = 23 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_BUFFER_POOL = 24 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_BUFFER_PROFILE = 25 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_INGRESS_PRIORITY_GROUP = 26 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_LAG_MEMBER = 27 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_HASH = 28 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_UDF = 29 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_UDF_MATCH = 30 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_UDF_GROUP = 31 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_FDB_ENTRY = 32 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_SWITCH = 33 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_HOSTIF_TRAP = 34 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_HOSTIF_TABLE_ENTRY = 35 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_NEIGHBOR_ENTRY = 36 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_ROUTE_ENTRY = 37 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_VLAN = 38 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_VLAN_MEMBER = 39 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_HOSTIF_PACKET = 40 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_TUNNEL_MAP = 41 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_TUNNEL = 42 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY = 43 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_FDB_FLUSH = 44 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_NEXT_HOP_GROUP_MEMBER = 45 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_STP_PORT = 46 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_RPF_GROUP = 47 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_RPF_GROUP_MEMBER = 48 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_L2MC_GROUP = 49 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_L2MC_GROUP_MEMBER = 50 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_IPMC_GROUP = 51 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_IPMC_GROUP_MEMBER = 52 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_L2MC_ENTRY = 53 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_IPMC_ENTRY = 54 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_MCAST_FDB_ENTRY = 55 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_HOSTIF_USER_DEFINED_TRAP = 56 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_BRIDGE = 57 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_BRIDGE_PORT = 58 # /usr/include/sai/saitypes.h: 220 - -SAI_OBJECT_TYPE_MAX = 59 # /usr/include/sai/saitypes.h: 220 - -sai_object_type_t = enum__sai_object_type_t # /usr/include/sai/saitypes.h: 220 - -# /usr/include/sai/saitypes.h: 225 -class struct__sai_u8_list_t(Structure): - pass - -struct__sai_u8_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_u8_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_uint8)), -] - -sai_u8_list_t = struct__sai_u8_list_t # /usr/include/sai/saitypes.h: 225 - -# /usr/include/sai/saitypes.h: 234 -class struct__sai_s8_list_t(Structure): - pass - -struct__sai_s8_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_s8_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_int8)), -] - -sai_s8_list_t = struct__sai_s8_list_t # /usr/include/sai/saitypes.h: 234 - -# /usr/include/sai/saitypes.h: 239 -class struct__sai_u16_list_t(Structure): - pass - -struct__sai_u16_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_u16_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_uint16)), -] - -sai_u16_list_t = struct__sai_u16_list_t # /usr/include/sai/saitypes.h: 239 - -# /usr/include/sai/saitypes.h: 244 -class struct__sai_s16_list_t(Structure): - pass - -struct__sai_s16_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_s16_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_int16)), -] - -sai_s16_list_t = struct__sai_s16_list_t # /usr/include/sai/saitypes.h: 244 - -# /usr/include/sai/saitypes.h: 249 -class struct__sai_u32_list_t(Structure): - pass - -struct__sai_u32_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_u32_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_uint32)), -] - -sai_u32_list_t = struct__sai_u32_list_t # /usr/include/sai/saitypes.h: 249 - -# /usr/include/sai/saitypes.h: 254 -class struct__sai_s32_list_t(Structure): - pass - -struct__sai_s32_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_s32_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_int32)), -] - -sai_s32_list_t = struct__sai_s32_list_t # /usr/include/sai/saitypes.h: 254 - -# /usr/include/sai/saitypes.h: 259 -class struct__sai_u32_range_t(Structure): - pass - -struct__sai_u32_range_t.__slots__ = [ - 'min', - 'max', -] -struct__sai_u32_range_t._fields_ = [ - ('min', c_uint32), - ('max', c_uint32), -] - -sai_u32_range_t = struct__sai_u32_range_t # /usr/include/sai/saitypes.h: 259 - -# /usr/include/sai/saitypes.h: 264 -class struct__sai_s32_range_t(Structure): - pass - -struct__sai_s32_range_t.__slots__ = [ - 'min', - 'max', -] -struct__sai_s32_range_t._fields_ = [ - ('min', c_int32), - ('max', c_int32), -] - -sai_s32_range_t = struct__sai_s32_range_t # /usr/include/sai/saitypes.h: 264 - -# /usr/include/sai/saitypes.h: 277 -class struct__sai_vlan_list_t(Structure): - pass - -struct__sai_vlan_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_vlan_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_vlan_id_t)), -] - -sai_vlan_list_t = struct__sai_vlan_list_t # /usr/include/sai/saitypes.h: 277 - -enum__sai_ip_addr_family_t = c_int # /usr/include/sai/saitypes.h: 285 - -SAI_IP_ADDR_FAMILY_IPV4 = 0 # /usr/include/sai/saitypes.h: 285 - -SAI_IP_ADDR_FAMILY_IPV6 = (SAI_IP_ADDR_FAMILY_IPV4 + 1) # /usr/include/sai/saitypes.h: 285 - -sai_ip_addr_family_t = enum__sai_ip_addr_family_t # /usr/include/sai/saitypes.h: 285 - -# /usr/include/sai/saitypes.h: 289 -class union_anon_14(Union): - pass - -union_anon_14.__slots__ = [ - 'ip4', - 'ip6', -] -union_anon_14._fields_ = [ - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), -] - -# /usr/include/sai/saitypes.h: 293 -class struct__sai_ip_address_t(Structure): - pass - -struct__sai_ip_address_t.__slots__ = [ - 'addr_family', - 'addr', -] -struct__sai_ip_address_t._fields_ = [ - ('addr_family', sai_ip_addr_family_t), - ('addr', union_anon_14), -] - -sai_ip_address_t = struct__sai_ip_address_t # /usr/include/sai/saitypes.h: 293 - -# /usr/include/sai/saitypes.h: 297 -class union_anon_15(Union): - pass - -union_anon_15.__slots__ = [ - 'ip4', - 'ip6', -] -union_anon_15._fields_ = [ - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), -] - -# /usr/include/sai/saitypes.h: 301 -class union_anon_16(Union): - pass - -union_anon_16.__slots__ = [ - 'ip4', - 'ip6', -] -union_anon_16._fields_ = [ - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), -] - -# /usr/include/sai/saitypes.h: 305 -class struct__sai_ip_prefix_t(Structure): - pass - -struct__sai_ip_prefix_t.__slots__ = [ - 'addr_family', - 'addr', - 'mask', -] -struct__sai_ip_prefix_t._fields_ = [ - ('addr_family', sai_ip_addr_family_t), - ('addr', union_anon_15), - ('mask', union_anon_16), -] - -sai_ip_prefix_t = struct__sai_ip_prefix_t # /usr/include/sai/saitypes.h: 305 - -# /usr/include/sai/saitypes.h: 322 -class union_anon_17(Union): - pass - -union_anon_17.__slots__ = [ - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'mac', - 'ip4', - 'ip6', - 'u8list', -] -union_anon_17._fields_ = [ - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('u8list', sai_u8_list_t), -] - -# /usr/include/sai/saitypes.h: 338 -class union_anon_18(Union): - pass - -union_anon_18.__slots__ = [ - 'booldata', - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'mac', - 'ip4', - 'ip6', - 'oid', - 'objlist', - 'u8list', -] -union_anon_18._fields_ = [ - ('booldata', c_bool), - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('oid', sai_object_id_t), - ('objlist', sai_object_list_t), - ('u8list', sai_u8_list_t), -] - -# /usr/include/sai/saitypes.h: 353 -class struct__sai_acl_field_data_t(Structure): - pass - -struct__sai_acl_field_data_t.__slots__ = [ - 'enable', - 'mask', - 'data', -] -struct__sai_acl_field_data_t._fields_ = [ - ('enable', c_bool), - ('mask', union_anon_17), - ('data', union_anon_18), -] - -sai_acl_field_data_t = struct__sai_acl_field_data_t # /usr/include/sai/saitypes.h: 353 - -# /usr/include/sai/saitypes.h: 370 -class union_anon_19(Union): - pass - -union_anon_19.__slots__ = [ - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'mac', - 'ip4', - 'ip6', - 'oid', - 'objlist', -] -union_anon_19._fields_ = [ - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('oid', sai_object_id_t), - ('objlist', sai_object_list_t), -] - -# /usr/include/sai/saitypes.h: 384 -class struct__sai_acl_action_data_t(Structure): - pass - -struct__sai_acl_action_data_t.__slots__ = [ - 'enable', - 'parameter', -] -struct__sai_acl_action_data_t._fields_ = [ - ('enable', c_bool), - ('parameter', union_anon_19), -] - -sai_acl_action_data_t = struct__sai_acl_action_data_t # /usr/include/sai/saitypes.h: 384 - -enum__sai_packet_color_t = c_int # /usr/include/sai/saitypes.h: 406 - -SAI_PACKET_COLOR_GREEN = 0 # /usr/include/sai/saitypes.h: 406 - -SAI_PACKET_COLOR_YELLOW = (SAI_PACKET_COLOR_GREEN + 1) # /usr/include/sai/saitypes.h: 406 - -SAI_PACKET_COLOR_RED = (SAI_PACKET_COLOR_YELLOW + 1) # /usr/include/sai/saitypes.h: 406 - -sai_packet_color_t = enum__sai_packet_color_t # /usr/include/sai/saitypes.h: 406 - -# /usr/include/sai/saitypes.h: 444 -class struct__sai_qos_map_params_t(Structure): - pass - -struct__sai_qos_map_params_t.__slots__ = [ - 'tc', - 'dscp', - 'dot1p', - 'prio', - 'pg', - 'queue_index', - 'color', -] -struct__sai_qos_map_params_t._fields_ = [ - ('tc', sai_cos_t), - ('dscp', sai_uint8_t), - ('dot1p', sai_uint8_t), - ('prio', sai_uint8_t), - ('pg', sai_uint8_t), - ('queue_index', sai_queue_index_t), - ('color', sai_packet_color_t), -] - -sai_qos_map_params_t = struct__sai_qos_map_params_t # /usr/include/sai/saitypes.h: 444 - -# /usr/include/sai/saitypes.h: 454 -class struct__sai_qos_map_t(Structure): - pass - -struct__sai_qos_map_t.__slots__ = [ - 'key', - 'value', -] -struct__sai_qos_map_t._fields_ = [ - ('key', sai_qos_map_params_t), - ('value', sai_qos_map_params_t), -] - -sai_qos_map_t = struct__sai_qos_map_t # /usr/include/sai/saitypes.h: 454 - -# /usr/include/sai/saitypes.h: 463 -class struct__sai_qos_map_list_t(Structure): - pass - -struct__sai_qos_map_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_qos_map_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_qos_map_t)), -] - -sai_qos_map_list_t = struct__sai_qos_map_list_t # /usr/include/sai/saitypes.h: 463 - -# /usr/include/sai/saitypes.h: 482 -class struct__sai_tunnel_map_params_t(Structure): - pass - -struct__sai_tunnel_map_params_t.__slots__ = [ - 'oecn', - 'uecn', - 'vlan_id', - 'vni_id', - 'bridge_if', -] -struct__sai_tunnel_map_params_t._fields_ = [ - ('oecn', sai_uint8_t), - ('uecn', sai_uint8_t), - ('vlan_id', sai_vlan_id_t), - ('vni_id', sai_uint32_t), - ('bridge_if', sai_object_id_t), -] - -sai_tunnel_map_params_t = struct__sai_tunnel_map_params_t # /usr/include/sai/saitypes.h: 482 - -# /usr/include/sai/saitypes.h: 492 -class struct__sai_tunnel_map_t(Structure): - pass - -struct__sai_tunnel_map_t.__slots__ = [ - 'key', - 'value', -] -struct__sai_tunnel_map_t._fields_ = [ - ('key', sai_tunnel_map_params_t), - ('value', sai_tunnel_map_params_t), -] - -sai_tunnel_map_t = struct__sai_tunnel_map_t # /usr/include/sai/saitypes.h: 492 - -# /usr/include/sai/saitypes.h: 502 -class struct__sai_tunnel_map_list_t(Structure): - pass - -struct__sai_tunnel_map_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_tunnel_map_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_tunnel_map_t)), -] - -sai_tunnel_map_list_t = struct__sai_tunnel_map_list_t # /usr/include/sai/saitypes.h: 502 - -# /usr/include/sai/saitypes.h: 530 -class struct__sai_acl_capability_t(Structure): - pass - -struct__sai_acl_capability_t.__slots__ = [ - 'stage', - 'is_action_list_mandatory', - 'action_list', -] -struct__sai_acl_capability_t._fields_ = [ - ('stage', sai_int32_t), - ('is_action_list_mandatory', c_bool), - ('action_list', sai_s32_list_t), -] - -sai_acl_capability_t = struct__sai_acl_capability_t # /usr/include/sai/saitypes.h: 530 - -enum__sai_fdb_entry_bridge_type_t = c_int # /usr/include/sai/saitypes.h: 543 - -SAI_FDB_ENTRY_BRIDGE_TYPE_1Q = 0 # /usr/include/sai/saitypes.h: 543 - -SAI_FDB_ENTRY_BRIDGE_TYPE_1D = (SAI_FDB_ENTRY_BRIDGE_TYPE_1Q + 1) # /usr/include/sai/saitypes.h: 543 - -sai_fdb_entry_bridge_type_t = enum__sai_fdb_entry_bridge_type_t # /usr/include/sai/saitypes.h: 543 - -# /usr/include/sai/saitypes.h: 581 -class union_anon_20(Union): - pass - -union_anon_20.__slots__ = [ - 'booldata', - 'chardata', - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'u64', - 's64', - 'ptr', - 'mac', - 'ip4', - 'ip6', - 'ipaddr', - 'oid', - 'objlist', - 'u8list', - 's8list', - 'u16list', - 's16list', - 'u32list', - 's32list', - 'u32range', - 's32range', - 'vlanlist', - 'aclfield', - 'aclaction', - 'qosmap', - 'tunnelmap', - 'aclcapability', -] -union_anon_20._fields_ = [ - ('booldata', c_bool), - ('chardata', c_char * 32), - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('u64', sai_uint64_t), - ('s64', sai_int64_t), - ('ptr', sai_pointer_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('ipaddr', sai_ip_address_t), - ('oid', sai_object_id_t), - ('objlist', sai_object_list_t), - ('u8list', sai_u8_list_t), - ('s8list', sai_s8_list_t), - ('u16list', sai_u16_list_t), - ('s16list', sai_s16_list_t), - ('u32list', sai_u32_list_t), - ('s32list', sai_s32_list_t), - ('u32range', sai_u32_range_t), - ('s32range', sai_s32_range_t), - ('vlanlist', sai_vlan_list_t), - ('aclfield', sai_acl_field_data_t), - ('aclaction', sai_acl_action_data_t), - ('qosmap', sai_qos_map_list_t), - ('tunnelmap', sai_tunnel_map_list_t), - ('aclcapability', sai_acl_capability_t), -] - -sai_attribute_value_t = union_anon_20 # /usr/include/sai/saitypes.h: 581 - -# /usr/include/sai/saitypes.h: 586 -class struct__sai_attribute_t(Structure): - pass - -struct__sai_attribute_t.__slots__ = [ - 'id', - 'value', -] -struct__sai_attribute_t._fields_ = [ - ('id', sai_attr_id_t), - ('value', sai_attribute_value_t), -] - -sai_attribute_t = struct__sai_attribute_t # /usr/include/sai/saitypes.h: 586 - -enum__sai_acl_stage_t = c_int # /usr/include/sai/saiacl.h: 47 - -SAI_ACL_STAGE_INGRESS = 0 # /usr/include/sai/saiacl.h: 47 - -SAI_ACL_STAGE_EGRESS = (SAI_ACL_STAGE_INGRESS + 1) # /usr/include/sai/saiacl.h: 47 - -sai_acl_stage_t = enum__sai_acl_stage_t # /usr/include/sai/saiacl.h: 47 - -enum__sai_acl_bind_point_type_t = c_int # /usr/include/sai/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_PORT = 0 # /usr/include/sai/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_LAG = (SAI_ACL_BIND_POINT_TYPE_PORT + 1) # /usr/include/sai/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_VLAN = (SAI_ACL_BIND_POINT_TYPE_LAG + 1) # /usr/include/sai/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_ROUTER_INTF = (SAI_ACL_BIND_POINT_TYPE_VLAN + 1) # /usr/include/sai/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_SWITCH = (SAI_ACL_BIND_POINT_TYPE_ROUTER_INTF + 1) # /usr/include/sai/saiacl.h: 69 - -sai_acl_bind_point_type_t = enum__sai_acl_bind_point_type_t # /usr/include/sai/saiacl.h: 69 - -enum__sai_acl_ip_type_t = c_int # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ANY = 0 # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_IP = (SAI_ACL_IP_TYPE_ANY + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_NON_IP = (SAI_ACL_IP_TYPE_IP + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_IPv4ANY = (SAI_ACL_IP_TYPE_NON_IP + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_NON_IPv4 = (SAI_ACL_IP_TYPE_IPv4ANY + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_IPv6ANY = (SAI_ACL_IP_TYPE_NON_IPv4 + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_NON_IPv6 = (SAI_ACL_IP_TYPE_IPv6ANY + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ARP = (SAI_ACL_IP_TYPE_NON_IPv6 + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ARP_REQUEST = (SAI_ACL_IP_TYPE_ARP + 1) # /usr/include/sai/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ARP_REPLY = (SAI_ACL_IP_TYPE_ARP_REQUEST + 1) # /usr/include/sai/saiacl.h: 106 - -sai_acl_ip_type_t = enum__sai_acl_ip_type_t # /usr/include/sai/saiacl.h: 106 - -enum__sai_acl_ip_frag_t = c_int # /usr/include/sai/saiacl.h: 128 - -SAI_ACL_IP_FRAG_ANY = 0 # /usr/include/sai/saiacl.h: 128 - -SAI_ACL_IP_FRAG_NON_FRAG = (SAI_ACL_IP_FRAG_ANY + 1) # /usr/include/sai/saiacl.h: 128 - -SAI_ACL_IP_FRAG_NON_FRAG_OR_HEAD = (SAI_ACL_IP_FRAG_NON_FRAG + 1) # /usr/include/sai/saiacl.h: 128 - -SAI_ACL_IP_FRAG_HEAD = (SAI_ACL_IP_FRAG_NON_FRAG_OR_HEAD + 1) # /usr/include/sai/saiacl.h: 128 - -SAI_ACL_IP_FRAG_NON_HEAD = (SAI_ACL_IP_FRAG_HEAD + 1) # /usr/include/sai/saiacl.h: 128 - -sai_acl_ip_frag_t = enum__sai_acl_ip_frag_t # /usr/include/sai/saiacl.h: 128 - -enum__sai_acl_action_type_t = c_int # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_REDIRECT = 0 # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_REDIRECT_LIST = (SAI_ACL_ACTION_TYPE_REDIRECT + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_PACKET_ACTION = (SAI_ACL_ACTION_TYPE_REDIRECT_LIST + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_FLOOD = (SAI_ACL_ACTION_TYPE_PACKET_ACTION + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_COUNTER = (SAI_ACL_ACTION_TYPE_FLOOD + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_MIRROR_INGRESS = (SAI_ACL_ACTION_TYPE_COUNTER + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_MIRROR_EGRESS = (SAI_ACL_ACTION_TYPE_MIRROR_INGRESS + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_POLICER = (SAI_ACL_ACTION_TYPE_MIRROR_EGRESS + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_DECREMENT_TTL = (SAI_ACL_ACTION_TYPE_SET_POLICER + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_TC = (SAI_ACL_ACTION_TYPE_DECREMENT_TTL + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_PACKET_COLOR = (SAI_ACL_ACTION_TYPE_SET_TC + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_ID = (SAI_ACL_ACTION_TYPE_SET_PACKET_COLOR + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_PRI = (SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_ID = (SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_PRI = (SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_SRC_MAC = (SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DST_MAC = (SAI_ACL_ACTION_TYPE_SET_SRC_MAC + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_SRC_IP = (SAI_ACL_ACTION_TYPE_SET_DST_MAC + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DST_IP = (SAI_ACL_ACTION_TYPE_SET_SRC_IP + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_SRC_IPv6 = (SAI_ACL_ACTION_TYPE_SET_DST_IP + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DST_IPv6 = (SAI_ACL_ACTION_TYPE_SET_SRC_IPv6 + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DSCP = (SAI_ACL_ACTION_TYPE_SET_DST_IPv6 + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_ECN = (SAI_ACL_ACTION_TYPE_SET_DSCP + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_L4_SRC_PORT = (SAI_ACL_ACTION_TYPE_SET_ECN + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_L4_DST_PORT = (SAI_ACL_ACTION_TYPE_SET_L4_SRC_PORT + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_INGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ACTION_TYPE_SET_L4_DST_PORT + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_EGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ACTION_TYPE_INGRESS_SAMPLEPACKET_ENABLE + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_CPU_QUEUE = (SAI_ACL_ACTION_TYPE_EGRESS_SAMPLEPACKET_ENABLE + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_ACL_META_DATA = (SAI_ACL_ACTION_TYPE_SET_CPU_QUEUE + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_EGRESS_BLOCK_PORT_LIST = (SAI_ACL_ACTION_TYPE_SET_ACL_META_DATA + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_USER_TRAP_ID = (SAI_ACL_ACTION_TYPE_EGRESS_BLOCK_PORT_LIST + 1) # /usr/include/sai/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DO_NOT_LEARN = (SAI_ACL_ACTION_TYPE_SET_USER_TRAP_ID + 1) # /usr/include/sai/saiacl.h: 231 - -sai_acl_action_type_t = enum__sai_acl_action_type_t # /usr/include/sai/saiacl.h: 231 - -enum__sai_acl_table_group_type_t = c_int # /usr/include/sai/saiacl.h: 244 - -SAI_ACL_TABLE_GROUP_TYPE_SEQUENTIAL = 0 # /usr/include/sai/saiacl.h: 244 - -SAI_ACL_TABLE_GROUP_TYPE_PARALLEL = (SAI_ACL_TABLE_GROUP_TYPE_SEQUENTIAL + 1) # /usr/include/sai/saiacl.h: 244 - -sai_acl_table_group_type_t = enum__sai_acl_table_group_type_t # /usr/include/sai/saiacl.h: 244 - -enum__sai_acl_table_group_attr_t = c_int # /usr/include/sai/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_START = 0 # /usr/include/sai/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE = SAI_ACL_TABLE_GROUP_ATTR_START # /usr/include/sai/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST = (SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE + 1) # /usr/include/sai/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_TYPE = (SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST + 1) # /usr/include/sai/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_END = (SAI_ACL_TABLE_GROUP_ATTR_TYPE + 1) # /usr/include/sai/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiacl.h: 313 - -sai_acl_table_group_attr_t = enum__sai_acl_table_group_attr_t # /usr/include/sai/saiacl.h: 313 - -enum__sai_acl_table_group_member_attr_t = c_int # /usr/include/sai/saiacl.h: 381 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_START = 0 # /usr/include/sai/saiacl.h: 381 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID = SAI_ACL_TABLE_GROUP_MEMBER_ATTR_START # /usr/include/sai/saiacl.h: 381 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID + 1) # /usr/include/sai/saiacl.h: 381 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_PRIORITY = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID + 1) # /usr/include/sai/saiacl.h: 381 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_END = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_PRIORITY + 1) # /usr/include/sai/saiacl.h: 381 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiacl.h: 381 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiacl.h: 381 - -sai_acl_table_group_member_attr_t = enum__sai_acl_table_group_member_attr_t # /usr/include/sai/saiacl.h: 381 - -enum__sai_acl_table_attr_t = c_int # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_START = 0 # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_ACL_STAGE = SAI_ACL_TABLE_ATTR_START # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST = (SAI_ACL_TABLE_ATTR_ACL_STAGE + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_SIZE = (SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_END = (SAI_ACL_TABLE_ATTR_SIZE + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_START = 4096 # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_IPv6 = SAI_ACL_TABLE_ATTR_FIELD_START # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_DST_IPv6 = (SAI_ACL_TABLE_ATTR_FIELD_SRC_IPv6 + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IPv6 = (SAI_ACL_TABLE_ATTR_FIELD_DST_IPv6 + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IPv6 = (SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IPv6 + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC = (SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IPv6 + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_DST_MAC = (SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_IP = (SAI_ACL_TABLE_ATTR_FIELD_DST_MAC + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_DST_IP = (SAI_ACL_TABLE_ATTR_FIELD_SRC_IP + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IP = (SAI_ACL_TABLE_ATTR_FIELD_DST_IP + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IP = (SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IP + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS = (SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IP + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS = (SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_IN_PORT = (SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT = (SAI_ACL_TABLE_ATTR_FIELD_IN_PORT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_PORT = (SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID = (SAI_ACL_TABLE_ATTR_FIELD_SRC_PORT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_PRI = (SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_CFI = (SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_ID = (SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_CFI + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_PRI = (SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_CFI = (SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT = (SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_CFI + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT = (SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE = (SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL = (SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_IP_IDENTIFICATION = (SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_DSCP = (SAI_ACL_TABLE_ATTR_FIELD_IP_IDENTIFICATION + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ECN = (SAI_ACL_TABLE_ATTR_FIELD_DSCP + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_TTL = (SAI_ACL_TABLE_ATTR_FIELD_ECN + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_TOS = (SAI_ACL_TABLE_ATTR_FIELD_TTL + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_IP_FLAGS = (SAI_ACL_TABLE_ATTR_FIELD_TOS + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS = (SAI_ACL_TABLE_ATTR_FIELD_IP_FLAGS + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE = (SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_FRAG = (SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_IPv6_FLOW_LABEL = (SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_FRAG + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_TC = (SAI_ACL_TABLE_ATTR_FIELD_IPv6_FLOW_LABEL + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE = (SAI_ACL_TABLE_ATTR_FIELD_TC + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE = (SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_PACKET_VLAN = (SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_FDB_DST_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_PACKET_VLAN + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_FDB_DST_USER_META + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_DST_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_PORT_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_DST_USER_META + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_VLAN_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_PORT_USER_META + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_VLAN_USER_META + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_FDB_NPU_META_DST_HIT = (SAI_ACL_TABLE_ATTR_FIELD_ACL_USER_META + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT = (SAI_ACL_TABLE_ATTR_FIELD_FDB_NPU_META_DST_HIT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ROUTE_NPU_META_DST_HIT = (SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MIN = (SAI_ACL_TABLE_ATTR_FIELD_ROUTE_NPU_META_DST_HIT + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MAX = (SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MIN + 255) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE = (SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MAX + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_ACTION_LIST = (SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE + 1) # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_ACTION_LIST # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiacl.h: 947 - -SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_END = (SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiacl.h: 947 - -sai_acl_table_attr_t = enum__sai_acl_table_attr_t # /usr/include/sai/saiacl.h: 947 - -enum__sai_acl_entry_attr_t = c_int # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_START = 0 # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_TABLE_ID = SAI_ACL_ENTRY_ATTR_START # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_PRIORITY = (SAI_ACL_ENTRY_ATTR_TABLE_ID + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ADMIN_STATE = (SAI_ACL_ENTRY_ATTR_PRIORITY + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_END = (SAI_ACL_ENTRY_ATTR_ADMIN_STATE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_START = 4096 # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_IPv6 = SAI_ACL_ENTRY_ATTR_FIELD_START # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_DST_IPv6 = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_IPv6 + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IPv6 = (SAI_ACL_ENTRY_ATTR_FIELD_DST_IPv6 + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IPv6 = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IPv6 + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_MAC = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IPv6 + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_DST_MAC = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_MAC + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP = (SAI_ACL_ENTRY_ATTR_FIELD_DST_MAC + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_DST_IP = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IP = (SAI_ACL_ENTRY_ATTR_FIELD_DST_IP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IP = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS = (SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_PORT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_CFI = (SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_CFI + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_CFI = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_L4_SRC_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_CFI + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_L4_DST_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_L4_SRC_PORT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ETHER_TYPE = (SAI_ACL_ENTRY_ATTR_FIELD_L4_DST_PORT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_IP_PROTOCOL = (SAI_ACL_ENTRY_ATTR_FIELD_ETHER_TYPE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_IP_IDENTIFICATION = (SAI_ACL_ENTRY_ATTR_FIELD_IP_PROTOCOL + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_DSCP = (SAI_ACL_ENTRY_ATTR_FIELD_IP_IDENTIFICATION + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ECN = (SAI_ACL_ENTRY_ATTR_FIELD_DSCP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_TTL = (SAI_ACL_ENTRY_ATTR_FIELD_ECN + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_TOS = (SAI_ACL_ENTRY_ATTR_FIELD_TTL + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_IP_FLAGS = (SAI_ACL_ENTRY_ATTR_FIELD_TOS + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_TCP_FLAGS = (SAI_ACL_ENTRY_ATTR_FIELD_IP_FLAGS + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE = (SAI_ACL_ENTRY_ATTR_FIELD_TCP_FLAGS + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_FRAG = (SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_IPv6_FLOW_LABEL = (SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_FRAG + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_TC = (SAI_ACL_ENTRY_ATTR_FIELD_IPv6_FLOW_LABEL + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ICMP_TYPE = (SAI_ACL_ENTRY_ATTR_FIELD_TC + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ICMP_CODE = (SAI_ACL_ENTRY_ATTR_FIELD_ICMP_TYPE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_PACKET_VLAN = (SAI_ACL_ENTRY_ATTR_FIELD_ICMP_CODE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_FDB_DST_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_PACKET_VLAN + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_DST_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_FDB_DST_USER_META + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_DST_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_DST_USER_META + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_PORT_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_DST_USER_META + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_VLAN_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_PORT_USER_META + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_VLAN_USER_META + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_FDB_NPU_META_DST_HIT = (SAI_ACL_ENTRY_ATTR_FIELD_ACL_USER_META + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT = (SAI_ACL_ENTRY_ATTR_FIELD_FDB_NPU_META_DST_HIT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_NPU_META_DST_HIT = (SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MIN = (SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_NPU_META_DST_HIT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MAX = (SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MIN + 255) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_RANGE_TYPE = (SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MAX + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_ACL_RANGE_TYPE # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_START = 8192 # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT = SAI_ACL_ENTRY_ATTR_ACTION_START # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT_LIST = (SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_PACKET_ACTION = (SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT_LIST + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_FLOOD = (SAI_ACL_ENTRY_ATTR_ACTION_PACKET_ACTION + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_COUNTER = (SAI_ACL_ENTRY_ATTR_ACTION_FLOOD + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS = (SAI_ACL_ENTRY_ATTR_ACTION_COUNTER + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS = (SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_POLICER = (SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_DECREMENT_TTL = (SAI_ACL_ENTRY_ATTR_ACTION_SET_POLICER + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_TC = (SAI_ACL_ENTRY_ATTR_ACTION_DECREMENT_TTL + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_PACKET_COLOR = (SAI_ACL_ENTRY_ATTR_ACTION_SET_TC + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_ACTION_SET_PACKET_COLOR + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_ID + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_MAC = (SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_PRI + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_MAC = (SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_MAC + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IP = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_MAC + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IP = (SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IPv6 = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IPv6 = (SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IPv6 + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DSCP = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IPv6 + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_ECN = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DSCP + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_SRC_PORT = (SAI_ACL_ENTRY_ATTR_ACTION_SET_ECN + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_DST_PORT = (SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_SRC_PORT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_INGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_DST_PORT + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ENTRY_ATTR_ACTION_INGRESS_SAMPLEPACKET_ENABLE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_CPU_QUEUE = (SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_SAMPLEPACKET_ENABLE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_ACL_META_DATA = (SAI_ACL_ENTRY_ATTR_ACTION_SET_CPU_QUEUE + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_BLOCK_PORT_LIST = (SAI_ACL_ENTRY_ATTR_ACTION_SET_ACL_META_DATA + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_USER_TRAP_ID = (SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_BLOCK_PORT_LIST + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DO_NOT_LEARN = (SAI_ACL_ENTRY_ATTR_ACTION_SET_USER_TRAP_ID + 1) # /usr/include/sai/saiacl.h: 1742 - -SAI_ACL_ENTRY_ATTR_ACTION_END = SAI_ACL_ENTRY_ATTR_ACTION_SET_DO_NOT_LEARN # /usr/include/sai/saiacl.h: 1742 - -sai_acl_entry_attr_t = enum__sai_acl_entry_attr_t # /usr/include/sai/saiacl.h: 1742 - -enum__sai_acl_counter_attr_t = c_int # /usr/include/sai/saiacl.h: 1812 - -SAI_ACL_COUNTER_ATTR_START = 0 # /usr/include/sai/saiacl.h: 1812 - -SAI_ACL_COUNTER_ATTR_TABLE_ID = SAI_ACL_COUNTER_ATTR_START # /usr/include/sai/saiacl.h: 1812 - -SAI_ACL_COUNTER_ATTR_ENABLE_PACKET_COUNT = (SAI_ACL_COUNTER_ATTR_TABLE_ID + 1) # /usr/include/sai/saiacl.h: 1812 - -SAI_ACL_COUNTER_ATTR_ENABLE_BYTE_COUNT = (SAI_ACL_COUNTER_ATTR_ENABLE_PACKET_COUNT + 1) # /usr/include/sai/saiacl.h: 1812 - -SAI_ACL_COUNTER_ATTR_PACKETS = (SAI_ACL_COUNTER_ATTR_ENABLE_BYTE_COUNT + 1) # /usr/include/sai/saiacl.h: 1812 - -SAI_ACL_COUNTER_ATTR_BYTES = (SAI_ACL_COUNTER_ATTR_PACKETS + 1) # /usr/include/sai/saiacl.h: 1812 - -SAI_ACL_COUNTER_ATTR_END = (SAI_ACL_COUNTER_ATTR_BYTES + 1) # /usr/include/sai/saiacl.h: 1812 - -sai_acl_counter_attr_t = enum__sai_acl_counter_attr_t # /usr/include/sai/saiacl.h: 1812 - -enum__sai_acl_range_type_t = c_int # /usr/include/sai/saiacl.h: 1834 - -SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE = 0 # /usr/include/sai/saiacl.h: 1834 - -SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE = (SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE + 1) # /usr/include/sai/saiacl.h: 1834 - -SAI_ACL_RANGE_TYPE_OUTER_VLAN = (SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE + 1) # /usr/include/sai/saiacl.h: 1834 - -SAI_ACL_RANGE_TYPE_INNER_VLAN = (SAI_ACL_RANGE_TYPE_OUTER_VLAN + 1) # /usr/include/sai/saiacl.h: 1834 - -SAI_ACL_RANGE_TYPE_PACKET_LENGTH = (SAI_ACL_RANGE_TYPE_INNER_VLAN + 1) # /usr/include/sai/saiacl.h: 1834 - -sai_acl_range_type_t = enum__sai_acl_range_type_t # /usr/include/sai/saiacl.h: 1834 - -enum__sai_acl_range_attr_t = c_int # /usr/include/sai/saiacl.h: 1874 - -SAI_ACL_RANGE_ATTR_START = 0 # /usr/include/sai/saiacl.h: 1874 - -SAI_ACL_RANGE_ATTR_TYPE = SAI_ACL_RANGE_ATTR_START # /usr/include/sai/saiacl.h: 1874 - -SAI_ACL_RANGE_ATTR_LIMIT = (SAI_ACL_RANGE_ATTR_TYPE + 1) # /usr/include/sai/saiacl.h: 1874 - -SAI_ACL_RANGE_ATTR_END = (SAI_ACL_RANGE_ATTR_LIMIT + 1) # /usr/include/sai/saiacl.h: 1874 - -sai_acl_range_attr_t = enum__sai_acl_range_attr_t # /usr/include/sai/saiacl.h: 1874 - -sai_create_acl_table_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 1886 - -sai_remove_acl_table_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiacl.h: 1899 - -sai_set_acl_table_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 1910 - -sai_get_acl_table_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 1923 - -sai_create_acl_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 1938 - -sai_remove_acl_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiacl.h: 1951 - -sai_set_acl_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 1962 - -sai_get_acl_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 1975 - -sai_create_acl_counter_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 1990 - -sai_remove_acl_counter_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiacl.h: 2003 - -sai_set_acl_counter_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2014 - -sai_get_acl_counter_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2027 - -sai_create_acl_range_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2042 - -sai_remove_acl_range_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiacl.h: 2055 - -sai_set_acl_range_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2065 - -sai_get_acl_range_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2078 - -sai_create_acl_table_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2092 - -sai_remove_acl_table_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiacl.h: 2104 - -sai_set_acl_table_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2115 - -sai_get_acl_table_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2128 - -sai_create_acl_table_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2142 - -sai_remove_acl_table_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiacl.h: 2154 - -sai_set_acl_table_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2165 - -sai_get_acl_table_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiacl.h: 2178 - -# /usr/include/sai/saiacl.h: 2212 -class struct__sai_acl_api_t(Structure): - pass - -struct__sai_acl_api_t.__slots__ = [ - 'create_acl_table', - 'remove_acl_table', - 'set_acl_table_attribute', - 'get_acl_table_attribute', - 'create_acl_entry', - 'remove_acl_entry', - 'set_acl_entry_attribute', - 'get_acl_entry_attribute', - 'create_acl_counter', - 'remove_acl_counter', - 'set_acl_counter_attribute', - 'get_acl_counter_attribute', - 'create_acl_range', - 'remove_acl_range', - 'set_acl_range_attribute', - 'get_acl_range_attribute', - 'create_acl_table_group', - 'remove_acl_table_group', - 'set_acl_table_group_attribute', - 'get_acl_table_group_attribute', - 'create_acl_table_group_member', - 'remove_acl_table_group_member', - 'set_acl_table_group_member_attribute', - 'get_acl_table_group_member_attribute', -] -struct__sai_acl_api_t._fields_ = [ - ('create_acl_table', sai_create_acl_table_fn), - ('remove_acl_table', sai_remove_acl_table_fn), - ('set_acl_table_attribute', sai_set_acl_table_attribute_fn), - ('get_acl_table_attribute', sai_get_acl_table_attribute_fn), - ('create_acl_entry', sai_create_acl_entry_fn), - ('remove_acl_entry', sai_remove_acl_entry_fn), - ('set_acl_entry_attribute', sai_set_acl_entry_attribute_fn), - ('get_acl_entry_attribute', sai_get_acl_entry_attribute_fn), - ('create_acl_counter', sai_create_acl_counter_fn), - ('remove_acl_counter', sai_remove_acl_counter_fn), - ('set_acl_counter_attribute', sai_set_acl_counter_attribute_fn), - ('get_acl_counter_attribute', sai_get_acl_counter_attribute_fn), - ('create_acl_range', sai_create_acl_range_fn), - ('remove_acl_range', sai_remove_acl_range_fn), - ('set_acl_range_attribute', sai_set_acl_range_attribute_fn), - ('get_acl_range_attribute', sai_get_acl_range_attribute_fn), - ('create_acl_table_group', sai_create_acl_table_group_fn), - ('remove_acl_table_group', sai_remove_acl_table_group_fn), - ('set_acl_table_group_attribute', sai_set_acl_table_group_attribute_fn), - ('get_acl_table_group_attribute', sai_get_acl_table_group_attribute_fn), - ('create_acl_table_group_member', sai_create_acl_table_group_member_fn), - ('remove_acl_table_group_member', sai_remove_acl_table_group_member_fn), - ('set_acl_table_group_member_attribute', sai_set_acl_table_group_member_attribute_fn), - ('get_acl_table_group_member_attribute', sai_get_acl_table_group_member_attribute_fn), -] - -sai_acl_api_t = struct__sai_acl_api_t # /usr/include/sai/saiacl.h: 2212 - -enum__sai_bridge_port_fdb_learning_mode_t = c_int # /usr/include/sai/saibridge.h: 63 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DROP = 0 # /usr/include/sai/saibridge.h: 63 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DISABLE = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DROP + 1) # /usr/include/sai/saibridge.h: 63 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DISABLE + 1) # /usr/include/sai/saibridge.h: 63 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_TRAP = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW + 1) # /usr/include/sai/saibridge.h: 63 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_LOG = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_TRAP + 1) # /usr/include/sai/saibridge.h: 63 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_FDB_NOTIFICATION = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_LOG + 1) # /usr/include/sai/saibridge.h: 63 - -sai_bridge_port_fdb_learning_mode_t = enum__sai_bridge_port_fdb_learning_mode_t # /usr/include/sai/saibridge.h: 63 - -enum__sai_bridge_port_type_t = c_int # /usr/include/sai/saibridge.h: 85 - -SAI_BRIDGE_PORT_TYPE_PORT = 0 # /usr/include/sai/saibridge.h: 85 - -SAI_BRIDGE_PORT_TYPE_SUB_PORT = (SAI_BRIDGE_PORT_TYPE_PORT + 1) # /usr/include/sai/saibridge.h: 85 - -SAI_BRIDGE_PORT_TYPE_1Q_ROUTER = (SAI_BRIDGE_PORT_TYPE_SUB_PORT + 1) # /usr/include/sai/saibridge.h: 85 - -SAI_BRIDGE_PORT_TYPE_1D_ROUTER = (SAI_BRIDGE_PORT_TYPE_1Q_ROUTER + 1) # /usr/include/sai/saibridge.h: 85 - -SAI_BRIDGE_PORT_TYPE_TUNNEL = (SAI_BRIDGE_PORT_TYPE_1D_ROUTER + 1) # /usr/include/sai/saibridge.h: 85 - -sai_bridge_port_type_t = enum__sai_bridge_port_type_t # /usr/include/sai/saibridge.h: 85 - -enum__sai_bridge_port_attr_t = c_int # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_START = 0 # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_TYPE = SAI_BRIDGE_PORT_ATTR_START # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_PORT_ID = (SAI_BRIDGE_PORT_ATTR_TYPE + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_VLAN_ID = (SAI_BRIDGE_PORT_ATTR_PORT_ID + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_RIF_ID = (SAI_BRIDGE_PORT_ATTR_VLAN_ID + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_TUNNEL_ID = (SAI_BRIDGE_PORT_ATTR_RIF_ID + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_BRIDGE_ID = (SAI_BRIDGE_PORT_ATTR_TUNNEL_ID + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE = (SAI_BRIDGE_PORT_ATTR_BRIDGE_ID + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_MAX_LEARNED_ADDRESSES = (SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_LIMIT_VIOLATION_PACKET_ACTION = (SAI_BRIDGE_PORT_ATTR_MAX_LEARNED_ADDRESSES + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_END = (SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_LIMIT_VIOLATION_PACKET_ACTION + 1) # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saibridge.h: 197 - -SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_END = (SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saibridge.h: 197 - -sai_bridge_port_attr_t = enum__sai_bridge_port_attr_t # /usr/include/sai/saibridge.h: 197 - -sai_create_bridge_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibridge.h: 210 - -sai_remove_bridge_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saibridge.h: 223 - -sai_set_bridge_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saibridge.h: 234 - -sai_get_bridge_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibridge.h: 247 - -enum__sai_bridge_type_t = c_int # /usr/include/sai/saibridge.h: 263 - -SAI_BRIDGE_TYPE_1Q = 0 # /usr/include/sai/saibridge.h: 263 - -SAI_BRIDGE_TYPE_1D = (SAI_BRIDGE_TYPE_1Q + 1) # /usr/include/sai/saibridge.h: 263 - -sai_bridge_type_t = enum__sai_bridge_type_t # /usr/include/sai/saibridge.h: 263 - -enum__sai_bridge_attr_t = c_int # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_START = 0 # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_TYPE = SAI_BRIDGE_ATTR_START # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_PORT_LIST = (SAI_BRIDGE_ATTR_TYPE + 1) # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_MAX_LEARNED_ADDRESSES = (SAI_BRIDGE_ATTR_PORT_LIST + 1) # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_LEARN_DISABLE = (SAI_BRIDGE_ATTR_MAX_LEARNED_ADDRESSES + 1) # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_END = (SAI_BRIDGE_ATTR_LEARN_DISABLE + 1) # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saibridge.h: 323 - -SAI_BRIDGE_ATTR_CUSTOM_RANGE_END = (SAI_BRIDGE_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saibridge.h: 323 - -sai_bridge_attr_t = enum__sai_bridge_attr_t # /usr/include/sai/saibridge.h: 323 - -sai_create_bridge_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibridge.h: 335 - -sai_remove_bridge_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saibridge.h: 349 - -sai_set_bridge_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saibridge.h: 361 - -sai_get_bridge_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibridge.h: 374 - -# /usr/include/sai/saibridge.h: 392 -class struct__sai_bridge_api_t(Structure): - pass - -struct__sai_bridge_api_t.__slots__ = [ - 'create_bridge', - 'remove_bridge', - 'set_bridge_attribute', - 'get_bridge_attribute', - 'create_bridge_port', - 'remove_bridge_port', - 'set_bridge_port_attribute', - 'get_bridge_port_attribute', -] -struct__sai_bridge_api_t._fields_ = [ - ('create_bridge', sai_create_bridge_fn), - ('remove_bridge', sai_remove_bridge_fn), - ('set_bridge_attribute', sai_set_bridge_attribute_fn), - ('get_bridge_attribute', sai_get_bridge_attribute_fn), - ('create_bridge_port', sai_create_bridge_port_fn), - ('remove_bridge_port', sai_remove_bridge_port_fn), - ('set_bridge_port_attribute', sai_set_bridge_port_attribute_fn), - ('get_bridge_port_attribute', sai_get_bridge_port_attribute_fn), -] - -sai_bridge_api_t = struct__sai_bridge_api_t # /usr/include/sai/saibridge.h: 392 - -enum__sai_ingress_priority_group_attr_t = c_int # /usr/include/sai/saibuffer.h: 63 - -SAI_INGRESS_PRIORITY_GROUP_ATTR_START = 0 # /usr/include/sai/saibuffer.h: 63 - -SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE = SAI_INGRESS_PRIORITY_GROUP_ATTR_START # /usr/include/sai/saibuffer.h: 63 - -SAI_INGRESS_PRIORITY_GROUP_ATTR_END = (SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE + 1) # /usr/include/sai/saibuffer.h: 63 - -sai_ingress_priority_group_attr_t = enum__sai_ingress_priority_group_attr_t # /usr/include/sai/saibuffer.h: 63 - -enum__sai_ingress_priority_group_stat_t = c_int # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS = 0 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_BYTES = 1 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_CURR_OCCUPANCY_BYTES = 2 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_WATERMARK_BYTES = 3 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_CURR_OCCUPANCY_BYTES = 4 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_WATERMARK_BYTES = 5 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_CURR_OCCUPANCY_BYTES = 6 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_WATERMARK_BYTES = 7 # /usr/include/sai/saibuffer.h: 97 - -SAI_INGRESS_PRIORITY_GROUP_STAT_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saibuffer.h: 97 - -sai_ingress_priority_group_stat_t = enum__sai_ingress_priority_group_stat_t # /usr/include/sai/saibuffer.h: 97 - -sai_set_ingress_priority_group_attr_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 107 - -sai_get_ingress_priority_group_attr_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 120 - -sai_get_ingress_priority_group_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_ingress_priority_group_stat_t), c_uint32, POINTER(c_uint64)) # /usr/include/sai/saibuffer.h: 135 - -sai_clear_ingress_priority_group_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_ingress_priority_group_stat_t), c_uint32) # /usr/include/sai/saibuffer.h: 150 - -enum__sai_buffer_pool_type_t = c_int # /usr/include/sai/saibuffer.h: 166 - -SAI_BUFFER_POOL_TYPE_INGRESS = 0 # /usr/include/sai/saibuffer.h: 166 - -SAI_BUFFER_POOL_TYPE_EGRESS = (SAI_BUFFER_POOL_TYPE_INGRESS + 1) # /usr/include/sai/saibuffer.h: 166 - -sai_buffer_pool_type_t = enum__sai_buffer_pool_type_t # /usr/include/sai/saibuffer.h: 166 - -enum__sai_buffer_pool_threshold_mode_t = c_int # /usr/include/sai/saibuffer.h: 179 - -SAI_BUFFER_POOL_THRESHOLD_MODE_STATIC = 0 # /usr/include/sai/saibuffer.h: 179 - -SAI_BUFFER_POOL_THRESHOLD_MODE_DYNAMIC = (SAI_BUFFER_POOL_THRESHOLD_MODE_STATIC + 1) # /usr/include/sai/saibuffer.h: 179 - -sai_buffer_pool_threshold_mode_t = enum__sai_buffer_pool_threshold_mode_t # /usr/include/sai/saibuffer.h: 179 - -enum__sai_buffer_pool_attr_t = c_int # /usr/include/sai/saibuffer.h: 241 - -SAI_BUFFER_POOL_ATTR_START = 0 # /usr/include/sai/saibuffer.h: 241 - -SAI_BUFFER_POOL_ATTR_SHARED_SIZE = SAI_BUFFER_POOL_ATTR_START # /usr/include/sai/saibuffer.h: 241 - -SAI_BUFFER_POOL_ATTR_TYPE = (SAI_BUFFER_POOL_ATTR_SHARED_SIZE + 1) # /usr/include/sai/saibuffer.h: 241 - -SAI_BUFFER_POOL_ATTR_SIZE = (SAI_BUFFER_POOL_ATTR_TYPE + 1) # /usr/include/sai/saibuffer.h: 241 - -SAI_BUFFER_POOL_ATTR_THRESHOLD_MODE = (SAI_BUFFER_POOL_ATTR_SIZE + 1) # /usr/include/sai/saibuffer.h: 241 - -SAI_BUFFER_POOL_ATTR_XOFF_SIZE = (SAI_BUFFER_POOL_ATTR_THRESHOLD_MODE + 1) # /usr/include/sai/saibuffer.h: 241 - -SAI_BUFFER_POOL_ATTR_END = (SAI_BUFFER_POOL_ATTR_XOFF_SIZE + 1) # /usr/include/sai/saibuffer.h: 241 - -sai_buffer_pool_attr_t = enum__sai_buffer_pool_attr_t # /usr/include/sai/saibuffer.h: 241 - -enum__sai_buffer_pool_stat_t = c_int # /usr/include/sai/saibuffer.h: 257 - -SAI_BUFFER_POOL_STAT_CURR_OCCUPANCY_BYTES = 0 # /usr/include/sai/saibuffer.h: 257 - -SAI_BUFFER_POOL_STAT_WATERMARK_BYTES = 1 # /usr/include/sai/saibuffer.h: 257 - -SAI_BUFFER_POOL_STAT_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saibuffer.h: 257 - -sai_buffer_pool_stat_t = enum__sai_buffer_pool_stat_t # /usr/include/sai/saibuffer.h: 257 - -sai_create_buffer_pool_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 269 - -sai_remove_buffer_pool_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saibuffer.h: 282 - -sai_set_buffer_pool_attr_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 293 - -sai_get_buffer_pool_attr_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 306 - -sai_get_buffer_pool_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_buffer_pool_stat_t), c_uint32, POINTER(c_uint64)) # /usr/include/sai/saibuffer.h: 321 - -enum__sai_buffer_profile_threshold_mode_t = c_int # /usr/include/sai/saibuffer.h: 341 - -SAI_BUFFER_PROFILE_THRESHOLD_MODE_STATIC = 0 # /usr/include/sai/saibuffer.h: 341 - -SAI_BUFFER_PROFILE_THRESHOLD_MODE_DYNAMIC = (SAI_BUFFER_PROFILE_THRESHOLD_MODE_STATIC + 1) # /usr/include/sai/saibuffer.h: 341 - -SAI_BUFFER_PROFILE_THRESHOLD_MODE_INHERIT_BUFFER_POOL_MODE = (SAI_BUFFER_PROFILE_THRESHOLD_MODE_DYNAMIC + 1) # /usr/include/sai/saibuffer.h: 341 - -sai_buffer_profile_threshold_mode_t = enum__sai_buffer_profile_threshold_mode_t # /usr/include/sai/saibuffer.h: 341 - -enum__sai_buffer_profile_attr_t = c_int # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_START = 0 # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_POOL_ID = SAI_BUFFER_PROFILE_ATTR_START # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE = (SAI_BUFFER_PROFILE_ATTR_POOL_ID + 1) # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_THRESHOLD_MODE = (SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE + 1) # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH = (SAI_BUFFER_PROFILE_ATTR_THRESHOLD_MODE + 1) # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_SHARED_STATIC_TH = (SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH + 1) # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_XOFF_TH = (SAI_BUFFER_PROFILE_ATTR_SHARED_STATIC_TH + 1) # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_XON_TH = (SAI_BUFFER_PROFILE_ATTR_XOFF_TH + 1) # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_XON_OFFSET_TH = (SAI_BUFFER_PROFILE_ATTR_XON_TH + 1) # /usr/include/sai/saibuffer.h: 465 - -SAI_BUFFER_PROFILE_ATTR_END = (SAI_BUFFER_PROFILE_ATTR_XON_OFFSET_TH + 1) # /usr/include/sai/saibuffer.h: 465 - -sai_buffer_profile_attr_t = enum__sai_buffer_profile_attr_t # /usr/include/sai/saibuffer.h: 465 - -sai_create_buffer_profile_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 477 - -sai_remove_buffer_profile_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saibuffer.h: 490 - -sai_set_buffer_profile_attr_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 501 - -sai_get_buffer_profile_attr_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saibuffer.h: 514 - -# /usr/include/sai/saibuffer.h: 538 -class struct__sai_buffer_api_t(Structure): - pass - -struct__sai_buffer_api_t.__slots__ = [ - 'create_buffer_pool', - 'remove_buffer_pool', - 'set_buffer_pool_attr', - 'get_buffer_pool_attr', - 'get_buffer_pool_stats', - 'set_ingress_priority_group_attr', - 'get_ingress_priority_group_attr', - 'get_ingress_priority_group_stats', - 'clear_ingress_priority_group_stats', - 'create_buffer_profile', - 'remove_buffer_profile', - 'set_buffer_profile_attr', - 'get_buffer_profile_attr', -] -struct__sai_buffer_api_t._fields_ = [ - ('create_buffer_pool', sai_create_buffer_pool_fn), - ('remove_buffer_pool', sai_remove_buffer_pool_fn), - ('set_buffer_pool_attr', sai_set_buffer_pool_attr_fn), - ('get_buffer_pool_attr', sai_get_buffer_pool_attr_fn), - ('get_buffer_pool_stats', sai_get_buffer_pool_stats_fn), - ('set_ingress_priority_group_attr', sai_set_ingress_priority_group_attr_fn), - ('get_ingress_priority_group_attr', sai_get_ingress_priority_group_attr_fn), - ('get_ingress_priority_group_stats', sai_get_ingress_priority_group_stats_fn), - ('clear_ingress_priority_group_stats', sai_clear_ingress_priority_group_stats_fn), - ('create_buffer_profile', sai_create_buffer_profile_fn), - ('remove_buffer_profile', sai_remove_buffer_profile_fn), - ('set_buffer_profile_attr', sai_set_buffer_profile_attr_fn), - ('get_buffer_profile_attr', sai_get_buffer_profile_attr_fn), -] - -sai_buffer_api_t = struct__sai_buffer_api_t # /usr/include/sai/saibuffer.h: 538 - -enum__sai_fdb_entry_type_t = c_int # /usr/include/sai/saifdb.h: 47 - -SAI_FDB_ENTRY_TYPE_DYNAMIC = 0 # /usr/include/sai/saifdb.h: 47 - -SAI_FDB_ENTRY_TYPE_STATIC = (SAI_FDB_ENTRY_TYPE_DYNAMIC + 1) # /usr/include/sai/saifdb.h: 47 - -sai_fdb_entry_type_t = enum__sai_fdb_entry_type_t # /usr/include/sai/saifdb.h: 47 - -# /usr/include/sai/saifdb.h: 77 -class struct__sai_fdb_entry_t(Structure): - pass - -struct__sai_fdb_entry_t.__slots__ = [ - 'switch_id', - 'mac_address', - 'bridge_type', - 'vlan_id', - 'bridge_id', -] -struct__sai_fdb_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('mac_address', sai_mac_t), - ('bridge_type', sai_fdb_entry_bridge_type_t), - ('vlan_id', sai_vlan_id_t), - ('bridge_id', sai_object_id_t), -] - -sai_fdb_entry_t = struct__sai_fdb_entry_t # /usr/include/sai/saifdb.h: 77 - -enum__sai_fdb_event_t = c_int # /usr/include/sai/saifdb.h: 96 - -SAI_FDB_EVENT_LEARNED = 0 # /usr/include/sai/saifdb.h: 96 - -SAI_FDB_EVENT_AGED = (SAI_FDB_EVENT_LEARNED + 1) # /usr/include/sai/saifdb.h: 96 - -SAI_FDB_EVENT_MOVE = (SAI_FDB_EVENT_AGED + 1) # /usr/include/sai/saifdb.h: 96 - -SAI_FDB_EVENT_FLUSHED = (SAI_FDB_EVENT_MOVE + 1) # /usr/include/sai/saifdb.h: 96 - -sai_fdb_event_t = enum__sai_fdb_event_t # /usr/include/sai/saifdb.h: 96 - -enum__sai_fdb_entry_attr_t = c_int # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_START = 0 # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_TYPE = SAI_FDB_ENTRY_ATTR_START # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_PACKET_ACTION = (SAI_FDB_ENTRY_ATTR_TYPE + 1) # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID = (SAI_FDB_ENTRY_ATTR_PACKET_ACTION + 1) # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_META_DATA = (SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID + 1) # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_END = (SAI_FDB_ENTRY_ATTR_META_DATA + 1) # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saifdb.h: 164 - -SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saifdb.h: 164 - -sai_fdb_entry_attr_t = enum__sai_fdb_entry_attr_t # /usr/include/sai/saifdb.h: 164 - -enum__sai_fdb_flush_entry_type_t = c_int # /usr/include/sai/saifdb.h: 177 - -SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC = 0 # /usr/include/sai/saifdb.h: 177 - -SAI_FDB_FLUSH_ENTRY_TYPE_STATIC = (SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC + 1) # /usr/include/sai/saifdb.h: 177 - -sai_fdb_flush_entry_type_t = enum__sai_fdb_flush_entry_type_t # /usr/include/sai/saifdb.h: 177 - -enum__sai_fdb_flush_attr_t = c_int # /usr/include/sai/saifdb.h: 237 - -SAI_FDB_FLUSH_ATTR_START = 0 # /usr/include/sai/saifdb.h: 237 - -SAI_FDB_FLUSH_ATTR_PORT_ID = SAI_FDB_FLUSH_ATTR_START # /usr/include/sai/saifdb.h: 237 - -SAI_FDB_FLUSH_ATTR_VLAN_ID = (SAI_FDB_FLUSH_ATTR_PORT_ID + 1) # /usr/include/sai/saifdb.h: 237 - -SAI_FDB_FLUSH_ATTR_ENTRY_TYPE = (SAI_FDB_FLUSH_ATTR_VLAN_ID + 1) # /usr/include/sai/saifdb.h: 237 - -SAI_FDB_FLUSH_ATTR_END = (SAI_FDB_FLUSH_ATTR_ENTRY_TYPE + 1) # /usr/include/sai/saifdb.h: 237 - -sai_fdb_flush_attr_t = enum__sai_fdb_flush_attr_t # /usr/include/sai/saifdb.h: 237 - -# /usr/include/sai/saifdb.h: 256 -class struct__sai_fdb_event_notification_data_t(Structure): - pass - -struct__sai_fdb_event_notification_data_t.__slots__ = [ - 'event_type', - 'fdb_entry', - 'attr_count', - 'attr', -] -struct__sai_fdb_event_notification_data_t._fields_ = [ - ('event_type', sai_fdb_event_t), - ('fdb_entry', sai_fdb_entry_t), - ('attr_count', c_uint32), - ('attr', POINTER(sai_attribute_t)), -] - -sai_fdb_event_notification_data_t = struct__sai_fdb_event_notification_data_t # /usr/include/sai/saifdb.h: 256 - -sai_create_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saifdb.h: 267 - -sai_remove_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t)) # /usr/include/sai/saifdb.h: 279 - -sai_set_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t), POINTER(sai_attribute_t)) # /usr/include/sai/saifdb.h: 290 - -sai_get_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saifdb.h: 303 - -sai_flush_fdb_entries_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saifdb.h: 317 - -sai_fdb_event_notification_fn = CFUNCTYPE(UNCHECKED(None), c_uint32, POINTER(sai_fdb_event_notification_data_t)) # /usr/include/sai/saifdb.h: 328 - -# /usr/include/sai/saifdb.h: 343 -class struct__sai_fdb_api_t(Structure): - pass - -struct__sai_fdb_api_t.__slots__ = [ - 'create_fdb_entry', - 'remove_fdb_entry', - 'set_fdb_entry_attribute', - 'get_fdb_entry_attribute', - 'flush_fdb_entries', -] -struct__sai_fdb_api_t._fields_ = [ - ('create_fdb_entry', sai_create_fdb_entry_fn), - ('remove_fdb_entry', sai_remove_fdb_entry_fn), - ('set_fdb_entry_attribute', sai_set_fdb_entry_attribute_fn), - ('get_fdb_entry_attribute', sai_get_fdb_entry_attribute_fn), - ('flush_fdb_entries', sai_flush_fdb_entries_fn), -] - -sai_fdb_api_t = struct__sai_fdb_api_t # /usr/include/sai/saifdb.h: 343 - -enum__sai_native_hash_field_t = c_int # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_SRC_IP = 0 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_DST_IP = 1 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_INNER_SRC_IP = 2 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_INNER_DST_IP = 3 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_VLAN_ID = 4 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_IP_PROTOCOL = 5 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_ETHERTYPE = 6 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_L4_SRC_PORT = 7 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_L4_DST_PORT = 8 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_SRC_MAC = 9 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_DST_MAC = 10 # /usr/include/sai/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_IN_PORT = 11 # /usr/include/sai/saihash.h: 85 - -sai_native_hash_field_t = enum__sai_native_hash_field_t # /usr/include/sai/saihash.h: 85 - -enum__sai_hash_attr_t = c_int # /usr/include/sai/saihash.h: 121 - -SAI_HASH_ATTR_START = 0 # /usr/include/sai/saihash.h: 121 - -SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST = SAI_HASH_ATTR_START # /usr/include/sai/saihash.h: 121 - -SAI_HASH_ATTR_UDF_GROUP_LIST = (SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST + 1) # /usr/include/sai/saihash.h: 121 - -SAI_HASH_ATTR_END = (SAI_HASH_ATTR_UDF_GROUP_LIST + 1) # /usr/include/sai/saihash.h: 121 - -sai_hash_attr_t = enum__sai_hash_attr_t # /usr/include/sai/saihash.h: 121 - -sai_create_hash_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihash.h: 133 - -sai_remove_hash_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saihash.h: 146 - -sai_set_hash_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saihash.h: 157 - -sai_get_hash_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihash.h: 170 - -# /usr/include/sai/saihash.h: 185 -class struct__sai_hash_api_t(Structure): - pass - -struct__sai_hash_api_t.__slots__ = [ - 'create_hash', - 'remove_hash', - 'set_hash_attribute', - 'get_hash_attribute', -] -struct__sai_hash_api_t._fields_ = [ - ('create_hash', sai_create_hash_fn), - ('remove_hash', sai_remove_hash_fn), - ('set_hash_attribute', sai_set_hash_attribute_fn), - ('get_hash_attribute', sai_get_hash_attribute_fn), -] - -sai_hash_api_t = struct__sai_hash_api_t # /usr/include/sai/saihash.h: 185 - -enum__sai_hostif_trap_group_attr_t = c_int # /usr/include/sai/saihostintf.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_START = 0 # /usr/include/sai/saihostintf.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_ADMIN_STATE = SAI_HOSTIF_TRAP_GROUP_ATTR_START # /usr/include/sai/saihostintf.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE = (SAI_HOSTIF_TRAP_GROUP_ATTR_ADMIN_STATE + 1) # /usr/include/sai/saihostintf.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER = (SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE + 1) # /usr/include/sai/saihostintf.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_END = (SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER + 1) # /usr/include/sai/saihostintf.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saihostintf.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_TRAP_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saihostintf.h: 99 - -sai_hostif_trap_group_attr_t = enum__sai_hostif_trap_group_attr_t # /usr/include/sai/saihostintf.h: 99 - -sai_create_hostif_trap_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 111 - -sai_remove_hostif_trap_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saihostintf.h: 124 - -sai_set_hostif_trap_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 135 - -sai_get_hostif_trap_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 148 - -enum__sai_hostif_trap_type_t = c_int # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_START = 0 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_STP = SAI_HOSTIF_TRAP_TYPE_START # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_LACP = 1 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_EAPOL = 2 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_LLDP = 3 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_PVRST = 4 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_QUERY = 5 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_LEAVE = 6 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_V1_REPORT = 7 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_V2_REPORT = 8 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_V3_REPORT = 9 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SAMPLEPACKET = 10 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SWITCH_CUSTOM_RANGE_BASE = 4096 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_ARP_REQUEST = 8192 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_ARP_RESPONSE = 8193 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_DHCP = 8194 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_OSPF = 8195 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_PIM = 8196 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_VRRP = 8197 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_DHCPV6 = 8198 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_OSPFV6 = 8199 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_VRRPV6 = 8200 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_NEIGHBOR_DISCOVERY = 8201 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_MLD_V1_V2 = 8202 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_MLD_V1_REPORT = 8203 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_MLD_V1_DONE = 8204 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_MLD_V2_REPORT = 8205 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_UNKNOWN_L3_MULTICAST = 8206 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_ROUTER_CUSTOM_RANGE_BASE = 12288 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IP2ME = 16384 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SSH = 16385 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SNMP = 16386 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_BGP = 16387 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_BGPV6 = 16388 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_LOCAL_IP_CUSTOM_RANGE_BASE = 20480 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_L3_MTU_ERROR = 24576 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_TTL_ERROR = 24577 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_CUSTOM_EXCEPTION_RANGE_BASE = 28672 # /usr/include/sai/saihostintf.h: 314 - -SAI_HOSTIF_TRAP_TYPE_END = 32768 # /usr/include/sai/saihostintf.h: 314 - -sai_hostif_trap_type_t = enum__sai_hostif_trap_type_t # /usr/include/sai/saihostintf.h: 314 - -enum__sai_hostif_trap_attr_t = c_int # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_START = 0 # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_TRAP_TYPE = SAI_HOSTIF_TRAP_ATTR_START # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION = (SAI_HOSTIF_TRAP_ATTR_TRAP_TYPE + 1) # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY = (SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION + 1) # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_EXCLUDE_PORT_LIST = (SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY + 1) # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP = (SAI_HOSTIF_TRAP_ATTR_EXCLUDE_PORT_LIST + 1) # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_END = (SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP + 1) # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saihostintf.h: 390 - -SAI_HOSTIF_TRAP_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_TRAP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saihostintf.h: 390 - -sai_hostif_trap_attr_t = enum__sai_hostif_trap_attr_t # /usr/include/sai/saihostintf.h: 390 - -sai_create_hostif_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 402 - -sai_remove_hostif_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saihostintf.h: 415 - -sai_set_hostif_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 426 - -sai_get_hostif_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 439 - -enum__sai_hostif_user_defined_trap_type_t = c_int # /usr/include/sai/saihostintf.h: 474 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_START = 0 # /usr/include/sai/saihostintf.h: 474 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ROUTER = SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_START # /usr/include/sai/saihostintf.h: 474 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_NEIGH = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ROUTER + 1) # /usr/include/sai/saihostintf.h: 474 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ACL = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_NEIGH + 1) # /usr/include/sai/saihostintf.h: 474 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_FDB = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ACL + 1) # /usr/include/sai/saihostintf.h: 474 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE = 4096 # /usr/include/sai/saihostintf.h: 474 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_END = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE + 1) # /usr/include/sai/saihostintf.h: 474 - -sai_hostif_user_defined_trap_type_t = enum__sai_hostif_user_defined_trap_type_t # /usr/include/sai/saihostintf.h: 474 - -enum__sai_hostif_user_defined_trap_attr_t = c_int # /usr/include/sai/saihostintf.h: 526 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_START = 0 # /usr/include/sai/saihostintf.h: 526 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TYPE = SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_START # /usr/include/sai/saihostintf.h: 526 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_PRIORITY = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TYPE + 1) # /usr/include/sai/saihostintf.h: 526 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_GROUP = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_PRIORITY + 1) # /usr/include/sai/saihostintf.h: 526 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_END = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_GROUP + 1) # /usr/include/sai/saihostintf.h: 526 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saihostintf.h: 526 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saihostintf.h: 526 - -sai_hostif_user_defined_trap_attr_t = enum__sai_hostif_user_defined_trap_attr_t # /usr/include/sai/saihostintf.h: 526 - -sai_create_hostif_user_defined_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 538 - -sai_remove_hostif_user_defined_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saihostintf.h: 551 - -sai_set_hostif_user_defined_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 562 - -sai_get_hostif_user_defined_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 575 - -enum__sai_hostif_type_t = c_int # /usr/include/sai/saihostintf.h: 591 - -SAI_HOSTIF_TYPE_NETDEV = 0 # /usr/include/sai/saihostintf.h: 591 - -SAI_HOSTIF_TYPE_FD = (SAI_HOSTIF_TYPE_NETDEV + 1) # /usr/include/sai/saihostintf.h: 591 - -sai_hostif_type_t = enum__sai_hostif_type_t # /usr/include/sai/saihostintf.h: 591 - -enum__sai_hostif_attr_t = c_int # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_START = 0 # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_TYPE = SAI_HOSTIF_ATTR_START # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_OBJ_ID = (SAI_HOSTIF_ATTR_TYPE + 1) # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_NAME = (SAI_HOSTIF_ATTR_OBJ_ID + 1) # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_OPER_STATUS = (SAI_HOSTIF_ATTR_NAME + 1) # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_END = (SAI_HOSTIF_ATTR_OPER_STATUS + 1) # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saihostintf.h: 660 - -SAI_HOSTIF_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saihostintf.h: 660 - -sai_hostif_attr_t = enum__sai_hostif_attr_t # /usr/include/sai/saihostintf.h: 660 - -sai_create_hostif_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 672 - -sai_remove_hostif_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saihostintf.h: 685 - -sai_set_hostif_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 696 - -sai_get_hostif_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 709 - -enum__sai_hostif_table_entry_type_t = c_int # /usr/include/sai/saihostintf.h: 734 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_PORT = 0 # /usr/include/sai/saihostintf.h: 734 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_LAG = (SAI_HOSTIF_TABLE_ENTRY_TYPE_PORT + 1) # /usr/include/sai/saihostintf.h: 734 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_VLAN = (SAI_HOSTIF_TABLE_ENTRY_TYPE_LAG + 1) # /usr/include/sai/saihostintf.h: 734 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_TRAP_ID = (SAI_HOSTIF_TABLE_ENTRY_TYPE_VLAN + 1) # /usr/include/sai/saihostintf.h: 734 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_WILDCARD = (SAI_HOSTIF_TABLE_ENTRY_TYPE_TRAP_ID + 1) # /usr/include/sai/saihostintf.h: 734 - -sai_hostif_table_entry_type_t = enum__sai_hostif_table_entry_type_t # /usr/include/sai/saihostintf.h: 734 - -enum__sai_hostif_table_entry_channel_type_t = c_int # /usr/include/sai/saihostintf.h: 756 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_CB = 0 # /usr/include/sai/saihostintf.h: 756 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_FD = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_CB + 1) # /usr/include/sai/saihostintf.h: 756 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_PHYSICAL_PORT = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_FD + 1) # /usr/include/sai/saihostintf.h: 756 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_LOGICAL_PORT = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_PHYSICAL_PORT + 1) # /usr/include/sai/saihostintf.h: 756 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_L3 = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_LOGICAL_PORT + 1) # /usr/include/sai/saihostintf.h: 756 - -sai_hostif_table_entry_channel_type_t = enum__sai_hostif_table_entry_channel_type_t # /usr/include/sai/saihostintf.h: 756 - -enum__sai_hostif_table_entry_attr_t = c_int # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_START = 0 # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_TYPE = SAI_HOSTIF_ATTR_START # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_OBJ_ID = (SAI_HOSTIF_TABLE_ENTRY_ATTR_TYPE + 1) # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_TRAP_ID = (SAI_HOSTIF_TABLE_ENTRY_ATTR_OBJ_ID + 1) # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_CHANNEL_TYPE = (SAI_HOSTIF_TABLE_ENTRY_ATTR_TRAP_ID + 1) # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_HOST_IF = (SAI_HOSTIF_TABLE_ENTRY_ATTR_CHANNEL_TYPE + 1) # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_END = (SAI_HOSTIF_TABLE_ENTRY_ATTR_HOST_IF + 1) # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saihostintf.h: 835 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saihostintf.h: 835 - -sai_hostif_table_entry_attr_t = enum__sai_hostif_table_entry_attr_t # /usr/include/sai/saihostintf.h: 835 - -sai_create_hostif_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 847 - -sai_remove_hostif_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saihostintf.h: 860 - -sai_set_hostif_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 871 - -sai_get_hostif_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 884 - -enum__sai_hostif_tx_type_t = c_int # /usr/include/sai/saihostintf.h: 906 - -SAI_HOSTIF_TX_TYPE_PIPELINE_BYPASS = 0 # /usr/include/sai/saihostintf.h: 906 - -SAI_HOSTIF_TX_TYPE_PIPELINE_LOOKUP = (SAI_HOSTIF_TX_TYPE_PIPELINE_BYPASS + 1) # /usr/include/sai/saihostintf.h: 906 - -SAI_HOSTIF_TX_TYPE_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saihostintf.h: 906 - -sai_hostif_tx_type_t = enum__sai_hostif_tx_type_t # /usr/include/sai/saihostintf.h: 906 - -enum__sai_hostif_packet_attr_t = c_int # /usr/include/sai/saihostintf.h: 971 - -SAI_HOSTIF_PACKET_ATTR_START = 0 # /usr/include/sai/saihostintf.h: 971 - -SAI_HOSTIF_PACKET_ATTR_HOSTIF_TRAP_ID = SAI_HOSTIF_PACKET_ATTR_START # /usr/include/sai/saihostintf.h: 971 - -SAI_HOSTIF_PACKET_ATTR_INGRESS_PORT = (SAI_HOSTIF_PACKET_ATTR_HOSTIF_TRAP_ID + 1) # /usr/include/sai/saihostintf.h: 971 - -SAI_HOSTIF_PACKET_ATTR_INGRESS_LAG = (SAI_HOSTIF_PACKET_ATTR_INGRESS_PORT + 1) # /usr/include/sai/saihostintf.h: 971 - -SAI_HOSTIF_PACKET_ATTR_HOSTIF_TX_TYPE = (SAI_HOSTIF_PACKET_ATTR_INGRESS_LAG + 1) # /usr/include/sai/saihostintf.h: 971 - -SAI_HOSTIF_PACKET_ATTR_EGRESS_PORT_OR_LAG = (SAI_HOSTIF_PACKET_ATTR_HOSTIF_TX_TYPE + 1) # /usr/include/sai/saihostintf.h: 971 - -SAI_HOSTIF_PACKET_ATTR_END = (SAI_HOSTIF_PACKET_ATTR_EGRESS_PORT_OR_LAG + 1) # /usr/include/sai/saihostintf.h: 971 - -sai_hostif_packet_attr_t = enum__sai_hostif_packet_attr_t # /usr/include/sai/saihostintf.h: 971 - -sai_recv_hostif_packet_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(None), POINTER(sai_size_t), POINTER(c_uint32), POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 987 - -sai_send_hostif_packet_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(None), sai_size_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 1007 - -sai_packet_event_notification_fn = CFUNCTYPE(UNCHECKED(None), sai_object_id_t, POINTER(None), sai_size_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saihostintf.h: 1023 - -# /usr/include/sai/saihostintf.h: 1057 -class struct__sai_hostif_api_t(Structure): - pass - -struct__sai_hostif_api_t.__slots__ = [ - 'create_hostif', - 'remove_hostif', - 'set_hostif_attribute', - 'get_hostif_attribute', - 'create_hostif_table_entry', - 'remove_hostif_table_entry', - 'set_hostif_table_entry_attribute', - 'get_hostif_table_entry_attribute', - 'create_hostif_trap_group', - 'remove_hostif_trap_group', - 'set_trap_group_attribute', - 'get_trap_group_attribute', - 'create_trap', - 'remove_trap', - 'set_trap_attribute', - 'get_trap_attribute', - 'create_user_defined_trap', - 'remove_user_defined_trap', - 'set_user_defined_trap_attribute', - 'get_user_defined_trap_attribute', - 'recv_packet', - 'send_packet', -] -struct__sai_hostif_api_t._fields_ = [ - ('create_hostif', sai_create_hostif_fn), - ('remove_hostif', sai_remove_hostif_fn), - ('set_hostif_attribute', sai_set_hostif_attribute_fn), - ('get_hostif_attribute', sai_get_hostif_attribute_fn), - ('create_hostif_table_entry', sai_create_hostif_table_entry_fn), - ('remove_hostif_table_entry', sai_remove_hostif_table_entry_fn), - ('set_hostif_table_entry_attribute', sai_set_hostif_table_entry_attribute_fn), - ('get_hostif_table_entry_attribute', sai_get_hostif_table_entry_attribute_fn), - ('create_hostif_trap_group', sai_create_hostif_trap_group_fn), - ('remove_hostif_trap_group', sai_remove_hostif_trap_group_fn), - ('set_trap_group_attribute', sai_set_hostif_trap_group_attribute_fn), - ('get_trap_group_attribute', sai_get_hostif_trap_group_attribute_fn), - ('create_trap', sai_create_hostif_trap_fn), - ('remove_trap', sai_remove_hostif_trap_fn), - ('set_trap_attribute', sai_set_hostif_trap_attribute_fn), - ('get_trap_attribute', sai_get_hostif_trap_attribute_fn), - ('create_user_defined_trap', sai_create_hostif_user_defined_trap_fn), - ('remove_user_defined_trap', sai_remove_hostif_user_defined_trap_fn), - ('set_user_defined_trap_attribute', sai_set_hostif_user_defined_trap_attribute_fn), - ('get_user_defined_trap_attribute', sai_get_hostif_user_defined_trap_attribute_fn), - ('recv_packet', sai_recv_hostif_packet_fn), - ('send_packet', sai_send_hostif_packet_fn), -] - -sai_hostif_api_t = struct__sai_hostif_api_t # /usr/include/sai/saihostintf.h: 1057 - -enum__sai_lag_attr_t = c_int # /usr/include/sai/sailag.h: 100 - -SAI_LAG_ATTR_START = 0 # /usr/include/sai/sailag.h: 100 - -SAI_LAG_ATTR_PORT_LIST = SAI_LAG_ATTR_START # /usr/include/sai/sailag.h: 100 - -SAI_LAG_ATTR_INGRESS_ACL = (SAI_LAG_ATTR_PORT_LIST + 1) # /usr/include/sai/sailag.h: 100 - -SAI_LAG_ATTR_EGRESS_ACL = (SAI_LAG_ATTR_INGRESS_ACL + 1) # /usr/include/sai/sailag.h: 100 - -SAI_LAG_ATTR_END = (SAI_LAG_ATTR_EGRESS_ACL + 1) # /usr/include/sai/sailag.h: 100 - -SAI_LAG_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sailag.h: 100 - -SAI_LAG_ATTR_CUSTOM_RANGE_END = (SAI_LAG_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sailag.h: 100 - -sai_lag_attr_t = enum__sai_lag_attr_t # /usr/include/sai/sailag.h: 100 - -sai_create_lag_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sailag.h: 112 - -sai_remove_lag_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sailag.h: 125 - -sai_set_lag_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sailag.h: 136 - -sai_get_lag_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sailag.h: 149 - -enum__sai_lag_member_attr_t = c_int # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_START = 0 # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_LAG_ID = SAI_LAG_MEMBER_ATTR_START # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_PORT_ID = (SAI_LAG_MEMBER_ATTR_LAG_ID + 1) # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_EGRESS_DISABLE = (SAI_LAG_MEMBER_ATTR_PORT_ID + 1) # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_INGRESS_DISABLE = (SAI_LAG_MEMBER_ATTR_EGRESS_DISABLE + 1) # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_END = (SAI_LAG_MEMBER_ATTR_INGRESS_DISABLE + 1) # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_LAG_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sailag.h: 211 - -sai_lag_member_attr_t = enum__sai_lag_member_attr_t # /usr/include/sai/sailag.h: 211 - -sai_create_lag_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sailag.h: 223 - -sai_remove_lag_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sailag.h: 236 - -sai_set_lag_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sailag.h: 247 - -sai_get_lag_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sailag.h: 260 - -# /usr/include/sai/sailag.h: 278 -class struct__sai_lag_api_t(Structure): - pass - -struct__sai_lag_api_t.__slots__ = [ - 'create_lag', - 'remove_lag', - 'set_lag_attribute', - 'get_lag_attribute', - 'create_lag_member', - 'remove_lag_member', - 'set_lag_member_attribute', - 'get_lag_member_attribute', -] -struct__sai_lag_api_t._fields_ = [ - ('create_lag', sai_create_lag_fn), - ('remove_lag', sai_remove_lag_fn), - ('set_lag_attribute', sai_set_lag_attribute_fn), - ('get_lag_attribute', sai_get_lag_attribute_fn), - ('create_lag_member', sai_create_lag_member_fn), - ('remove_lag_member', sai_remove_lag_member_fn), - ('set_lag_member_attribute', sai_set_lag_member_attribute_fn), - ('get_lag_member_attribute', sai_get_lag_member_attribute_fn), -] - -sai_lag_api_t = struct__sai_lag_api_t # /usr/include/sai/sailag.h: 278 - -enum__sai_mirror_session_type_t = c_int # /usr/include/sai/saimirror.h: 50 - -SAI_MIRROR_SESSION_TYPE_LOCAL = 0 # /usr/include/sai/saimirror.h: 50 - -SAI_MIRROR_SESSION_TYPE_REMOTE = (SAI_MIRROR_SESSION_TYPE_LOCAL + 1) # /usr/include/sai/saimirror.h: 50 - -SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE = (SAI_MIRROR_SESSION_TYPE_REMOTE + 1) # /usr/include/sai/saimirror.h: 50 - -sai_mirror_session_type_t = enum__sai_mirror_session_type_t # /usr/include/sai/saimirror.h: 50 - -enum__sai_erspan_encapsulation_type_t = c_int # /usr/include/sai/saimirror.h: 62 - -SAI_ERSPAN_ENCAPSULATION_TYPE_MIRROR_L3_GRE_TUNNEL = 0 # /usr/include/sai/saimirror.h: 62 - -sai_erspan_encapsulation_type_t = enum__sai_erspan_encapsulation_type_t # /usr/include/sai/saimirror.h: 62 - -enum__sai_mirror_session_attr_t = c_int # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_START = 0 # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_TYPE = SAI_MIRROR_SESSION_ATTR_START # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_MONITOR_PORT = (SAI_MIRROR_SESSION_ATTR_TYPE + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_TRUNCATE_SIZE = (SAI_MIRROR_SESSION_ATTR_MONITOR_PORT + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_TC = (SAI_MIRROR_SESSION_ATTR_TRUNCATE_SIZE + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_VLAN_TPID = (SAI_MIRROR_SESSION_ATTR_TC + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_VLAN_ID = (SAI_MIRROR_SESSION_ATTR_VLAN_TPID + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_VLAN_PRI = (SAI_MIRROR_SESSION_ATTR_VLAN_ID + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_VLAN_CFI = (SAI_MIRROR_SESSION_ATTR_VLAN_PRI + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE = (SAI_MIRROR_SESSION_ATTR_VLAN_CFI + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_IPHDR_VERSION = (SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_TOS = (SAI_MIRROR_SESSION_ATTR_IPHDR_VERSION + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_TTL = (SAI_MIRROR_SESSION_ATTR_TOS + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS = (SAI_MIRROR_SESSION_ATTR_TTL + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS = (SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS = (SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS = (SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_GRE_PROTOCOL_TYPE = (SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS + 1) # /usr/include/sai/saimirror.h: 241 - -SAI_MIRROR_SESSION_ATTR_END = (SAI_MIRROR_SESSION_ATTR_GRE_PROTOCOL_TYPE + 1) # /usr/include/sai/saimirror.h: 241 - -sai_mirror_session_attr_t = enum__sai_mirror_session_attr_t # /usr/include/sai/saimirror.h: 241 - -sai_create_mirror_session_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saimirror.h: 254 - -sai_remove_mirror_session_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saimirror.h: 268 - -sai_set_mirror_session_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saimirror.h: 280 - -sai_get_mirror_session_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saimirror.h: 294 - -# /usr/include/sai/saimirror.h: 309 -class struct__sai_mirror_api_t(Structure): - pass - -struct__sai_mirror_api_t.__slots__ = [ - 'create_mirror_session', - 'remove_mirror_session', - 'set_mirror_session_attribute', - 'get_mirror_session_attribute', -] -struct__sai_mirror_api_t._fields_ = [ - ('create_mirror_session', sai_create_mirror_session_fn), - ('remove_mirror_session', sai_remove_mirror_session_fn), - ('set_mirror_session_attribute', sai_set_mirror_session_attribute_fn), - ('get_mirror_session_attribute', sai_get_mirror_session_attribute_fn), -] - -sai_mirror_api_t = struct__sai_mirror_api_t # /usr/include/sai/saimirror.h: 309 - -enum__sai_neighbor_entry_attr_t = c_int # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_START = 0 # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS = SAI_NEIGHBOR_ENTRY_ATTR_START # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_PACKET_ACTION = (SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS + 1) # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE = (SAI_NEIGHBOR_ENTRY_ATTR_PACKET_ACTION + 1) # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_META_DATA = (SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE + 1) # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_END = (SAI_NEIGHBOR_ENTRY_ATTR_META_DATA + 1) # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saineighbor.h: 102 - -SAI_NEIGHBOR_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_NEIGHBOR_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saineighbor.h: 102 - -sai_neighbor_entry_attr_t = enum__sai_neighbor_entry_attr_t # /usr/include/sai/saineighbor.h: 102 - -# /usr/include/sai/saineighbor.h: 128 -class struct__sai_neighbor_entry_t(Structure): - pass - -struct__sai_neighbor_entry_t.__slots__ = [ - 'switch_id', - 'rif_id', - 'ip_address', -] -struct__sai_neighbor_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('rif_id', sai_object_id_t), - ('ip_address', sai_ip_address_t), -] - -sai_neighbor_entry_t = struct__sai_neighbor_entry_t # /usr/include/sai/saineighbor.h: 128 - -sai_create_neighbor_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saineighbor.h: 141 - -sai_remove_neighbor_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t)) # /usr/include/sai/saineighbor.h: 155 - -sai_set_neighbor_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t), POINTER(sai_attribute_t)) # /usr/include/sai/saineighbor.h: 166 - -sai_get_neighbor_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saineighbor.h: 179 - -sai_remove_all_neighbor_entries_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saineighbor.h: 190 - -# /usr/include/sai/saineighbor.h: 204 -class struct__sai_neighbor_api_t(Structure): - pass - -struct__sai_neighbor_api_t.__slots__ = [ - 'create_neighbor_entry', - 'remove_neighbor_entry', - 'set_neighbor_attribute', - 'get_neighbor_attribute', - 'remove_all_neighbor_entries', -] -struct__sai_neighbor_api_t._fields_ = [ - ('create_neighbor_entry', sai_create_neighbor_entry_fn), - ('remove_neighbor_entry', sai_remove_neighbor_entry_fn), - ('set_neighbor_attribute', sai_set_neighbor_attribute_fn), - ('get_neighbor_attribute', sai_get_neighbor_attribute_fn), - ('remove_all_neighbor_entries', sai_remove_all_neighbor_entries_fn), -] - -sai_neighbor_api_t = struct__sai_neighbor_api_t # /usr/include/sai/saineighbor.h: 204 - -enum__sai_next_hop_group_type_t = c_int # /usr/include/sai/sainexthopgroup.h: 46 - -SAI_NEXT_HOP_GROUP_TYPE_ECMP = 0 # /usr/include/sai/sainexthopgroup.h: 46 - -sai_next_hop_group_type_t = enum__sai_next_hop_group_type_t # /usr/include/sai/sainexthopgroup.h: 46 - -enum__sai_next_hop_group_attr_t = c_int # /usr/include/sai/sainexthopgroup.h: 93 - -SAI_NEXT_HOP_GROUP_ATTR_START = 0 # /usr/include/sai/sainexthopgroup.h: 93 - -SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_COUNT = SAI_NEXT_HOP_GROUP_ATTR_START # /usr/include/sai/sainexthopgroup.h: 93 - -SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_MEMBER_LIST = (SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_COUNT + 1) # /usr/include/sai/sainexthopgroup.h: 93 - -SAI_NEXT_HOP_GROUP_ATTR_TYPE = (SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_MEMBER_LIST + 1) # /usr/include/sai/sainexthopgroup.h: 93 - -SAI_NEXT_HOP_GROUP_ATTR_END = (SAI_NEXT_HOP_GROUP_ATTR_TYPE + 1) # /usr/include/sai/sainexthopgroup.h: 93 - -SAI_NEXT_HOP_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sainexthopgroup.h: 93 - -SAI_NEXT_HOP_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_NEXT_HOP_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sainexthopgroup.h: 93 - -sai_next_hop_group_attr_t = enum__sai_next_hop_group_attr_t # /usr/include/sai/sainexthopgroup.h: 93 - -enum__sai_next_hop_group_member_attr_t = c_int # /usr/include/sai/sainexthopgroup.h: 137 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_START = 0 # /usr/include/sai/sainexthopgroup.h: 137 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_GROUP_ID = SAI_NEXT_HOP_GROUP_MEMBER_ATTR_START # /usr/include/sai/sainexthopgroup.h: 137 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_ID = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_GROUP_ID + 1) # /usr/include/sai/sainexthopgroup.h: 137 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_WEIGHT = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_ID + 1) # /usr/include/sai/sainexthopgroup.h: 137 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_END = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_WEIGHT + 1) # /usr/include/sai/sainexthopgroup.h: 137 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sainexthopgroup.h: 137 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sainexthopgroup.h: 137 - -sai_next_hop_group_member_attr_t = enum__sai_next_hop_group_member_attr_t # /usr/include/sai/sainexthopgroup.h: 137 - -sai_create_next_hop_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthopgroup.h: 149 - -sai_remove_next_hop_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sainexthopgroup.h: 162 - -sai_set_next_hop_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthopgroup.h: 173 - -sai_get_next_hop_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthopgroup.h: 186 - -sai_create_next_hop_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthopgroup.h: 200 - -sai_remove_next_hop_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sainexthopgroup.h: 213 - -sai_set_next_hop_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthopgroup.h: 225 - -sai_get_next_hop_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthopgroup.h: 240 - -# /usr/include/sai/sainexthopgroup.h: 260 -class struct__sai_next_hop_group_api_t(Structure): - pass - -struct__sai_next_hop_group_api_t.__slots__ = [ - 'create_next_hop_group', - 'remove_next_hop_group', - 'set_next_hop_group_attribute', - 'get_next_hop_group_attribute', - 'create_next_hop_group_member', - 'remove_next_hop_group_member', - 'set_next_hop_group_member_attribute', - 'get_next_hop_group_member_attribute', -] -struct__sai_next_hop_group_api_t._fields_ = [ - ('create_next_hop_group', sai_create_next_hop_group_fn), - ('remove_next_hop_group', sai_remove_next_hop_group_fn), - ('set_next_hop_group_attribute', sai_set_next_hop_group_attribute_fn), - ('get_next_hop_group_attribute', sai_get_next_hop_group_attribute_fn), - ('create_next_hop_group_member', sai_create_next_hop_group_member_fn), - ('remove_next_hop_group_member', sai_remove_next_hop_group_member_fn), - ('set_next_hop_group_member_attribute', sai_set_next_hop_group_member_attribute_fn), - ('get_next_hop_group_member_attribute', sai_get_next_hop_group_member_attribute_fn), -] - -sai_next_hop_group_api_t = struct__sai_next_hop_group_api_t # /usr/include/sai/sainexthopgroup.h: 260 - -enum__sai_next_hop_type_t = c_int # /usr/include/sai/sainexthop.h: 50 - -SAI_NEXT_HOP_TYPE_IP = 0 # /usr/include/sai/sainexthop.h: 50 - -SAI_NEXT_HOP_TYPE_MPLS = (SAI_NEXT_HOP_TYPE_IP + 1) # /usr/include/sai/sainexthop.h: 50 - -SAI_NEXT_HOP_TYPE_TUNNEL_ENCAP = (SAI_NEXT_HOP_TYPE_MPLS + 1) # /usr/include/sai/sainexthop.h: 50 - -sai_next_hop_type_t = enum__sai_next_hop_type_t # /usr/include/sai/sainexthop.h: 50 - -enum__sai_next_hop_attr_t = c_int # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_START = 0 # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_TYPE = SAI_NEXT_HOP_ATTR_START # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_IP = (SAI_NEXT_HOP_ATTR_TYPE + 1) # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID = (SAI_NEXT_HOP_ATTR_IP + 1) # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_TUNNEL_ID = (SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID + 1) # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_END = (SAI_NEXT_HOP_ATTR_TUNNEL_ID + 1) # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_CUSTOM_RANGE_END = (SAI_NEXT_HOP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sainexthop.h: 109 - -sai_next_hop_attr_t = enum__sai_next_hop_attr_t # /usr/include/sai/sainexthop.h: 109 - -sai_create_next_hop_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthop.h: 123 - -sai_remove_next_hop_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sainexthop.h: 136 - -sai_set_next_hop_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthop.h: 147 - -sai_get_next_hop_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sainexthop.h: 160 - -# /usr/include/sai/sainexthop.h: 175 -class struct__sai_next_hop_api_t(Structure): - pass - -struct__sai_next_hop_api_t.__slots__ = [ - 'create_next_hop', - 'remove_next_hop', - 'set_next_hop_attribute', - 'get_next_hop_attribute', -] -struct__sai_next_hop_api_t._fields_ = [ - ('create_next_hop', sai_create_next_hop_fn), - ('remove_next_hop', sai_remove_next_hop_fn), - ('set_next_hop_attribute', sai_set_next_hop_attribute_fn), - ('get_next_hop_attribute', sai_get_next_hop_attribute_fn), -] - -sai_next_hop_api_t = struct__sai_next_hop_api_t # /usr/include/sai/sainexthop.h: 175 - -# /usr/include/sai/saimcfdb.h: 54 -class struct__sai_mcast_fdb_entry_t(Structure): - pass - -struct__sai_mcast_fdb_entry_t.__slots__ = [ - 'switch_id', - 'mac_address', - 'vlan_id', -] -struct__sai_mcast_fdb_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('mac_address', sai_mac_t), - ('vlan_id', sai_vlan_id_t), -] - -sai_mcast_fdb_entry_t = struct__sai_mcast_fdb_entry_t # /usr/include/sai/saimcfdb.h: 54 - -enum__sai_mcast_fdb_entry_attr_t = c_int # /usr/include/sai/saimcfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_START = 0 # /usr/include/sai/saimcfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_GROUP_ID = SAI_MCAST_FDB_ENTRY_ATTR_START # /usr/include/sai/saimcfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_PACKET_ACTION = (SAI_MCAST_FDB_ENTRY_ATTR_GROUP_ID + 1) # /usr/include/sai/saimcfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_META_DATA = (SAI_MCAST_FDB_ENTRY_ATTR_PACKET_ACTION + 1) # /usr/include/sai/saimcfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_END = (SAI_MCAST_FDB_ENTRY_ATTR_META_DATA + 1) # /usr/include/sai/saimcfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saimcfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_MCAST_FDB_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saimcfdb.h: 108 - -sai_mcast_fdb_entry_attr_t = enum__sai_mcast_fdb_entry_attr_t # /usr/include/sai/saimcfdb.h: 108 - -sai_create_mcast_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saimcfdb.h: 119 - -sai_remove_mcast_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t)) # /usr/include/sai/saimcfdb.h: 131 - -sai_set_mcast_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t), POINTER(sai_attribute_t)) # /usr/include/sai/saimcfdb.h: 142 - -sai_get_mcast_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saimcfdb.h: 155 - -# /usr/include/sai/saimcfdb.h: 170 -class struct__sai_mcast_fdb_api_t(Structure): - pass - -struct__sai_mcast_fdb_api_t.__slots__ = [ - 'create_mcast_fdb_entry', - 'remove_mcast_fdb_entry', - 'set_mcast_fdb_entry_attribute', - 'get_mcast_fdb_entry_attribute', -] -struct__sai_mcast_fdb_api_t._fields_ = [ - ('create_mcast_fdb_entry', sai_create_mcast_fdb_entry_fn), - ('remove_mcast_fdb_entry', sai_remove_mcast_fdb_entry_fn), - ('set_mcast_fdb_entry_attribute', sai_set_mcast_fdb_entry_attribute_fn), - ('get_mcast_fdb_entry_attribute', sai_get_mcast_fdb_entry_attribute_fn), -] - -sai_mcast_fdb_api_t = struct__sai_mcast_fdb_api_t # /usr/include/sai/saimcfdb.h: 170 - -enum__sai_l2mc_entry_type_t = c_int # /usr/include/sai/sail2mc.h: 47 - -SAI_L2MC_ENTRY_TYPE_SG = 0 # /usr/include/sai/sail2mc.h: 47 - -SAI_L2MC_ENTRY_TYPE_XG = (SAI_L2MC_ENTRY_TYPE_SG + 1) # /usr/include/sai/sail2mc.h: 47 - -sai_l2mc_entry_type_t = enum__sai_l2mc_entry_type_t # /usr/include/sai/sail2mc.h: 47 - -# /usr/include/sai/sail2mc.h: 82 -class struct__sai_l2mc_entry_t(Structure): - pass - -struct__sai_l2mc_entry_t.__slots__ = [ - 'switch_id', - 'bridge_type', - 'vlan_id', - 'bridge_id', - 'type', - 'destination', - 'source', -] -struct__sai_l2mc_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('bridge_type', sai_fdb_entry_bridge_type_t), - ('vlan_id', sai_vlan_id_t), - ('bridge_id', sai_object_id_t), - ('type', sai_l2mc_entry_type_t), - ('destination', sai_ip_address_t), - ('source', sai_ip_address_t), -] - -sai_l2mc_entry_t = struct__sai_l2mc_entry_t # /usr/include/sai/sail2mc.h: 82 - -enum__sai_l2mc_entry_attr_t = c_int # /usr/include/sai/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_START = 0 # /usr/include/sai/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_PACKET_ACTION = SAI_L2MC_ENTRY_ATTR_START # /usr/include/sai/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_OUTPUT_GROUP_ID = (SAI_L2MC_ENTRY_ATTR_PACKET_ACTION + 1) # /usr/include/sai/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_END = (SAI_L2MC_ENTRY_ATTR_OUTPUT_GROUP_ID + 1) # /usr/include/sai/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_BASE + 1) # /usr/include/sai/sail2mc.h: 128 - -sai_l2mc_entry_attr_t = enum__sai_l2mc_entry_attr_t # /usr/include/sai/sail2mc.h: 128 - -sai_create_l2mc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mc.h: 139 - -sai_remove_l2mc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t)) # /usr/include/sai/sail2mc.h: 151 - -sai_set_l2mc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t), POINTER(sai_attribute_t)) # /usr/include/sai/sail2mc.h: 162 - -sai_get_l2mc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mc.h: 175 - -# /usr/include/sai/sail2mc.h: 190 -class struct__sai_l2mc_api_t(Structure): - pass - -struct__sai_l2mc_api_t.__slots__ = [ - 'create_l2mc_entry', - 'remove_l2mc_entry', - 'set_l2mc_entry_attribute', - 'get_l2mc_entry_attribute', -] -struct__sai_l2mc_api_t._fields_ = [ - ('create_l2mc_entry', sai_create_l2mc_entry_fn), - ('remove_l2mc_entry', sai_remove_l2mc_entry_fn), - ('set_l2mc_entry_attribute', sai_set_l2mc_entry_attribute_fn), - ('get_l2mc_entry_attribute', sai_get_l2mc_entry_attribute_fn), -] - -sai_l2mc_api_t = struct__sai_l2mc_api_t # /usr/include/sai/sail2mc.h: 190 - -enum__sai_ipmc_entry_type_t = c_int # /usr/include/sai/saiipmc.h: 47 - -SAI_IPMC_ENTRY_TYPE_SG = 0 # /usr/include/sai/saiipmc.h: 47 - -SAI_IPMC_ENTRY_TYPE_XG = (SAI_IPMC_ENTRY_TYPE_SG + 1) # /usr/include/sai/saiipmc.h: 47 - -sai_ipmc_entry_type_t = enum__sai_ipmc_entry_type_t # /usr/include/sai/saiipmc.h: 47 - -# /usr/include/sai/saiipmc.h: 76 -class struct__sai_ipmc_entry_t(Structure): - pass - -struct__sai_ipmc_entry_t.__slots__ = [ - 'switch_id', - 'vr_id', - 'type', - 'destination', - 'source', -] -struct__sai_ipmc_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('vr_id', sai_object_id_t), - ('type', sai_ipmc_entry_type_t), - ('destination', sai_ip_address_t), - ('source', sai_ip_address_t), -] - -sai_ipmc_entry_t = struct__sai_ipmc_entry_t # /usr/include/sai/saiipmc.h: 76 - -enum__sai_ipmc_entry_attr_t = c_int # /usr/include/sai/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_START = 0 # /usr/include/sai/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_PACKET_ACTION = SAI_IPMC_ENTRY_ATTR_START # /usr/include/sai/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_OUTPUT_GROUP_ID = (SAI_IPMC_ENTRY_ATTR_PACKET_ACTION + 1) # /usr/include/sai/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_RPF_GROUP_ID = (SAI_IPMC_ENTRY_ATTR_OUTPUT_GROUP_ID + 1) # /usr/include/sai/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_END = (SAI_IPMC_ENTRY_ATTR_RPF_GROUP_ID + 1) # /usr/include/sai/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_BASE + 1) # /usr/include/sai/saiipmc.h: 133 - -sai_ipmc_entry_attr_t = enum__sai_ipmc_entry_attr_t # /usr/include/sai/saiipmc.h: 133 - -sai_create_ipmc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmc.h: 144 - -sai_remove_ipmc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t)) # /usr/include/sai/saiipmc.h: 156 - -sai_set_ipmc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t), POINTER(sai_attribute_t)) # /usr/include/sai/saiipmc.h: 167 - -sai_get_ipmc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmc.h: 180 - -# /usr/include/sai/saiipmc.h: 195 -class struct__sai_ipmc_api_t(Structure): - pass - -struct__sai_ipmc_api_t.__slots__ = [ - 'create_ipmc_entry', - 'remove_ipmc_entry', - 'set_ipmc_entry_attribute', - 'get_ipmc_entry_attribute', -] -struct__sai_ipmc_api_t._fields_ = [ - ('create_ipmc_entry', sai_create_ipmc_entry_fn), - ('remove_ipmc_entry', sai_remove_ipmc_entry_fn), - ('set_ipmc_entry_attribute', sai_set_ipmc_entry_attribute_fn), - ('get_ipmc_entry_attribute', sai_get_ipmc_entry_attribute_fn), -] - -sai_ipmc_api_t = struct__sai_ipmc_api_t # /usr/include/sai/saiipmc.h: 195 - -enum__sai_route_entry_attr_t = c_int # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_START = 0 # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION = SAI_ROUTE_ENTRY_ATTR_START # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_TRAP_PRIORITY = (SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION + 1) # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID = (SAI_ROUTE_ENTRY_ATTR_TRAP_PRIORITY + 1) # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_META_DATA = (SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID + 1) # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_END = (SAI_ROUTE_ENTRY_ATTR_META_DATA + 1) # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sairoute.h: 112 - -sai_route_entry_attr_t = enum__sai_route_entry_attr_t # /usr/include/sai/sairoute.h: 112 - -# /usr/include/sai/sairoute.h: 138 -class struct__sai_route_entry_t(Structure): - pass - -struct__sai_route_entry_t.__slots__ = [ - 'switch_id', - 'vr_id', - 'destination', -] -struct__sai_route_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('vr_id', sai_object_id_t), - ('destination', sai_ip_prefix_t), -] - -sai_route_entry_t = struct__sai_route_entry_t # /usr/include/sai/sairoute.h: 138 - -sai_create_route_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairoute.h: 151 - -sai_remove_route_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t)) # /usr/include/sai/sairoute.h: 165 - -sai_set_route_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t), POINTER(sai_attribute_t)) # /usr/include/sai/sairoute.h: 176 - -sai_get_route_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairoute.h: 189 - -# /usr/include/sai/sairoute.h: 204 -class struct__sai_route_api_t(Structure): - pass - -struct__sai_route_api_t.__slots__ = [ - 'create_route', - 'remove_route', - 'set_route_attribute', - 'get_route_attribute', -] -struct__sai_route_api_t._fields_ = [ - ('create_route', sai_create_route_fn), - ('remove_route', sai_remove_route_fn), - ('set_route_attribute', sai_set_route_attribute_fn), - ('get_route_attribute', sai_get_route_attribute_fn), -] - -sai_route_api_t = struct__sai_route_api_t # /usr/include/sai/sairoute.h: 204 - -# /usr/include/sai/saiobject.h: 49 -class union_anon_21(Union): - pass - -union_anon_21.__slots__ = [ - 'object_id', - 'fdb_entry', - 'neighbor_entry', - 'route_entry', - 'mcast_fdb_entry', - 'l2mc_entry', - 'ipmc_entry', -] -union_anon_21._fields_ = [ - ('object_id', sai_object_id_t), - ('fdb_entry', sai_fdb_entry_t), - ('neighbor_entry', sai_neighbor_entry_t), - ('route_entry', sai_route_entry_t), - ('mcast_fdb_entry', sai_mcast_fdb_entry_t), - ('l2mc_entry', sai_l2mc_entry_t), - ('ipmc_entry', sai_ipmc_entry_t), -] - -# /usr/include/sai/saiobject.h: 61 -class struct__sai_object_key_t(Structure): - pass - -struct__sai_object_key_t.__slots__ = [ - 'key', -] -struct__sai_object_key_t._fields_ = [ - ('key', union_anon_21), -] - -sai_object_key_t = struct__sai_object_key_t # /usr/include/sai/saiobject.h: 61 - -# /usr/include/sai/saiobject.h: 72 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_get_maximum_attribute_count'): - continue - sai_get_maximum_attribute_count = _lib.sai_get_maximum_attribute_count - sai_get_maximum_attribute_count.argtypes = [sai_object_id_t, sai_object_type_t, POINTER(c_uint32)] - sai_get_maximum_attribute_count.restype = sai_status_t - break - -# /usr/include/sai/saiobject.h: 86 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_get_object_count'): - continue - sai_get_object_count = _lib.sai_get_object_count - sai_get_object_count.argtypes = [sai_object_id_t, sai_object_type_t, POINTER(c_uint32)] - sai_get_object_count.restype = sai_status_t - break - -# /usr/include/sai/saiobject.h: 101 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_get_object_key'): - continue - sai_get_object_key = _lib.sai_get_object_key - sai_get_object_key.argtypes = [sai_object_id_t, sai_object_type_t, c_uint32, POINTER(sai_object_key_t)] - sai_get_object_key.restype = sai_status_t - break - -# /usr/include/sai/saiobject.h: 136 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_bulk_get_attribute'): - continue - sai_bulk_get_attribute = _lib.sai_bulk_get_attribute - sai_bulk_get_attribute.argtypes = [sai_object_id_t, sai_object_type_t, c_uint32, POINTER(sai_object_key_t), POINTER(c_uint32), POINTER(POINTER(sai_attribute_t)), POINTER(sai_status_t)] - sai_bulk_get_attribute.restype = sai_status_t - break - -enum__sai_meter_type_t = c_int # /usr/include/sai/saipolicer.h: 50 - -SAI_METER_TYPE_PACKETS = 0 # /usr/include/sai/saipolicer.h: 50 - -SAI_METER_TYPE_BYTES = 1 # /usr/include/sai/saipolicer.h: 50 - -SAI_METER_TYPE_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saipolicer.h: 50 - -sai_meter_type_t = enum__sai_meter_type_t # /usr/include/sai/saipolicer.h: 50 - -enum__sai_policer_mode_t = c_int # /usr/include/sai/saipolicer.h: 69 - -SAI_POLICER_MODE_SR_TCM = 0 # /usr/include/sai/saipolicer.h: 69 - -SAI_POLICER_MODE_TR_TCM = 1 # /usr/include/sai/saipolicer.h: 69 - -SAI_POLICER_MODE_STORM_CONTROL = 2 # /usr/include/sai/saipolicer.h: 69 - -SAI_POLICER_MODE_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saipolicer.h: 69 - -sai_policer_mode_t = enum__sai_policer_mode_t # /usr/include/sai/saipolicer.h: 69 - -enum__sai_policer_color_source_t = c_int # /usr/include/sai/saipolicer.h: 85 - -SAI_POLICER_COLOR_SOURCE_BLIND = 0 # /usr/include/sai/saipolicer.h: 85 - -SAI_POLICER_COLOR_SOURCE_AWARE = 1 # /usr/include/sai/saipolicer.h: 85 - -SAI_POLICER_COLOR_SOURCE_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saipolicer.h: 85 - -sai_policer_color_source_t = enum__sai_policer_color_source_t # /usr/include/sai/saipolicer.h: 85 - -enum__sai_policer_attr_t = c_int # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_START = 0 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_METER_TYPE = SAI_POLICER_ATTR_START # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_MODE = 1 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_COLOR_SOURCE = 2 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_CBS = 3 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_CIR = 4 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_PBS = 5 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_PIR = 6 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_GREEN_PACKET_ACTION = 7 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_YELLOW_PACKET_ACTION = 8 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_RED_PACKET_ACTION = 9 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_ENABLE_COUNTER_PACKET_ACTION_LIST = 10 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_END = (SAI_POLICER_ATTR_ENABLE_COUNTER_PACKET_ACTION_LIST + 1) # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saipolicer.h: 212 - -SAI_POLICER_ATTR_CUSTOM_RANGE_END = (SAI_POLICER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saipolicer.h: 212 - -sai_policer_attr_t = enum__sai_policer_attr_t # /usr/include/sai/saipolicer.h: 212 - -enum__sai_policer_stat_t = c_int # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_PACKETS = 0 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_ATTR_BYTES = 1 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_GREEN_PACKETS = 2 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_GREEN_BYTES = 3 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_YELLOW_PACKETS = 4 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_YELLOW_BYTES = 5 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_RED_PACKETS = 6 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_RED_BYTES = 7 # /usr/include/sai/saipolicer.h: 246 - -SAI_POLICER_STAT_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saipolicer.h: 246 - -sai_policer_stat_t = enum__sai_policer_stat_t # /usr/include/sai/saipolicer.h: 246 - -sai_create_policer_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saipolicer.h: 258 - -sai_remove_policer_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saipolicer.h: 271 - -sai_set_policer_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saipolicer.h: 282 - -sai_get_policer_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saipolicer.h: 295 - -sai_get_policer_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_policer_stat_t), c_uint32, POINTER(c_uint64)) # /usr/include/sai/saipolicer.h: 310 - -sai_clear_policer_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_policer_stat_t)) # /usr/include/sai/saipolicer.h: 326 - -# /usr/include/sai/saipolicer.h: 344 -class struct__sai_policer_api_t(Structure): - pass - -struct__sai_policer_api_t.__slots__ = [ - 'create_policer', - 'remove_policer', - 'set_policer_attribute', - 'get_policer_attribute', - 'get_policer_statistics', - 'clear_policer_stats', -] -struct__sai_policer_api_t._fields_ = [ - ('create_policer', sai_create_policer_fn), - ('remove_policer', sai_remove_policer_fn), - ('set_policer_attribute', sai_set_policer_attribute_fn), - ('get_policer_attribute', sai_get_policer_attribute_fn), - ('get_policer_statistics', sai_get_policer_stats_fn), - ('clear_policer_stats', sai_clear_policer_stats_fn), -] - -sai_policer_api_t = struct__sai_policer_api_t # /usr/include/sai/saipolicer.h: 344 - -enum__sai_port_type_t = c_int # /usr/include/sai/saiport.h: 47 - -SAI_PORT_TYPE_LOGICAL = 0 # /usr/include/sai/saiport.h: 47 - -SAI_PORT_TYPE_CPU = (SAI_PORT_TYPE_LOGICAL + 1) # /usr/include/sai/saiport.h: 47 - -sai_port_type_t = enum__sai_port_type_t # /usr/include/sai/saiport.h: 47 - -enum__sai_port_bind_mode_t = c_int # /usr/include/sai/saiport.h: 60 - -SAI_PORT_BIND_MODE_PORT = 0 # /usr/include/sai/saiport.h: 60 - -SAI_PORT_BIND_MODE_SUB_PORT = (SAI_PORT_BIND_MODE_PORT + 1) # /usr/include/sai/saiport.h: 60 - -sai_port_bind_mode_t = enum__sai_port_bind_mode_t # /usr/include/sai/saiport.h: 60 - -enum__sai_port_oper_status_t = c_int # /usr/include/sai/saiport.h: 82 - -SAI_PORT_OPER_STATUS_UNKNOWN = 0 # /usr/include/sai/saiport.h: 82 - -SAI_PORT_OPER_STATUS_UP = (SAI_PORT_OPER_STATUS_UNKNOWN + 1) # /usr/include/sai/saiport.h: 82 - -SAI_PORT_OPER_STATUS_DOWN = (SAI_PORT_OPER_STATUS_UP + 1) # /usr/include/sai/saiport.h: 82 - -SAI_PORT_OPER_STATUS_TESTING = (SAI_PORT_OPER_STATUS_DOWN + 1) # /usr/include/sai/saiport.h: 82 - -SAI_PORT_OPER_STATUS_NOT_PRESENT = (SAI_PORT_OPER_STATUS_TESTING + 1) # /usr/include/sai/saiport.h: 82 - -sai_port_oper_status_t = enum__sai_port_oper_status_t # /usr/include/sai/saiport.h: 82 - -# /usr/include/sai/saiport.h: 95 -class struct__sai_port_oper_status_notification_t(Structure): - pass - -struct__sai_port_oper_status_notification_t.__slots__ = [ - 'port_id', - 'port_state', -] -struct__sai_port_oper_status_notification_t._fields_ = [ - ('port_id', sai_object_id_t), - ('port_state', sai_port_oper_status_t), -] - -sai_port_oper_status_notification_t = struct__sai_port_oper_status_notification_t # /usr/include/sai/saiport.h: 95 - -enum__sai_port_flow_control_mode_t = c_int # /usr/include/sai/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_DISABLE = 0 # /usr/include/sai/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_TX_ONLY = (SAI_PORT_FLOW_CONTROL_MODE_DISABLE + 1) # /usr/include/sai/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_RX_ONLY = (SAI_PORT_FLOW_CONTROL_MODE_TX_ONLY + 1) # /usr/include/sai/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_BOTH_ENABLE = (SAI_PORT_FLOW_CONTROL_MODE_RX_ONLY + 1) # /usr/include/sai/saiport.h: 114 - -sai_port_flow_control_mode_t = enum__sai_port_flow_control_mode_t # /usr/include/sai/saiport.h: 114 - -enum__sai_port_internal_loopback_mode_t = c_int # /usr/include/sai/saiport.h: 130 - -SAI_PORT_INTERNAL_LOOPBACK_MODE_NONE = 0 # /usr/include/sai/saiport.h: 130 - -SAI_PORT_INTERNAL_LOOPBACK_MODE_PHY = (SAI_PORT_INTERNAL_LOOPBACK_MODE_NONE + 1) # /usr/include/sai/saiport.h: 130 - -SAI_PORT_INTERNAL_LOOPBACK_MODE_MAC = (SAI_PORT_INTERNAL_LOOPBACK_MODE_PHY + 1) # /usr/include/sai/saiport.h: 130 - -sai_port_internal_loopback_mode_t = enum__sai_port_internal_loopback_mode_t # /usr/include/sai/saiport.h: 130 - -enum__sai_port_media_type_t = c_int # /usr/include/sai/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_NOT_PRESENT = 0 # /usr/include/sai/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_UNKNONWN = (SAI_PORT_MEDIA_TYPE_NOT_PRESENT + 1) # /usr/include/sai/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_FIBER = (SAI_PORT_MEDIA_TYPE_UNKNONWN + 1) # /usr/include/sai/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_COPPER = (SAI_PORT_MEDIA_TYPE_FIBER + 1) # /usr/include/sai/saiport.h: 148 - -sai_port_media_type_t = enum__sai_port_media_type_t # /usr/include/sai/saiport.h: 148 - -enum__sai_port_breakout_mode_type_t = c_int # /usr/include/sai/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_1_LANE = 0 # /usr/include/sai/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_2_LANE = 1 # /usr/include/sai/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_4_LANE = 2 # /usr/include/sai/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_MAX = (SAI_PORT_BREAKOUT_MODE_TYPE_4_LANE + 1) # /usr/include/sai/saiport.h: 167 - -sai_port_breakout_mode_type_t = enum__sai_port_breakout_mode_type_t # /usr/include/sai/saiport.h: 167 - -enum__sai_port_attr_t = c_int # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_START = 0 # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_TYPE = SAI_PORT_ATTR_START # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_OPER_STATUS = (SAI_PORT_ATTR_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SUPPORTED_BREAKOUT_MODE_TYPE = (SAI_PORT_ATTR_OPER_STATUS + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_CURRENT_BREAKOUT_MODE_TYPE = (SAI_PORT_ATTR_SUPPORTED_BREAKOUT_MODE_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES = (SAI_PORT_ATTR_CURRENT_BREAKOUT_MODE_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_QUEUE_LIST = (SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_NUMBER_OF_SCHEDULER_GROUPS = (SAI_PORT_ATTR_QOS_QUEUE_LIST + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_SCHEDULER_GROUP_LIST = (SAI_PORT_ATTR_QOS_NUMBER_OF_SCHEDULER_GROUPS + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SUPPORTED_SPEED = (SAI_PORT_ATTR_QOS_SCHEDULER_GROUP_LIST + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SUPPORTED_HALF_DUPLEX_SPEED = (SAI_PORT_ATTR_SUPPORTED_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE = (SAI_PORT_ATTR_SUPPORTED_HALF_DUPLEX_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SUPPORTED_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SUPPORTED_ASYMMETRIC_PAUSE_MODE = (SAI_PORT_ATTR_SUPPORTED_FLOW_CONTROL_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SUPPORTED_MEDIA_TYPE = (SAI_PORT_ATTR_SUPPORTED_ASYMMETRIC_PAUSE_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_SUPPORTED_SPEED = (SAI_PORT_ATTR_SUPPORTED_MEDIA_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_SUPPORTED_HALF_DUPLEX_SPEED = (SAI_PORT_ATTR_REMOTE_SUPPORTED_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_SUPPORTED_AUTO_NEG_MODE = (SAI_PORT_ATTR_REMOTE_SUPPORTED_HALF_DUPLEX_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_SUPPORTED_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_REMOTE_SUPPORTED_AUTO_NEG_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_SUPPORTED_ASYMMETRIC_PAUSE_MODE = (SAI_PORT_ATTR_REMOTE_SUPPORTED_FLOW_CONTROL_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_SUPPORTED_MEDIA_TYPE = (SAI_PORT_ATTR_REMOTE_SUPPORTED_ASYMMETRIC_PAUSE_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_SPEED = (SAI_PORT_ATTR_REMOTE_SUPPORTED_MEDIA_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_HALF_DUPLEX_SPEED = (SAI_PORT_ATTR_REMOTE_ADVERTISED_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_AUTO_NEG_MODE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_HALF_DUPLEX_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_AUTO_NEG_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_ASYMMETRIC_PAUSE_MODE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_FLOW_CONTROL_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_MEDIA_TYPE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_ASYMMETRIC_PAUSE_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_NUMBER_OF_INGRESS_PRIORITY_GROUPS = (SAI_PORT_ATTR_REMOTE_ADVERTISED_MEDIA_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_INGRESS_PRIORITY_GROUP_LIST = (SAI_PORT_ATTR_NUMBER_OF_INGRESS_PRIORITY_GROUPS + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_HW_LANE_LIST = (SAI_PORT_ATTR_INGRESS_PRIORITY_GROUP_LIST + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_SPEED = (SAI_PORT_ATTR_HW_LANE_LIST + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_FULL_DUPLEX_MODE = (SAI_PORT_ATTR_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_AUTO_NEG_MODE = (SAI_PORT_ATTR_FULL_DUPLEX_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_ADMIN_STATE = (SAI_PORT_ATTR_AUTO_NEG_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_MEDIA_TYPE = (SAI_PORT_ATTR_ADMIN_STATE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_ADVERTISED_SPEED = (SAI_PORT_ATTR_MEDIA_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_ADVERTISED_HALF_DUPLEX_SPEED = (SAI_PORT_ATTR_ADVERTISED_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_ADVERTISED_AUTO_NEG_MODE = (SAI_PORT_ATTR_ADVERTISED_HALF_DUPLEX_SPEED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_ADVERTISED_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_ADVERTISED_AUTO_NEG_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_ADVERTISED_ASYMMETRIC_PAUSE_MODE = (SAI_PORT_ATTR_ADVERTISED_FLOW_CONTROL_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_ADVERTISED_MEDIA_TYPE = (SAI_PORT_ATTR_ADVERTISED_ASYMMETRIC_PAUSE_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_PORT_VLAN_ID = (SAI_PORT_ATTR_ADVERTISED_MEDIA_TYPE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_DEFAULT_VLAN_PRIORITY = (SAI_PORT_ATTR_PORT_VLAN_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_INGRESS_FILTERING = (SAI_PORT_ATTR_DEFAULT_VLAN_PRIORITY + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_DROP_UNTAGGED = (SAI_PORT_ATTR_INGRESS_FILTERING + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_DROP_TAGGED = (SAI_PORT_ATTR_DROP_UNTAGGED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_INTERNAL_LOOPBACK_MODE = (SAI_PORT_ATTR_DROP_TAGGED + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_UPDATE_DSCP = (SAI_PORT_ATTR_INTERNAL_LOOPBACK_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_MTU = (SAI_PORT_ATTR_UPDATE_DSCP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_FLOOD_STORM_CONTROL_POLICER_ID = (SAI_PORT_ATTR_MTU + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_BROADCAST_STORM_CONTROL_POLICER_ID = (SAI_PORT_ATTR_FLOOD_STORM_CONTROL_POLICER_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_MULTICAST_STORM_CONTROL_POLICER_ID = (SAI_PORT_ATTR_BROADCAST_STORM_CONTROL_POLICER_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_GLOBAL_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_MULTICAST_STORM_CONTROL_POLICER_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_INGRESS_ACL = (SAI_PORT_ATTR_GLOBAL_FLOW_CONTROL_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_EGRESS_ACL = (SAI_PORT_ATTR_INGRESS_ACL + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_INGRESS_MIRROR_SESSION = (SAI_PORT_ATTR_EGRESS_ACL + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_EGRESS_MIRROR_SESSION = (SAI_PORT_ATTR_INGRESS_MIRROR_SESSION + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE = (SAI_PORT_ATTR_EGRESS_MIRROR_SESSION + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_EGRESS_SAMPLEPACKET_ENABLE = (SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_POLICER_ID = (SAI_PORT_ATTR_EGRESS_SAMPLEPACKET_ENABLE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_DEFAULT_TC = (SAI_PORT_ATTR_POLICER_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_DOT1P_TO_TC_MAP = (SAI_PORT_ATTR_QOS_DEFAULT_TC + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_DOT1P_TO_COLOR_MAP = (SAI_PORT_ATTR_QOS_DOT1P_TO_TC_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_DSCP_TO_TC_MAP = (SAI_PORT_ATTR_QOS_DOT1P_TO_COLOR_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_DSCP_TO_COLOR_MAP = (SAI_PORT_ATTR_QOS_DSCP_TO_TC_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_TC_TO_QUEUE_MAP = (SAI_PORT_ATTR_QOS_DSCP_TO_COLOR_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP = (SAI_PORT_ATTR_QOS_TC_TO_QUEUE_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP = (SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_TC_TO_PRIORITY_GROUP_MAP = (SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_PRIORITY_GROUP_MAP = (SAI_PORT_ATTR_QOS_TC_TO_PRIORITY_GROUP_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_QUEUE_MAP = (SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_PRIORITY_GROUP_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_WRED_PROFILE_ID = (SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_QUEUE_MAP + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID = (SAI_PORT_ATTR_QOS_WRED_PROFILE_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_INGRESS_BUFFER_PROFILE_LIST = (SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_QOS_EGRESS_BUFFER_PROFILE_LIST = (SAI_PORT_ATTR_QOS_INGRESS_BUFFER_PROFILE_LIST + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL = (SAI_PORT_ATTR_QOS_EGRESS_BUFFER_PROFILE_LIST + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_META_DATA = (SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_EGRESS_BLOCK_PORT_LIST = (SAI_PORT_ATTR_META_DATA + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_HW_PROFILE_ID = (SAI_PORT_ATTR_EGRESS_BLOCK_PORT_LIST + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_EEE_ENABLE = (SAI_PORT_ATTR_HW_PROFILE_ID + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_EEE_IDLE_TIME = (SAI_PORT_ATTR_EEE_ENABLE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_EEE_WAKE_TIME = (SAI_PORT_ATTR_EEE_IDLE_TIME + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_BIND_MODE = (SAI_PORT_ATTR_EEE_WAKE_TIME + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_END = (SAI_PORT_ATTR_BIND_MODE + 1) # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiport.h: 1048 - -SAI_PORT_ATTR_CUSTOM_RANGE_END = (SAI_PORT_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiport.h: 1048 - -sai_port_attr_t = enum__sai_port_attr_t # /usr/include/sai/saiport.h: 1048 - -enum__sai_port_stat_t = c_int # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_OCTETS = 0 # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_UCAST_PKTS = (SAI_PORT_STAT_IF_IN_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS = (SAI_PORT_STAT_IF_IN_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_DISCARDS = (SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_ERRORS = (SAI_PORT_STAT_IF_IN_DISCARDS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS = (SAI_PORT_STAT_IF_IN_ERRORS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_BROADCAST_PKTS = (SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_MULTICAST_PKTS = (SAI_PORT_STAT_IF_IN_BROADCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_IN_VLAN_DISCARDS = (SAI_PORT_STAT_IF_IN_MULTICAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_OCTETS = (SAI_PORT_STAT_IF_IN_VLAN_DISCARDS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_UCAST_PKTS = (SAI_PORT_STAT_IF_OUT_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_NON_UCAST_PKTS = (SAI_PORT_STAT_IF_OUT_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_DISCARDS = (SAI_PORT_STAT_IF_OUT_NON_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_ERRORS = (SAI_PORT_STAT_IF_OUT_DISCARDS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_QLEN = (SAI_PORT_STAT_IF_OUT_ERRORS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_BROADCAST_PKTS = (SAI_PORT_STAT_IF_OUT_QLEN + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IF_OUT_MULTICAST_PKTS = (SAI_PORT_STAT_IF_OUT_BROADCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS = (SAI_PORT_STAT_IF_OUT_MULTICAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_MULTICAST_PKTS = (SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS = (SAI_PORT_STAT_ETHER_STATS_MULTICAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS = (SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_FRAGMENTS = (SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_64_OCTETS = (SAI_PORT_STAT_ETHER_STATS_FRAGMENTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_65_TO_127_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_64_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_128_TO_255_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_65_TO_127_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_256_TO_511_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_128_TO_255_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_512_TO_1023_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_256_TO_511_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_1024_TO_1518_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_512_TO_1023_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_1519_TO_2047_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_1024_TO_1518_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_2048_TO_4095_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_1519_TO_2047_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_2048_TO_4095_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS_9217_TO_16383_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS = (SAI_PORT_STAT_ETHER_STATS_PKTS_9217_TO_16383_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS = (SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_TX_OVERSIZE_PKTS = (SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_JABBERS = (SAI_PORT_STAT_ETHER_TX_OVERSIZE_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_OCTETS = (SAI_PORT_STAT_ETHER_STATS_JABBERS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_PKTS = (SAI_PORT_STAT_ETHER_STATS_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_COLLISIONS = (SAI_PORT_STAT_ETHER_STATS_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_CRC_ALIGN_ERRORS = (SAI_PORT_STAT_ETHER_STATS_COLLISIONS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS = (SAI_PORT_STAT_ETHER_STATS_CRC_ALIGN_ERRORS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_STATS_RX_NO_ERRORS = (SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_IN_RECEIVES = (SAI_PORT_STAT_ETHER_STATS_RX_NO_ERRORS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_IN_OCTETS = (SAI_PORT_STAT_IP_IN_RECEIVES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_IN_UCAST_PKTS = (SAI_PORT_STAT_IP_IN_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_IN_NON_UCAST_PKTS = (SAI_PORT_STAT_IP_IN_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_IN_DISCARDS = (SAI_PORT_STAT_IP_IN_NON_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_OUT_OCTETS = (SAI_PORT_STAT_IP_IN_DISCARDS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_OUT_UCAST_PKTS = (SAI_PORT_STAT_IP_OUT_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_OUT_NON_UCAST_PKTS = (SAI_PORT_STAT_IP_OUT_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IP_OUT_DISCARDS = (SAI_PORT_STAT_IP_OUT_NON_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_IN_RECEIVES = (SAI_PORT_STAT_IP_OUT_DISCARDS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_IN_OCTETS = (SAI_PORT_STAT_IPV6_IN_RECEIVES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_IN_UCAST_PKTS = (SAI_PORT_STAT_IPV6_IN_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_IN_NON_UCAST_PKTS = (SAI_PORT_STAT_IPV6_IN_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_IN_MCAST_PKTS = (SAI_PORT_STAT_IPV6_IN_NON_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_IN_DISCARDS = (SAI_PORT_STAT_IPV6_IN_MCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_OUT_OCTETS = (SAI_PORT_STAT_IPV6_IN_DISCARDS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_OUT_UCAST_PKTS = (SAI_PORT_STAT_IPV6_OUT_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_OUT_NON_UCAST_PKTS = (SAI_PORT_STAT_IPV6_OUT_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS = (SAI_PORT_STAT_IPV6_OUT_NON_UCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_IPV6_OUT_DISCARDS = (SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_GREEN_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_IPV6_OUT_DISCARDS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_GREEN_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_GREEN_DISCARD_DROPPED_PACKETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_GREEN_DISCARD_DROPPED_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_PACKETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_RED_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_RED_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_RED_DISCARD_DROPPED_PACKETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_RED_DISCARD_DROPPED_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_DISCARD_DROPPED_PACKETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ECN_MARKED_PACKETS = (SAI_PORT_STAT_DISCARD_DROPPED_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS = (SAI_PORT_STAT_ECN_MARKED_PACKETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_128_TO_255_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_128_TO_255_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_CURR_OCCUPANCY_BYTES = (SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_WATERMARK_BYTES = (SAI_PORT_STAT_CURR_OCCUPANCY_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_SHARED_CURR_OCCUPANCY_BYTES = (SAI_PORT_STAT_WATERMARK_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_SHARED_WATERMARK_BYTES = (SAI_PORT_STAT_SHARED_CURR_OCCUPANCY_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PAUSE_RX_PKTS = (SAI_PORT_STAT_SHARED_WATERMARK_BYTES + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PAUSE_TX_PKTS = (SAI_PORT_STAT_PAUSE_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_0_RX_PKTS = (SAI_PORT_STAT_PAUSE_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_0_TX_PKTS = (SAI_PORT_STAT_PFC_0_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_1_RX_PKTS = (SAI_PORT_STAT_PFC_0_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_1_TX_PKTS = (SAI_PORT_STAT_PFC_1_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_2_RX_PKTS = (SAI_PORT_STAT_PFC_1_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_2_TX_PKTS = (SAI_PORT_STAT_PFC_2_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_3_RX_PKTS = (SAI_PORT_STAT_PFC_2_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_3_TX_PKTS = (SAI_PORT_STAT_PFC_3_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_4_RX_PKTS = (SAI_PORT_STAT_PFC_3_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_4_TX_PKTS = (SAI_PORT_STAT_PFC_4_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_5_RX_PKTS = (SAI_PORT_STAT_PFC_4_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_5_TX_PKTS = (SAI_PORT_STAT_PFC_5_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_6_RX_PKTS = (SAI_PORT_STAT_PFC_5_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_6_TX_PKTS = (SAI_PORT_STAT_PFC_6_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_7_RX_PKTS = (SAI_PORT_STAT_PFC_6_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_PFC_7_TX_PKTS = (SAI_PORT_STAT_PFC_7_RX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_EEE_TX_EVENT_COUNT = (SAI_PORT_STAT_PFC_7_TX_PKTS + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_EEE_RX_EVENT_COUNT = (SAI_PORT_STAT_EEE_TX_EVENT_COUNT + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_EEE_TX_DURATION = (SAI_PORT_STAT_EEE_RX_EVENT_COUNT + 1) # /usr/include/sai/saiport.h: 1410 - -SAI_PORT_STAT_EEE_RX_DURATION = (SAI_PORT_STAT_EEE_TX_DURATION + 1) # /usr/include/sai/saiport.h: 1410 - -sai_port_stat_t = enum__sai_port_stat_t # /usr/include/sai/saiport.h: 1410 - -sai_create_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiport.h: 1422 - -sai_remove_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiport.h: 1434 - -sai_set_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiport.h: 1445 - -sai_get_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiport.h: 1458 - -sai_get_port_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_port_stat_t), c_uint32, POINTER(c_uint64)) # /usr/include/sai/saiport.h: 1473 - -sai_clear_port_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_port_stat_t), c_uint32) # /usr/include/sai/saiport.h: 1488 - -sai_clear_port_all_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiport.h: 1500 - -sai_port_state_change_notification_fn = CFUNCTYPE(UNCHECKED(None), c_uint32, POINTER(sai_port_oper_status_notification_t)) # /usr/include/sai/saiport.h: 1511 - -# /usr/include/sai/saiport.h: 1528 -class struct__sai_port_api_t(Structure): - pass - -struct__sai_port_api_t.__slots__ = [ - 'create_port', - 'remove_port', - 'set_port_attribute', - 'get_port_attribute', - 'get_port_stats', - 'clear_port_stats', - 'clear_port_all_stats', -] -struct__sai_port_api_t._fields_ = [ - ('create_port', sai_create_port_fn), - ('remove_port', sai_remove_port_fn), - ('set_port_attribute', sai_set_port_attribute_fn), - ('get_port_attribute', sai_get_port_attribute_fn), - ('get_port_stats', sai_get_port_stats_fn), - ('clear_port_stats', sai_clear_port_stats_fn), - ('clear_port_all_stats', sai_clear_port_all_stats_fn), -] - -sai_port_api_t = struct__sai_port_api_t # /usr/include/sai/saiport.h: 1528 - -enum__sai_qos_map_type_t = c_int # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_DOT1P_TO_TC = 0 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_DOT1P_TO_COLOR = 1 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_DSCP_TO_TC = 2 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_DSCP_TO_COLOR = 3 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_TC_TO_QUEUE = 4 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_TC_AND_COLOR_TO_DSCP = 5 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_TC_AND_COLOR_TO_DOT1P = 6 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_TC_TO_PRIORITY_GROUP = 7 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_PRIORITY_GROUP = 8 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_QUEUE = 9 # /usr/include/sai/saiqosmaps.h: 74 - -SAI_QOS_MAP_TYPE_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saiqosmaps.h: 74 - -sai_qos_map_type_t = enum__sai_qos_map_type_t # /usr/include/sai/saiqosmaps.h: 74 - -enum__sai_qos_map_attr_t = c_int # /usr/include/sai/saiqosmaps.h: 119 - -SAI_QOS_MAP_ATTR_START = 0 # /usr/include/sai/saiqosmaps.h: 119 - -SAI_QOS_MAP_ATTR_TYPE = SAI_QOS_MAP_ATTR_START # /usr/include/sai/saiqosmaps.h: 119 - -SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST = 1 # /usr/include/sai/saiqosmaps.h: 119 - -SAI_QOS_MAP_ATTR_END = (SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST + 1) # /usr/include/sai/saiqosmaps.h: 119 - -SAI_QOS_MAP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiqosmaps.h: 119 - -SAI_QOS_MAP_ATTR_CUSTOM_RANGE_END = (SAI_QOS_MAP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiqosmaps.h: 119 - -sai_qos_map_attr_t = enum__sai_qos_map_attr_t # /usr/include/sai/saiqosmaps.h: 119 - -sai_create_qos_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiqosmaps.h: 131 - -sai_remove_qos_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiqosmaps.h: 144 - -sai_set_qos_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiqosmaps.h: 155 - -sai_get_qos_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiqosmaps.h: 168 - -# /usr/include/sai/saiqosmaps.h: 183 -class struct__sai_qos_map_api_t(Structure): - pass - -struct__sai_qos_map_api_t.__slots__ = [ - 'create_qos_map', - 'remove_qos_map', - 'set_qos_map_attribute', - 'get_qos_map_attribute', -] -struct__sai_qos_map_api_t._fields_ = [ - ('create_qos_map', sai_create_qos_map_fn), - ('remove_qos_map', sai_remove_qos_map_fn), - ('set_qos_map_attribute', sai_set_qos_map_attribute_fn), - ('get_qos_map_attribute', sai_get_qos_map_attribute_fn), -] - -sai_qos_map_api_t = struct__sai_qos_map_api_t # /usr/include/sai/saiqosmaps.h: 183 - -enum__sai_queue_type_t = c_int # /usr/include/sai/saiqueue.h: 53 - -SAI_QUEUE_TYPE_ALL = 0 # /usr/include/sai/saiqueue.h: 53 - -SAI_QUEUE_TYPE_UNICAST = 1 # /usr/include/sai/saiqueue.h: 53 - -SAI_QUEUE_TYPE_MULTICAST = 2 # /usr/include/sai/saiqueue.h: 53 - -SAI_QUEUE_TYPE_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saiqueue.h: 53 - -sai_queue_type_t = enum__sai_queue_type_t # /usr/include/sai/saiqueue.h: 53 - -enum__sai_queue_attr_t = c_int # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_START = 0 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_TYPE = SAI_QUEUE_ATTR_START # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_PORT = 1 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_INDEX = 2 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_PARENT_SCHEDULER_NODE = 3 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_WRED_PROFILE_ID = 4 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_BUFFER_PROFILE_ID = 5 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_SCHEDULER_PROFILE_ID = 6 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_END = (SAI_QUEUE_ATTR_SCHEDULER_PROFILE_ID + 1) # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiqueue.h: 154 - -SAI_QUEUE_ATTR_CUSTOM_RANGE_END = (SAI_QUEUE_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiqueue.h: 154 - -sai_queue_attr_t = enum__sai_queue_attr_t # /usr/include/sai/saiqueue.h: 154 - -enum__sai_queue_stat_t = c_int # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_PACKETS = 0 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_BYTES = 1 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_DROPPED_PACKETS = 2 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_DROPPED_BYTES = 3 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_GREEN_PACKETS = 4 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_GREEN_BYTES = 5 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_GREEN_DROPPED_PACKETS = 6 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_GREEN_DROPPED_BYTES = 7 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_YELLOW_PACKETS = 8 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_YELLOW_BYTES = 9 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_YELLOW_DROPPED_PACKETS = 10 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_YELLOW_DROPPED_BYTES = 11 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_RED_PACKETS = 12 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_RED_BYTES = 13 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_RED_DROPPED_PACKETS = 14 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_RED_DROPPED_BYTES = 15 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_GREEN_DISCARD_DROPPED_PACKETS = 16 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_GREEN_DISCARD_DROPPED_BYTES = 17 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_YELLOW_DISCARD_DROPPED_PACKETS = 18 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_YELLOW_DISCARD_DROPPED_BYTES = 19 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_RED_DISCARD_DROPPED_PACKETS = 20 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_RED_DISCARD_DROPPED_BYTES = 21 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS = 22 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_DISCARD_DROPPED_BYTES = 23 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES = 24 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_WATERMARK_BYTES = 25 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_SHARED_CURR_OCCUPANCY_BYTES = 26 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES = 27 # /usr/include/sai/saiqueue.h: 248 - -SAI_QUEUE_STAT_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saiqueue.h: 248 - -sai_queue_stat_t = enum__sai_queue_stat_t # /usr/include/sai/saiqueue.h: 248 - -sai_create_queue_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiqueue.h: 260 - -sai_remove_queue_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiqueue.h: 273 - -sai_set_queue_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiqueue.h: 284 - -sai_get_queue_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiqueue.h: 297 - -sai_get_queue_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_queue_stat_t), c_uint32, POINTER(c_uint64)) # /usr/include/sai/saiqueue.h: 313 - -sai_clear_queue_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_queue_stat_t), c_uint32) # /usr/include/sai/saiqueue.h: 328 - -# /usr/include/sai/saiqueue.h: 345 -class struct__sai_queue_api_t(Structure): - pass - -struct__sai_queue_api_t.__slots__ = [ - 'create_queue', - 'remove_queue', - 'set_queue_attribute', - 'get_queue_attribute', - 'get_queue_stats', - 'clear_queue_stats', -] -struct__sai_queue_api_t._fields_ = [ - ('create_queue', sai_create_queue_fn), - ('remove_queue', sai_remove_queue_fn), - ('set_queue_attribute', sai_set_queue_attribute_fn), - ('get_queue_attribute', sai_get_queue_attribute_fn), - ('get_queue_stats', sai_get_queue_stats_fn), - ('clear_queue_stats', sai_clear_queue_stats_fn), -] - -sai_queue_api_t = struct__sai_queue_api_t # /usr/include/sai/saiqueue.h: 345 - -enum__sai_virtual_router_attr_t = c_int # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_START = 0 # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE = SAI_VIRTUAL_ROUTER_ATTR_START # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE = (SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE + 1) # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_SRC_MAC_ADDRESS = (SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE + 1) # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_TTL1_PACKET_ACTION = (SAI_VIRTUAL_ROUTER_ATTR_SRC_MAC_ADDRESS + 1) # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_IP_OPTIONS_PACKET_ACTION = (SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_TTL1_PACKET_ACTION + 1) # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_UNKNOWN_L3_MULTICAST_PACKET_ACTION = (SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_IP_OPTIONS_PACKET_ACTION + 1) # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_END = (SAI_VIRTUAL_ROUTER_ATTR_UNKNOWN_L3_MULTICAST_PACKET_ACTION + 1) # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sairouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_CUSTOM_RANGE_END = (SAI_VIRTUAL_ROUTER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sairouter.h: 122 - -sai_virtual_router_attr_t = enum__sai_virtual_router_attr_t # /usr/include/sai/sairouter.h: 122 - -sai_create_virtual_router_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairouter.h: 136 - -sai_remove_virtual_router_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sairouter.h: 149 - -sai_set_virtual_router_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sairouter.h: 160 - -sai_get_virtual_router_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairouter.h: 173 - -# /usr/include/sai/sairouter.h: 188 -class struct__sai_virtual_router_api_t(Structure): - pass - -struct__sai_virtual_router_api_t.__slots__ = [ - 'create_virtual_router', - 'remove_virtual_router', - 'set_virtual_router_attribute', - 'get_virtual_router_attribute', -] -struct__sai_virtual_router_api_t._fields_ = [ - ('create_virtual_router', sai_create_virtual_router_fn), - ('remove_virtual_router', sai_remove_virtual_router_fn), - ('set_virtual_router_attribute', sai_set_virtual_router_attribute_fn), - ('get_virtual_router_attribute', sai_get_virtual_router_attribute_fn), -] - -sai_virtual_router_api_t = struct__sai_virtual_router_api_t # /usr/include/sai/sairouter.h: 188 - -enum__sai_router_interface_type_t = c_int # /usr/include/sai/sairouterintf.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_PORT = 0 # /usr/include/sai/sairouterintf.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_VLAN = (SAI_ROUTER_INTERFACE_TYPE_PORT + 1) # /usr/include/sai/sairouterintf.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_LOOPBACK = (SAI_ROUTER_INTERFACE_TYPE_VLAN + 1) # /usr/include/sai/sairouterintf.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_SUB_PORT = (SAI_ROUTER_INTERFACE_TYPE_LOOPBACK + 1) # /usr/include/sai/sairouterintf.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_BRIDGE = (SAI_ROUTER_INTERFACE_TYPE_SUB_PORT + 1) # /usr/include/sai/sairouterintf.h: 56 - -sai_router_interface_type_t = enum__sai_router_interface_type_t # /usr/include/sai/sairouterintf.h: 56 - -enum__sai_router_interface_attr_t = c_int # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_START = 0 # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID = SAI_ROUTER_INTERFACE_ATTR_START # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_TYPE = (SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_PORT_ID = (SAI_ROUTER_INTERFACE_ATTR_TYPE + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_VLAN_ID = (SAI_ROUTER_INTERFACE_ATTR_PORT_ID + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS = (SAI_ROUTER_INTERFACE_ATTR_VLAN_ID + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE = (SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE = (SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_MTU = (SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_INGRESS_ACL = (SAI_ROUTER_INTERFACE_ATTR_MTU + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_EGRESS_ACL = (SAI_ROUTER_INTERFACE_ATTR_INGRESS_ACL + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_NEIGHBOR_MISS_PACKET_ACTION = (SAI_ROUTER_INTERFACE_ATTR_EGRESS_ACL + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_V4_MCAST_ENABLE = (SAI_ROUTER_INTERFACE_ATTR_NEIGHBOR_MISS_PACKET_ACTION + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_V6_MCAST_ENABLE = (SAI_ROUTER_INTERFACE_ATTR_V4_MCAST_ENABLE + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_END = (SAI_ROUTER_INTERFACE_ATTR_V6_MCAST_ENABLE + 1) # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sairouterintf.h: 220 - -SAI_ROUTER_INTERFACE_ATTR_CUSTOM_RANGE_END = (SAI_ROUTER_INTERFACE_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sairouterintf.h: 220 - -sai_router_interface_attr_t = enum__sai_router_interface_attr_t # /usr/include/sai/sairouterintf.h: 220 - -sai_create_router_interface_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairouterintf.h: 232 - -sai_remove_router_interface_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sairouterintf.h: 245 - -sai_set_router_interface_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sairouterintf.h: 256 - -sai_get_router_interface_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairouterintf.h: 269 - -# /usr/include/sai/sairouterintf.h: 284 -class struct__sai_router_interface_api_t(Structure): - pass - -struct__sai_router_interface_api_t.__slots__ = [ - 'create_router_interface', - 'remove_router_interface', - 'set_router_interface_attribute', - 'get_router_interface_attribute', -] -struct__sai_router_interface_api_t._fields_ = [ - ('create_router_interface', sai_create_router_interface_fn), - ('remove_router_interface', sai_remove_router_interface_fn), - ('set_router_interface_attribute', sai_set_router_interface_attribute_fn), - ('get_router_interface_attribute', sai_get_router_interface_attribute_fn), -] - -sai_router_interface_api_t = struct__sai_router_interface_api_t # /usr/include/sai/sairouterintf.h: 284 - -enum__sai_samplepacket_type_t = c_int # /usr/include/sai/saisamplepacket.h: 44 - -SAI_SAMPLEPACKET_TYPE_SLOW_PATH = 0 # /usr/include/sai/saisamplepacket.h: 44 - -sai_samplepacket_type_t = enum__sai_samplepacket_type_t # /usr/include/sai/saisamplepacket.h: 44 - -enum__sai_samplepacket_mode_t = c_int # /usr/include/sai/saisamplepacket.h: 69 - -SAI_SAMPLEPACKET_MODE_EXCLUSIVE = 0 # /usr/include/sai/saisamplepacket.h: 69 - -SAI_SAMPLEPACKET_MODE_SHARED = (SAI_SAMPLEPACKET_MODE_EXCLUSIVE + 1) # /usr/include/sai/saisamplepacket.h: 69 - -sai_samplepacket_mode_t = enum__sai_samplepacket_mode_t # /usr/include/sai/saisamplepacket.h: 69 - -enum__sai_samplepacket_attr_t = c_int # /usr/include/sai/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_START = 0 # /usr/include/sai/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_SAMPLE_RATE = SAI_SAMPLEPACKET_ATTR_START # /usr/include/sai/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_TYPE = (SAI_SAMPLEPACKET_ATTR_SAMPLE_RATE + 1) # /usr/include/sai/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_MODE = (SAI_SAMPLEPACKET_ATTR_TYPE + 1) # /usr/include/sai/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_END = (SAI_SAMPLEPACKET_ATTR_MODE + 1) # /usr/include/sai/saisamplepacket.h: 117 - -sai_samplepacket_attr_t = enum__sai_samplepacket_attr_t # /usr/include/sai/saisamplepacket.h: 117 - -sai_create_samplepacket_session_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saisamplepacket.h: 130 - -sai_remove_samplepacket_session_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saisamplepacket.h: 144 - -sai_set_samplepacket_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saisamplepacket.h: 156 - -sai_get_samplepacket_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saisamplepacket.h: 170 - -# /usr/include/sai/saisamplepacket.h: 185 -class struct__sai_samplepacket_api_t(Structure): - pass - -struct__sai_samplepacket_api_t.__slots__ = [ - 'create_samplepacket_session', - 'remove_samplepacket_session', - 'set_samplepacket_attribute', - 'get_samplepacket_attribute', -] -struct__sai_samplepacket_api_t._fields_ = [ - ('create_samplepacket_session', sai_create_samplepacket_session_fn), - ('remove_samplepacket_session', sai_remove_samplepacket_session_fn), - ('set_samplepacket_attribute', sai_set_samplepacket_attribute_fn), - ('get_samplepacket_attribute', sai_get_samplepacket_attribute_fn), -] - -sai_samplepacket_api_t = struct__sai_samplepacket_api_t # /usr/include/sai/saisamplepacket.h: 185 - -enum__sai_scheduler_group_attr_t = c_int # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_START = 0 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CHILD_COUNT = SAI_SCHEDULER_GROUP_ATTR_START # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CHILD_LIST = 1 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_PORT_ID = 2 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_LEVEL = 3 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_MAX_CHILDS = 4 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_SCHEDULER_PROFILE_ID = 5 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_PARENT_NODE = 6 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_END = (SAI_SCHEDULER_GROUP_ATTR_PARENT_NODE + 1) # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_SCHEDULER_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saischedulergroup.h: 119 - -sai_scheduler_group_attr_t = enum__sai_scheduler_group_attr_t # /usr/include/sai/saischedulergroup.h: 119 - -sai_create_scheduler_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saischedulergroup.h: 131 - -sai_remove_scheduler_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saischedulergroup.h: 144 - -sai_set_scheduler_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saischedulergroup.h: 155 - -sai_get_scheduler_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saischedulergroup.h: 168 - -# /usr/include/sai/saischedulergroup.h: 183 -class struct__sai_scheduler_group_api_t(Structure): - pass - -struct__sai_scheduler_group_api_t.__slots__ = [ - 'create_scheduler_group', - 'remove_scheduler_group', - 'set_scheduler_group_attribute', - 'get_scheduler_group_attribute', -] -struct__sai_scheduler_group_api_t._fields_ = [ - ('create_scheduler_group', sai_create_scheduler_group_fn), - ('remove_scheduler_group', sai_remove_scheduler_group_fn), - ('set_scheduler_group_attribute', sai_set_scheduler_group_attribute_fn), - ('get_scheduler_group_attribute', sai_get_scheduler_group_attribute_fn), -] - -sai_scheduler_group_api_t = struct__sai_scheduler_group_api_t # /usr/include/sai/saischedulergroup.h: 183 - -enum__sai_scheduling_type_t = c_int # /usr/include/sai/saischeduler.h: 50 - -SAI_SCHEDULING_TYPE_STRICT = 0 # /usr/include/sai/saischeduler.h: 50 - -SAI_SCHEDULING_TYPE_WRR = 1 # /usr/include/sai/saischeduler.h: 50 - -SAI_SCHEDULING_TYPE_DWRR = 2 # /usr/include/sai/saischeduler.h: 50 - -sai_scheduling_type_t = enum__sai_scheduling_type_t # /usr/include/sai/saischeduler.h: 50 - -enum__sai_scheduler_attr_t = c_int # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_START = 0 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_SCHEDULING_TYPE = SAI_SCHEDULER_ATTR_START # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_SCHEDULING_WEIGHT = 1 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_METER_TYPE = 2 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_RATE = 3 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_BURST_RATE = 4 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE = 5 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_BURST_RATE = 6 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_END = (SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_BURST_RATE + 1) # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_CUSTOM_RANGE_END = (SAI_SCHEDULER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saischeduler.h: 143 - -sai_scheduler_attr_t = enum__sai_scheduler_attr_t # /usr/include/sai/saischeduler.h: 143 - -sai_create_scheduler_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saischeduler.h: 155 - -sai_remove_scheduler_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saischeduler.h: 168 - -sai_set_scheduler_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saischeduler.h: 179 - -sai_get_scheduler_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saischeduler.h: 192 - -# /usr/include/sai/saischeduler.h: 207 -class struct__sai_scheduler_api_t(Structure): - pass - -struct__sai_scheduler_api_t.__slots__ = [ - 'create_scheduler_profile', - 'remove_scheduler_profile', - 'set_scheduler_attribute', - 'get_scheduler_attribute', -] -struct__sai_scheduler_api_t._fields_ = [ - ('create_scheduler_profile', sai_create_scheduler_fn), - ('remove_scheduler_profile', sai_remove_scheduler_fn), - ('set_scheduler_attribute', sai_set_scheduler_attribute_fn), - ('get_scheduler_attribute', sai_get_scheduler_attribute_fn), -] - -sai_scheduler_api_t = struct__sai_scheduler_api_t # /usr/include/sai/saischeduler.h: 207 - -enum__sai_stp_port_state_t = c_int # /usr/include/sai/saistp.h: 50 - -SAI_STP_PORT_STATE_LEARNING = 0 # /usr/include/sai/saistp.h: 50 - -SAI_STP_PORT_STATE_FORWARDING = (SAI_STP_PORT_STATE_LEARNING + 1) # /usr/include/sai/saistp.h: 50 - -SAI_STP_PORT_STATE_BLOCKING = (SAI_STP_PORT_STATE_FORWARDING + 1) # /usr/include/sai/saistp.h: 50 - -sai_stp_port_state_t = enum__sai_stp_port_state_t # /usr/include/sai/saistp.h: 50 - -enum__sai_stp_attr_t = c_int # /usr/include/sai/saistp.h: 96 - -SAI_STP_ATTR_START = 0 # /usr/include/sai/saistp.h: 96 - -SAI_STP_ATTR_VLAN_LIST = SAI_STP_ATTR_START # /usr/include/sai/saistp.h: 96 - -SAI_STP_ATTR_BRIDGE_ID = (SAI_STP_ATTR_VLAN_LIST + 1) # /usr/include/sai/saistp.h: 96 - -SAI_STP_ATTR_PORT_LIST = (SAI_STP_ATTR_BRIDGE_ID + 1) # /usr/include/sai/saistp.h: 96 - -SAI_STP_ATTR_END = (SAI_STP_ATTR_PORT_LIST + 1) # /usr/include/sai/saistp.h: 96 - -sai_stp_attr_t = enum__sai_stp_attr_t # /usr/include/sai/saistp.h: 96 - -enum__sai_stp_port_attr_t = c_int # /usr/include/sai/saistp.h: 136 - -SAI_STP_PORT_ATTR_START = 0 # /usr/include/sai/saistp.h: 136 - -SAI_STP_PORT_ATTR_STP = SAI_STP_PORT_ATTR_START # /usr/include/sai/saistp.h: 136 - -SAI_STP_PORT_ATTR_BRIDGE_PORT = (SAI_STP_PORT_ATTR_STP + 1) # /usr/include/sai/saistp.h: 136 - -SAI_STP_PORT_ATTR_STATE = (SAI_STP_PORT_ATTR_BRIDGE_PORT + 1) # /usr/include/sai/saistp.h: 136 - -SAI_STP_PORT_ATTR_END = (SAI_STP_PORT_ATTR_STATE + 1) # /usr/include/sai/saistp.h: 136 - -sai_stp_port_attr_t = enum__sai_stp_port_attr_t # /usr/include/sai/saistp.h: 136 - -sai_create_stp_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saistp.h: 149 - -sai_remove_stp_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saistp.h: 163 - -sai_set_stp_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saistp.h: 174 - -sai_get_stp_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saistp.h: 187 - -sai_create_stp_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saistp.h: 201 - -sai_remove_stp_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saistp.h: 214 - -sai_set_stp_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saistp.h: 225 - -sai_get_stp_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saistp.h: 238 - -# /usr/include/sai/saistp.h: 255 -class struct__sai_stp_api_t(Structure): - pass - -struct__sai_stp_api_t.__slots__ = [ - 'create_stp', - 'remove_stp', - 'set_stp_attribute', - 'get_stp_attribute', - 'create_stp_port', - 'remove_stp_port', - 'set_stp_port_attribute', - 'get_stp_port_attribute', -] -struct__sai_stp_api_t._fields_ = [ - ('create_stp', sai_create_stp_fn), - ('remove_stp', sai_remove_stp_fn), - ('set_stp_attribute', sai_set_stp_attribute_fn), - ('get_stp_attribute', sai_get_stp_attribute_fn), - ('create_stp_port', sai_create_stp_port_fn), - ('remove_stp_port', sai_remove_stp_port_fn), - ('set_stp_port_attribute', sai_set_stp_port_attribute_fn), - ('get_stp_port_attribute', sai_get_stp_port_attribute_fn), -] - -sai_stp_api_t = struct__sai_stp_api_t # /usr/include/sai/saistp.h: 255 - -enum__sai_switch_oper_status_t = c_int # /usr/include/sai/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_UNKNOWN = 0 # /usr/include/sai/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_UP = (SAI_SWITCH_OPER_STATUS_UNKNOWN + 1) # /usr/include/sai/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_DOWN = (SAI_SWITCH_OPER_STATUS_UP + 1) # /usr/include/sai/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_FAILED = (SAI_SWITCH_OPER_STATUS_DOWN + 1) # /usr/include/sai/saiswitch.h: 66 - -sai_switch_oper_status_t = enum__sai_switch_oper_status_t # /usr/include/sai/saiswitch.h: 66 - -enum__sai_packet_action_t = c_int # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_DROP = 0 # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_FORWARD = (SAI_PACKET_ACTION_DROP + 1) # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_COPY = (SAI_PACKET_ACTION_FORWARD + 1) # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_COPY_CANCEL = (SAI_PACKET_ACTION_COPY + 1) # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_TRAP = (SAI_PACKET_ACTION_COPY_CANCEL + 1) # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_LOG = (SAI_PACKET_ACTION_TRAP + 1) # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_DENY = (SAI_PACKET_ACTION_LOG + 1) # /usr/include/sai/saiswitch.h: 119 - -SAI_PACKET_ACTION_TRANSIT = (SAI_PACKET_ACTION_DENY + 1) # /usr/include/sai/saiswitch.h: 119 - -sai_packet_action_t = enum__sai_packet_action_t # /usr/include/sai/saiswitch.h: 119 - -enum__sai_packet_vlan_t = c_int # /usr/include/sai/saiswitch.h: 149 - -SAI_PACKET_VLAN_UNTAG = 0 # /usr/include/sai/saiswitch.h: 149 - -SAI_PACKET_VLAN_SINGLE_OUTER_TAG = (SAI_PACKET_VLAN_UNTAG + 1) # /usr/include/sai/saiswitch.h: 149 - -SAI_PACKET_VLAN_DOUBLE_TAG = (SAI_PACKET_VLAN_SINGLE_OUTER_TAG + 1) # /usr/include/sai/saiswitch.h: 149 - -sai_packet_vlan_t = enum__sai_packet_vlan_t # /usr/include/sai/saiswitch.h: 149 - -enum__sai_switch_switching_mode_t = c_int # /usr/include/sai/saiswitch.h: 162 - -SAI_SWITCH_SWITCHING_MODE_CUT_THROUGH = 0 # /usr/include/sai/saiswitch.h: 162 - -SAI_SWITCH_SWITCHING_MODE_STORE_AND_FORWARD = (SAI_SWITCH_SWITCHING_MODE_CUT_THROUGH + 1) # /usr/include/sai/saiswitch.h: 162 - -sai_switch_switching_mode_t = enum__sai_switch_switching_mode_t # /usr/include/sai/saiswitch.h: 162 - -enum__sai_hash_algorithm_t = c_int # /usr/include/sai/saiswitch.h: 179 - -SAI_HASH_ALGORITHM_CRC = 0 # /usr/include/sai/saiswitch.h: 179 - -SAI_HASH_ALGORITHM_XOR = 1 # /usr/include/sai/saiswitch.h: 179 - -SAI_HASH_ALGORITHM_RANDOM = 2 # /usr/include/sai/saiswitch.h: 179 - -sai_hash_algorithm_t = enum__sai_hash_algorithm_t # /usr/include/sai/saiswitch.h: 179 - -enum__sai_switch_restart_type_t = c_int # /usr/include/sai/saiswitch.h: 195 - -SAI_SWITCH_RESTART_TYPE_NONE = 0 # /usr/include/sai/saiswitch.h: 195 - -SAI_SWITCH_RESTART_TYPE_PLANNED = 1 # /usr/include/sai/saiswitch.h: 195 - -SAI_SWITCH_RESTART_TYPE_ANY = 2 # /usr/include/sai/saiswitch.h: 195 - -sai_switch_restart_type_t = enum__sai_switch_restart_type_t # /usr/include/sai/saiswitch.h: 195 - -enum__sai_switch_mcast_snooping_capability_t = c_int # /usr/include/sai/saiswitch.h: 214 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_NONE = 0 # /usr/include/sai/saiswitch.h: 214 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_XG = 1 # /usr/include/sai/saiswitch.h: 214 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_SG = 2 # /usr/include/sai/saiswitch.h: 214 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_XG_AND_SG = 3 # /usr/include/sai/saiswitch.h: 214 - -sai_switch_mcast_snooping_capability_t = enum__sai_switch_mcast_snooping_capability_t # /usr/include/sai/saiswitch.h: 214 - -enum__sai_switch_attr_t = c_int # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_START = 0 # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_PORT_NUMBER = SAI_SWITCH_ATTR_START # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_PORT_LIST = (SAI_SWITCH_ATTR_PORT_NUMBER + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_PORT_MAX_MTU = (SAI_SWITCH_ATTR_PORT_LIST + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_CPU_PORT = (SAI_SWITCH_ATTR_PORT_MAX_MTU + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_MAX_VIRTUAL_ROUTERS = (SAI_SWITCH_ATTR_CPU_PORT + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FDB_TABLE_SIZE = (SAI_SWITCH_ATTR_MAX_VIRTUAL_ROUTERS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_L3_NEIGHBOR_TABLE_SIZE = (SAI_SWITCH_ATTR_FDB_TABLE_SIZE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_L3_ROUTE_TABLE_SIZE = (SAI_SWITCH_ATTR_L3_NEIGHBOR_TABLE_SIZE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_MEMBERS = (SAI_SWITCH_ATTR_L3_ROUTE_TABLE_SIZE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NUMBER_OF_LAGS = (SAI_SWITCH_ATTR_LAG_MEMBERS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_MEMBERS = (SAI_SWITCH_ATTR_NUMBER_OF_LAGS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NUMBER_OF_ECMP_GROUPS = (SAI_SWITCH_ATTR_ECMP_MEMBERS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NUMBER_OF_UNICAST_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_ECMP_GROUPS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NUMBER_OF_MULTICAST_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_UNICAST_QUEUES + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NUMBER_OF_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_MULTICAST_QUEUES + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NUMBER_OF_CPU_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_QUEUES + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ON_LINK_ROUTE_SUPPORTED = (SAI_SWITCH_ATTR_NUMBER_OF_CPU_QUEUES + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_OPER_STATUS = (SAI_SWITCH_ATTR_ON_LINK_ROUTE_SUPPORTED + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_MAX_TEMP = (SAI_SWITCH_ATTR_OPER_STATUS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_TABLE_MINIMUM_PRIORITY = (SAI_SWITCH_ATTR_MAX_TEMP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_TABLE_MAXIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_TABLE_MINIMUM_PRIORITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_ENTRY_MINIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_TABLE_MAXIMUM_PRIORITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_ENTRY_MAXIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_ENTRY_MINIMUM_PRIORITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MINIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_ENTRY_MAXIMUM_PRIORITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MAXIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MINIMUM_PRIORITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FDB_DST_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MAXIMUM_PRIORITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ROUTE_DST_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_FDB_DST_USER_META_DATA_RANGE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NEIGHBOR_DST_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_ROUTE_DST_USER_META_DATA_RANGE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_PORT_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_NEIGHBOR_DST_USER_META_DATA_RANGE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_VLAN_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_PORT_USER_META_DATA_RANGE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_VLAN_USER_META_DATA_RANGE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_USER_TRAP_ID_RANGE = (SAI_SWITCH_ATTR_ACL_USER_META_DATA_RANGE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_DEFAULT_VLAN_ID = (SAI_SWITCH_ATTR_ACL_USER_TRAP_ID_RANGE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_DEFAULT_STP_INST_ID = (SAI_SWITCH_ATTR_DEFAULT_VLAN_ID + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID = (SAI_SWITCH_ATTR_DEFAULT_STP_INST_ID + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID = (SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_INGRESS_ACL = (SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_EGRESS_ACL = (SAI_SWITCH_ATTR_INGRESS_ACL + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_TRAFFIC_CLASSES = (SAI_SWITCH_ATTR_EGRESS_ACL + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUP_HIERARCHY_LEVELS = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_TRAFFIC_CLASSES + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUPS_PER_HIERARCHY_LEVEL = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUP_HIERARCHY_LEVELS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_CHILDS_PER_SCHEDULER_GROUP = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUPS_PER_HIERARCHY_LEVEL + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_TOTAL_BUFFER_SIZE = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_CHILDS_PER_SCHEDULER_GROUP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_INGRESS_BUFFER_POOL_NUM = (SAI_SWITCH_ATTR_TOTAL_BUFFER_SIZE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_EGRESS_BUFFER_POOL_NUM = (SAI_SWITCH_ATTR_INGRESS_BUFFER_POOL_NUM + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP = (SAI_SWITCH_ATTR_EGRESS_BUFFER_POOL_NUM + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_HASH = (SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_HASH = (SAI_SWITCH_ATTR_ECMP_HASH + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_RESTART_WARM = (SAI_SWITCH_ATTR_LAG_HASH + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_RESTART_TYPE = (SAI_SWITCH_ATTR_RESTART_WARM + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_MIN_PLANNED_RESTART_INTERVAL = (SAI_SWITCH_ATTR_RESTART_TYPE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_NV_STORAGE_SIZE = (SAI_SWITCH_ATTR_MIN_PLANNED_RESTART_INTERVAL + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_MAX_ACL_ACTION_COUNT = (SAI_SWITCH_ATTR_NV_STORAGE_SIZE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ACL_CAPABILITY = (SAI_SWITCH_ATTR_MAX_ACL_ACTION_COUNT + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_MCAST_SNOOPING_CAPABILITY = (SAI_SWITCH_ATTR_ACL_CAPABILITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_SWITCHING_MODE = (SAI_SWITCH_ATTR_MCAST_SNOOPING_CAPABILITY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_BCAST_CPU_FLOOD_ENABLE = (SAI_SWITCH_ATTR_SWITCHING_MODE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_MCAST_CPU_FLOOD_ENABLE = (SAI_SWITCH_ATTR_BCAST_CPU_FLOOD_ENABLE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_SRC_MAC_ADDRESS = (SAI_SWITCH_ATTR_MCAST_CPU_FLOOD_ENABLE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_MAX_LEARNED_ADDRESSES = (SAI_SWITCH_ATTR_SRC_MAC_ADDRESS + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FDB_AGING_TIME = (SAI_SWITCH_ATTR_MAX_LEARNED_ADDRESSES + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FDB_UNICAST_MISS_PACKET_ACTION = (SAI_SWITCH_ATTR_FDB_AGING_TIME + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FDB_BROADCAST_MISS_PACKET_ACTION = (SAI_SWITCH_ATTR_FDB_UNICAST_MISS_PACKET_ACTION + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION = (SAI_SWITCH_ATTR_FDB_BROADCAST_MISS_PACKET_ACTION + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM = (SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_SEED = (SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_DEFAULT_SYMMETRIC_HASH = (SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_SEED + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_HASH_IPV4 = (SAI_SWITCH_ATTR_ECMP_DEFAULT_SYMMETRIC_HASH + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_HASH_IPV4_IN_IPV4 = (SAI_SWITCH_ATTR_ECMP_HASH_IPV4 + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_ECMP_HASH_IPV6 = (SAI_SWITCH_ATTR_ECMP_HASH_IPV4_IN_IPV4 + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM = (SAI_SWITCH_ATTR_ECMP_HASH_IPV6 + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED = (SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_DEFAULT_SYMMETRIC_HASH = (SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_HASH_IPV4 = (SAI_SWITCH_ATTR_LAG_DEFAULT_SYMMETRIC_HASH + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_HASH_IPV4_IN_IPV4 = (SAI_SWITCH_ATTR_LAG_HASH_IPV4 + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_LAG_HASH_IPV6 = (SAI_SWITCH_ATTR_LAG_HASH_IPV4_IN_IPV4 + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_COUNTER_REFRESH_INTERVAL = (SAI_SWITCH_ATTR_LAG_HASH_IPV6 + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_DEFAULT_TC = (SAI_SWITCH_ATTR_COUNTER_REFRESH_INTERVAL + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_DOT1P_TO_TC_MAP = (SAI_SWITCH_ATTR_QOS_DEFAULT_TC + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_DOT1P_TO_COLOR_MAP = (SAI_SWITCH_ATTR_QOS_DOT1P_TO_TC_MAP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP = (SAI_SWITCH_ATTR_QOS_DOT1P_TO_COLOR_MAP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_DSCP_TO_COLOR_MAP = (SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_TC_TO_QUEUE_MAP = (SAI_SWITCH_ATTR_QOS_DSCP_TO_COLOR_MAP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP = (SAI_SWITCH_ATTR_QOS_TC_TO_QUEUE_MAP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP = (SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_SWITCH_SHELL_ENABLE = (SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_SWITCH_PROFILE_ID = (SAI_SWITCH_ATTR_SWITCH_SHELL_ENABLE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO = (SAI_SWITCH_ATTR_SWITCH_PROFILE_ID + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FIRMWARE_PATH_NAME = (SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_INIT_SWITCH = (SAI_SWITCH_ATTR_FIRMWARE_PATH_NAME + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_SWITCH_STATE_CHANGE_NOTIFY = (SAI_SWITCH_ATTR_INIT_SWITCH + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_SHUTDOWN_REQUEST_NOTIFY = (SAI_SWITCH_ATTR_SWITCH_STATE_CHANGE_NOTIFY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FDB_EVENT_NOTIFY = (SAI_SWITCH_ATTR_SHUTDOWN_REQUEST_NOTIFY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_PORT_STATE_CHANGE_NOTIFY = (SAI_SWITCH_ATTR_FDB_EVENT_NOTIFY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_PACKET_EVENT_NOTIFY = (SAI_SWITCH_ATTR_PORT_STATE_CHANGE_NOTIFY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_FAST_API_ENABLE = (SAI_SWITCH_ATTR_PACKET_EVENT_NOTIFY + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_END = (SAI_SWITCH_ATTR_FAST_API_ENABLE + 1) # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiswitch.h: 1221 - -SAI_SWITCH_ATTR_CUSTOM_RANGE_END = (SAI_SWITCH_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiswitch.h: 1221 - -sai_switch_attr_t = enum__sai_switch_attr_t # /usr/include/sai/saiswitch.h: 1221 - -sai_switch_shutdown_request_fn = CFUNCTYPE(UNCHECKED(None), sai_object_id_t) # /usr/include/sai/saiswitch.h: 1340 - -sai_switch_state_change_notification_fn = CFUNCTYPE(UNCHECKED(None), sai_object_id_t, sai_switch_oper_status_t) # /usr/include/sai/saiswitch.h: 1349 - -sai_create_switch_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiswitch.h: 1366 - -sai_remove_switch_fn = CFUNCTYPE(UNCHECKED(None), sai_object_id_t) # /usr/include/sai/saiswitch.h: 1379 - -sai_set_switch_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiswitch.h: 1390 - -sai_get_switch_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, sai_uint32_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiswitch.h: 1403 - -# /usr/include/sai/saiswitch.h: 1418 -class struct__sai_switch_api_t(Structure): - pass - -struct__sai_switch_api_t.__slots__ = [ - 'create_switch', - 'remove_switch', - 'set_switch_attribute', - 'get_switch_attribute', -] -struct__sai_switch_api_t._fields_ = [ - ('create_switch', sai_create_switch_fn), - ('remove_switch', sai_remove_switch_fn), - ('set_switch_attribute', sai_set_switch_attribute_fn), - ('get_switch_attribute', sai_get_switch_attribute_fn), -] - -sai_switch_api_t = struct__sai_switch_api_t # /usr/include/sai/saiswitch.h: 1418 - -enum__sai_tunnel_map_type_t = c_int # /usr/include/sai/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN = 0 # /usr/include/sai/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN = 1 # /usr/include/sai/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_VNI_TO_VLAN_ID = 2 # /usr/include/sai/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_VLAN_ID_TO_VNI = 3 # /usr/include/sai/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_VNI_TO_BRIDGE_IF = 4 # /usr/include/sai/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_BRIDGE_IF_TO_VNI = 5 # /usr/include/sai/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_CUSTOM_RANGE_BASE = 268435456 # /usr/include/sai/saitunnel.h: 62 - -sai_tunnel_map_type_t = enum__sai_tunnel_map_type_t # /usr/include/sai/saitunnel.h: 62 - -enum__sai_tunnel_map_attr_t = c_int # /usr/include/sai/saitunnel.h: 101 - -SAI_TUNNEL_MAP_ATTR_START = 0 # /usr/include/sai/saitunnel.h: 101 - -SAI_TUNNEL_MAP_ATTR_TYPE = SAI_TUNNEL_MAP_ATTR_START # /usr/include/sai/saitunnel.h: 101 - -SAI_TUNNEL_MAP_ATTR_MAP_TO_VALUE_LIST = 1 # /usr/include/sai/saitunnel.h: 101 - -SAI_TUNNEL_MAP_ATTR_END = (SAI_TUNNEL_MAP_ATTR_MAP_TO_VALUE_LIST + 1) # /usr/include/sai/saitunnel.h: 101 - -SAI_TUNNEL_MAP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saitunnel.h: 101 - -SAI_TUNNEL_MAP_ATTR_CUSTOM_RANGE_END = (SAI_TUNNEL_MAP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saitunnel.h: 101 - -sai_tunnel_map_attr_t = enum__sai_tunnel_map_attr_t # /usr/include/sai/saitunnel.h: 101 - -sai_create_tunnel_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 113 - -sai_remove_tunnel_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saitunnel.h: 126 - -sai_set_tunnel_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 137 - -sai_get_tunnel_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 150 - -enum__sai_tunnel_type_t = c_int # /usr/include/sai/saitunnel.h: 168 - -SAI_TUNNEL_TYPE_IPINIP = 0 # /usr/include/sai/saitunnel.h: 168 - -SAI_TUNNEL_TYPE_IPINIP_GRE = (SAI_TUNNEL_TYPE_IPINIP + 1) # /usr/include/sai/saitunnel.h: 168 - -SAI_TUNNEL_TYPE_VXLAN = (SAI_TUNNEL_TYPE_IPINIP_GRE + 1) # /usr/include/sai/saitunnel.h: 168 - -SAI_TUNNEL_TYPE_MPLS = (SAI_TUNNEL_TYPE_VXLAN + 1) # /usr/include/sai/saitunnel.h: 168 - -sai_tunnel_type_t = enum__sai_tunnel_type_t # /usr/include/sai/saitunnel.h: 168 - -enum__sai_tunnel_ttl_mode_t = c_int # /usr/include/sai/saitunnel.h: 196 - -SAI_TUNNEL_TTL_MODE_UNIFORM_MODEL = 0 # /usr/include/sai/saitunnel.h: 196 - -SAI_TUNNEL_TTL_MODE_PIPE_MODEL = (SAI_TUNNEL_TTL_MODE_UNIFORM_MODEL + 1) # /usr/include/sai/saitunnel.h: 196 - -sai_tunnel_ttl_mode_t = enum__sai_tunnel_ttl_mode_t # /usr/include/sai/saitunnel.h: 196 - -enum__sai_tunnel_dscp_mode_t = c_int # /usr/include/sai/saitunnel.h: 223 - -SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL = 0 # /usr/include/sai/saitunnel.h: 223 - -SAI_TUNNEL_DSCP_MODE_PIPE_MODEL = (SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL + 1) # /usr/include/sai/saitunnel.h: 223 - -sai_tunnel_dscp_mode_t = enum__sai_tunnel_dscp_mode_t # /usr/include/sai/saitunnel.h: 223 - -enum__sai_tunnel_encap_ecn_mode_t = c_int # /usr/include/sai/saitunnel.h: 243 - -SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD = 0 # /usr/include/sai/saitunnel.h: 243 - -SAI_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED = (SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD + 1) # /usr/include/sai/saitunnel.h: 243 - -sai_tunnel_encap_ecn_mode_t = enum__sai_tunnel_encap_ecn_mode_t # /usr/include/sai/saitunnel.h: 243 - -enum__sai_tunnel_decap_ecn_mode_t = c_int # /usr/include/sai/saitunnel.h: 267 - -SAI_TUNNEL_DECAP_ECN_MODE_STANDARD = 0 # /usr/include/sai/saitunnel.h: 267 - -SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER = (SAI_TUNNEL_DECAP_ECN_MODE_STANDARD + 1) # /usr/include/sai/saitunnel.h: 267 - -SAI_TUNNEL_DECAP_ECN_MODE_USER_DEFINED = (SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER + 1) # /usr/include/sai/saitunnel.h: 267 - -sai_tunnel_decap_ecn_mode_t = enum__sai_tunnel_decap_ecn_mode_t # /usr/include/sai/saitunnel.h: 267 - -enum__sai_tunnel_attr_t = c_int # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_START = 0 # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_TYPE = SAI_TUNNEL_ATTR_START # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE = (SAI_TUNNEL_ATTR_TYPE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_OVERLAY_INTERFACE = (SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_SRC_IP = (SAI_TUNNEL_ATTR_OVERLAY_INTERFACE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_TTL_MODE = (SAI_TUNNEL_ATTR_ENCAP_SRC_IP + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_TTL_VAL = (SAI_TUNNEL_ATTR_ENCAP_TTL_MODE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_DSCP_MODE = (SAI_TUNNEL_ATTR_ENCAP_TTL_VAL + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_DSCP_VAL = (SAI_TUNNEL_ATTR_ENCAP_DSCP_MODE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_GRE_KEY_VALID = (SAI_TUNNEL_ATTR_ENCAP_DSCP_VAL + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_GRE_KEY = (SAI_TUNNEL_ATTR_ENCAP_GRE_KEY_VALID + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_ECN_MODE = (SAI_TUNNEL_ATTR_ENCAP_GRE_KEY + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_ENCAP_MAPPERS = (SAI_TUNNEL_ATTR_ENCAP_ECN_MODE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_DECAP_ECN_MODE = (SAI_TUNNEL_ATTR_ENCAP_MAPPERS + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_DECAP_MAPPERS = (SAI_TUNNEL_ATTR_DECAP_ECN_MODE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_DECAP_TTL_MODE = (SAI_TUNNEL_ATTR_DECAP_MAPPERS + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_DECAP_DSCP_MODE = (SAI_TUNNEL_ATTR_DECAP_TTL_MODE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_END = (SAI_TUNNEL_ATTR_DECAP_DSCP_MODE + 1) # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saitunnel.h: 452 - -SAI_TUNNEL_ATTR_CUSTOM_RANGE_END = (SAI_TUNNEL_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saitunnel.h: 452 - -sai_tunnel_attr_t = enum__sai_tunnel_attr_t # /usr/include/sai/saitunnel.h: 452 - -sai_create_tunnel_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 464 - -sai_remove_tunnel_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saitunnel.h: 477 - -sai_set_tunnel_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 488 - -sai_get_tunnel_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 501 - -enum__sai_tunnel_term_table_entry_type_t = c_int # /usr/include/sai/saitunnel.h: 517 - -SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2P = 0 # /usr/include/sai/saitunnel.h: 517 - -SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2MP = (SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2P + 1) # /usr/include/sai/saitunnel.h: 517 - -sai_tunnel_term_table_entry_type_t = enum__sai_tunnel_term_table_entry_type_t # /usr/include/sai/saitunnel.h: 517 - -enum__sai_tunnel_term_table_entry_attr_t = c_int # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_START = 0 # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_VR_ID = SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_START # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TYPE = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_VR_ID + 1) # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_DST_IP = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TYPE + 1) # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_SRC_IP = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_DST_IP + 1) # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TUNNEL_TYPE = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_SRC_IP + 1) # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_ACTION_TUNNEL_ID = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TUNNEL_TYPE + 1) # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_END = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_ACTION_TUNNEL_ID + 1) # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saitunnel.h: 592 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saitunnel.h: 592 - -sai_tunnel_term_table_entry_attr_t = enum__sai_tunnel_term_table_entry_attr_t # /usr/include/sai/saitunnel.h: 592 - -sai_create_tunnel_term_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 604 - -sai_remove_tunnel_term_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saitunnel.h: 617 - -sai_set_tunnel_term_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 628 - -sai_get_tunnel_term_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saitunnel.h: 641 - -# /usr/include/sai/saitunnel.h: 664 -class struct__sai_tunnel_api_t(Structure): - pass - -struct__sai_tunnel_api_t.__slots__ = [ - 'create_tunnel_map', - 'remove_tunnel_map', - 'set_tunnel_map_attribute', - 'get_tunnel_map_attribute', - 'create_tunnel', - 'remove_tunnel', - 'set_tunnel_attribute', - 'get_tunnel_attribute', - 'create_tunnel_term_table_entry', - 'remove_tunnel_term_table_entry', - 'set_tunnel_term_table_entry_attribute', - 'get_tunnel_term_table_entry_attribute', -] -struct__sai_tunnel_api_t._fields_ = [ - ('create_tunnel_map', sai_create_tunnel_map_fn), - ('remove_tunnel_map', sai_remove_tunnel_map_fn), - ('set_tunnel_map_attribute', sai_set_tunnel_map_attribute_fn), - ('get_tunnel_map_attribute', sai_get_tunnel_map_attribute_fn), - ('create_tunnel', sai_create_tunnel_fn), - ('remove_tunnel', sai_remove_tunnel_fn), - ('set_tunnel_attribute', sai_set_tunnel_attribute_fn), - ('get_tunnel_attribute', sai_get_tunnel_attribute_fn), - ('create_tunnel_term_table_entry', sai_create_tunnel_term_table_entry_fn), - ('remove_tunnel_term_table_entry', sai_remove_tunnel_term_table_entry_fn), - ('set_tunnel_term_table_entry_attribute', sai_set_tunnel_term_table_entry_attribute_fn), - ('get_tunnel_term_table_entry_attribute', sai_get_tunnel_term_table_entry_attribute_fn), -] - -sai_tunnel_api_t = struct__sai_tunnel_api_t # /usr/include/sai/saitunnel.h: 664 - -enum__sai_udf_base_t = c_int # /usr/include/sai/saiudf.h: 50 - -SAI_UDF_BASE_L2 = 0 # /usr/include/sai/saiudf.h: 50 - -SAI_UDF_BASE_L3 = (SAI_UDF_BASE_L2 + 1) # /usr/include/sai/saiudf.h: 50 - -SAI_UDF_BASE_L4 = (SAI_UDF_BASE_L3 + 1) # /usr/include/sai/saiudf.h: 50 - -sai_udf_base_t = enum__sai_udf_base_t # /usr/include/sai/saiudf.h: 50 - -enum__sai_udf_attr_t = c_int # /usr/include/sai/saiudf.h: 117 - -SAI_UDF_ATTR_START = 0 # /usr/include/sai/saiudf.h: 117 - -SAI_UDF_ATTR_MATCH_ID = SAI_UDF_ATTR_START # /usr/include/sai/saiudf.h: 117 - -SAI_UDF_ATTR_GROUP_ID = (SAI_UDF_ATTR_MATCH_ID + 1) # /usr/include/sai/saiudf.h: 117 - -SAI_UDF_ATTR_BASE = (SAI_UDF_ATTR_GROUP_ID + 1) # /usr/include/sai/saiudf.h: 117 - -SAI_UDF_ATTR_OFFSET = (SAI_UDF_ATTR_BASE + 1) # /usr/include/sai/saiudf.h: 117 - -SAI_UDF_ATTR_HASH_MASK = (SAI_UDF_ATTR_OFFSET + 1) # /usr/include/sai/saiudf.h: 117 - -SAI_UDF_ATTR_END = (SAI_UDF_ATTR_HASH_MASK + 1) # /usr/include/sai/saiudf.h: 117 - -sai_udf_attr_t = enum__sai_udf_attr_t # /usr/include/sai/saiudf.h: 117 - -enum__sai_udf_match_attr_t = c_int # /usr/include/sai/saiudf.h: 176 - -SAI_UDF_MATCH_ATTR_START = 0 # /usr/include/sai/saiudf.h: 176 - -SAI_UDF_MATCH_ATTR_L2_TYPE = SAI_UDF_MATCH_ATTR_START # /usr/include/sai/saiudf.h: 176 - -SAI_UDF_MATCH_ATTR_L3_TYPE = (SAI_UDF_MATCH_ATTR_L2_TYPE + 1) # /usr/include/sai/saiudf.h: 176 - -SAI_UDF_MATCH_ATTR_GRE_TYPE = (SAI_UDF_MATCH_ATTR_L3_TYPE + 1) # /usr/include/sai/saiudf.h: 176 - -SAI_UDF_MATCH_ATTR_PRIORITY = (SAI_UDF_MATCH_ATTR_GRE_TYPE + 1) # /usr/include/sai/saiudf.h: 176 - -SAI_UDF_MATCH_ATTR_END = (SAI_UDF_MATCH_ATTR_PRIORITY + 1) # /usr/include/sai/saiudf.h: 176 - -sai_udf_match_attr_t = enum__sai_udf_match_attr_t # /usr/include/sai/saiudf.h: 176 - -enum__sai_udf_group_type_t = c_int # /usr/include/sai/saiudf.h: 195 - -SAI_UDF_GROUP_TYPE_START = 0 # /usr/include/sai/saiudf.h: 195 - -SAI_UDF_GROUP_TYPE_GENERIC = SAI_UDF_GROUP_TYPE_START # /usr/include/sai/saiudf.h: 195 - -SAI_UDF_GROUP_TYPE_HASH = (SAI_UDF_GROUP_TYPE_GENERIC + 1) # /usr/include/sai/saiudf.h: 195 - -SAI_UDF_GROUP_TYPE_END = (SAI_UDF_GROUP_TYPE_HASH + 1) # /usr/include/sai/saiudf.h: 195 - -sai_udf_group_type_t = enum__sai_udf_group_type_t # /usr/include/sai/saiudf.h: 195 - -enum__sai_udf_group_attr_t = c_int # /usr/include/sai/saiudf.h: 238 - -SAI_UDF_GROUP_ATTR_START = 0 # /usr/include/sai/saiudf.h: 238 - -SAI_UDF_GROUP_ATTR_UDF_LIST = SAI_UDF_GROUP_ATTR_START # /usr/include/sai/saiudf.h: 238 - -SAI_UDF_GROUP_ATTR_TYPE = (SAI_UDF_GROUP_ATTR_UDF_LIST + 1) # /usr/include/sai/saiudf.h: 238 - -SAI_UDF_GROUP_ATTR_LENGTH = (SAI_UDF_GROUP_ATTR_TYPE + 1) # /usr/include/sai/saiudf.h: 238 - -SAI_UDF_GROUP_ATTR_END = (SAI_UDF_GROUP_ATTR_LENGTH + 1) # /usr/include/sai/saiudf.h: 238 - -sai_udf_group_attr_t = enum__sai_udf_group_attr_t # /usr/include/sai/saiudf.h: 238 - -sai_create_udf_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 250 - -sai_remove_udf_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiudf.h: 263 - -sai_set_udf_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 274 - -sai_get_udf_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 287 - -sai_create_udf_match_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 302 - -sai_remove_udf_match_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiudf.h: 315 - -sai_set_udf_match_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 326 - -sai_get_udf_match_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 339 - -sai_create_udf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 354 - -sai_remove_udf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiudf.h: 367 - -sai_set_udf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 378 - -sai_get_udf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiudf.h: 391 - -# /usr/include/sai/saiudf.h: 414 -class struct__sai_udf_api_t(Structure): - pass - -struct__sai_udf_api_t.__slots__ = [ - 'create_udf', - 'remove_udf', - 'set_udf_attribute', - 'get_udf_attribute', - 'create_udf_match', - 'remove_udf_match', - 'set_udf_match_attribute', - 'get_udf_match_attribute', - 'create_udf_group', - 'remove_udf_group', - 'set_udf_group_attribute', - 'get_udf_group_attribute', -] -struct__sai_udf_api_t._fields_ = [ - ('create_udf', sai_create_udf_fn), - ('remove_udf', sai_remove_udf_fn), - ('set_udf_attribute', sai_set_udf_attribute_fn), - ('get_udf_attribute', sai_get_udf_attribute_fn), - ('create_udf_match', sai_create_udf_match_fn), - ('remove_udf_match', sai_remove_udf_match_fn), - ('set_udf_match_attribute', sai_set_udf_match_attribute_fn), - ('get_udf_match_attribute', sai_get_udf_match_attribute_fn), - ('create_udf_group', sai_create_udf_group_fn), - ('remove_udf_group', sai_remove_udf_group_fn), - ('set_udf_group_attribute', sai_set_udf_group_attribute_fn), - ('get_udf_group_attribute', sai_get_udf_group_attribute_fn), -] - -sai_udf_api_t = struct__sai_udf_api_t # /usr/include/sai/saiudf.h: 414 - -enum__sai_vlan_tagging_mode_t = c_int # /usr/include/sai/saivlan.h: 52 - -SAI_VLAN_TAGGING_MODE_UNTAGGED = 0 # /usr/include/sai/saivlan.h: 52 - -SAI_VLAN_TAGGING_MODE_TAGGED = (SAI_VLAN_TAGGING_MODE_UNTAGGED + 1) # /usr/include/sai/saivlan.h: 52 - -SAI_VLAN_TAGGING_MODE_PRIORITY_TAGGED = (SAI_VLAN_TAGGING_MODE_TAGGED + 1) # /usr/include/sai/saivlan.h: 52 - -sai_vlan_tagging_mode_t = enum__sai_vlan_tagging_mode_t # /usr/include/sai/saivlan.h: 52 - -enum__sai_vlan_mcast_lookup_key_type_t = c_int # /usr/include/sai/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_MAC_DA = 0 # /usr/include/sai/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_XG = (SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_MAC_DA + 1) # /usr/include/sai/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_SG = (SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_XG + 1) # /usr/include/sai/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_XG_AND_SG = (SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_SG + 1) # /usr/include/sai/saivlan.h: 67 - -sai_vlan_mcast_lookup_key_type_t = enum__sai_vlan_mcast_lookup_key_type_t # /usr/include/sai/saivlan.h: 67 - -enum__sai_vlan_attr_t = c_int # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_START = 0 # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_VLAN_ID = SAI_VLAN_ATTR_START # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_MEMBER_LIST = (SAI_VLAN_ATTR_VLAN_ID + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_MAX_LEARNED_ADDRESSES = (SAI_VLAN_ATTR_MEMBER_LIST + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_STP_INSTANCE = (SAI_VLAN_ATTR_MAX_LEARNED_ADDRESSES + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_LEARN_DISABLE = (SAI_VLAN_ATTR_STP_INSTANCE + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_IPV4_MCAST_LOOKUP_KEY_TYPE = (SAI_VLAN_ATTR_LEARN_DISABLE + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_IPV6_MCAST_LOOKUP_KEY_TYPE = (SAI_VLAN_ATTR_IPV4_MCAST_LOOKUP_KEY_TYPE + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_UNKNOWN_NON_IP_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_IPV6_MCAST_LOOKUP_KEY_TYPE + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_UNKNOWN_IPV4_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_UNKNOWN_NON_IP_MCAST_OUTPUT_GROUP_ID + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_UNKNOWN_IPV6_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_UNKNOWN_IPV4_MCAST_OUTPUT_GROUP_ID + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_UNKNOWN_LINKLOCAL_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_UNKNOWN_IPV6_MCAST_OUTPUT_GROUP_ID + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_INGRESS_ACL = (SAI_VLAN_ATTR_UNKNOWN_LINKLOCAL_MCAST_OUTPUT_GROUP_ID + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_EGRESS_ACL = (SAI_VLAN_ATTR_INGRESS_ACL + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_META_DATA = (SAI_VLAN_ATTR_EGRESS_ACL + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_END = (SAI_VLAN_ATTR_META_DATA + 1) # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saivlan.h: 280 - -SAI_VLAN_ATTR_CUSTOM_RANGE_END = (SAI_VLAN_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saivlan.h: 280 - -sai_vlan_attr_t = enum__sai_vlan_attr_t # /usr/include/sai/saivlan.h: 280 - -enum__sai_vlan_member_attr_t = c_int # /usr/include/sai/saivlan.h: 330 - -SAI_VLAN_MEMBER_ATTR_START = 0 # /usr/include/sai/saivlan.h: 330 - -SAI_VLAN_MEMBER_ATTR_VLAN_ID = SAI_VLAN_MEMBER_ATTR_START # /usr/include/sai/saivlan.h: 330 - -SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID = (SAI_VLAN_MEMBER_ATTR_VLAN_ID + 1) # /usr/include/sai/saivlan.h: 330 - -SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE = (SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID + 1) # /usr/include/sai/saivlan.h: 330 - -SAI_VLAN_MEMBER_ATTR_END = (SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE + 1) # /usr/include/sai/saivlan.h: 330 - -SAI_VLAN_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saivlan.h: 330 - -SAI_VLAN_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_VLAN_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saivlan.h: 330 - -sai_vlan_member_attr_t = enum__sai_vlan_member_attr_t # /usr/include/sai/saivlan.h: 330 - -enum__sai_vlan_stat_t = c_int # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_IN_OCTETS = 0 # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_IN_PACKETS = (SAI_VLAN_STAT_IN_OCTETS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_IN_UCAST_PKTS = (SAI_VLAN_STAT_IN_PACKETS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_IN_NON_UCAST_PKTS = (SAI_VLAN_STAT_IN_UCAST_PKTS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_IN_DISCARDS = (SAI_VLAN_STAT_IN_NON_UCAST_PKTS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_IN_ERRORS = (SAI_VLAN_STAT_IN_DISCARDS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_IN_UNKNOWN_PROTOS = (SAI_VLAN_STAT_IN_ERRORS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_OUT_OCTETS = (SAI_VLAN_STAT_IN_UNKNOWN_PROTOS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_OUT_PACKETS = (SAI_VLAN_STAT_OUT_OCTETS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_OUT_UCAST_PKTS = (SAI_VLAN_STAT_OUT_PACKETS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_OUT_NON_UCAST_PKTS = (SAI_VLAN_STAT_OUT_UCAST_PKTS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_OUT_DISCARDS = (SAI_VLAN_STAT_OUT_NON_UCAST_PKTS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_OUT_ERRORS = (SAI_VLAN_STAT_OUT_DISCARDS + 1) # /usr/include/sai/saivlan.h: 352 - -SAI_VLAN_STAT_OUT_QLEN = (SAI_VLAN_STAT_OUT_ERRORS + 1) # /usr/include/sai/saivlan.h: 352 - -sai_vlan_stat_t = enum__sai_vlan_stat_t # /usr/include/sai/saivlan.h: 352 - -sai_create_vlan_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saivlan.h: 364 - -sai_remove_vlan_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saivlan.h: 377 - -sai_set_vlan_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saivlan.h: 388 - -sai_get_vlan_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saivlan.h: 401 - -sai_create_vlan_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saivlan.h: 416 - -sai_remove_vlan_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saivlan.h: 429 - -sai_set_vlan_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saivlan.h: 440 - -sai_get_vlan_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saivlan.h: 453 - -sai_get_vlan_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_vlan_stat_t), c_uint32, POINTER(c_uint64)) # /usr/include/sai/saivlan.h: 468 - -sai_clear_vlan_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_vlan_stat_t), c_uint32) # /usr/include/sai/saivlan.h: 483 - -# /usr/include/sai/saivlan.h: 504 -class struct__sai_vlan_api_t(Structure): - pass - -struct__sai_vlan_api_t.__slots__ = [ - 'create_vlan', - 'remove_vlan', - 'set_vlan_attribute', - 'get_vlan_attribute', - 'create_vlan_member', - 'remove_vlan_member', - 'set_vlan_member_attribute', - 'get_vlan_member_attribute', - 'get_vlan_stats', - 'clear_vlan_stats', -] -struct__sai_vlan_api_t._fields_ = [ - ('create_vlan', sai_create_vlan_fn), - ('remove_vlan', sai_remove_vlan_fn), - ('set_vlan_attribute', sai_set_vlan_attribute_fn), - ('get_vlan_attribute', sai_get_vlan_attribute_fn), - ('create_vlan_member', sai_create_vlan_member_fn), - ('remove_vlan_member', sai_remove_vlan_member_fn), - ('set_vlan_member_attribute', sai_set_vlan_member_attribute_fn), - ('get_vlan_member_attribute', sai_get_vlan_member_attribute_fn), - ('get_vlan_stats', sai_get_vlan_stats_fn), - ('clear_vlan_stats', sai_clear_vlan_stats_fn), -] - -sai_vlan_api_t = struct__sai_vlan_api_t # /usr/include/sai/saivlan.h: 504 - -enum__sai_ecn_mark_mode_t = c_int # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_NONE = 0 # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_GREEN = (SAI_ECN_MARK_MODE_NONE + 1) # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_YELLOW = (SAI_ECN_MARK_MODE_GREEN + 1) # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_RED = (SAI_ECN_MARK_MODE_YELLOW + 1) # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_GREEN_YELLOW = (SAI_ECN_MARK_MODE_RED + 1) # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_GREEN_RED = (SAI_ECN_MARK_MODE_GREEN_YELLOW + 1) # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_YELLOW_RED = (SAI_ECN_MARK_MODE_GREEN_RED + 1) # /usr/include/sai/saiwred.h: 65 - -SAI_ECN_MARK_MODE_ALL = (SAI_ECN_MARK_MODE_YELLOW_RED + 1) # /usr/include/sai/saiwred.h: 65 - -sai_ecn_mark_mode_t = enum__sai_ecn_mark_mode_t # /usr/include/sai/saiwred.h: 65 - -enum__sai_wred_attr_t = c_int # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_START = 0 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_GREEN_ENABLE = SAI_WRED_ATTR_START # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_GREEN_MIN_THRESHOLD = 1 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_GREEN_MAX_THRESHOLD = 2 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_GREEN_DROP_PROBABILITY = 3 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_YELLOW_ENABLE = 4 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_YELLOW_MIN_THRESHOLD = 5 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_YELLOW_MAX_THRESHOLD = 6 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_YELLOW_DROP_PROBABILITY = 7 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_RED_ENABLE = 8 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_RED_MIN_THRESHOLD = 9 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_RED_MAX_THRESHOLD = 10 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_RED_DROP_PROBABILITY = 11 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_WEIGHT = 12 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_ECN_MARK_MODE = 13 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_END = (SAI_WRED_ATTR_ECN_MARK_MODE + 1) # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiwred.h: 245 - -SAI_WRED_ATTR_CUSTOM_RANGE_END = (SAI_WRED_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiwred.h: 245 - -sai_wred_attr_t = enum__sai_wred_attr_t # /usr/include/sai/saiwred.h: 245 - -sai_create_wred_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiwred.h: 257 - -sai_remove_wred_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiwred.h: 270 - -sai_set_wred_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiwred.h: 281 - -sai_get_wred_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiwred.h: 294 - -# /usr/include/sai/saiwred.h: 309 -class struct__sai_wred_api_t(Structure): - pass - -struct__sai_wred_api_t.__slots__ = [ - 'create_wred_profile', - 'remove_wred_profile', - 'set_wred_attribute', - 'get_wred_attribute', -] -struct__sai_wred_api_t._fields_ = [ - ('create_wred_profile', sai_create_wred_fn), - ('remove_wred_profile', sai_remove_wred_fn), - ('set_wred_attribute', sai_set_wred_attribute_fn), - ('get_wred_attribute', sai_get_wred_attribute_fn), -] - -sai_wred_api_t = struct__sai_wred_api_t # /usr/include/sai/saiwred.h: 309 - -enum__sai_rpf_group_attr_t = c_int # /usr/include/sai/sairpfgroup.h: 73 - -SAI_RPF_GROUP_ATTR_START = 0 # /usr/include/sai/sairpfgroup.h: 73 - -SAI_RPF_GROUP_ATTR_RPF_INTERFACE_COUNT = SAI_RPF_GROUP_ATTR_START # /usr/include/sai/sairpfgroup.h: 73 - -SAI_RPF_GROUP_ATTR_RPF_MEMBER_LIST = (SAI_RPF_GROUP_ATTR_RPF_INTERFACE_COUNT + 1) # /usr/include/sai/sairpfgroup.h: 73 - -SAI_RPF_GROUP_ATTR_END = (SAI_RPF_GROUP_ATTR_RPF_MEMBER_LIST + 1) # /usr/include/sai/sairpfgroup.h: 73 - -SAI_RPF_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sairpfgroup.h: 73 - -SAI_RPF_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_RPF_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sairpfgroup.h: 73 - -sai_rpf_group_attr_t = enum__sai_rpf_group_attr_t # /usr/include/sai/sairpfgroup.h: 73 - -enum__sai_rpf_group_member_attr_t = c_int # /usr/include/sai/sairpfgroup.h: 109 - -SAI_RPF_GROUP_MEMBER_ATTR_START = 0 # /usr/include/sai/sairpfgroup.h: 109 - -SAI_RPF_GROUP_MEMBER_ATTR_RPF_GROUP_ID = SAI_RPF_GROUP_MEMBER_ATTR_START # /usr/include/sai/sairpfgroup.h: 109 - -SAI_RPF_GROUP_MEMBER_ATTR_RPF_INTERFACE_ID = (SAI_RPF_GROUP_MEMBER_ATTR_RPF_GROUP_ID + 1) # /usr/include/sai/sairpfgroup.h: 109 - -SAI_RPF_GROUP_MEMBER_ATTR_END = (SAI_RPF_GROUP_MEMBER_ATTR_RPF_INTERFACE_ID + 1) # /usr/include/sai/sairpfgroup.h: 109 - -SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sairpfgroup.h: 109 - -SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sairpfgroup.h: 109 - -sai_rpf_group_member_attr_t = enum__sai_rpf_group_member_attr_t # /usr/include/sai/sairpfgroup.h: 109 - -sai_create_rpf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairpfgroup.h: 121 - -sai_remove_rpf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sairpfgroup.h: 134 - -sai_set_rpf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sairpfgroup.h: 145 - -sai_get_rpf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairpfgroup.h: 158 - -sai_create_rpf_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairpfgroup.h: 172 - -sai_remove_rpf_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sairpfgroup.h: 185 - -sai_set_rpf_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sairpfgroup.h: 197 - -sai_get_rpf_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sairpfgroup.h: 211 - -# /usr/include/sai/sairpfgroup.h: 231 -class struct__sai_rpf_group_api_t(Structure): - pass - -struct__sai_rpf_group_api_t.__slots__ = [ - 'create_rpf_group', - 'remove_rpf_group', - 'set_rpf_group_attribute', - 'get_rpf_group_attribute', - 'create_rpf_group_member', - 'remove_rpf_group_member', - 'set_rpf_group_member_attribute', - 'get_rpf_group_member_attribute', -] -struct__sai_rpf_group_api_t._fields_ = [ - ('create_rpf_group', sai_create_rpf_group_fn), - ('remove_rpf_group', sai_remove_rpf_group_fn), - ('set_rpf_group_attribute', sai_set_rpf_group_attribute_fn), - ('get_rpf_group_attribute', sai_get_rpf_group_attribute_fn), - ('create_rpf_group_member', sai_create_rpf_group_member_fn), - ('remove_rpf_group_member', sai_remove_rpf_group_member_fn), - ('set_rpf_group_member_attribute', sai_set_rpf_group_member_attribute_fn), - ('get_rpf_group_member_attribute', sai_get_rpf_group_member_attribute_fn), -] - -sai_rpf_group_api_t = struct__sai_rpf_group_api_t # /usr/include/sai/sairpfgroup.h: 231 - -enum__sai_l2mc_group_attr_t = c_int # /usr/include/sai/sail2mcgroup.h: 73 - -SAI_L2MC_GROUP_ATTR_START = 0 # /usr/include/sai/sail2mcgroup.h: 73 - -SAI_L2MC_GROUP_ATTR_L2MC_OUTPUT_COUNT = SAI_L2MC_GROUP_ATTR_START # /usr/include/sai/sail2mcgroup.h: 73 - -SAI_L2MC_GROUP_ATTR_L2MC_MEMBER_LIST = (SAI_L2MC_GROUP_ATTR_L2MC_OUTPUT_COUNT + 1) # /usr/include/sai/sail2mcgroup.h: 73 - -SAI_L2MC_GROUP_ATTR_END = (SAI_L2MC_GROUP_ATTR_L2MC_MEMBER_LIST + 1) # /usr/include/sai/sail2mcgroup.h: 73 - -SAI_L2MC_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sail2mcgroup.h: 73 - -SAI_L2MC_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_L2MC_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sail2mcgroup.h: 73 - -sai_l2mc_group_attr_t = enum__sai_l2mc_group_attr_t # /usr/include/sai/sail2mcgroup.h: 73 - -enum__sai_l2mc_group_member_attr_t = c_int # /usr/include/sai/sail2mcgroup.h: 109 - -SAI_L2MC_GROUP_MEMBER_ATTR_START = 0 # /usr/include/sai/sail2mcgroup.h: 109 - -SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_GROUP_ID = SAI_L2MC_GROUP_MEMBER_ATTR_START # /usr/include/sai/sail2mcgroup.h: 109 - -SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_OUTPUT_ID = (SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_GROUP_ID + 1) # /usr/include/sai/sail2mcgroup.h: 109 - -SAI_L2MC_GROUP_MEMBER_ATTR_END = (SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_OUTPUT_ID + 1) # /usr/include/sai/sail2mcgroup.h: 109 - -SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/sail2mcgroup.h: 109 - -SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/sail2mcgroup.h: 109 - -sai_l2mc_group_member_attr_t = enum__sai_l2mc_group_member_attr_t # /usr/include/sai/sail2mcgroup.h: 109 - -sai_create_l2mc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mcgroup.h: 121 - -sai_remove_l2mc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sail2mcgroup.h: 134 - -sai_set_l2mc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mcgroup.h: 145 - -sai_get_l2mc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mcgroup.h: 158 - -sai_create_l2mc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mcgroup.h: 172 - -sai_remove_l2mc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/sail2mcgroup.h: 185 - -sai_set_l2mc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mcgroup.h: 197 - -sai_get_l2mc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/sail2mcgroup.h: 211 - -# /usr/include/sai/sail2mcgroup.h: 231 -class struct__sai_l2mc_group_api_t(Structure): - pass - -struct__sai_l2mc_group_api_t.__slots__ = [ - 'create_l2mc_group', - 'remove_l2mc_group', - 'set_l2mc_group_attribute', - 'get_l2mc_group_attribute', - 'create_l2mc_group_member', - 'remove_l2mc_group_member', - 'set_l2mc_group_member_attribute', - 'get_l2mc_group_member_attribute', -] -struct__sai_l2mc_group_api_t._fields_ = [ - ('create_l2mc_group', sai_create_l2mc_group_fn), - ('remove_l2mc_group', sai_remove_l2mc_group_fn), - ('set_l2mc_group_attribute', sai_set_l2mc_group_attribute_fn), - ('get_l2mc_group_attribute', sai_get_l2mc_group_attribute_fn), - ('create_l2mc_group_member', sai_create_l2mc_group_member_fn), - ('remove_l2mc_group_member', sai_remove_l2mc_group_member_fn), - ('set_l2mc_group_member_attribute', sai_set_l2mc_group_member_attribute_fn), - ('get_l2mc_group_member_attribute', sai_get_l2mc_group_member_attribute_fn), -] - -sai_l2mc_group_api_t = struct__sai_l2mc_group_api_t # /usr/include/sai/sail2mcgroup.h: 231 - -enum__sai_ipmc_group_attr_t = c_int # /usr/include/sai/saiipmcgroup.h: 73 - -SAI_IPMC_GROUP_ATTR_START = 0 # /usr/include/sai/saiipmcgroup.h: 73 - -SAI_IPMC_GROUP_ATTR_IPMC_OUTPUT_COUNT = SAI_IPMC_GROUP_ATTR_START # /usr/include/sai/saiipmcgroup.h: 73 - -SAI_IPMC_GROUP_ATTR_IPMC_MEMBER_LIST = (SAI_IPMC_GROUP_ATTR_IPMC_OUTPUT_COUNT + 1) # /usr/include/sai/saiipmcgroup.h: 73 - -SAI_IPMC_GROUP_ATTR_END = (SAI_IPMC_GROUP_ATTR_IPMC_MEMBER_LIST + 1) # /usr/include/sai/saiipmcgroup.h: 73 - -SAI_IPMC_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiipmcgroup.h: 73 - -SAI_IPMC_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_IPMC_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiipmcgroup.h: 73 - -sai_ipmc_group_attr_t = enum__sai_ipmc_group_attr_t # /usr/include/sai/saiipmcgroup.h: 73 - -enum__sai_ipmc_group_member_attr_t = c_int # /usr/include/sai/saiipmcgroup.h: 109 - -SAI_IPMC_GROUP_MEMBER_ATTR_START = 0 # /usr/include/sai/saiipmcgroup.h: 109 - -SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_GROUP_ID = SAI_IPMC_GROUP_MEMBER_ATTR_START # /usr/include/sai/saiipmcgroup.h: 109 - -SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID = (SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_GROUP_ID + 1) # /usr/include/sai/saiipmcgroup.h: 109 - -SAI_IPMC_GROUP_MEMBER_ATTR_END = (SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID + 1) # /usr/include/sai/saiipmcgroup.h: 109 - -SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /usr/include/sai/saiipmcgroup.h: 109 - -SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /usr/include/sai/saiipmcgroup.h: 109 - -sai_ipmc_group_member_attr_t = enum__sai_ipmc_group_member_attr_t # /usr/include/sai/saiipmcgroup.h: 109 - -sai_create_ipmc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmcgroup.h: 121 - -sai_remove_ipmc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiipmcgroup.h: 134 - -sai_set_ipmc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmcgroup.h: 145 - -sai_get_ipmc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmcgroup.h: 158 - -sai_create_ipmc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmcgroup.h: 172 - -sai_remove_ipmc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /usr/include/sai/saiipmcgroup.h: 185 - -sai_set_ipmc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmcgroup.h: 197 - -sai_get_ipmc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /usr/include/sai/saiipmcgroup.h: 211 - -# /usr/include/sai/saiipmcgroup.h: 231 -class struct__sai_ipmc_group_api_t(Structure): - pass - -struct__sai_ipmc_group_api_t.__slots__ = [ - 'create_ipmc_group', - 'remove_ipmc_group', - 'set_ipmc_group_attribute', - 'get_ipmc_group_attribute', - 'create_ipmc_group_member', - 'remove_ipmc_group_member', - 'set_ipmc_group_member_attribute', - 'get_ipmc_group_member_attribute', -] -struct__sai_ipmc_group_api_t._fields_ = [ - ('create_ipmc_group', sai_create_ipmc_group_fn), - ('remove_ipmc_group', sai_remove_ipmc_group_fn), - ('set_ipmc_group_attribute', sai_set_ipmc_group_attribute_fn), - ('get_ipmc_group_attribute', sai_get_ipmc_group_attribute_fn), - ('create_ipmc_group_member', sai_create_ipmc_group_member_fn), - ('remove_ipmc_group_member', sai_remove_ipmc_group_member_fn), - ('set_ipmc_group_member_attribute', sai_set_ipmc_group_member_attribute_fn), - ('get_ipmc_group_member_attribute', sai_get_ipmc_group_member_attribute_fn), -] - -sai_ipmc_group_api_t = struct__sai_ipmc_group_api_t # /usr/include/sai/saiipmcgroup.h: 231 - -enum__sai_api_t = c_int # /usr/include/sai/sai.h: 114 - -SAI_API_UNSPECIFIED = 0 # /usr/include/sai/sai.h: 114 - -SAI_API_SWITCH = 1 # /usr/include/sai/sai.h: 114 - -SAI_API_PORT = 2 # /usr/include/sai/sai.h: 114 - -SAI_API_FDB = 3 # /usr/include/sai/sai.h: 114 - -SAI_API_VLAN = 4 # /usr/include/sai/sai.h: 114 - -SAI_API_VIRTUAL_ROUTER = 5 # /usr/include/sai/sai.h: 114 - -SAI_API_ROUTE = 6 # /usr/include/sai/sai.h: 114 - -SAI_API_NEXT_HOP = 7 # /usr/include/sai/sai.h: 114 - -SAI_API_NEXT_HOP_GROUP = 8 # /usr/include/sai/sai.h: 114 - -SAI_API_ROUTER_INTERFACE = 9 # /usr/include/sai/sai.h: 114 - -SAI_API_NEIGHBOR = 10 # /usr/include/sai/sai.h: 114 - -SAI_API_ACL = 11 # /usr/include/sai/sai.h: 114 - -SAI_API_HOST_INTERFACE = 12 # /usr/include/sai/sai.h: 114 - -SAI_API_MIRROR = 13 # /usr/include/sai/sai.h: 114 - -SAI_API_SAMPLEPACKET = 14 # /usr/include/sai/sai.h: 114 - -SAI_API_STP = 15 # /usr/include/sai/sai.h: 114 - -SAI_API_LAG = 16 # /usr/include/sai/sai.h: 114 - -SAI_API_POLICER = 17 # /usr/include/sai/sai.h: 114 - -SAI_API_WRED = 18 # /usr/include/sai/sai.h: 114 - -SAI_API_QOS_MAPS = 19 # /usr/include/sai/sai.h: 114 - -SAI_API_QUEUE = 20 # /usr/include/sai/sai.h: 114 - -SAI_API_SCHEDULER = 21 # /usr/include/sai/sai.h: 114 - -SAI_API_SCHEDULER_GROUP = 22 # /usr/include/sai/sai.h: 114 - -SAI_API_BUFFERS = 23 # /usr/include/sai/sai.h: 114 - -SAI_API_HASH = 24 # /usr/include/sai/sai.h: 114 - -SAI_API_UDF = 25 # /usr/include/sai/sai.h: 114 - -SAI_API_TUNNEL = 26 # /usr/include/sai/sai.h: 114 - -SAI_API_L2MC = 27 # /usr/include/sai/sai.h: 114 - -SAI_API_IPMC = 28 # /usr/include/sai/sai.h: 114 - -SAI_API_RPF_GROUP = 29 # /usr/include/sai/sai.h: 114 - -SAI_API_L2MC_GROUP = 30 # /usr/include/sai/sai.h: 114 - -SAI_API_IPMC_GROUP = 31 # /usr/include/sai/sai.h: 114 - -SAI_API_MCAST_FDB = 32 # /usr/include/sai/sai.h: 114 - -SAI_API_BRIDGE = 33 # /usr/include/sai/sai.h: 114 - -sai_api_t = enum__sai_api_t # /usr/include/sai/sai.h: 114 - -enum__sai_log_level_t = c_int # /usr/include/sai/sai.h: 139 - -SAI_LOG_LEVEL_DEBUG = 0 # /usr/include/sai/sai.h: 139 - -SAI_LOG_LEVEL_INFO = 1 # /usr/include/sai/sai.h: 139 - -SAI_LOG_LEVEL_NOTICE = 2 # /usr/include/sai/sai.h: 139 - -SAI_LOG_LEVEL_WARN = 3 # /usr/include/sai/sai.h: 139 - -SAI_LOG_LEVEL_ERROR = 4 # /usr/include/sai/sai.h: 139 - -SAI_LOG_LEVEL_CRITICAL = 5 # /usr/include/sai/sai.h: 139 - -sai_log_level_t = enum__sai_log_level_t # /usr/include/sai/sai.h: 139 - -# /usr/include/sai/sai.h: 165 -class struct__service_method_table_t(Structure): - pass - -struct__service_method_table_t.__slots__ = [ - 'profile_get_value', - 'profile_get_next_value', -] -struct__service_method_table_t._fields_ = [ - ('profile_get_value', CFUNCTYPE(UNCHECKED(String), sai_switch_profile_id_t, String)), - ('profile_get_next_value', CFUNCTYPE(UNCHECKED(c_int), sai_switch_profile_id_t, POINTER(POINTER(c_char)), POINTER(POINTER(c_char)))), -] - -service_method_table_t = struct__service_method_table_t # /usr/include/sai/sai.h: 165 - -# /usr/include/sai/sai.h: 175 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_api_initialize'): - continue - sai_api_initialize = _lib.sai_api_initialize - sai_api_initialize.argtypes = [c_uint64, POINTER(service_method_table_t)] - sai_api_initialize.restype = sai_status_t - break - -# /usr/include/sai/sai.h: 189 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_api_query'): - continue - sai_api_query = _lib.sai_api_query - sai_api_query.argtypes = [sai_api_t, POINTER(POINTER(None))] - sai_api_query.restype = sai_status_t - break - -# /usr/include/sai/sai.h: 199 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_api_uninitialize'): - continue - sai_api_uninitialize = _lib.sai_api_uninitialize - sai_api_uninitialize.argtypes = [] - sai_api_uninitialize.restype = sai_status_t - break - -# /usr/include/sai/sai.h: 209 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_log_set'): - continue - sai_log_set = _lib.sai_log_set - sai_log_set.argtypes = [sai_api_t, sai_log_level_t] - sai_log_set.restype = sai_status_t - break - -# /usr/include/sai/sai.h: 221 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_object_type_query'): - continue - sai_object_type_query = _lib.sai_object_type_query - sai_object_type_query.argtypes = [sai_object_id_t] - sai_object_type_query.restype = sai_object_type_t - break - -# /usr/include/sai/sai.h: 231 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_dbg_generate_dump'): - continue - sai_dbg_generate_dump = _lib.sai_dbg_generate_dump - sai_dbg_generate_dump.argtypes = [String] - sai_dbg_generate_dump.restype = sai_status_t - break - -# /usr/include/sai/saitypes.h: 122 -try: - SAI_NULL_OBJECT_ID = 0L -except: - pass - -# /usr/include/sai/saiacl.h: 386 -try: - SAI_ACL_USER_DEFINED_FIELD_ATTR_ID_RANGE = 255 -except: - pass - -# /usr/include/sai/saistatus.h: 43 -def SAI_STATUS_CODE(_S_): - return (-_S_) - -# /usr/include/sai/saistatus.h: 50 -try: - SAI_STATUS_SUCCESS = 0L -except: - pass - -# /usr/include/sai/saistatus.h: 55 -try: - SAI_STATUS_FAILURE = (SAI_STATUS_CODE (1L)) -except: - pass - -# /usr/include/sai/saistatus.h: 60 -try: - SAI_STATUS_NOT_SUPPORTED = (SAI_STATUS_CODE (2L)) -except: - pass - -# /usr/include/sai/saistatus.h: 65 -try: - SAI_STATUS_NO_MEMORY = (SAI_STATUS_CODE (3L)) -except: - pass - -# /usr/include/sai/saistatus.h: 70 -try: - SAI_STATUS_INSUFFICIENT_RESOURCES = (SAI_STATUS_CODE (4L)) -except: - pass - -# /usr/include/sai/saistatus.h: 75 -try: - SAI_STATUS_INVALID_PARAMETER = (SAI_STATUS_CODE (5L)) -except: - pass - -# /usr/include/sai/saistatus.h: 81 -try: - SAI_STATUS_ITEM_ALREADY_EXISTS = (SAI_STATUS_CODE (6L)) -except: - pass - -# /usr/include/sai/saistatus.h: 87 -try: - SAI_STATUS_ITEM_NOT_FOUND = (SAI_STATUS_CODE (7L)) -except: - pass - -# /usr/include/sai/saistatus.h: 92 -try: - SAI_STATUS_BUFFER_OVERFLOW = (SAI_STATUS_CODE (8L)) -except: - pass - -# /usr/include/sai/saistatus.h: 97 -try: - SAI_STATUS_INVALID_PORT_NUMBER = (SAI_STATUS_CODE (9L)) -except: - pass - -# /usr/include/sai/saistatus.h: 102 -try: - SAI_STATUS_INVALID_PORT_MEMBER = (SAI_STATUS_CODE (10L)) -except: - pass - -# /usr/include/sai/saistatus.h: 107 -try: - SAI_STATUS_INVALID_VLAN_ID = (SAI_STATUS_CODE (11L)) -except: - pass - -# /usr/include/sai/saistatus.h: 112 -try: - SAI_STATUS_UNINITIALIZED = (SAI_STATUS_CODE (12L)) -except: - pass - -# /usr/include/sai/saistatus.h: 117 -try: - SAI_STATUS_TABLE_FULL = (SAI_STATUS_CODE (13L)) -except: - pass - -# /usr/include/sai/saistatus.h: 122 -try: - SAI_STATUS_MANDATORY_ATTRIBUTE_MISSING = (SAI_STATUS_CODE (14L)) -except: - pass - -# /usr/include/sai/saistatus.h: 127 -try: - SAI_STATUS_NOT_IMPLEMENTED = (SAI_STATUS_CODE (15L)) -except: - pass - -# /usr/include/sai/saistatus.h: 132 -try: - SAI_STATUS_ADDR_NOT_FOUND = (SAI_STATUS_CODE (16L)) -except: - pass - -# /usr/include/sai/saistatus.h: 137 -try: - SAI_STATUS_OBJECT_IN_USE = (SAI_STATUS_CODE (17L)) -except: - pass - -# /usr/include/sai/saistatus.h: 144 -try: - SAI_STATUS_INVALID_OBJECT_TYPE = (SAI_STATUS_CODE (18L)) -except: - pass - -# /usr/include/sai/saistatus.h: 152 -try: - SAI_STATUS_INVALID_OBJECT_ID = (SAI_STATUS_CODE (19L)) -except: - pass - -# /usr/include/sai/saistatus.h: 157 -try: - SAI_STATUS_INVALID_NV_STORAGE = (SAI_STATUS_CODE (20L)) -except: - pass - -# /usr/include/sai/saistatus.h: 162 -try: - SAI_STATUS_NV_STORAGE_FULL = (SAI_STATUS_CODE (21L)) -except: - pass - -# /usr/include/sai/saistatus.h: 167 -try: - SAI_STATUS_SW_UPGRADE_VERSION_MISMATCH = (SAI_STATUS_CODE (22L)) -except: - pass - -# /usr/include/sai/saistatus.h: 180 -try: - SAI_STATUS_INVALID_ATTRIBUTE_0 = (SAI_STATUS_CODE (65536L)) -except: - pass - -# /usr/include/sai/saistatus.h: 185 -try: - SAI_STATUS_INVALID_ATTRIBUTE_MAX = (SAI_STATUS_CODE (131071L)) -except: - pass - -# /usr/include/sai/saistatus.h: 190 -try: - SAI_STATUS_INVALID_ATTR_VALUE_0 = (SAI_STATUS_CODE (131072L)) -except: - pass - -# /usr/include/sai/saistatus.h: 194 -try: - SAI_STATUS_INVALID_ATTR_VALUE_MAX = (SAI_STATUS_CODE (196607L)) -except: - pass - -# /usr/include/sai/saistatus.h: 202 -try: - SAI_STATUS_ATTR_NOT_IMPLEMENTED_0 = (SAI_STATUS_CODE (196608L)) -except: - pass - -# /usr/include/sai/saistatus.h: 207 -try: - SAI_STATUS_ATTR_NOT_IMPLEMENTED_MAX = (SAI_STATUS_CODE (262143L)) -except: - pass - -# /usr/include/sai/saistatus.h: 215 -try: - SAI_STATUS_UNKNOWN_ATTRIBUTE_0 = (SAI_STATUS_CODE (262144L)) -except: - pass - -# /usr/include/sai/saistatus.h: 220 -try: - SAI_STATUS_UNKNOWN_ATTRIBUTE_MAX = (SAI_STATUS_CODE (327679L)) -except: - pass - -# /usr/include/sai/saistatus.h: 228 -try: - SAI_STATUS_ATTR_NOT_SUPPORTED_0 = (SAI_STATUS_CODE (327680L)) -except: - pass - -# /usr/include/sai/saistatus.h: 233 -try: - SAI_STATUS_ATTR_NOT_SUPPORTED_MAX = (SAI_STATUS_CODE (393215L)) -except: - pass - -# /usr/include/sai/saistatus.h: 242 -def SAI_STATUS_IS_INVALID_ATTRIBUTE(x): - return (x & ((~65535) == SAI_STATUS_INVALID_ATTRIBUTE_0)) - -# /usr/include/sai/saistatus.h: 247 -def SAI_STATUS_IS_INVALID_ATTR_VALUE(x): - return (x & ((~65535) == SAI_STATUS_INVALID_ATTR_VALUE_0)) - -# /usr/include/sai/saistatus.h: 252 -def SAI_STATUS_IS_ATTR_NOT_IMPLEMENTED(x): - return (x & ((~65535) == SAI_STATUS_ATTR_NOT_IMPLEMENTED_0)) - -# /usr/include/sai/saistatus.h: 257 -def SAI_STATUS_IS_UNKNOWN_ATTRIBUTE(x): - return (x & ((~65535) == SAI_STATUS_INVALID_ATTRIBUTE_0)) - -# /usr/include/sai/saistatus.h: 262 -def SAI_STATUS_IS_ATTR_NOT_SUPPORTED(x): - return (x & ((~65535) == SAI_STATUS_ATTR_NOT_SUPPORTED_0)) - -# /usr/include/sai/saihostintf.h: 47 -try: - HOSTIF_NAME_SIZE = 16 -except: - pass - -# /usr/include/sai/saiswitch.h: 42 -try: - SAI_MAX_HARDWARE_ID_LEN = 255 -except: - pass - -# /usr/include/sai/saiswitch.h: 1227 -try: - SAI_SWITCH_ATTR_MAX_KEY_STRING_LEN = 64 -except: - pass - -# /usr/include/sai/saiswitch.h: 1236 -try: - SAI_SWITCH_ATTR_MAX_KEY_COUNT = 16 -except: - pass - -# /usr/include/sai/saiswitch.h: 1245 -try: - SAI_KEY_FDB_TABLE_SIZE = 'SAI_FDB_TABLE_SIZE' -except: - pass - -# /usr/include/sai/saiswitch.h: 1250 -try: - SAI_KEY_L3_ROUTE_TABLE_SIZE = 'SAI_L3_ROUTE_TABLE_SIZE' -except: - pass - -# /usr/include/sai/saiswitch.h: 1255 -try: - SAI_KEY_L3_NEIGHBOR_TABLE_SIZE = 'SAI_L3_NEIGHBOR_TABLE_SIZE' -except: - pass - -# /usr/include/sai/saiswitch.h: 1260 -try: - SAI_KEY_NUM_LAG_MEMBERS = 'SAI_NUM_LAG_MEMBERS' -except: - pass - -# /usr/include/sai/saiswitch.h: 1265 -try: - SAI_KEY_NUM_LAGS = 'SAI_NUM_LAGS' -except: - pass - -# /usr/include/sai/saiswitch.h: 1270 -try: - SAI_KEY_NUM_ECMP_MEMBERS = 'SAI_NUM_ECMP_MEMBERS' -except: - pass - -# /usr/include/sai/saiswitch.h: 1275 -try: - SAI_KEY_NUM_ECMP_GROUPS = 'SAI_NUM_ECMP_GROUPS' -except: - pass - -# /usr/include/sai/saiswitch.h: 1280 -try: - SAI_KEY_NUM_UNICAST_QUEUES = 'SAI_NUM_UNICAST_QUEUES' -except: - pass - -# /usr/include/sai/saiswitch.h: 1285 -try: - SAI_KEY_NUM_MULTICAST_QUEUES = 'SAI_NUM_MULTICAST_QUEUES' -except: - pass - -# /usr/include/sai/saiswitch.h: 1290 -try: - SAI_KEY_NUM_QUEUES = 'SAI_NUM_QUEUES' -except: - pass - -# /usr/include/sai/saiswitch.h: 1295 -try: - SAI_KEY_NUM_CPU_QUEUES = 'SAI_NUM_CPU_QUEUES' -except: - pass - -# /usr/include/sai/saiswitch.h: 1300 -try: - SAI_KEY_INIT_CONFIG_FILE = 'SAI_INIT_CONFIG_FILE' -except: - pass - -# /usr/include/sai/saiswitch.h: 1310 -try: - SAI_KEY_BOOT_TYPE = 'SAI_BOOT_TYPE' -except: - pass - -# /usr/include/sai/saiswitch.h: 1316 -try: - SAI_KEY_WARM_BOOT_READ_FILE = 'SAI_WARM_BOOT_READ_FILE' -except: - pass - -# /usr/include/sai/saiswitch.h: 1322 -try: - SAI_KEY_WARM_BOOT_WRITE_FILE = 'SAI_WARM_BOOT_WRITE_FILE' -except: - pass - -# /usr/include/sai/saiswitch.h: 1330 -try: - SAI_KEY_HW_PORT_PROFILE_ID_CONFIG_FILE = 'SAI_HW_PORT_PROFILE_ID_CONFIG_FILE' -except: - pass - -# /usr/include/sai/saivlan.h: 39 -try: - VLAN_COUNTER_SET_DEFAULT = 0 -except: - pass - -_sai_object_list_t = struct__sai_object_list_t # /usr/include/sai/saitypes.h: 143 - -_sai_u8_list_t = struct__sai_u8_list_t # /usr/include/sai/saitypes.h: 225 - -_sai_s8_list_t = struct__sai_s8_list_t # /usr/include/sai/saitypes.h: 234 - -_sai_u16_list_t = struct__sai_u16_list_t # /usr/include/sai/saitypes.h: 239 - -_sai_s16_list_t = struct__sai_s16_list_t # /usr/include/sai/saitypes.h: 244 - -_sai_u32_list_t = struct__sai_u32_list_t # /usr/include/sai/saitypes.h: 249 - -_sai_s32_list_t = struct__sai_s32_list_t # /usr/include/sai/saitypes.h: 254 - -_sai_u32_range_t = struct__sai_u32_range_t # /usr/include/sai/saitypes.h: 259 - -_sai_s32_range_t = struct__sai_s32_range_t # /usr/include/sai/saitypes.h: 264 - -_sai_vlan_list_t = struct__sai_vlan_list_t # /usr/include/sai/saitypes.h: 277 - -_sai_ip_address_t = struct__sai_ip_address_t # /usr/include/sai/saitypes.h: 293 - -_sai_ip_prefix_t = struct__sai_ip_prefix_t # /usr/include/sai/saitypes.h: 305 - -_sai_acl_field_data_t = struct__sai_acl_field_data_t # /usr/include/sai/saitypes.h: 353 - -_sai_acl_action_data_t = struct__sai_acl_action_data_t # /usr/include/sai/saitypes.h: 384 - -_sai_qos_map_params_t = struct__sai_qos_map_params_t # /usr/include/sai/saitypes.h: 444 - -_sai_qos_map_t = struct__sai_qos_map_t # /usr/include/sai/saitypes.h: 454 - -_sai_qos_map_list_t = struct__sai_qos_map_list_t # /usr/include/sai/saitypes.h: 463 - -_sai_tunnel_map_params_t = struct__sai_tunnel_map_params_t # /usr/include/sai/saitypes.h: 482 - -_sai_tunnel_map_t = struct__sai_tunnel_map_t # /usr/include/sai/saitypes.h: 492 - -_sai_tunnel_map_list_t = struct__sai_tunnel_map_list_t # /usr/include/sai/saitypes.h: 502 - -_sai_acl_capability_t = struct__sai_acl_capability_t # /usr/include/sai/saitypes.h: 530 - -_sai_attribute_t = struct__sai_attribute_t # /usr/include/sai/saitypes.h: 586 - -_sai_acl_api_t = struct__sai_acl_api_t # /usr/include/sai/saiacl.h: 2212 - -_sai_bridge_api_t = struct__sai_bridge_api_t # /usr/include/sai/saibridge.h: 392 - -_sai_buffer_api_t = struct__sai_buffer_api_t # /usr/include/sai/saibuffer.h: 538 - -_sai_fdb_entry_t = struct__sai_fdb_entry_t # /usr/include/sai/saifdb.h: 77 - -_sai_fdb_event_notification_data_t = struct__sai_fdb_event_notification_data_t # /usr/include/sai/saifdb.h: 256 - -_sai_fdb_api_t = struct__sai_fdb_api_t # /usr/include/sai/saifdb.h: 343 - -_sai_hash_api_t = struct__sai_hash_api_t # /usr/include/sai/saihash.h: 185 - -_sai_hostif_api_t = struct__sai_hostif_api_t # /usr/include/sai/saihostintf.h: 1057 - -_sai_lag_api_t = struct__sai_lag_api_t # /usr/include/sai/sailag.h: 278 - -_sai_mirror_api_t = struct__sai_mirror_api_t # /usr/include/sai/saimirror.h: 309 - -_sai_neighbor_entry_t = struct__sai_neighbor_entry_t # /usr/include/sai/saineighbor.h: 128 - -_sai_neighbor_api_t = struct__sai_neighbor_api_t # /usr/include/sai/saineighbor.h: 204 - -_sai_next_hop_group_api_t = struct__sai_next_hop_group_api_t # /usr/include/sai/sainexthopgroup.h: 260 - -_sai_next_hop_api_t = struct__sai_next_hop_api_t # /usr/include/sai/sainexthop.h: 175 - -_sai_mcast_fdb_entry_t = struct__sai_mcast_fdb_entry_t # /usr/include/sai/saimcfdb.h: 54 - -_sai_mcast_fdb_api_t = struct__sai_mcast_fdb_api_t # /usr/include/sai/saimcfdb.h: 170 - -_sai_l2mc_entry_t = struct__sai_l2mc_entry_t # /usr/include/sai/sail2mc.h: 82 - -_sai_l2mc_api_t = struct__sai_l2mc_api_t # /usr/include/sai/sail2mc.h: 190 - -_sai_ipmc_entry_t = struct__sai_ipmc_entry_t # /usr/include/sai/saiipmc.h: 76 - -_sai_ipmc_api_t = struct__sai_ipmc_api_t # /usr/include/sai/saiipmc.h: 195 - -_sai_route_entry_t = struct__sai_route_entry_t # /usr/include/sai/sairoute.h: 138 - -_sai_route_api_t = struct__sai_route_api_t # /usr/include/sai/sairoute.h: 204 - -_sai_object_key_t = struct__sai_object_key_t # /usr/include/sai/saiobject.h: 61 - -_sai_policer_api_t = struct__sai_policer_api_t # /usr/include/sai/saipolicer.h: 344 - -_sai_port_oper_status_notification_t = struct__sai_port_oper_status_notification_t # /usr/include/sai/saiport.h: 95 - -_sai_port_api_t = struct__sai_port_api_t # /usr/include/sai/saiport.h: 1528 - -_sai_qos_map_api_t = struct__sai_qos_map_api_t # /usr/include/sai/saiqosmaps.h: 183 - -_sai_queue_api_t = struct__sai_queue_api_t # /usr/include/sai/saiqueue.h: 345 - -_sai_virtual_router_api_t = struct__sai_virtual_router_api_t # /usr/include/sai/sairouter.h: 188 - -_sai_router_interface_api_t = struct__sai_router_interface_api_t # /usr/include/sai/sairouterintf.h: 284 - -_sai_samplepacket_api_t = struct__sai_samplepacket_api_t # /usr/include/sai/saisamplepacket.h: 185 - -_sai_scheduler_group_api_t = struct__sai_scheduler_group_api_t # /usr/include/sai/saischedulergroup.h: 183 - -_sai_scheduler_api_t = struct__sai_scheduler_api_t # /usr/include/sai/saischeduler.h: 207 - -_sai_stp_api_t = struct__sai_stp_api_t # /usr/include/sai/saistp.h: 255 - -_sai_switch_api_t = struct__sai_switch_api_t # /usr/include/sai/saiswitch.h: 1418 - -_sai_tunnel_api_t = struct__sai_tunnel_api_t # /usr/include/sai/saitunnel.h: 664 - -_sai_udf_api_t = struct__sai_udf_api_t # /usr/include/sai/saiudf.h: 414 - -_sai_vlan_api_t = struct__sai_vlan_api_t # /usr/include/sai/saivlan.h: 504 - -_sai_wred_api_t = struct__sai_wred_api_t # /usr/include/sai/saiwred.h: 309 - -_sai_rpf_group_api_t = struct__sai_rpf_group_api_t # /usr/include/sai/sairpfgroup.h: 231 - -_sai_l2mc_group_api_t = struct__sai_l2mc_group_api_t # /usr/include/sai/sail2mcgroup.h: 231 - -_sai_ipmc_group_api_t = struct__sai_ipmc_group_api_t # /usr/include/sai/saiipmcgroup.h: 231 - -_service_method_table_t = struct__service_method_table_t # /usr/include/sai/sai.h: 165 - -# No inserted files - diff --git a/bm/sai_adapter/test/ptf_tests/wip_tests/sail2_wip.py b/bm/sai_adapter/test/ptf_tests/wip_tests/sail2_wip.py deleted file mode 100644 index 8d27bcd9c..000000000 --- a/bm/sai_adapter/test/ptf_tests/wip_tests/sail2_wip.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface L2 tests -""" -import socket -from switch import * -import sai_base_test -import sys -sys.path.append('../sai_thrift_src/gen-py/') -from switch_sai.ttypes import * -import random -from sai_types import * - -@group('l2_wip') -class L2WIP(sai_base_test.ThriftInterfaceDataPlane): - def runTest(self): - print - mac1 = '00:11:11:11:11:11' - mac2 = '00:22:22:22:22:22' - vlan_id = 1 - switch_init2(self.client) - hw_port1 = 0 - hw_port2 = 1 - port1 = port_list[hw_port1] - port2 = port_list[hw_port2] - bridge_port1 = br_port_list[port1] - bridge_port2 = br_port_list[port2] - - # port2 drops tagged. port1 drops untagged - attr_value = sai_thrift_attribute_value_t(booldata=True) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_UNTAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_TAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port2, attr) - - # Create FDB Entries: - mac_action = SAI_PACKET_ACTION_FORWARD - fdb_entry_type = SAI_FDB_ENTRY_TYPE_STATIC - sai_thrift_create_fdb(self.client, mac1, default_bridge_type, vlan_id, default_bridge, bridge_port1, mac_action, fdb_entry_type) - sai_thrift_create_fdb(self.client, mac2, default_bridge_type, vlan_id, default_bridge, bridge_port2, mac_action, fdb_entry_type) - - untagged_pkt1 = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - tagged_pkt1 = simple_tcp_packet(eth_dst='00:22:22:22:22:22', - eth_src='00:11:11:11:11:11', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64, - pktlen=104) - untagged_pkt2 = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=101, - ip_ttl=64) - tagged_pkt2 = simple_tcp_packet(eth_dst='00:11:11:11:11:11', - eth_src='00:22:22:22:22:22', - ip_dst='10.0.0.1', - ip_id=101, - dl_vlan_enable=True, - vlan_vid=vlan_id, - ip_ttl=64, - pktlen=104) - - try: - print "Sending tagged packet port 0 -> port 1" - send_packet(self, hw_port1, str(tagged_pkt1)) - verify_packets(self, tagged_pkt1, [hw_port2]) - print "Sending tagged packet port 1 -> port 0" - send_packet(self, hw_port2, str(tagged_pkt2)) - verify_no_packet_any(self, tagged_pkt2, port_list.keys()) - print "Sending untagged packet port 0 -> port 1" - send_packet(self, hw_port1, str(untagged_pkt1)) - verify_no_packet_any(self, untagged_pkt1, port_list.keys()) - print "Sending untagged packet port 1 -> port 0" - send_packet(self, hw_port2, str(untagged_pkt2)) - verify_packets(self, untagged_pkt2, [hw_port1]) - finally: - sai_thrift_delete_fdb(self.client, mac1, default_bridge) - sai_thrift_delete_fdb(self.client, mac2, default_bridge) - attr_value = sai_thrift_attribute_value_t(booldata=False) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_UNTAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port1, attr) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_DROP_TAGGED, value=attr_value) - self.client.sai_thrift_set_port_attribute(port2, attr) \ No newline at end of file diff --git a/bm/sai_adapter/test/ptf_tests/wip_tests/switch.py b/bm/sai_adapter/test/ptf_tests/wip_tests/switch.py deleted file mode 100644 index 0d6ab9536..000000000 --- a/bm/sai_adapter/test/ptf_tests/wip_tests/switch.py +++ /dev/null @@ -1,853 +0,0 @@ -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Thrift SAI interface basic tests -""" - -#import switch_sai_thrift -from sai_base_test import * -import time -import sys -sys.path.append('../sai_thrift_src/gen-py') -from switch_sai.ttypes import * -import logging - -import unittest -import random - -import sai_base_test - -from ptf import config -from ptf.testutils import * -from ptf.thriftutils import * -from sai_types import * -import os - -#from switch_sai_thrift.ttypes import * - -# from switch_sai_thrift.sai_headers import * - - -this_dir = os.path.dirname(os.path.abspath(__file__)) - -switch_inited=0 -port_list = {} -br_port_list = {} -sai_port_list = [] -front_port_list = [] -table_attr_list = [] -router_mac='00:77:66:55:44:00' -rewrite_mac1='00:77:66:55:44:01' -rewrite_mac2='00:77:66:55:44:02' -default_bridge = 0 -default_bridge_type = None - - -is_bmv2 = ('BMV2_TEST' in os.environ) and (int(os.environ['BMV2_TEST']) == 1) - -def switch_init(client): - global switch_inited - if switch_inited: - return - - switch_attr_list = client.sai_thrift_get_switch_attribute() - attr_list = switch_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_SWITCH_ATTR_PORT_NUMBER: - print "max ports: " + attribute.value.u32 - elif attribute.id == SAI_SWITCH_ATTR_PORT_LIST: - for port_id in attribute.value.objlist.object_id_list: - attr_value = sai_thrift_attribute_value_t(booldata=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_ADMIN_STATE, value=attr_value) - client.sai_thrift_set_port_attribute(port_id, attr) - sai_port_list.append(port_id) - else: - print "unknown switch attribute" - attr_value = sai_thrift_attribute_value_t(mac=router_mac) - attr = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_SRC_MAC_ADDRESS, value=attr_value) - client.sai_thrift_set_switch_attribute(attr) - all_ports_are_up = True - for num_of_tries in range(200): - time.sleep(1) - # wait till the port are up - for port in sai_port_list: - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_OPER_STATUS: - if attribute.value.s32 != SAI_PORT_OPER_STATUS_UP: - all_ports_are_up = False - print "port 0x%x is down" % port - if all_ports_are_up: - break - else: - all_ports_are_up = True - if not all_ports_are_up: - raise RuntimeError('Not all of the ports are up') - - thrift_attr = client.sai_thrift_get_port_list_by_front_port() - if thrift_attr.id == SAI_SWITCH_ATTR_PORT_LIST: - for port_id in thrift_attr.value.objlist.object_id_list: - front_port_list.append(port_id) - for interface,front in interface_to_front_mapping.iteritems(): - sai_port_id = client.sai_thrift_get_port_id_by_front_port(front); - port_list[int(interface)]=sai_port_id - switch_inited = 1 - -def switch_init2(client): - attr_value = sai_thrift_attribute_value_t(oid=0) - attr = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID, value=attr_value) - attr_value2 = sai_thrift_attribute_value_t(objlist=0) - attr2 = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_PORT_LIST, value=attr_value) - attr_list = client.sai_thrift_get_switch_attribute(thrift_attr_list=[attr, attr2]) - bridge = attr_list.attr_list[0].value.oid - for interface,front in interface_to_front_mapping.iteritems(): - sai_port_id = client.sai_thrift_get_port_id_by_front_port(front); - port_list[int(interface)]=sai_port_id - - - attr_list = [] - attr_value = sai_thrift_attribute_value_t(objlist=None) - attr_list.append(sai_thrift_attribute_t(id= SAI_BRIDGE_ATTR_PORT_LIST, value=attr_value)) - attr_value = sai_thrift_attribute_value_t(s32=None) - attr_list.append(sai_thrift_attribute_t(id= SAI_BRIDGE_ATTR_TYPE, value=attr_value)) - attr_list = client.sai_thirft_get_bridge_attribute(bridge, attr_list) - default_bridge_type = attr_list.attr_list[1].value.s32 - for br_port in attr_list.attr_list[0].value.objlist.object_id_list: - attr_value = sai_thrift_attribute_value_t(oid=None) - attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_PORT_ID, value=attr_value) - port_id = client.sai_thirft_get_bridge_port_attribute(br_port,[attr]).attr_list[0].value.oid - br_port_list[port_id] = br_port - - # attr_list = [] - # attr_value = sai_thrift_attribute_value_t(u32list=None) - # attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_HW_LANE_LIST, value=attr_value) - # attr_list.append(attr) - # attr_list = client.sai_thrift_get_port_attribute(port1, attr_list) - # hw_port1 = attr_list.attr_list[0].value.u32list.u32list[0] - # attr_list = [] - # attr_value = sai_thrift_attribute_value_t(u32list=None) - # attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_HW_LANE_LIST, value=attr_value) - # attr_list.append(attr) - # attr_list = client.sai_thrift_get_port_attribute(port2, attr_list) - # hw_port2 = attr_list.attr_list[0].value.u32list.u32list[0] - -def sai_thrift_get_cpu_port_id(client): - cpu_port = client.sai_thrift_get_cpu_port_id() - return cpu_port - -def sai_thrift_get_default_router_id(client): - default_router_id = client.sai_thrift_get_default_router_id() - return default_router_id - -def sai_thrift_create_bridge_port(client, bridge_port_type, port_id, vlan_id, bridge_id): - vport_attr_list = [] - - vport_attr_value = sai_thrift_attribute_value_t(s32=bridge_port_type) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_TYPE, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - vport_attr_value = sai_thrift_attribute_value_t(oid=port_id) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_PORT_ID, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - vport_attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_VLAN_ID, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - vport_attr_value = sai_thrift_attribute_value_t(oid=bridge_id) - vport_attr = sai_thrift_attribute_t(id= SAI_BRIDGE_PORT_ATTR_BRIDGE_ID, value=vport_attr_value) - vport_attr_list.append(vport_attr) - - return client.sai_thrift_create_bridge_port(vport_attr_list) - -def sai_thrift_create_fdb(client, mac, bridge_type, vlan_id, bridge_id, bridge_port, mac_action, fdb_entry_type): - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, vlan_id=vlan_id, bridge_type=bridge_type, bridge_id=bridge_id) - #value 0 represents static entry, id=0, represents entry type - fdb_attribute1_value = sai_thrift_attribute_value_t(s32=fdb_entry_type) - fdb_attribute1 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_TYPE, - value=fdb_attribute1_value) - #value oid represents object id, id=1 represents port id - fdb_attribute2_value = sai_thrift_attribute_value_t(oid=bridge_port) - fdb_attribute2 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID, - value=fdb_attribute2_value) - #value oid represents object id, id=1 represents port id - fdb_attribute3_value = sai_thrift_attribute_value_t(s32=mac_action) - fdb_attribute3 = sai_thrift_attribute_t(id=SAI_FDB_ENTRY_ATTR_PACKET_ACTION, - value=fdb_attribute3_value) - fdb_attr_list = [fdb_attribute1, fdb_attribute2, fdb_attribute3] - client.sai_thrift_create_fdb_entry(thrift_fdb_entry=fdb_entry, thrift_attr_list=fdb_attr_list) - -def sai_thrift_delete_fdb(client, mac, bridge_id): - fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, bridge_id=bridge_id) - client.sai_thrift_delete_fdb_entry(thrift_fdb_entry=fdb_entry) - -def sai_thrift_flush_fdb_by_vlan(client, vlan_id): - fdb_attribute1_value = sai_thrift_attribute_value_t(u16=vlan_id) - fdb_attribute1 = sai_thrift_attribute_t(id=SAI_FDB_FLUSH_ATTR_VLAN_ID, - value=fdb_attribute1_value) - fdb_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_FDB_FLUSH_ENTRY_DYNAMIC) - fdb_attribute2 = sai_thrift_attribute_t(id=SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, - value=fdb_attribute2_value) - fdb_attr_list = [fdb_attribute1, fdb_attribute2] - client.sai_thrift_flush_fdb_entries(thrift_attr_list=fdb_attr_list) - -def sai_thrift_create_virtual_router(client, v4_enabled, v6_enabled): - #v4 enabled - vr_attribute1_value = sai_thrift_attribute_value_t(booldata=v4_enabled) - vr_attribute1 = sai_thrift_attribute_t(id=SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE, - value=vr_attribute1_value) - #v6 enabled - vr_attribute2_value = sai_thrift_attribute_value_t(booldata=v6_enabled) - vr_attribute2 = sai_thrift_attribute_t(id=SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE, - value=vr_attribute2_value) - vr_attr_list = [vr_attribute1, vr_attribute2] - vr_id = client.sai_thrift_create_virtual_router(thrift_attr_list=vr_attr_list) - return vr_id - -def sai_thrift_create_router_interface(client, vr_id, is_port, port_id, vlan_id, v4_enabled, v6_enabled, mac): - #vrf attribute - rif_attr_list = [] - rif_attribute1_value = sai_thrift_attribute_value_t(oid=vr_id) - rif_attribute1 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID, - value=rif_attribute1_value) - rif_attr_list.append(rif_attribute1) - if is_port: - #port type and port id - rif_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_ROUTER_INTERFACE_TYPE_PORT) - rif_attribute2 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_TYPE, - value=rif_attribute2_value) - rif_attr_list.append(rif_attribute2) - rif_attribute3_value = sai_thrift_attribute_value_t(oid=port_id) - rif_attribute3 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_PORT_ID, - value=rif_attribute3_value) - rif_attr_list.append(rif_attribute3) - else: - #vlan type and vlan id - rif_attribute2_value = sai_thrift_attribute_value_t(s32=SAI_ROUTER_INTERFACE_TYPE_VLAN) - rif_attribute2 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_TYPE, - value=rif_attribute2_value) - rif_attr_list.append(rif_attribute2) - rif_attribute3_value = sai_thrift_attribute_value_t(u16=vlan_id) - rif_attribute3 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_VLAN_ID, - value=rif_attribute3_value) - rif_attr_list.append(rif_attribute3) - - #v4_enabled - rif_attribute4_value = sai_thrift_attribute_value_t(booldata=v4_enabled) - rif_attribute4 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE, - value=rif_attribute4_value) - rif_attr_list.append(rif_attribute4) - #v6_enabled - rif_attribute5_value = sai_thrift_attribute_value_t(booldata=v6_enabled) - rif_attribute5 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE, - value=rif_attribute5_value) - rif_attr_list.append(rif_attribute5) - - if mac: - rif_attribute6_value = sai_thrift_attribute_value_t(mac=mac) - rif_attribute6 = sai_thrift_attribute_t(id=SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS, - value=rif_attribute6_value) - rif_attr_list.append(rif_attribute6) - - rif_id = client.sai_thrift_create_router_interface(rif_attr_list) - return rif_id - -def sai_thrift_create_route(client, vr_id, addr_family, ip_addr, ip_mask, nhop, packet_action=None): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - mask = sai_thrift_ip_t(ip4=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr, mask=mask) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - mask = sai_thrift_ip_t(ip6=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr, mask=mask) - route_attribute1_value = sai_thrift_attribute_value_t(oid=nhop) - route_attribute1 = sai_thrift_attribute_t(id=SAI_ROUTE_ATTR_NEXT_HOP_ID, - value=route_attribute1_value) - - route = sai_thrift_unicast_route_entry_t(vr_id, ip_prefix) - route_attr_list = [route_attribute1] - - if packet_action != None: - route_packet_action_value = sai_thrift_attribute_value_t(s32=packet_action) - route_packet_action_attr = sai_thrift_attribute_t(id=SAI_ROUTE_ATTR_PACKET_ACTION, value=route_packet_action_value) - route_attr_list.append(route_packet_action_attr) - - client.sai_thrift_create_route(thrift_unicast_route_entry=route, thrift_attr_list=route_attr_list) - return - -def sai_thrift_remove_route(client, vr_id, addr_family, ip_addr, ip_mask, nhop): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - mask = sai_thrift_ip_t(ip4=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr, mask=mask) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - mask = sai_thrift_ip_t(ip6=ip_mask) - ip_prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr, mask=mask) - route = sai_thrift_unicast_route_entry_t(vr_id, ip_prefix) - client.sai_thrift_remove_route(thrift_unicast_route_entry=route) - -def sai_thrift_create_nhop(client, addr_family, ip_addr, rif_id): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - nhop_attribute1_value = sai_thrift_attribute_value_t(ipaddr=ipaddr) - nhop_attribute1 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_IP, - value=nhop_attribute1_value) - nhop_attribute2_value = sai_thrift_attribute_value_t(oid=rif_id) - nhop_attribute2 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID, - value=nhop_attribute2_value) - nhop_attribute3_value = sai_thrift_attribute_value_t(s32=SAI_NEXT_HOP_IP) - nhop_attribute3 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_ATTR_TYPE, - value=nhop_attribute3_value) - nhop_attr_list = [nhop_attribute1, nhop_attribute2, nhop_attribute3] - nhop = client.sai_thrift_create_next_hop(thrift_attr_list=nhop_attr_list) - return nhop - -def sai_thrift_create_neighbor(client, addr_family, rif_id, ip_addr, dmac): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - neighbor_attribute1_value = sai_thrift_attribute_value_t(mac=dmac) - neighbor_attribute1 = sai_thrift_attribute_t(id=SAI_NEIGHBOR_ATTR_DST_MAC_ADDRESS, - value=neighbor_attribute1_value) - neighbor_attr_list = [neighbor_attribute1] - neighbor_entry = sai_thrift_neighbor_entry_t(rif_id=rif_id, ip_address=ipaddr) - client.sai_thrift_create_neighbor_entry(neighbor_entry, neighbor_attr_list) - -def sai_thrift_remove_neighbor(client, addr_family, rif_id, ip_addr, dmac): - if addr_family == SAI_IP_ADDR_FAMILY_IPV4: - addr = sai_thrift_ip_t(ip4=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4, addr=addr) - else: - addr = sai_thrift_ip_t(ip6=ip_addr) - ipaddr = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV6, addr=addr) - neighbor_entry = sai_thrift_neighbor_entry_t(rif_id=rif_id, ip_address=ipaddr) - client.sai_thrift_remove_neighbor_entry(neighbor_entry) - -def sai_thrift_create_next_hop_group(client, nhop_list): - nhop_group_attribute1_value = sai_thrift_attribute_value_t(s32=SAI_NEXT_HOP_GROUP_ECMP) - nhop_group_attribute1 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_GROUP_ATTR_TYPE, - value=nhop_group_attribute1_value) - nhop_objlist = sai_thrift_object_list_t(count=len(nhop_list), object_id_list=nhop_list) - nhop_group_attribute2_value = sai_thrift_attribute_value_t(objlist=nhop_objlist) - nhop_group_attribute2 = sai_thrift_attribute_t(id=SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_LIST, - value=nhop_group_attribute2_value) - nhop_group_attr_list = [nhop_group_attribute1, nhop_group_attribute2] - nhop_group = client.sai_thrift_create_next_hop_group(thrift_attr_list=nhop_group_attr_list) - return nhop_group - -def sai_thrift_create_lag(client, port_list): - lag_port_list = sai_thrift_object_list_t(count=len(port_list), object_id_list=port_list) - lag1_attr_value = sai_thrift_attribute_value_t(objlist=lag_port_list) - lag1_attr = sai_thrift_attribute_t(id=SAI_LAG_ATTR_PORT_LIST, - value=lag1_attr_value) - lag_attr_list = [lag1_attr] - lag = client.sai_thrift_create_lag(lag_attr_list) - return lag - -def sai_thrift_create_lag_member(client, lag_id, port_id): - lag_member_attr1_value = sai_thrift_attribute_value_t(oid=lag_id) - lag_member_attr1 = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_LAG_ID, - value=lag_member_attr1_value) - lag_member_attr2_value = sai_thrift_attribute_value_t(oid=port_id) - lag_member_attr2 = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_PORT_ID, - value=lag_member_attr2_value) - lag_member_attr_list = [lag_member_attr1, lag_member_attr2] - lag_member_id = client.sai_thrift_create_lag_member(lag_member_attr_list) - return lag_member_id - -def sai_thrift_create_stp_entry(client, vlan_list): - vlanlist=sai_thrift_vlan_list_t(vlan_count=len(vlan_list), vlan_list=vlan_list) - stp_attribute1_value = sai_thrift_attribute_value_t(vlanlist=vlanlist) - stp_attribute1 = sai_thrift_attribute_t(id=SAI_STP_ATTR_VLAN_LIST, - value=stp_attribute1_value) - stp_attr_list = [stp_attribute1] - stp_id = client.sai_thrift_create_stp_entry(stp_attr_list) - return stp_id - - -def sai_thrift_set_hostif_trap_group(client, trap_group_id, policer_id): - policer_attr_value = sai_thrift_attribute_value_t(oid=policer_id) - policer_attr = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER, value=policer_attr_value) - status = client.sai_thrift_set_hostif_trap_group(trap_group_id, thrift_attr=policer_attr) - return status - -def sai_thrift_create_hostif_trap_group(client, queue_id, policer_id=None): - attr_list = [] - attribute_value = sai_thrift_attribute_value_t(u32=queue_id) - attribute = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE, value=attribute_value) - attr_list.append(attribute) - - if policer_id != None: - policer_attr_value = sai_thrift_attribute_value_t(oid=policer_id) - policer_attr = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER, value=policer_attr_value) - attr_list.append(policer_attr) - - trap_group_id = client.sai_thrift_create_hostif_trap_group(thrift_attr_list=attr_list) - return trap_group_id - -def sai_thrift_create_port(client, bind_mode, hw_port, vlan_id=None): - attr_list = [] - bind_attr_value = sai_thrift_attribute_value_t(s32=bind_mode) - bind_attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_BIND_MODE, value=bind_attr_value) - attr_list.append(bind_attr) - hw_port_list = sai_thrift_u32_list_t(u32list=[hw_port], count=1) - hw_lane_attr_value = sai_thrift_attribute_value_t(u32list=hw_port_list) - hw_lane_attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_HW_LANE_LIST, value=hw_lane_attr_value) - attr_list.append(hw_lane_attr) - if vlan_id: - vlan_attr_value = sai_thrift_attribute_value_t(u16=vlan_id) - vlan_attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_PORT_VLAN_ID, value=vlan_attr_value) - attr_list.append(vlan_attr) - return client.sai_thrift_create_port(thrift_attr_list=attr_list) - -def sai_thrift_create_lag_member(client, port_id, lag_id): - attr_list = [] - port_attr_value = sai_thrift_attribute_value_t(oid=port_id) - port_attr = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_PORT_ID, value=port_attr_value) - attr_list.append(port_attr) - lag_attr_value = sai_thrift_attribute_value_t(oid=lag_id) - lag_attr = sai_thrift_attribute_t(id=SAI_LAG_MEMBER_ATTR_LAG_ID, value=lag_attr_value) - attr_list.append(lag_attr) - return client.sai_thrift_create_lag_member(thrift_attr_list=attr_list) - -def sai_thrift_create_policer(client, meter_type, mode, cir, red_action): - attr_list = [] - - meter_attr_value = sai_thrift_attribute_value_t(s32=meter_type) - meter_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_METER_TYPE, value=meter_attr_value) - - mode_attr_value = sai_thrift_attribute_value_t(s32=mode) - mode_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_MODE, value=mode_attr_value) - - cir_attr_value = sai_thrift_attribute_value_t(u64=cir) - cir_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_CIR, value=cir_attr_value) - - red_action_attr_val = sai_thrift_attribute_value_t(s32=red_action) - red_action_attr = sai_thrift_attribute_t(id=SAI_POLICER_ATTR_RED_PACKET_ACTION, value=red_action_attr_val) - - attr_list.append(meter_attr) - attr_list.append(mode_attr) - attr_list.append(cir_attr) - attr_list.append(red_action_attr) - policer_id = client.sai_thrift_create_policer(attr_list) - - return policer_id - -def sai_thrift_set_hostif_trap(client, trap_id, action, priority=None, channel=None, trap_group_id=None): - - if channel != None: - attribute3_value = sai_thrift_attribute_value_t(s32=channel) - attribute3 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_CHANNEL, value=attribute3_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute3) - - if trap_group_id != None: - attribute4_value = sai_thrift_attribute_value_t(oid=trap_group_id) - attribute4 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP, value=attribute4_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute4) - - attribute1_value = sai_thrift_attribute_value_t(s32=action) - attribute1 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION, value=attribute1_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute1) - - if priority != None: - attribute2_value = sai_thrift_attribute_value_t(u32=priority) - attribute2 = sai_thrift_attribute_t(id=SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY, value=attribute2_value) - client.sai_thrift_set_hostif_trap(trap_id, attribute2) - -def sai_thrift_create_hostif(client, rif_or_port_id, intf_name): - attribute1_value = sai_thrift_attribute_value_t(s32=SAI_HOSTIF_TYPE_NETDEV) - attribute1 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_TYPE, - value=attribute1_value) - attribute2_value = sai_thrift_attribute_value_t(oid=rif_or_port_id) - attribute2 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_RIF_OR_PORT_ID, - value=attribute2_value) - attribute3_value = sai_thrift_attribute_value_t(chardata=intf_name) - attribute3 = sai_thrift_attribute_t(id=SAI_HOSTIF_ATTR_NAME, - value=attribute3_value) - attr_list = [attribute1, attribute2, attribute3] - hif_id = client.sai_thrift_create_hostif(attr_list) - return hif_id - -def sai_thrift_create_acl_table(client, addr_family, - ip_src, ip_dst, - ip_proto, - in_ports, out_ports, - in_port, out_port): - #print "aaa" - acl_attr_list = [] - if ip_src != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_SRC_IP, - value=attribute_value) - acl_attr_list.append(attribute) - if ip_dst != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_DST_IP, - value=attribute_value) - acl_attr_list.append(attribute) - if ip_proto != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL, - value=attribute_value) - acl_attr_list.append(attribute) - if in_ports: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - if out_ports: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - if in_port != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_IN_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - if out_port != None: - attribute_value = sai_thrift_attribute_value_t(booldata=1) - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=0) #TODO: Expose stage as function parameter - attribute = sai_thrift_attribute_t(id=SAI_ACL_TABLE_ATTR_STAGE, value=attribute_value) - acl_attr_list.append(attribute) - - #print "bbb" - acl_table_id = client.sai_thrift_create_acl_table(acl_attr_list) - #print acl_table_id - return acl_table_id - -def sai_thrift_create_acl_entry(client, acl_table_id, - action, addr_family, - ip_src, ip_src_mask, - ip_dst, ip_dst_mask, - ip_proto, - in_port_list, out_port_list, - in_port, out_port, - ingress_mirror, egress_mirror): - acl_attr_list = [] - - #OID - attribute_value = sai_thrift_attribute_value_t(oid=acl_table_id) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_TABLE_ID, - value=attribute_value) - acl_attr_list.append(attribute) - - #Priority - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(u32=10))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_PRIORITY, - value=attribute_value) - acl_attr_list.append(attribute) - - #Ip source - if ip_src != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(ip4=ip_src), mask =sai_thrift_acl_mask_t(ip4=ip_src_mask))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP, - value=attribute_value) - acl_attr_list.append(attribute) - - #Input ports - if in_port_list: - acl_port_list = sai_thrift_object_list_t(count=len(in_port_list), object_id_list=in_port_list) - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(objlist=acl_port_list))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - - #Output ports - if out_port_list: - acl_port_list = sai_thrift_object_list_t(count=len(out_port_list), object_id_list=out_port_list) - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(objlist=acl_port_list))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS, - value=attribute_value) - acl_attr_list.append(attribute) - - if in_port != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(oid=in_port))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - if out_port != None: - attribute_value = sai_thrift_attribute_value_t(aclfield=sai_thrift_acl_field_data_t(data = sai_thrift_acl_data_t(oid=out_port))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT, - value=attribute_value) - acl_attr_list.append(attribute) - - #Packet action - if action == 1: - #Drop - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(u32=0))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_PACKET_ACTION, - value=attribute_value) - acl_attr_list.append(attribute) - elif action == 2: - #Ingress mirroring - if ingress_mirror != None: - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(oid=ingress_mirror))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS, value=attribute_value) - acl_attr_list.append(attribute) - elif egress_mirror != None: - attribute_value = sai_thrift_attribute_value_t(aclaction=sai_thrift_acl_action_data_t(parameter = sai_thrift_acl_data_t(oid=egress_mirror))) - attribute = sai_thrift_attribute_t(id=SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS, value=attribute_value) - acl_attr_list.append(attribute) - - acl_entry_id = client.sai_thrift_create_acl_entry(acl_attr_list) - return acl_entry_id - -def sai_thrift_create_mirror_session(client, mirror_type, port, - vlan, vlan_priority, vlan_tpid, - src_mac, dst_mac, - addr_family, src_ip, dst_ip, - encap_type, protocol, ttl, tos): - mirror_attr_list = [] - - #Mirror type - attribute1_value = sai_thrift_attribute_value_t(u8=mirror_type) - attribute1 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_TYPE, - value=attribute1_value) - mirror_attr_list.append(attribute1) - - #Monitor port - attribute2_value = sai_thrift_attribute_value_t(oid=port) - attribute2 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_MONITOR_PORT, - value=attribute2_value) - mirror_attr_list.append(attribute2) - - if mirror_type == SAI_MIRROR_TYPE_LOCAL: - attribute4_value = sai_thrift_attribute_value_t(u16=vlan) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_ID, - value=attribute4_value) - mirror_attr_list.append(attribute4) - elif mirror_type == SAI_MIRROR_TYPE_REMOTE: - #vlan tpid - attribute3_value = sai_thrift_attribute_value_t(u16=vlan_tpid) - attribute3 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_TPID, - value=attribute3_value) - mirror_attr_list.append(attribute3) - - #vlan - attribute4_value = sai_thrift_attribute_value_t(u16=vlan) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_ID, - value=attribute4_value) - mirror_attr_list.append(attribute4) - - #vlan priority - attribute5_value = sai_thrift_attribute_value_t(u16=vlan_priority) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_VLAN_PRI, - value=attribute5_value) - mirror_attr_list.append(attribute5) - elif mirror_type == SAI_MIRROR_TYPE_ENHANCED_REMOTE: - #encap type - attribute3_value = sai_thrift_attribute_value_t(u8=encap_type) - attribute3 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_ENCAP_TYPE, - value=attribute3_value) - mirror_attr_list.append(attribute3) - - #source ip - addr = sai_thrift_ip_t(ip4=src_ip) - src_ip_addr = sai_thrift_ip_address_t(addr_family=addr_family, addr=addr) - attribute4_value = sai_thrift_attribute_value_t(ipaddr=src_ip_addr) - attribute4 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS, - value=attribute4_value) - mirror_attr_list.append(attribute4) - - #dst ip - addr = sai_thrift_ip_t(ip4=dst_ip) - dst_ip_addr = sai_thrift_ip_address_t(addr_family=addr_family, addr=addr) - attribute5_value = sai_thrift_attribute_value_t(ipaddr=dst_ip_addr) - attribute5 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS, - value=attribute5_value) - mirror_attr_list.append(attribute5) - - #source mac - attribute6_value = sai_thrift_attribute_value_t(mac=src_mac) - attribute6 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS, - value=attribute6_value) - mirror_attr_list.append(attribute6) - - #dst mac - attribute7_value = sai_thrift_attribute_value_t(mac=dst_mac) - attribute7 = sai_thrift_attribute_t(id=SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS, - value=attribute7_value) - mirror_attr_list.append(attribute7) - - mirror_id = client.sai_thrift_create_mirror_session(mirror_attr_list) - return mirror_id - -def sai_thrift_create_scheduler_profile(client, max_rate, algorithm=0): - scheduler_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(u64=max_rate) - attribute = sai_thrift_attribute_t(id=SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE , - value=attribute_value) - scheduler_attr_list.append(attribute) - attribute_value = sai_thrift_attribute_value_t(s32=algorithm) - attribute = sai_thrift_attribute_t(id=SAI_SCHEDULER_ATTR_SCHEDULING_ALGORITHM , - value=attribute_value) - scheduler_attr_list.append(attribute) - scheduler_profile_id = client.sai_thrift_create_scheduler_profile(scheduler_attr_list) - return scheduler_profile_id - -def sai_thrift_create_buffer_profile(client, pool_id, size, threshold, xoff_th, xon_th): - buffer_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(oid=pool_id) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_POOL_ID , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=size) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u8=threshold) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=xoff_th) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_XOFF_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=xon_th) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_PROFILE_ATTR_XON_TH , - value=attribute_value) - buffer_attr_list.append(attribute) - - buffer_profile_id = client.sai_thrift_create_buffer_profile(buffer_attr_list) - return buffer_profile_id - -def sai_thrift_create_pool_profile(client, pool_type, size, threshold_mode): - pool_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(s32=pool_type) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_TYPE , - value=attribute_value) - pool_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(u32=size) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_SIZE , - value=attribute_value) - pool_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(s32=threshold_mode) - attribute = sai_thrift_attribute_t(id=SAI_BUFFER_POOL_ATTR_TH_MODE , - value=attribute_value) - pool_attr_list.append(attribute) - pool_id = client.sai_thrift_create_pool_profile(pool_attr_list) - return pool_id - -def sai_thrift_clear_all_counters(client): - for port in sai_port_list: - queue_list=[] - client.sai_thrift_clear_port_all_stats(port) - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_QOS_QUEUE_LIST: - for queue_id in attribute.value.objlist.object_id_list: - queue_list.append(queue_id) - - cnt_ids=[] - cnt_ids.append(SAI_QUEUE_STAT_PACKETS) - for queue in queue_list: - client.sai_thrift_clear_queue_stats(queue,cnt_ids,len(cnt_ids)) - -def sai_thrift_read_port_counters(client,port): - port_cnt_ids=[] - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_DISCARDS) - port_cnt_ids.append(SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_0_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_1_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_2_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_3_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_4_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_5_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_6_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_PFC_7_TX_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_OCTETS) - port_cnt_ids.append(SAI_PORT_STAT_IF_OUT_UCAST_PKTS) - port_cnt_ids.append(SAI_PORT_STAT_IF_IN_UCAST_PKTS) - counters_results=[] - counters_results = client.sai_thrift_get_port_stats(port,port_cnt_ids,len(port_cnt_ids)) - queue_list=[] - port_attr_list = client.sai_thrift_get_port_attribute(port) - attr_list = port_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_PORT_ATTR_QOS_QUEUE_LIST: - for queue_id in attribute.value.objlist.object_id_list: - queue_list.append(queue_id) - cnt_ids=[] - thrift_results=[] - queue_counters_results=[] - cnt_ids.append(SAI_QUEUE_STAT_PACKETS) - queue1=0 - for queue in queue_list: - if queue1 <= 7: - thrift_results=client.sai_thrift_get_queue_stats(queue,cnt_ids,len(cnt_ids)) - queue_counters_results.append(thrift_results[0]) - queue1+=1 - return (counters_results, queue_counters_results) - -def sai_thrift_create_vlan_member(client, vlan_oid, bridge_port, tagging_mode): - vlan_member_attr_list = [] - attribute_value = sai_thrift_attribute_value_t(oid=vlan_oid) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_VLAN_ID, - value=attribute_value) - vlan_member_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(oid=bridge_port) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID, - value=attribute_value) - vlan_member_attr_list.append(attribute) - - attribute_value = sai_thrift_attribute_value_t(s32=tagging_mode) - attribute = sai_thrift_attribute_t(id=SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE, - value=attribute_value) - vlan_member_attr_list.append(attribute) - vlan_member_id = client.sai_thrift_create_vlan_member(vlan_member_attr_list) - return vlan_member_id - -def sai_thrift_vlan_remove_all_ports(client, vid): - vlan_members_list = [] - - vlan_attr_list = client.sai_thrift_get_vlan_attribute(vid) - attr_list = vlan_attr_list.attr_list - for attribute in attr_list: - if attribute.id == SAI_VLAN_ATTR_MEMBER_LIST: - for vlan_member in attribute.value.objlist.object_id_list: - vlan_members_list.append(vlan_member) - - for vlan_member in vlan_members_list: - client.sai_thrift_remove_vlan_member(vlan_member) - -def sai_thrift_set_port_shaper(client, port_id, max_rate): - sched_prof_id=sai_thrift_create_scheduler_profile(client, max_rate) - attr_value = sai_thrift_attribute_value_t(oid=sched_prof_id) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID, value=attr_value) - client.sai_thrift_set_port_attribute(port_id,attr) diff --git a/bm/sai_adapter/test/sai_thrift_development_python_server/cli_driver.py b/bm/sai_adapter/test/sai_thrift_development_python_server/cli_driver.py deleted file mode 100755 index 87e2e99b1..000000000 --- a/bm/sai_adapter/test/sai_thrift_development_python_server/cli_driver.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python2 - -# Copyright 2013-present Barefoot Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# Antonin Bas (antonin@barefootnetworks.com) -# -# -import sys -sys.path.append('../../tools/') -import runtime_CLI as cli -from subprocess import Popen, call -import shlex - -class SwitchThriftClient(): - def __init__(self, ip='localhost', port=9090,services=cli.PreType.SimplePreLAG, - json='../../../p4-softswitch/targets/P4-SAI/sai.json', - default_config='../../../p4-softswitch/targets/P4-SAI/p4src/DefaultConfig.txt'): - self.pre = services - self.standard_client, self.mc_client = self.ConnectToThrift(ip, port, services, json) - self.json = json - self.default_config = default_config - - def ConnectToThrift(self, ip, port, services, json): - standard_client, mc_client = cli.thrift_connect( - ip, port, - cli.RuntimeAPI.get_thrift_services(services) - ) - cli.load_json_config(standard_client, json) - return standard_client, mc_client - - def AddTable(self, table_name, action_name, match_string, value_string): - cmd = '%s %s %s => %s' % (table_name, action_name, match_string, value_string) - print 'table_add ' + cmd - cli.RuntimeAPI(self.pre, self.standard_client, self.mc_client).do_table_add(cmd) - - - def RemoveTableEntry(self, table_name, match_string): - return cli.RuntimeAPI(self.pre, self.standard_client, self.mc_client).do_table_delete_entry_from_key('%s %s' % (table_name, match_string)) - - def ReloadDefaultConfig(self): - cli.RuntimeAPI(self.pre, self.standard_client, self.mc_client).do_load_new_config_file(self.json) - with open(self.default_config,'r') as def_file: - for line in def_file: - cli.RuntimeAPI(self.pre, self.standard_client, self.mc_client).onecmd(line.strip('\n')) - cli.RuntimeAPI(self.pre, self.standard_client, self.mc_client).do_swap_configs('') - -def main(): - args = cli.get_parser().parse_args() - client = SwitchThriftClient() - client.AddTable('table_ingress_lag', 'action_set_l2if', '20', '') - client.ReloadDefaultConfig() - client.AddTable('table_ingress_lag', 'action_set_l2if', '11', '') - # parse_match_key(0) - # entry_handle = standard_client.bm_mt_add_entry( - # 0, 'table_ingress_lag', 0, 'action_set_lag_l2if', [0, 0, 0], - # BmAddEntryOptions(priority = 0) - # ) - - #RuntimeAPI(args.pre, standard_client, mc_client).cmdloop() - - # table_name = 'table_ingress_lag' - # match_key = [] - # bitwidths = [16] - # key_fields=['0'] - # for bw, field in zip(bitwidths, key_fields): - # key = cli.bytes_to_string(cli.parse_param(field, bw)) - # param = cli.BmMatchParam(type = cli.BmMatchParamType.EXACT, - # exact = cli.BmMatchParamExact(key)) - # match_key.append(param) - # # match_key = [cli.BmMatchParam(type = cli.BmMatchParamType.EXACT, - # # exact = cli.BmMatchParamExact('0'))] - # print match_key - # action_name = 'action_set_lag_l2if' - # params = ['0', '0', '0'] - # bitwidths = [1, 16, 3] - # byte_array = [] - # for input_str, bitwidth in zip(params, bitwidths): - # byte_array += [cli.bytes_to_string(cli.parse_param(input_str, bitwidth))] - # runtime_data = byte_array - # priority = 0 - # entry_handle = standard_client.bm_mt_add_entry(0, table_name, match_key, action_name, runtime_data, - # cli.BmAddEntryOptions(priority = priority)) -if __name__ == '__main__': - main() diff --git a/bm/sai_adapter/test/sai_thrift_development_python_server/sai_rpc_server.sh b/bm/sai_adapter/test/sai_thrift_development_python_server/sai_rpc_server.sh deleted file mode 100755 index e7aa920d7..000000000 --- a/bm/sai_adapter/test/sai_thrift_development_python_server/sai_rpc_server.sh +++ /dev/null @@ -1,3 +0,0 @@ -rm -rf config.log -python switch_sai_server.py > config.log -# python switch_sai_server.py diff --git a/bm/sai_adapter/test/sai_thrift_development_python_server/switch_sai_server.py b/bm/sai_adapter/test/sai_thrift_development_python_server/switch_sai_server.py deleted file mode 100644 index f593c82fc..000000000 --- a/bm/sai_adapter/test/sai_thrift_development_python_server/switch_sai_server.py +++ /dev/null @@ -1,528 +0,0 @@ -import sys -sys.path.append('../sai_thrift_src/gen-py') -sys.path.append('../') -sys.path.append('../../../p4-softswitch/tools/') -from sai_types import * -from cli_driver import SwitchThriftClient -from switch_sai import switch_sai_rpc -from switch_sai.ttypes import * - -from thrift.transport import TSocket -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol -from thrift.server import TServer - - -import socket - -def list_to_str(num_list): - st = '' - for num in num_list: - st = st + str(num) + ' ' - return st - - -def GetNewIndex(num_list): - return min(set(xrange(len(num_list)+1)) - set(num_list)) - -def CreateNewItem(obj_list, obj_class, forbidden_list=[]): - new_id = GetNewIndex(forbidden_list) - new_obj = obj_class(sai_object_id=new_id) - obj_list[new_id] = new_obj - # obj_list.update({new_id: new_obj}) - return new_id, new_obj - -class Sai_obj(): - def __init__(self, sai_object_id): - self.sai_object_id = sai_object_id - - -class Port_obj(Sai_obj): - def __init__(self, sai_object_id, l2_if=0, hw_port=0, pvid=1, mtu=1512, drop_tagged=0, drop_untagged=0, bind_mode=SAI_PORT_BIND_MODE_PORT): - Sai_obj.__init__(self, sai_object_id) - self.l2_if = l2_if - self.hw_port = hw_port - self.pvid = pvid - self.bind_mode = bind_mode - self.mtu = mtu - self.drop_tagged = drop_tagged - self.drop_untagged = drop_untagged - - - -class Lag_obj(Sai_obj): - def __init__(self, sai_object_id, l2_if = 0, lag_members=[], port_obj=None): - Sai_obj.__init__(self, sai_object_id) - self.l2_if = l2_if - self.lag_members = lag_members - self.port_obj = port_obj - - -class LagMember_obj(Sai_obj): - def __init__(self, sai_object_id, port_id=0,lag_id=0,hw_port=0): - Sai_obj.__init__(self, sai_object_id) - self.port_id = port_id - self.lag_id = lag_id - self.hw_port = hw_port - - -class VlanMember_obj(Sai_obj): - def __init__(self, sai_object_id, vid=1, bridge_port_id=0,vlan_oid=0,tagging_mode=0): - Sai_obj.__init__(self, sai_object_id) - self.vlan_oid = vlan_oid - self.vid = vid - self.bridge_port_id = bridge_port_id - self.tagging_mode = tagging_mode - - -class Vlan_obj(Sai_obj): - def __init__(self, sai_object_id, vid=1, vlan_members=None): - Sai_obj.__init__(self, sai_object_id) - self.vid = vid - self.vlan_members = vlan_members - - -class BridgePort_obj(Sai_obj): - def __init__(self, sai_object_id, bridge_port=0, port_id=0, vlan_id=1, br_port_type=SAI_BRIDGE_PORT_TYPE_PORT, bridge_id=1): - Sai_obj.__init__(self, sai_object_id) - self.bridge_port = bridge_port - self.port_id = port_id - self.vlan_id = vlan_id - self.br_port_type = br_port_type - self.bridge_id = bridge_id - - -class Bridge_obj(Sai_obj): - def __init__(self, sai_object_id, bridge_id=1, bridge_type=SAI_BRIDGE_TYPE_1Q, bridge_port_list=[]): - Sai_obj.__init__(self, sai_object_id) - self.bridge_id = bridge_id - self.bridge_type = bridge_type - self.bridge_port_list = bridge_port_list - - -class SaiHandler(): - def __init__(self): - self.switch_id = 0 - self.log = {} - print "connecting to cli thrift" - self.cli_client = SwitchThriftClient(json='../../../p4-softswitch/targets/P4-SAI/sai.json',default_config='../../../p4-softswitch/targets/P4-SAI/p4src/DefaultConfig.txt') - self.hw_port_list = [0, 1, 2, 3, 4, 5, 6, 7] - self.sai_thrift_create_switch([]) - - def get_all_oids(self): - return self.ports.keys() + self.vlans.keys() + self.vlan_members.keys() + self.bridge_ports.keys() + self.bridges.keys() + self.lag_members.keys() + self.lags.keys() - - def get_new_l2_if(self): - l2_ifs = [x.l2_if for x in self.ports.values() + self.lags.values()] - return GetNewIndex(l2_ifs) - - def get_new_bridge_id(self): - bridge_ids = [x.bridge_id for x in self.bridges.values()] - return GetNewIndex(bridge_ids) - - def get_new_bridge_port(self): - bridge_ports = [x.bridge_port for x in self.bridge_ports.values()] - return GetNewIndex(bridge_ports) - - # Switch API - def sai_thrift_create_switch(self, thrift_attr_list): - # self.cli_client.ReloadDefaultConfig() - self.ports = {} - self.vlans = {} - self.vlan_members = {} - self.bridge_ports = {} - self.bridges = {} - self.lag_members = {} - self.lags = {} - self.l2_ifs = [] - bridge_object_id, bridge_obj = CreateNewItem(self.bridges, Bridge_obj, forbidden_list=self.get_all_oids()) - bridge_obj.bridge_id = 1 - for port_num in self.hw_port_list: - port_id, port_obj = CreateNewItem(self.ports, Port_obj, forbidden_list=self.get_all_oids()) - port_obj.hw_port = port_num - port_obj.l2_if = port_num - br_port_id, br_port_obj = CreateNewItem(self.bridge_ports, BridgePort_obj, forbidden_list=self.get_all_oids()) - br_port_obj.port_id = port_id - br_port_obj.bridge_port = port_num - bridge_obj.bridge_port_list.append(br_port_id) - return self.switch_id - - def sai_thrift_get_switch_attribute(self, thrift_attr_list): - for attr in thrift_attr_list: - if attr.id == SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID: - attr.value.oid = self.bridges[0].sai_object_id - for attr in thrift_attr_list: - if attr.id == SAI_SWITCH_ATTR_PORT_LIST: - attr.value.objlist = sai_thrift_object_list_t(count=len(self.ports.keys()), object_id_list=self.ports.keys()) - - return sai_thrift_attribute_list_t(attr_list=thrift_attr_list, attr_count = len(thrift_attr_list)) - - def sai_thrift_get_port_id_by_front_port(self, port_name): - for port in self.ports.values(): - if port.hw_port == int(port_name): - return port.sai_object_id - return -1 - - # FDB API - def sai_thrift_create_fdb_entry(self, thrift_fdb_entry, thrift_attr_list): - # fdb_entry = sai_thrift_fdb_entry_t(mac_address=mac, vlan_id=vlan_id) - for attr in thrift_attr_list: - if attr.id == SAI_FDB_ENTRY_ATTR_TYPE: - entry_type = attr.value.s32 - elif attr.id == SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID: - bridge_port = self.bridge_ports[attr.value.oid].bridge_port - elif attr.id == SAI_FDB_ENTRY_ATTR_PACKET_ACTION: - packet_action = attr.value.s32 - bridge_type = thrift_fdb_entry.bridge_type - bridge_id = self.bridges[thrift_fdb_entry.bridge_id].bridge_id - mac = thrift_fdb_entry.mac_address - vlan_id = thrift_fdb_entry.vlan_id - match_str = thrift_fdb_entry.mac_address + ' ' + str(bridge_id) - action_str = str(bridge_port) - if packet_action == SAI_PACKET_ACTION_FORWARD: - if entry_type == SAI_FDB_ENTRY_TYPE_STATIC: - self.cli_client.AddTable('table_fdb', 'action_set_egress_br_port', match_str, action_str) - return 0 - - def sai_thrift_delete_fdb_entry(self, thrift_fdb_entry): - match_str = thrift_fdb_entry.mac_address + ' ' + str(self.bridges[thrift_fdb_entry.bridge_id].bridge_id) - self.cli_client.RemoveTableEntry('table_fdb', match_str) - return 0 - - # VLAN API - def sai_thrift_create_vlan(self, thrift_attr_list): - for attr in thrift_attr_list: - if attr.id == SAI_VLAN_ATTR_VLAN_ID: - vid = attr.value.u16 - if vid in [x.vid for x in self.vlans]: - print "vlan id %d already exists" % vid - return SAI_STATUS_ITEM_ALREADY_EXISTS - else: - print "vlan id %d created" % vid - vlan_oid, vlan_obj = CreateNewItem(self.vlans, Vlan_obj, forbidden_list=self.get_all_oids()) - vlan_obj.vid = vid - vlan_obj.vlan_members = [] - return vlan_oid - - def sai_thrift_delete_vlan(self, vlan_oid): - self.vlans.pop(vlan_oid, None) - return 0 - - def sai_thrift_remove_vlan_member(self, vlan_member_id): - vlan_member = self.vlan_members[vlan_member_id] - bridge_port_id = vlan_member.bridge_port_id - vid = vlan_member.vid - self.cli_client.RemoveTableEntry('table_egress_vlan_filtering', list_to_str([bridge_port_id, vid])) - self.cli_client.RemoveTableEntry('table_ingress_vlan_filtering', list_to_str([bridge_port_id, vid])) - out_if = self.ports[self.bridge_ports[bridge_port_id].port_id].hw_port - if vlan_member.tagging_mode == SAI_VLAN_TAGGING_MODE_UNTAGGED: - self.cli_client.RemoveTableEntry('table_egress_vlan_tag', list_to_str([out_if, vid, 1])) - else: - self.cli_client.RemoveTableEntry('table_egress_vlan_tag', list_to_str([out_if, vid, 0])) - self.vlans[vlan_member.vlan_oid].vlan_members.remove(vlan_member_id) - self.vlan_members.pop(vlan_member_id, None) - return 0 - - def sai_thrift_create_vlan_member(self, vlan_member_attr_list): - # SAI_VLAN_TAGGING_MODE_TAGGED - # SAI_VLAN_TAGGING_MODE_UNTAGGED - for attr in vlan_member_attr_list: - if attr.id == SAI_VLAN_MEMBER_ATTR_VLAN_ID: - vlan_oid = attr.value.oid - elif attr.id == SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID: - bridge_port_id = attr.value.oid - elif attr.id == SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE: - tagging_mode = attr.value.s32 - vlan_obj = self.vlans[vlan_oid] - vlan_id = vlan_obj.vid - vlan_member_id, vlan_member_obj = CreateNewItem(self.vlan_members, VlanMember_obj, forbidden_list=self.get_all_oids()) - vlan_member_obj.bridge_port_id = bridge_port_id - vlan_member_obj.vid = vlan_id - vlan_member_obj.vlan_oid = vlan_oid - vlan_member_obj.tagging_mode = tagging_mode - vlan_obj.vlan_members.append(vlan_member_id) - - port_id = self.bridge_ports[bridge_port_id].port_id - bridge_port = self.bridge_ports[bridge_port_id].bridge_port - if port_id in self.lags.keys(): - out_if = self.lags[port_id].l2_if - else: - out_if = self.ports[port_id].hw_port - - if tagging_mode == SAI_VLAN_TAGGING_MODE_TAGGED: - vlan_pcp = 0 - vlan_cfi = 0 - self.cli_client.AddTable('table_egress_vlan_tag','action_forward_vlan_tag', - list_to_str([out_if, vlan_id, 0]), list_to_str([vlan_pcp, vlan_cfi, vlan_id])) - elif tagging_mode == SAI_VLAN_TAGGING_MODE_PRIORITY_TAGGED: - vlan_pcp = 0 - vlan_cfi = 0 - self.cli_client.AddTable('table_egress_vlan_tag','action_forward_vlan_tag', - list_to_str([out_if, vlan_id, 0]), list_to_str([vlan_pcp, vlan_cfi, 0])) - else: - self.cli_client.AddTable('table_egress_vlan_tag','action_forward_vlan_untag', - list_to_str([out_if, vlan_id, 1]),'') - - self.cli_client.AddTable('table_egress_vlan_filtering','_nop', - list_to_str([bridge_port, vlan_id]),'') - self.cli_client.AddTable('table_ingress_vlan_filtering','_nop', - list_to_str([bridge_port, vlan_id]),'') - - return vlan_member_id - - # Port API - def config_port(self, port_obj,l2_if): - self.cli_client.RemoveTableEntry('table_port_configurations', str(l2_if)) - self.cli_client.AddTable('table_port_configurations', 'action_set_port_configurations',str(l2_if), list_to_str([port_obj.pvid, port_obj.bind_mode, port_obj.mtu, - port_obj.drop_tagged, port_obj.drop_untagged])) - - def sai_thrift_create_port(self, thrift_attr_list): - port, port_obj = CreateNewItem(self.ports, Port_obj, forbidden_list=self.get_all_oids()) - for attr in thrift_attr_list: - if attr.id == SAI_PORT_ATTR_PORT_VLAN_ID: - vlan_id = attr.value.u16 - port_obj.pvid = vlan_id - elif attr.id == SAI_PORT_ATTR_BIND_MODE: - bind_mode = attr.value.s32 - port_obj.bind_mode = bind_mode - elif attr.id == SAI_PORT_ATTR_HW_LANE_LIST: - hw_port_list = attr.value.u32list.u32list - # TODO: Add MTU and drop tagged, untagged - hw_port = hw_port_list[0] - port_obj.hw_port = hw_port - port_obj.l2_if = self.get_new_l2_if() - self.cli_client.AddTable('table_ingress_lag', 'action_set_lag_l2if', str(port_obj.hw_port), list_to_str([0,port_obj.l2_if])) - self.config_port(port_obj, port_obj.l2_if) - return port - - def sai_thrift_remove_port(self, port_id): - hw_port = self.ports[port_id].hw_port - l2_if = self.ports[port_id].l2_if - self.cli_client.RemoveTableEntry('table_ingress_lag', str(hw_port)) - self.cli_client.RemoveTableEntry('table_port_configurations', str(l2_if)) - self.ports.pop(port_id, None) - return 0 - - def sai_thrift_set_port_attribute(self, port, attr): - if port in self.ports: - port_obj = self.ports[port] - else: - port_obj = self.lags[port].port_obj - - if attr.id == SAI_PORT_ATTR_PORT_VLAN_ID: - port_obj.pvid = attr.value.u16 - if attr.id == SAI_PORT_ATTR_BIND_MODE: - port_obj.bind_mode = attr.value.s32 - if attr.id == SAI_PORT_ATTR_DROP_UNTAGGED: - port_obj.drop_untagged = int(attr.value.booldata) - if attr.id == SAI_PORT_ATTR_DROP_TAGGED: - port_obj.drop_tagged = int(attr.value.booldata) - - self.config_port(port_obj, port_obj.l2_if) - return 0 - - def sai_thrift_get_port_attribute(self, port_id, thrift_attr_list): - if port_id in self.lags: - port_obj = self.lags[port_id].port_obj - else: - port_obj = self.ports[port_id] - - for attr in thrift_attr_list: - if attr.id == SAI_PORT_ATTR_HW_LANE_LIST: - hw_port = port_obj.hw_port - attr.value.u32list = sai_thrift_u32_list_t(u32list=[hw_port], count=1) - return sai_thrift_attribute_list_t(attr_list=thrift_attr_list, attr_count = len(thrift_attr_list)) - - # LAG Api - def sai_thrift_create_lag(self, thrift_attr_list): - lag_id, lag_obj = CreateNewItem(self.lags, Lag_obj, forbidden_list=self.get_all_oids()) - lag_obj.l2_if = self.get_new_l2_if() - return lag_id - - def sai_thrift_remove_lag(self, lag_id): - lag = self.lags.pop(lag_id, None) - self.cli_client.RemoveTableEntry('table_port_configurations', str(lag.l2_if)) - self.cli_client.RemoveTableEntry('table_lag_hash',str(lag.l2_if)) - return 0 - - def sai_thrift_create_lag_member(self, thrift_attr_list): - lag_member_id, lag_member_obj = CreateNewItem(self.lag_members, LagMember_obj, forbidden_list=self.get_all_oids()) - for attr in thrift_attr_list: - if attr.id == SAI_LAG_MEMBER_ATTR_PORT_ID: - port_id = attr.value.oid - lag_member_obj.port_id = port_id - port = self.ports[port_id] - if attr.id == SAI_LAG_MEMBER_ATTR_LAG_ID: - lag_id = attr.value.oid - lag_member_obj.lag_id = lag_id - lag = self.lags[lag_id] - lag.lag_members.append(lag_member_id) - lag.port_obj = port - lag_member_obj.hw_port = port.hw_port - l2_if = lag.l2_if - self.cli_client.RemoveTableEntry('table_ingress_lag', str(lag_member_obj.hw_port)) - self.cli_client.AddTable('table_ingress_lag', 'action_set_lag_l2if', str(lag_member_obj.hw_port), list_to_str([1, lag_id])) - self.cli_client.AddTable('table_egress_lag', 'action_set_out_port', list_to_str([l2_if, len(self.lags[lag_id].lag_members)-1]), str(lag_member_obj.hw_port)) - self.cli_client.RemoveTableEntry('table_lag_hash',str(l2_if)) - self.cli_client.AddTable('table_lag_hash', 'action_set_lag_hash_size', str(l2_if), str(len(self.lags[lag_id].lag_members))) - self.config_port(lag.port_obj, lag.l2_if) - return lag_member_id - - def sai_thrift_remove_lag_member(self, lag_member_id): - lag_member = self.lag_members.pop(lag_member_id, None) - if not lag_member: - return 0 - lag = self.lags[lag_member.lag_id] - hash_ind = lag.lag_members.index(lag_member_id) - del lag.lag_members[hash_ind] - self.cli_client.RemoveTableEntry('table_lag_hash',str(lag.l2_if)) - self.cli_client.RemoveTableEntry('table_ingress_lag', str(lag_member.hw_port)) - self.cli_client.AddTable('table_lag_hash', 'action_set_lag_hash_size', str(lag.l2_if), str(len(lag.lag_members))) - self.cli_client.RemoveTableEntry('table_egress_lag', list_to_str([lag.l2_if, hash_ind])) - if hash_ind!=len(lag.lag_members): - self.cli_client.RemoveTableEntry('table_egress_lag', list_to_str([lag.l2_if, len(lag.lag_members)])) - last_lag_member_id = lag.lag_members.pop() - lag.lag_members.insert(hash_ind, last_lag_member_id) - last_lag_member = self.lag_members[last_lag_member_id] - self.cli_client.AddTable('table_egress_lag', 'action_set_out_port', list_to_str([lag.l2_if, hash_ind]), str(last_lag_member.hw_port)) - return 0 - - - # Bridge API - def sai_thrift_create_bridge(self, thrift_attr_list): - bridge_id, bridge_obj = CreateNewItem(self.bridges, Bridge_obj, forbidden_list=self.get_all_oids()) - bridge_obj.bridge_id = self.get_new_bridge_id() - for attr in thrift_attr_list: - if attr.id == SAI_BRIDGE_ATTR_TYPE: - bridge_type = attr.value.s32 - bridge_obj.bridge_type = bridge_type - return bridge_id - - def sai_thrift_remove_bridge(self, bridge_id): - self.bridges.pop(bridge_id, None) - return 0 - - def sai_thirft_get_bridge_attribute(self, bridge_id, thrift_attr_list): - for attr in thrift_attr_list: - if attr.id == SAI_BRIDGE_ATTR_PORT_LIST: - attr.value.objlist = sai_thrift_object_list_t(object_id_list = self.bridges[bridge_id].bridge_port_list,count = len(self.bridges[bridge_id].bridge_port_list)) - if attr.id == SAI_BRIDGE_ATTR_TYPE: - attr.value.s32 = self.bridges[bridge_id].bridge_type - return sai_thrift_attribute_list_t(attr_list=thrift_attr_list, attr_count = len(thrift_attr_list)) - - def sai_thrift_create_bridge_port(self, thrift_attr_list): - for attr in thrift_attr_list: - if attr.id == SAI_BRIDGE_PORT_ATTR_VLAN_ID: - vlan_id = attr.value.u16 - elif attr.id == SAI_BRIDGE_PORT_ATTR_BRIDGE_ID: - bridge_sai_object_id = attr.value.oid - bridge_id = self.bridges[bridge_sai_object_id].bridge_id - elif attr.id == SAI_BRIDGE_PORT_ATTR_TYPE: - bridge_port_type = attr.value.s32 - elif attr.id == SAI_BRIDGE_PORT_ATTR_PORT_ID: - port_id = attr.value.oid - br_port = self.get_new_bridge_port() - br_port_id, br_port_obj = CreateNewItem(self.bridge_ports, BridgePort_obj, forbidden_list=self.get_all_oids()) - br_port_obj.bridge_port = br_port - br_port_obj.port_id = port_id - br_port_obj.vlan_id = vlan_id - br_port_obj.br_port_type = bridge_port_type - br_port_obj.bridge_id = bridge_id - if bridge_port_type == SAI_BRIDGE_PORT_TYPE_SUB_PORT: #.1D - self.cli_client.AddTable('table_bridge_id_1d', 'action_set_bridge_id', str(br_port), str(bridge_id)) - self.cli_client.AddTable('table_egress_set_vlan', 'action_set_vlan', str(br_port), str(vlan_id)) - l2_if_type = 2 - elif bridge_port_type == SAI_BRIDGE_PORT_TYPE_PORT: #.1Q - self.cli_client.AddTable('table_bridge_id_1q', 'action_set_bridge_id', str(vlan_id), str(bridge_id)) - l2_if_type = 3 - if port_id in self.lags.keys(): # LAG - l2_if = self.lags[port_id].l2_if - self.cli_client.AddTable('table_egress_br_port_to_if', 'action_forward_set_outIfType', str(br_port), list_to_str([l2_if, 1])) - bind_mode = self.lags[port_id].port_obj.bind_mode - else: # port - l2_if = self.ports[port_id].l2_if - hw_port = self.ports[port_id].hw_port - self.cli_client.AddTable('table_egress_br_port_to_if', 'action_forward_set_outIfType', str(br_port), list_to_str([hw_port, 0])) - bind_mode = self.ports[port_id].bind_mode - if bind_mode == SAI_PORT_BIND_MODE_SUB_PORT: - self.cli_client.AddTable('table_subport_ingress_interface_type', 'action_set_l2_if_type', list_to_str([l2_if, vlan_id]), list_to_str([l2_if_type, br_port])) - else: - self.cli_client.AddTable('table_port_ingress_interface_type', 'action_set_l2_if_type', str(l2_if), list_to_str([l2_if_type, br_port])) - - return br_port_id - - def config_bridge_port(self, bridge_port_obj): - br_port = bridge_port_obj.bridge_port - vlan_id = bridge_port_obj.vlan_id - bridge_port_type = bridge_port_obj.br_port_type - bridge_id = bridge_port_obj.bridge_id - if bridge_port_type == SAI_BRIDGE_PORT_TYPE_SUB_PORT: #.1D - self.cli_client.AddTable('table_bridge_id_1d', 'action_set_bridge_id', str(br_port), str(bridge_id)) - elif bridge_port_type == SAI_BRIDGE_PORT_TYPE_PORT: #.1Q - self.cli_client.AddTable('table_bridge_id_1q', 'action_set_bridge_id', str(vlan_id), str(bridge_id)) - return SAI_STATUS_SUCCESS - - def sai_thrift_remove_bridge_port(self, bridge_port_id): - br_port_obj = self.bridge_ports.pop(bridge_port_id, None) - bridge_port = br_port_obj.bridge_port - port_id = br_port_obj.port_id - vlan_id = br_port_obj.vlan_id - self.cli_client.RemoveTableEntry('table_egress_br_port_to_if', str(bridge_port)) - if port_id in self.lags: - l2_if = self.lags[port_id].l2_if - bind_mode = self.lags[port_id].port_obj.bind_mode - else: - l2_if = self.ports[port_id].l2_if - bind_mode = self.ports[port_id].bind_mode - if bind_mode == SAI_PORT_BIND_MODE_SUB_PORT: - self.cli_client.RemoveTableEntry('table_subport_ingress_interface_type', list_to_str([l2_if, vlan_id])) - else: - self.cli_client.RemoveTableEntry('table_port_ingress_interface_type', list_to_str([l2_if])) - if br_port_obj.br_port_type == SAI_BRIDGE_PORT_TYPE_SUB_PORT: #.1D - self.cli_client.RemoveTableEntry('table_bridge_id_1d', str(bridge_port)) - self.cli_client.RemoveTableEntry('table_egress_set_vlan', str(bridge_port)) - else: - self.cli_client.RemoveTableEntry('table_bridge_id_1q', str(vlan_id)) - return SAI_STATUS_SUCCESS - - def remove_bridge_port_config(self, br_port_obj): - bridge_port = br_port_obj.bridge_port - vlan_id = br_port_obj.vlan_id - br_port_type = br_port_obj.br_port_type - - if br_port_type == SAI_BRIDGE_PORT_TYPE_SUB_PORT: #.1D - self.cli_client.RemoveTableEntry('table_bridge_id_1d', str(bridge_port)) - else: - self.cli_client.RemoveTableEntry('table_bridge_id_1q', str(vlan_id)) - return SAI_STATUS_SUCCESS - - def sai_thirft_get_bridge_port_attribute(self, bridge_port_id, thrift_attr_list): - bridge_port_obj = self.bridge_ports[bridge_port_id] - for attr in thrift_attr_list: - if attr.id == SAI_BRIDGE_PORT_ATTR_PORT_ID: - attr.value.oid = bridge_port_obj.port_id - if attr.id == SAI_BRIDGE_PORT_ATTR_VLAN_ID: - attr.value.u16 = bridge_port_obj.vlan_id - if attr.id == SAI_BRIDGE_PORT_ATTR_TYPE: - attr.value.s32 = bridge_port_obj.br_port_type - return sai_thrift_attribute_list_t(attr_list=thrift_attr_list, attr_count = len(thrift_attr_list)) - - def sai_thrift_set_bridge_port_attribute(self, bridge_port_id, attr): - bridge_port_obj = self.bridge_ports[bridge_port_id] - self.remove_bridge_port_config(bridge_port_obj) - if attr.id == SAI_BRIDGE_PORT_ATTR_BRIDGE_ID: - bridge_port_obj.bridge_id = self.bridges[attr.value.oid].bridge_id - self.config_bridge_port(bridge_port_obj) - return SAI_STATUS_SUCCESS - - -handler = SaiHandler() -processor = switch_sai_rpc.Processor(handler) -transport = TSocket.TServerSocket(port=9092) -tfactory = TTransport.TBufferedTransportFactory() -pfactory = TBinaryProtocol.TBinaryProtocolFactory() - -server = TServer.TSimpleServer(processor, transport, tfactory, pfactory) -print "Starting python server..." -server.serve() -print "done!" \ No newline at end of file diff --git a/bm/sai_adapter/test/sai_thrift_server/.gitignore b/bm/sai_adapter/test/sai_thrift_server/.gitignore deleted file mode 100644 index 22024dd8e..000000000 --- a/bm/sai_adapter/test/sai_thrift_server/.gitignore +++ /dev/null @@ -1 +0,0 @@ -SaiCppServer \ No newline at end of file diff --git a/bm/sai_adapter/test/sai_thrift_server/SaiCppServer.cpp b/bm/sai_adapter/test/sai_thrift_server/SaiCppServer.cpp deleted file mode 100644 index 67563d16a..000000000 --- a/bm/sai_adapter/test/sai_thrift_server/SaiCppServer.cpp +++ /dev/null @@ -1,1327 +0,0 @@ -#include -#include -/// thrift sai server -#include -#include -#include -#include -#include -#include -#include - -// SAI -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif - -using namespace std; -using namespace ::apache::thrift; -using namespace ::apache::thrift::protocol; -using namespace ::apache::thrift::transport; -using namespace ::apache::thrift::server; - -using boost::shared_ptr; -using namespace ::switch_sai; - -// temp - TODO move to other file -extern "C" { -const char *test_profile_get_value(_In_ sai_switch_profile_id_t profile_id, - _In_ const char *variable) { - return NULL; -} -int test_profile_get_next_value(_In_ sai_switch_profile_id_t profile_id, - _Out_ const char **variable, - _Out_ const char **value) { - return -1; -} -const service_method_table_t test_services = {test_profile_get_value, - test_profile_get_next_value}; -sai_status_t sai_api_initialize(_In_ uint64_t flags, - _In_ const service_method_table_t *services); -sai_status_t sai_api_query(_In_ sai_api_t sai_api_id, - _Out_ void **api_method_table); -sai_status_t sai_api_uninitialize(void); -} -// globals -const int sai_port = 9092; - -class switch_sai_rpcHandler : virtual public switch_sai_rpcIf { -public: - // static sai_object sai_obj; - std::shared_ptr logger; - ~switch_sai_rpcHandler() { - // deconstructor - logger->info("switch_sai_rpcHandler destructor called"); - spdlog::drop_all(); - sai_api_uninitialize(); - } - switch_sai_rpcHandler() { - // initialization - logger = spdlog::get("logger"); - sai_api_initialize(0, &test_services); - // server_internal_init_switch(); - } - - sai_attribute_t - parse_port_atrribute(const sai_thrift_attribute_t &thrift_attr) { - sai_attribute_t sai_attr; - sai_attr.id = thrift_attr.id; - switch (thrift_attr.id) { - case SAI_PORT_ATTR_UPDATE_DSCP: - sai_attr.value.booldata = thrift_attr.value.booldata; - break; - case SAI_PORT_ATTR_PORT_VLAN_ID: - sai_attr.value.u16 = thrift_attr.value.u16; - break; - case SAI_PORT_ATTR_BIND_MODE: - sai_attr.value.s32 = thrift_attr.value.s32; - break; - case SAI_PORT_ATTR_DROP_UNTAGGED: - sai_attr.value.booldata = thrift_attr.value.booldata; - break; - case SAI_PORT_ATTR_DROP_TAGGED: - sai_attr.value.booldata = thrift_attr.value.booldata; - break; - }; - return sai_attr; - } - - sai_thrift_status_t - sai_thrift_set_port_attribute(const sai_thrift_object_id_t port_id, - const sai_thrift_attribute_t &thrift_attr) { - logger->info("sai_thrift_set_port_attribute"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_port_api_t *port_api; - sai_attribute_t attr = parse_port_atrribute(thrift_attr); - status = sai_api_query(SAI_API_PORT, (void **)&port_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - status = port_api->set_port_attribute(port_id, &attr); - return SAI_STATUS_SUCCESS; - } - - void sai_thrift_get_port_attribute( - sai_thrift_attribute_list_t &_return, - const sai_thrift_object_id_t port_id, - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_get_port_attribute"); - } - - void sai_thrift_get_port_stats( - std::vector &_return, const sai_thrift_object_id_t port_id, - const std::vector &counter_ids, - const int32_t number_of_counters) { - // Your implementation goes here - logger->info("sai_thrift_get_port_stats"); - } - - sai_thrift_status_t - sai_thrift_clear_port_all_stats(const sai_thrift_object_id_t port_id) { - // Your implementation goes here - logger->info("sai_thrift_clear_port_all_stats"); - } - - sai_thrift_status_t - sai_thrift_remove_port(const sai_thrift_object_id_t port_id) { - logger->info("sai_thrift_remove_port"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_port_api_t *port_api; - sai_attribute_t attr; - status = sai_api_query(SAI_API_PORT, (void **)&port_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return status; - } - status = port_api->remove_port(port_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_port( - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_port"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_port_api_t *port_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_PORT, (void **)&port_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - uint32_t *lane_list_ptr = - sai_thrift_parse_port_attributes(thrift_attr_list, attr); - // switch_metatdata.switch_id.sai_object_id - sai_object_id_t s_id = 0; - uint32_t count = thrift_attr_list.size(); - sai_object_id_t port_id = 1; - status = port_api->create_port(&port_id, s_id, count, attr); - free(lane_list_ptr); - free(attr); - return port_id; - } - - uint32_t *sai_thrift_parse_port_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - uint32_t *lane_list_ptr; - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_PORT_ATTR_UPDATE_DSCP: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_PORT_ATTR_PORT_VLAN_ID: - attr_list[i].value.u16 = attribute.value.u16; - break; - case SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL: - case SAI_PORT_ATTR_QOS_DEFAULT_TC: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_PORT_ATTR_QOS_INGRESS_BUFFER_PROFILE_LIST: - case SAI_PORT_ATTR_QOS_EGRESS_BUFFER_PROFILE_LIST: - case SAI_PORT_ATTR_BIND_MODE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_PORT_ATTR_HW_LANE_LIST: { - attr_list[i].value.u32list.count = attribute.value.u32list.count; - attr_list[i].value.u32list.list = (uint32_t *)malloc( - sizeof(uint32_t) * attribute.value.u32list.count); - int j; - for (j = 0; j <= attribute.value.u32list.count; j++) { - attr_list[i].value.u32list.list[j] = - attribute.value.u32list.u32list[j]; - } - lane_list_ptr = attr_list[i].value.u32list.list; - break; - } - default: - break; - } - } - return lane_list_ptr; - } - void sai_thrift_parse_bridge_port_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - int l = thrift_attr_list.size(); - for (uint32_t i = 0; i < l; i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_BRIDGE_PORT_ATTR_VLAN_ID: - attr_list[i].value.u16 = attribute.value.u16; - break; - case SAI_BRIDGE_PORT_ATTR_BRIDGE_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_BRIDGE_PORT_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_BRIDGE_PORT_ATTR_PORT_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - default: - break; - } - } - } - - sai_thrift_attribute_t - parse_bridge_port_thrift_attribute(sai_attribute_t *sai_attr) { - sai_thrift_attribute_t thrift_attr; - thrift_attr.id = sai_attr->id; - switch (sai_attr->id) { - case SAI_BRIDGE_PORT_ATTR_PORT_ID: - thrift_attr.value.oid = sai_attr->value.oid; - break; - case SAI_BRIDGE_PORT_ATTR_VLAN_ID: - thrift_attr.value.u16 = sai_attr->value.u16; - break; - case SAI_BRIDGE_PORT_ATTR_TYPE: - thrift_attr.value.s32 = sai_attr->value.s32; - break; - case SAI_BRIDGE_PORT_ATTR_BRIDGE_ID: - thrift_attr.value.oid = sai_attr->value.oid; - break; - } - return thrift_attr; - } - - void sai_thrift_parse_bridge_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_BRIDGE_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_BRIDGE_ATTR_PORT_LIST: - attr_list[i].value.objlist.count = 0; - break; - default: - break; - } - } - return; - } - - void sai_thrift_parse_fdb_entry_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_FDB_ENTRY_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_FDB_ENTRY_ATTR_PACKET_ACTION: - attr_list[i].value.s32 = attribute.value.s32; - break; - default: - logger->error("--> while parsing fdb_attr: attribute.id = {} was " - "dumped in sai_cpp_server", - attribute.id); - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_bridge( - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_bridge"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_bridge_api_t *bridge_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_BRIDGE, (void **)&bridge_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - sai_thrift_parse_bridge_attributes(thrift_attr_list, attr); - sai_object_id_t s_id = 0; - uint32_t count = thrift_attr_list.size(); - sai_object_id_t bridge_id = 1; - status = bridge_api->create_bridge(&bridge_id, s_id, count, attr); - free(attr); - return bridge_id; - } - - sai_thrift_status_t - sai_thrift_remove_bridge(const sai_thrift_object_id_t bridge_id) { - logger->info("sai_thrift_remove_bridge"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_bridge_api_t *bridge_api; - status = sai_api_query(SAI_API_BRIDGE, (void **)&bridge_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - status = bridge_api->remove_bridge(bridge_id); - return status; - } - - sai_thrift_attribute_t - parse_bridge_thrift_attribute(sai_attribute_t *sai_attr) { - sai_thrift_attribute_t thrift_attr; - thrift_attr.id = sai_attr->id; - switch (sai_attr->id) { - case SAI_BRIDGE_ATTR_TYPE: - thrift_attr.value.s32 = sai_attr->value.s32; - break; - case SAI_BRIDGE_ATTR_PORT_LIST: - thrift_attr.value.objlist.count = sai_attr->value.objlist.count; - for (int i = 0; i < thrift_attr.value.objlist.count; i++) { - thrift_attr.value.objlist.object_id_list.push_back( - sai_attr->value.objlist.list[i]); - } - break; - } - return thrift_attr; - } - - void sai_thirft_get_bridge_attribute( - sai_thrift_attribute_list_t &_return, - const sai_thrift_object_id_t bridge_id, - const std::vector &thrift_attr_list) { - logger->info("sai_thirft_get_bridge_attribute"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_bridge_api_t *bridge_api; - status = sai_api_query(SAI_API_BRIDGE, (void **)&bridge_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - // return SAI_STATUS_NOT_IMPLEMENTED; - } - - uint32_t count = thrift_attr_list.size(); - sai_attribute_t *attr = - (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * count); - sai_thrift_parse_bridge_attributes(thrift_attr_list, attr); - status = bridge_api->get_bridge_attribute(bridge_id, count, attr); - _return.attr_count = count; - for (int i = 0; i < count; i++) { - _return.attr_list.push_back(parse_bridge_thrift_attribute(attr + i)); - } - free(attr); - return; - } - - sai_thrift_object_id_t sai_thrift_create_bridge_port( - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_bridge_port"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_bridge_api_t *bridge_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_BRIDGE, (void **)&bridge_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - // return SAI_STATUS_NOT_IMPLEMENTED; - } - uint32_t count = thrift_attr_list.size(); - sai_thrift_parse_bridge_port_attributes(thrift_attr_list, attr); - sai_object_id_t s_id = 0; - sai_object_id_t bridge_port_id = 1; - bridge_api->create_bridge_port(&bridge_port_id, s_id, count, attr); - free(attr); - return (sai_thrift_object_id_t)bridge_port_id; - } - - sai_thrift_status_t - sai_thrift_remove_bridge_port(const sai_thrift_object_id_t bridge_port_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_bridge_port"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_bridge_api_t *bridge_api; - status = sai_api_query(SAI_API_BRIDGE, (void **)&bridge_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - return bridge_api->remove_bridge_port(bridge_port_id); - } - - void sai_thirft_get_bridge_port_attribute( - sai_thrift_attribute_list_t &_return, - const sai_thrift_object_id_t bridge_port_id, - const std::vector &thrift_attr_list) { - logger->info("sai_thirft_get_bridge_port_attribute"); - sai_bridge_api_t *bridge_api; - sai_status_t status = sai_api_query(SAI_API_BRIDGE, (void **)&bridge_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - // return SAI_STATUS_NOT_IMPLEMENTED; - } - uint32_t count = thrift_attr_list.size(); - sai_attribute_t *attr = - (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * count); - sai_thrift_parse_bridge_port_attributes(thrift_attr_list, attr); - - status = bridge_api->get_bridge_port_attribute(bridge_port_id, count, attr); - _return.attr_count = count; - for (int i = 0; i < count; i++) { - _return.attr_list.push_back(parse_bridge_port_thrift_attribute(attr + i)); - } - free(attr); - return; - } - - sai_thrift_status_t sai_thrift_set_bridge_port_attribute( - const sai_thrift_object_id_t bridge_port_id, - const sai_thrift_attribute_t &thrift_attr) { - // Your implementation goes here - logger->info("sai_thrift_set_bridge_port_attribute"); - } - - // GENERAL - void parse_mac_str(const std::string &mac_str, uint8_t mac[6]) { - int l = mac_str.length(); - int j = 5; - for (int i = 0; i < l; i += 3) { - mac[j] = (uint8_t)std::stoi(mac_str.substr(i, 2), NULL, 16); - j--; - } - } - - sai_fdb_entry_t - parse_thrift_fdb_entry(const sai_thrift_fdb_entry_t thrift_fdb_entry) { - sai_fdb_entry_t sai_fdb_entry; - sai_fdb_entry.switch_id = 0; - parse_mac_str(thrift_fdb_entry.mac_address, sai_fdb_entry.mac_address); - sai_fdb_entry.vlan_id = thrift_fdb_entry.vlan_id; - sai_fdb_entry.bridge_type = - (sai_fdb_entry_bridge_type_t)thrift_fdb_entry.bridge_type; - sai_fdb_entry.bridge_id = thrift_fdb_entry.bridge_id; - return sai_fdb_entry; - } - - sai_thrift_status_t sai_thrift_create_fdb_entry( - const sai_thrift_fdb_entry_t &thrift_fdb_entry, - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_fdb_entry"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_fdb_api_t *fdb_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_FDB, (void **)&fdb_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - sai_thrift_parse_fdb_entry_attributes(thrift_attr_list, attr); - uint32_t count = thrift_attr_list.size(); - sai_fdb_entry_t sai_fdb_entry; - sai_fdb_entry = parse_thrift_fdb_entry(thrift_fdb_entry); - return fdb_api->create_fdb_entry(&sai_fdb_entry, count, attr); - } - - sai_thrift_status_t - sai_thrift_delete_fdb_entry(const sai_thrift_fdb_entry_t &thrift_fdb_entry) { - logger->info("sai_thrift_delete_fdb_entry"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_fdb_api_t *fdb_api; - status = sai_api_query(SAI_API_FDB, (void **)&fdb_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - sai_fdb_entry_t sai_fdb_entry; - sai_fdb_entry = parse_thrift_fdb_entry(thrift_fdb_entry); - return fdb_api->remove_fdb_entry(&sai_fdb_entry); - } - - sai_thrift_status_t sai_thrift_flush_fdb_entries( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_flush_fdb_entries"); - } - - void sai_thrift_parse_vlan_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_VLAN_ATTR_VLAN_ID: - attr_list[i].value.u16 = attribute.value.u16; - break; - default: - logger->error( - "--> while parsing vlan_attr: {} was dumped in sai_cpp_server", - attribute.id); - break; - } - } - } - sai_thrift_object_id_t sai_thrift_create_vlan( - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_vlan"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_VLAN, (void **)&vlan_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - // return SAI_STATUS_NOT_IMPLEMENTED; - } - sai_thrift_parse_vlan_attributes(thrift_attr_list, attr); - uint32_t count = thrift_attr_list.size(); - sai_object_id_t s_id = 0; - sai_object_id_t vlan_id = 1; - vlan_api->create_vlan(&vlan_id, s_id, count, attr); - free(attr); - return (sai_thrift_object_id_t)vlan_id; - } - - sai_thrift_status_t - sai_thrift_remove_vlan(const sai_thrift_object_id_t vlan_id) { - logger->info("sai_thrift_delete_vlan"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - status = sai_api_query(SAI_API_VLAN, (void **)&vlan_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - status = vlan_api->remove_vlan(vlan_id); - return status; - } - - void sai_thrift_get_vlan_stats( - std::vector &_return, const sai_thrift_vlan_id_t vlan_id, - const std::vector &counter_ids, - const int32_t number_of_counters) { - // Your implementation goes here - logger->info("sai_thrift_get_vlan_stats"); - } - - void sai_thrift_parse_vlan_member_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_VLAN_MEMBER_ATTR_VLAN_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE: - attr_list[i].value.s32 = attribute.value.s32; - break; - default: - logger->error("--> while parsing vlan_member_attr: {} was dumped in " - "sai_cpp_server", - attribute.id); - break; - } - } - } - sai_thrift_object_id_t sai_thrift_create_vlan_member( - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_vlan_member"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_VLAN, (void **)&vlan_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - // return SAI_STATUS_NOT_IMPLEMENTED; - } - sai_thrift_parse_vlan_member_attributes(thrift_attr_list, attr); - uint32_t count = thrift_attr_list.size(); - sai_object_id_t s_id = 0; - sai_object_id_t vlan_member_id = 1; - vlan_api->create_vlan_member(&vlan_member_id, s_id, count, attr); - free(attr); - return (sai_thrift_object_id_t)vlan_member_id; - } - - sai_thrift_status_t - sai_thrift_remove_vlan_member(const sai_thrift_object_id_t vlan_member_id) { - logger->info("sai_thrift_remove_vlan_member"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - status = sai_api_query(SAI_API_VLAN, (void **)&vlan_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - // return SAI_STATUS_NOT_IMPLEMENTED; - } - vlan_api->remove_vlan_member((sai_object_id_t)vlan_member_id); - return (sai_thrift_object_id_t)vlan_member_id; - } - - void sai_thrift_get_vlan_attribute(sai_thrift_attribute_list_t &_return, - const sai_thrift_object_id_t vlan_id) { - // Your implementation goes here - logger->info("sai_thrift_get_vlan_attribute"); - } - - void sai_thrift_get_vlan_id(sai_thrift_result_t &_return, - const sai_thrift_object_id_t vlan_id) { - // Your implementation goes here - logger->info("sai_thrift_get_vlan_id"); - } - - sai_thrift_object_id_t sai_thrift_create_virtual_router( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_virtual_router"); - } - - sai_thrift_status_t - sai_thrift_remove_virtual_router(const sai_thrift_object_id_t vr_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_virtual_router"); - } - - sai_thrift_status_t sai_thrift_create_route( - const sai_thrift_route_entry_t &thrift_route_entry, - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_route"); - } - - sai_thrift_status_t - sai_thrift_remove_route(const sai_thrift_route_entry_t &thrift_route_entry) { - // Your implementation goes here - logger->info("sai_thrift_remove_route"); - } - - sai_thrift_object_id_t sai_thrift_create_router_interface( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_router_interface"); - } - - sai_thrift_status_t - sai_thrift_remove_router_interface(const sai_thrift_object_id_t rif_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_router_interface"); - } - - sai_thrift_status_t sai_thrift_set_router_interface_attribute( - const sai_thrift_object_id_t rif_id, - const sai_thrift_attribute_t &thrift_attr) { - // Your implementation goes here - logger->info("sai_thrift_set_router_interface_attribute"); - } - - sai_thrift_object_id_t sai_thrift_create_next_hop( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_next_hop"); - } - - sai_thrift_status_t - sai_thrift_remove_next_hop(const sai_thrift_object_id_t next_hop_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_next_hop"); - } - - sai_thrift_object_id_t sai_thrift_create_next_hop_group( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_next_hop_group"); - } - - sai_thrift_status_t sai_thrift_remove_next_hop_group( - const sai_thrift_object_id_t nhop_group_oid) { - // Your implementation goes here - logger->info("sai_thrift_remove_next_hop_group"); - } - - sai_thrift_object_id_t sai_thrift_create_next_hop_group_member( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_next_hop_group_member"); - } - - sai_thrift_status_t sai_thrift_remove_next_hop_group_member( - const sai_thrift_object_id_t nhop_group_member_oid) { - // Your implementation goes here - logger->info("sai_thrift_remove_next_hop_group_member"); - } - - void sai_thrift_parse_lag_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - default: - logger->error("while parsing lag_attr: attribute.id = {} was dumped in " - "sai_cpp_server ", - attribute.id); - break; - } - } - } - - void sai_thrift_parse_lag_member_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = - thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_LAG_MEMBER_ATTR_PORT_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_LAG_MEMBER_ATTR_LAG_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - default: - logger->error( - "while parsing lag_member_attr: attribute.id = {} was dumped in " - "sai_cpp_server", - attribute.id); - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_lag( - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_lag"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_LAG, (void **)&lag_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - } - sai_thrift_parse_lag_attributes(thrift_attr_list, attr); - uint32_t count = thrift_attr_list.size(); - sai_object_id_t s_id = 0; - sai_object_id_t lag_id = 1; - lag_api->create_lag(&lag_id, s_id, count, attr); - free(attr); - return (sai_thrift_object_id_t)lag_id; - } - - sai_thrift_status_t - sai_thrift_remove_lag(const sai_thrift_object_id_t lag_id) { - logger->info("sai_thrift_remove_lag"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - status = sai_api_query(SAI_API_LAG, (void **)&lag_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - sai_object_id_t s_id = 0; - lag_api->remove_lag(lag_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_lag_member( - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_create_lag_member"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - sai_attribute_t *attr = (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * - thrift_attr_list.size()); - status = sai_api_query(SAI_API_LAG, (void **)&lag_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - } - sai_thrift_parse_lag_member_attributes(thrift_attr_list, attr); - uint32_t count = thrift_attr_list.size(); - sai_object_id_t s_id = 0; - sai_object_id_t lag_member_id = 1; - lag_api->create_lag_member(&lag_member_id, s_id, count, attr); - free(attr); - return (sai_thrift_object_id_t)lag_member_id; - } - - sai_thrift_status_t - sai_thrift_remove_lag_member(const sai_thrift_object_id_t lag_member_id) { - logger->info("sai_thrift_remove_lag_member"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - status = sai_api_query(SAI_API_LAG, (void **)&lag_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return SAI_STATUS_NOT_IMPLEMENTED; - } - sai_object_id_t s_id = 0; - lag_api->remove_lag_member(lag_member_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_stp_entry( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_stp_entry"); - } - - sai_thrift_status_t - sai_thrift_remove_stp_entry(const sai_thrift_object_id_t stp_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_stp_entry"); - } - - sai_thrift_status_t sai_thrift_set_stp_port_state( - const sai_thrift_object_id_t stp_id, const sai_thrift_object_id_t port_id, - const sai_thrift_port_stp_port_state_t stp_port_state) { - // Your implementation goes here - logger->info("sai_thrift_set_stp_port_state"); - } - - sai_thrift_port_stp_port_state_t - sai_thrift_get_stp_port_state(const sai_thrift_object_id_t stp_id, - const sai_thrift_object_id_t port_id) { - // Your implementation goes here - logger->info("sai_thrift_get_stp_port_state"); - } - - sai_thrift_status_t sai_thrift_create_neighbor_entry( - const sai_thrift_neighbor_entry_t &thrift_neighbor_entry, - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_neighbor_entry"); - } - - sai_thrift_status_t sai_thrift_remove_neighbor_entry( - const sai_thrift_neighbor_entry_t &thrift_neighbor_entry) { - // Your implementation goes here - logger->info("sai_thrift_remove_neighbor_entry"); - } - - sai_thrift_object_id_t sai_thrift_create_switch( - const std::vector &thrift_attr_list) { - // TODO: Currently not caring about attr_list. - // sai_attribute_t *attr = (sai_attribute_t*) malloc(sizeof(sai_attribute_t) - // * thrift_attr_list.size()); - logger->info("sai_thrift_create_switch - currently only initiated on " - "server constructor"); - } - - sai_attribute_t parse_switch_attribute(sai_thrift_attribute_t thrift_attr) { - sai_attribute_t sai_attr; - sai_attr.id = thrift_attr.id; - if (thrift_attr.id == SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID) { - sai_attr.value.oid = thrift_attr.value.oid; - } - // if (thrift_attr.id == SAI_SWITCH_ATTR_PORT_LIST) { - // sai_attr.value.objlist.count = thrift_attr.value.objlist.count; - // sai_attr.value.objlist.list = (uint64_t*) - // &thrift_attr.value.objlist.object_id_list[0]; - // } - return sai_attr; - } - - sai_thrift_attribute_t - parse_switch_thrift_attribute(sai_attribute_t *sai_attr) { - sai_thrift_attribute_t thrift_attr; - thrift_attr.id = sai_attr->id; - if (sai_attr->id == SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID) { - thrift_attr.value.oid = sai_attr->value.oid; - } - // if (sai_attr->id == SAI_SWITCH_ATTR_PORT_LIST) { - // thrift_attr.value.objlist.object_id_list.clear(); - // thrift_attr.value.objlist.count = sai_attr->value.objlist.count; - // for (int j=0;jvalue.objlist.count;j++) { - // thrift_attr.value.objlist.object_id_list.push_back(sai_attr->value.objlist.list[j]); - // } - // } - return thrift_attr; - } - - void sai_thrift_get_switch_attribute( - sai_thrift_attribute_list_t &_return, - const std::vector &thrift_attr_list) { - logger->info("sai_thrift_get_switch_attribute"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_switch_api_t *switch_api; - status = sai_api_query(SAI_API_SWITCH, (void **)&switch_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return; - } - uint32_t count = thrift_attr_list.size(); - sai_attribute_t *attr = - (sai_attribute_t *)malloc(sizeof(sai_attribute_t) * count); - int i; - for (i = 0; i < count; i++) { - *(attr + i) = parse_switch_attribute(thrift_attr_list[i]); - } - sai_object_id_t s_id = 1; - status = switch_api->get_switch_attribute(s_id, count, attr); - _return.attr_count = count; - for (i = 0; i < count; i++) { - _return.attr_list.push_back(parse_switch_thrift_attribute(attr + i)); - } - free(attr); - return; - } - - void sai_thrift_get_port_list_by_front_port(sai_thrift_attribute_t &_return) { - // Your implementation goes here - logger->info("sai_thrift_get_port_list_by_front_port"); - } - - sai_thrift_object_id_t sai_thrift_get_cpu_port_id() { - // Your implementation goes here - logger->info("sai_thrift_get_cpu_port_id"); - } - - sai_thrift_object_id_t sai_thrift_get_default_trap_group() { - // Your implementation goes here - logger->info("sai_thrift_get_default_trap_group"); - } - - sai_thrift_object_id_t sai_thrift_get_default_router_id() { - // Your implementation goes here - logger->info("sai_thrift_get_default_router_id"); - } - - void sai_thrift_get_default_vlan_id(sai_thrift_result_t &_return) { - // Your implementation goes here - logger->info("sai_thrift_get_default_vlan_id"); - } - - sai_thrift_object_id_t - sai_thrift_get_port_id_by_front_port(const std::string &port_name) { - // Your implementation goes here - uint32_t hw_port = std::stoi(port_name); - logger->info("sai_thrift_get_port_id_by_front_port ({})", hw_port); - - sai_status_t status = SAI_STATUS_SUCCESS; - sai_switch_api_t *switch_api; - sai_port_api_t *port_api; - status = sai_api_query(SAI_API_SWITCH, (void **)&switch_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return -1; - } - status = sai_api_query(SAI_API_PORT, (void **)&port_api); - if (status != SAI_STATUS_SUCCESS) { - logger->error("sai_api_query failed!!!"); - return -1; - } - sai_attribute_t max_port_attribute; - max_port_attribute.id = SAI_SWITCH_ATTR_PORT_NUMBER; - sai_object_id_t s_id = 1; - switch_api->get_switch_attribute(s_id, 1, &max_port_attribute); - uint32_t max_ports = max_port_attribute.value.u32; - - sai_attribute_t port_list_object_attribute; - port_list_object_attribute.id = SAI_SWITCH_ATTR_PORT_LIST; - port_list_object_attribute.value.objlist.list = - (sai_object_id_t *)malloc(sizeof(sai_object_id_t) * max_ports); - port_list_object_attribute.value.objlist.count = max_ports; - switch_api->get_switch_attribute(s_id, 1, &port_list_object_attribute); - sai_object_id_t port_id; - bool found = false; - bool mem_assigned = false; - sai_attribute_t hw_lane_list_attr; - for (int i = 0; i < max_ports; i++) { - hw_lane_list_attr.id = SAI_PORT_ATTR_HW_LANE_LIST; - hw_lane_list_attr.value.u32list.list = - (uint32_t *)malloc(sizeof(uint32_t)); - mem_assigned = true; - port_api->get_port_attribute( - port_list_object_attribute.value.objlist.list[i], 1, - &hw_lane_list_attr); - if (hw_lane_list_attr.value.u32list.list[0] == hw_port) { - port_id = port_list_object_attribute.value.objlist.list[i]; - found = true; - } - } - if (!found) { - logger->info("didn't find port"); - } - if (mem_assigned == true) { - // logger->info("--> freeing hw_lane_list_attr.value.u32list.list"); - free(hw_lane_list_attr.value.u32list.list); - } - // logger->info("--> freeing - // port_list_object_attribute.value.objlist.list"); - free(port_list_object_attribute.value.objlist.list); - - return port_id; - } - - sai_thrift_status_t - sai_thrift_set_switch_attribute(const sai_thrift_attribute_t &attribute) { - // Your implementation goes here - logger->info("sai_thrift_set_switch_attribute"); - } - - sai_thrift_object_id_t sai_thrift_create_hostif( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_hostif"); - } - - sai_thrift_status_t - sai_thrift_remove_hostif(const sai_thrift_object_id_t hif_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_hostif"); - } - - sai_thrift_object_id_t sai_thrift_create_hostif_trap_group( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_hostif_trap_group"); - } - - sai_thrift_status_t sai_thrift_remove_hostif_trap_group( - const sai_thrift_object_id_t trap_group_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_hostif_trap_group"); - } - - sai_thrift_status_t sai_thrift_create_hostif_trap( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_hostif_trap"); - } - - sai_thrift_status_t - sai_thrift_remove_hostif_trap(const sai_thrift_hostif_trap_id_t trap_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_hostif_trap"); - } - - sai_thrift_status_t - sai_thrift_set_hostif_trap(const sai_thrift_object_id_t trap_id, - const sai_thrift_attribute_t &thrift_attr) { - // Your implementation goes here - logger->info("sai_thrift_set_hostif_trap"); - } - - sai_thrift_status_t - sai_thrift_set_hostif_trap_group(const sai_thrift_object_id_t trap_group_id, - const sai_thrift_attribute_t &thrift_attr) { - // Your implementation goes here - logger->info("sai_thrift_set_hostif_trap_group"); - } - - sai_thrift_object_id_t sai_thrift_create_acl_table( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_acl_table"); - } - - sai_thrift_status_t - sai_thrift_remove_acl_table(const sai_thrift_object_id_t acl_table_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_acl_table"); - } - - sai_thrift_object_id_t sai_thrift_create_acl_entry( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_acl_entry"); - } - - sai_thrift_status_t - sai_thrift_remove_acl_entry(const sai_thrift_object_id_t acl_entry) { - // Your implementation goes here - logger->info("sai_thrift_remove_acl_entry"); - } - - sai_thrift_object_id_t sai_thrift_create_acl_table_group( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_acl_table_group"); - } - - sai_thrift_status_t sai_thrift_remove_acl_table_group( - const sai_thrift_object_id_t acl_table_group_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_acl_table_group"); - } - - sai_thrift_object_id_t sai_thrift_create_acl_table_group_member( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_acl_table_group_member"); - } - - sai_thrift_status_t sai_thrift_remove_acl_table_group_member( - const sai_thrift_object_id_t acl_table_group_member_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_acl_table_group_member"); - } - - sai_thrift_object_id_t sai_thrift_create_acl_counter( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_acl_counter"); - } - - sai_thrift_status_t - sai_thrift_remove_acl_counter(const sai_thrift_object_id_t acl_counter_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_acl_counter"); - } - - void sai_thrift_get_acl_counter_attribute( - std::vector &_return, - const sai_thrift_object_id_t acl_counter_id, - const std::vector &thrift_attr_ids) { - // Your implementation goes here - logger->info("sai_thrift_get_acl_counter_attribute"); - } - - sai_thrift_object_id_t sai_thrift_create_mirror_session( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_mirror_session"); - } - - sai_thrift_status_t - sai_thrift_remove_mirror_session(const sai_thrift_object_id_t session_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_mirror_session"); - } - - sai_thrift_object_id_t sai_thrift_create_policer( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_policer"); - } - - sai_thrift_status_t - sai_thrift_remove_policer(const sai_thrift_object_id_t policer_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_policer"); - } - - void sai_thrift_get_policer_stats( - std::vector &_return, const sai_thrift_object_id_t policer_id, - const std::vector &counter_ids) { - // Your implementation goes here - logger->info("sai_thrift_get_policer_stats"); - } - - sai_thrift_object_id_t sai_thrift_create_scheduler_profile( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_scheduler_profile"); - } - - sai_thrift_status_t sai_thrift_remove_scheduler_profile( - const sai_thrift_object_id_t scheduler_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_scheduler_profile"); - } - - void sai_thrift_get_queue_stats( - std::vector &_return, const sai_thrift_object_id_t queue_id, - const std::vector &counter_ids, - const int32_t number_of_counters) { - // Your implementation goes here - logger->info("sai_thrift_get_queue_stats"); - } - - sai_thrift_status_t sai_thrift_clear_queue_stats( - const sai_thrift_object_id_t queue_id, - const std::vector &counter_ids, - const int32_t number_of_counters) { - // Your implementation goes here - logger->info("sai_thrift_clear_queue_stats"); - } - - sai_thrift_status_t - sai_thrift_set_queue_attribute(const sai_thrift_object_id_t queue_id, - const sai_thrift_attribute_t &thrift_attr) { - // Your implementation goes here - logger->info("sai_thrift_set_queue_attribute"); - } - - sai_thrift_object_id_t sai_thrift_create_buffer_profile( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_buffer_profile"); - } - - sai_thrift_object_id_t sai_thrift_create_pool_profile( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_pool_profile"); - } - - sai_thrift_status_t sai_thrift_set_priority_group_attribute( - const sai_thrift_object_id_t pg_id, - const sai_thrift_attribute_t &thrift_attr) { - // Your implementation goes here - logger->info("sai_thrift_set_priority_group_attribute"); - } - - void sai_thrift_get_pg_stats( - std::vector &_return, const sai_thrift_object_id_t pg_id, - const std::vector &counter_ids, - const int32_t number_of_counters) { - // Your implementation goes here - logger->info("sai_thrift_get_pg_stats"); - } - - sai_thrift_object_id_t sai_thrift_create_wred_profile( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_wred_profile"); - } - - sai_thrift_status_t - sai_thrift_remove_wred_profile(const sai_thrift_object_id_t wred_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_wred_profile"); - } - - sai_thrift_object_id_t sai_thrift_create_qos_map( - const std::vector &thrift_attr_list) { - // Your implementation goes here - logger->info("sai_thrift_create_qos_map"); - } - - sai_thrift_status_t - sai_thrift_remove_qos_map(const sai_thrift_object_id_t qos_map_id) { - // Your implementation goes here - logger->info("sai_thrift_remove_qos_map"); - } -}; - -TSimpleServer *server_ptr; - -void close_rpc_server(int signum) { server_ptr->stop(); } - -int main(int argc, char **argv) { - // logging - auto logger = spdlog::basic_logger_mt("logger", "logs/log.txt"); - logger->flush_on(spdlog::level::info); // make err - spdlog::set_pattern("[thread %t] %l %v "); // add %T for time - auto inline_log = spdlog::stdout_color_mt("inline_log"); - inline_log->info("creating server for SAI on port {}", sai_port); - logger->info("creating server for SAI on port {}", sai_port); - - // open server to sai functions - boost::shared_ptr handler(new switch_sai_rpcHandler()); - boost::shared_ptr processor(new switch_sai_rpcProcessor(handler)); - boost::shared_ptr serverTransport( - new TServerSocket(sai_port)); - boost::shared_ptr transportFactory( - new TBufferedTransportFactory()); - boost::shared_ptr protocolFactory( - new TBinaryProtocolFactory()); - - TSimpleServer server(processor, serverTransport, transportFactory, - protocolFactory); - - server_ptr = &server; - signal(SIGINT, close_rpc_server); - logger->info("SAI rpc server started on port {}", sai_port); - server.serve(); - logger->info("thrift done"); - spdlog::drop_all(); - return 0; -} diff --git a/bm/sai_adapter/test/sai_thrift_server/logs/.gitignore b/bm/sai_adapter/test/sai_thrift_server/logs/.gitignore deleted file mode 100644 index 314f02b1b..000000000 --- a/bm/sai_adapter/test/sai_thrift_server/logs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.txt \ No newline at end of file diff --git a/bm/sai_adapter/test/sai_thrift_server/obj/.gitignore b/bm/sai_adapter/test/sai_thrift_server/obj/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/bm/sai_adapter/test/sai_thrift_server/run_server.sh b/bm/sai_adapter/test/sai_thrift_server/run_server.sh deleted file mode 100755 index 0310401dd..000000000 --- a/bm/sai_adapter/test/sai_thrift_server/run_server.sh +++ /dev/null @@ -1,3 +0,0 @@ -rm -rf logs/log.txt -# sudo ip netns exec hostif_net ./SaiCppServer -sudo ./SaiCppServer \ No newline at end of file diff --git a/bm/sai_adapter/test/sai_thrift_server/saiutils.c b/bm/sai_adapter/test/sai_thrift_server/saiutils.c deleted file mode 100644 index 17151b0de..000000000 --- a/bm/sai_adapter/test/sai_thrift_server/saiutils.c +++ /dev/null @@ -1,328 +0,0 @@ -/* -Copyright 2013-present Barefoot Networks, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "sai_bm_c_api.h" - -// maps from SAI types to switchapi types - -char *sai_status_to_string(_In_ const sai_status_t status) { - switch (status) { - case SAI_STATUS_INVALID_PARAMETER: - return "invalid parameter"; - case SAI_STATUS_NO_MEMORY: - return "no memory"; - case SAI_STATUS_FAILURE: - return "unknown failure"; - default: - return "unknown failure"; - } -} - -char *sai_object_type_to_string(_In_ sai_object_type_t object_type) { - if (object_type > SAI_OBJECT_TYPE_MAX) { - return "invalid object"; - } - - switch (object_type) { - case SAI_OBJECT_TYPE_NULL: - return "null object"; - case SAI_OBJECT_TYPE_PORT: - return "port object"; - case SAI_OBJECT_TYPE_LAG: - return "lag object"; - case SAI_OBJECT_TYPE_VIRTUAL_ROUTER: - return "virtual router object"; - case SAI_OBJECT_TYPE_NEXT_HOP: - return "nexthop object"; - case SAI_OBJECT_TYPE_NEXT_HOP_GROUP: - return "nexthop group object"; - case SAI_OBJECT_TYPE_ROUTER_INTERFACE: - return "router interface object"; - case SAI_OBJECT_TYPE_ACL_TABLE: - return "acl table object"; - case SAI_OBJECT_TYPE_ACL_ENTRY: - return "acl entry object"; - case SAI_OBJECT_TYPE_ACL_COUNTER: - return "acl counter object"; - case SAI_OBJECT_TYPE_HOSTIF: - return "host interface object"; - case SAI_OBJECT_TYPE_MIRROR_SESSION: - return "mirror object"; - case SAI_OBJECT_TYPE_SAMPLEPACKET: - return "sample packet object"; - case SAI_OBJECT_TYPE_STP: - return "stp instance object"; - case SAI_OBJECT_TYPE_HOSTIF_TRAP_GROUP: - return "trap group object"; - case SAI_OBJECT_TYPE_ACL_TABLE_GROUP: - return "acl table group object"; - case SAI_OBJECT_TYPE_POLICER: - return "policer object"; - case SAI_OBJECT_TYPE_WRED: - return "wred object"; - case SAI_OBJECT_TYPE_QOS_MAP: - return "qos maps object"; - case SAI_OBJECT_TYPE_QUEUE: - return "queue object"; - case SAI_OBJECT_TYPE_SCHEDULER: - return "scheduler object"; - case SAI_OBJECT_TYPE_SCHEDULER_GROUP: - return "scheduler group object"; - default: - return "invalid object"; - } -} - -sai_status_t sai_ipv4_prefix_length(_In_ sai_ip4_t ip4, - _Out_ uint32_t *prefix_length) { - int x = 0; - *prefix_length = 0; - while (ip4) { - x = ip4 & 0x1; - if (x) (*prefix_length)++; - ip4 = ip4 >> 1; - } - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_ipv6_prefix_length(_In_ const sai_ip6_t ip6, - _Out_ uint32_t *prefix_length) { - int i = 0, x = 0; - sai_ip6_t ip6_temp; - memcpy(ip6_temp, ip6, 16); - *prefix_length = 0; - for (i = 0; i < 16; i++) { - if (ip6_temp[i] == 0xFF) { - *prefix_length += 8; - } else { - while (ip6_temp[i]) { - x = ip6_temp[i] & 0x1; - if (x) (*prefix_length)++; - ip6_temp[i] = ip6_temp[i] >> 1; - } - } - } - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_ip_prefix_to_switch_ip_addr( - const _In_ sai_ip_prefix_t *sai_ip_addr, _Out_ switch_ip_addr_t *ip_addr) { - if (sai_ip_addr->addr_family == SAI_IP_ADDR_FAMILY_IPV4) { - ip_addr->type = SWITCH_API_IP_ADDR_V4; - ip_addr->ip.v4addr = ntohl(sai_ip_addr->addr.ip4); - sai_ipv4_prefix_length(ntohl(sai_ip_addr->mask.ip4), &ip_addr->prefix_len); - } else if (sai_ip_addr->addr_family == SAI_IP_ADDR_FAMILY_IPV6) { - ip_addr->type = SWITCH_API_IP_ADDR_V6; - memcpy(ip_addr->ip.v6addr, sai_ip_addr->addr.ip6, 16); - sai_ipv6_prefix_length(sai_ip_addr->mask.ip6, &ip_addr->prefix_len); - } - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_ip_addr_to_switch_ip_addr( - const _In_ sai_ip_address_t *sai_ip_addr, _Out_ switch_ip_addr_t *ip_addr) { - if (sai_ip_addr->addr_family == SAI_IP_ADDR_FAMILY_IPV4) { - ip_addr->type = SWITCH_API_IP_ADDR_V4; - ip_addr->ip.v4addr = ntohl(sai_ip_addr->addr.ip4); - ip_addr->prefix_len = 32; - } else if (sai_ip_addr->addr_family == SAI_IP_ADDR_FAMILY_IPV6) { - ip_addr->type = SWITCH_API_IP_ADDR_V6; - memcpy(ip_addr->ip.v6addr, sai_ip_addr->addr.ip6, 16); - ip_addr->prefix_len = 128; - } - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_ipv4_to_string(_In_ sai_ip4_t ip4, - _In_ uint32_t max_length, - _Out_ char *entry_string, - _Out_ int *entry_length) { - inet_ntop(AF_INET, &ip4, entry_string, max_length); - *entry_length = (int)strlen(entry_string); - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_ipv6_to_string(_In_ sai_ip6_t ip6, - _In_ uint32_t max_length, - _Out_ char *entry_string, - _Out_ int *entry_length) { - inet_ntop(AF_INET6, &ip6, entry_string, max_length); - *entry_length = (int)strlen(entry_string); - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_ipaddress_to_string(_In_ sai_ip_address_t ip_addr, - _In_ uint32_t max_length, - _Out_ char *entry_string, - _Out_ int *entry_length) { - if (ip_addr.addr_family == SAI_IP_ADDR_FAMILY_IPV4) { - sai_ipv4_to_string( - ip_addr.addr.ip4, max_length, entry_string, entry_length); - } else if (ip_addr.addr_family == SAI_IP_ADDR_FAMILY_IPV6) { - sai_ipv6_to_string( - ip_addr.addr.ip6, max_length, entry_string, entry_length); - } else { - snprintf(entry_string, - max_length, - "Invalid addr family %d", - ip_addr.addr_family); - return SAI_STATUS_INVALID_PARAMETER; - } - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_ipprefix_to_string(_In_ sai_ip_prefix_t ip_prefix, - _In_ uint32_t max_length, - _Out_ char *entry_string, - _Out_ int *entry_length) { - int len = 0; - uint32_t pos = 0; - - if (ip_prefix.addr_family == SAI_IP_ADDR_FAMILY_IPV4) { - sai_ipv4_to_string(ip_prefix.addr.ip4, max_length, entry_string, &len); - pos += len; - if (pos > max_length) { - *entry_length = max_length; - return SAI_STATUS_SUCCESS; - } - pos += snprintf(entry_string + pos, max_length - pos, "/"); - if (pos > max_length) { - *entry_length = max_length; - return SAI_STATUS_SUCCESS; - } - sai_ipv4_to_string( - ip_prefix.mask.ip4, max_length - pos, entry_string + pos, &len); - pos += len; - if (pos > max_length) { - *entry_length = max_length; - return SAI_STATUS_SUCCESS; - } - } else if (ip_prefix.addr_family == SAI_IP_ADDR_FAMILY_IPV6) { - sai_ipv6_to_string(ip_prefix.addr.ip6, max_length, entry_string, &len); - pos += len; - if (pos > max_length) { - *entry_length = max_length; - return SAI_STATUS_SUCCESS; - } - pos += snprintf(entry_string + pos, max_length - pos, "/"); - if (pos > max_length) { - *entry_length = max_length; - return SAI_STATUS_SUCCESS; - } - sai_ipv6_to_string( - ip_prefix.mask.ip6, max_length - pos, entry_string + pos, &len); - pos += len; - if (pos > max_length) { - *entry_length = max_length; - return SAI_STATUS_SUCCESS; - } - } else { - snprintf(entry_string, - max_length, - "Invalid addr family %d", - ip_prefix.addr_family); - return SAI_STATUS_INVALID_PARAMETER; - } - - *entry_length = pos; - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_port_speed_to_switch_port_speed( - uint32_t sai_port_speed, _Out_ switch_port_speed_t *switch_port_speed) { - // speeds are in mbps - switch (sai_port_speed) { - case 1000: - *switch_port_speed = SWITCH_API_PORT_SPEED_1G; - break; - case 10000: - *switch_port_speed = SWITCH_API_PORT_SPEED_10G; - break; - case 25000: - *switch_port_speed = SWITCH_API_PORT_SPEED_25G; - break; - case 40000: - *switch_port_speed = SWITCH_API_PORT_SPEED_40G; - break; - case 50000: - *switch_port_speed = SWITCH_API_PORT_SPEED_50G; - break; - case 100000: - *switch_port_speed = SWITCH_API_PORT_SPEED_100G; - break; - default: - return SAI_STATUS_INVALID_PARAMETER; - } - - return SAI_STATUS_SUCCESS; -} - -switch_acl_action_t sai_packet_action_to_switch_packet_action( - _In_ sai_packet_action_t action) { - switch (action) { - case SAI_PACKET_ACTION_DROP: - return SWITCH_ACL_ACTION_DROP; - case SAI_PACKET_ACTION_FORWARD: - return SWITCH_ACL_ACTION_PERMIT; - case SAI_PACKET_ACTION_TRAP: - return SWITCH_ACL_ACTION_REDIRECT_TO_CPU; - case SAI_PACKET_ACTION_LOG: - return SWITCH_ACL_ACTION_LOG; - default: - return SWITCH_ACL_ACTION_NOP; - } -} - -// maps from switchapi types to SAI types - -sai_status_t sai_switch_ip_addr_to_sai_ip_addr( - _Out_ sai_ip_address_t *sai_ip_addr, const _In_ switch_ip_addr_t *ip_addr) { - if (ip_addr->type == SWITCH_API_IP_ADDR_V4) { - sai_ip_addr->addr_family = SAI_IP_ADDR_FAMILY_IPV4; - sai_ip_addr->addr.ip4 = htonl(ip_addr->ip.v4addr); - } else if (ip_addr->type == SWITCH_API_IP_ADDR_V6) { - sai_ip_addr->addr_family = SAI_IP_ADDR_FAMILY_IPV6; - memcpy(sai_ip_addr->addr.ip6, ip_addr->ip.v6addr, 16); - } - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_switch_port_enabled_to_sai_oper_status( - _In_ _Out_ sai_attribute_t *attr) { - switch ((int)attr->value.booldata) { - case 1: - attr->value.u8 = SAI_PORT_OPER_STATUS_UP; - break; - case 0: - attr->value.u8 = SAI_PORT_OPER_STATUS_DOWN; - break; - } - - return SAI_STATUS_SUCCESS; -} - -sai_status_t sai_switch_status_to_sai_status(_In_ const switch_status_t - status) { - switch (status) { - case SWITCH_STATUS_SUCCESS: - return SAI_STATUS_SUCCESS; - case SWITCH_STATUS_FAILURE: - return SWITCH_STATUS_FAILURE; - case SWITCH_STATUS_INVALID_PARAMETER: - return SAI_STATUS_INVALID_PARAMETER; - case SWITCH_STATUS_NO_MEMORY: - return SAI_STATUS_NO_MEMORY; - default: - return SAI_STATUS_FAILURE; - } -} \ No newline at end of file diff --git a/bm/sai_adapter/test/sai_thrift_src/saiserver.cpp b/bm/sai_adapter/test/sai_thrift_src/saiserver.cpp deleted file mode 100644 index 0103bf9bb..000000000 --- a/bm/sai_adapter/test/sai_thrift_src/saiserver.cpp +++ /dev/null @@ -1,383 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include "switch_sai_rpc.h" -#include "switch_sai_rpc_server.h" - -#define UNREFERENCED_PARAMETER(P) (P) - -extern "C" { -#include "sai.h" -#include "saistatus.h" -} - - -#define SWITCH_SAI_THRIFT_RPC_SERVER_PORT 9092 - -sai_switch_api_t* sai_switch_api; - -std::map gProfileMap; -std::map, std::string> gPortMap; - -sai_object_id_t gSwitchId; ///< SAI switch global object ID. - -void on_switch_state_change(_In_ sai_object_id_t switch_id, - _In_ sai_switch_oper_status_t switch_oper_status)// -{ -} - -void on_fdb_event(_In_ uint32_t count, - _In_ sai_fdb_event_notification_data_t *data) -{ -} - -void on_port_state_change(_In_ uint32_t count, - _In_ sai_port_oper_status_notification_t *data) -{ -} - -void on_shutdown_request(_In_ sai_object_id_t switch_id)// -{ -} - -void on_packet_event(_In_ sai_object_id_t switch_id, - _In_ const void *buffer, - _In_ sai_size_t buffer_size, - _In_ uint32_t attr_count, - _In_ const sai_attribute_t *attr_list) -{ -} - -// Profile services -/* Get variable value given its name */ -const char* test_profile_get_value( - _In_ sai_switch_profile_id_t profile_id, - _In_ const char* variable) -{ - UNREFERENCED_PARAMETER(profile_id); - - if (variable == NULL) - { - printf("variable is null\n"); - return NULL; - } - - std::map::const_iterator it = gProfileMap.find(variable); - if (it == gProfileMap.end()) - { - printf("%s: NULL\n", variable); - return NULL; - } - - return it->second.c_str(); -} - -std::map::iterator gProfileIter = gProfileMap.begin(); -/* Enumerate all the K/V pairs in a profile. - Pointer to NULL passed as variable restarts enumeration. - Function returns 0 if next value exists, -1 at the end of the list. */ -int test_profile_get_next_value( - _In_ sai_switch_profile_id_t profile_id, - _Out_ const char** variable, - _Out_ const char** value) -{ - UNREFERENCED_PARAMETER(profile_id); - - if (value == NULL) - { - printf("resetting profile map iterator"); - - gProfileIter = gProfileMap.begin(); - return 0; - } - - if (variable == NULL) - { - printf("variable is null"); - return -1; - } - - if (gProfileIter == gProfileMap.end()) - { - printf("iterator reached end"); - return -1; - } - - *variable = gProfileIter->first.c_str(); - *value = gProfileIter->second.c_str(); - - printf("key: %s:%s", *variable, *value); - - gProfileIter++; - - return 0; -} - -const service_method_table_t test_services = { - test_profile_get_value, - test_profile_get_next_value -}; - -#ifdef BRCMSAI -void sai_diag_shell() -{ - sai_status_t status; - - while (true) - { - sai_attribute_t attr; - attr.id = SAI_SWITCH_ATTR_SWITCH_SHELL_ENABLE; - attr.value.booldata = true; - status = sai_switch_api->set_switch_attribute(gSwitchId, &attr); - if (status != SAI_STATUS_SUCCESS) - { - return; - } - - sleep(1); - } -} -#endif - -struct cmdOptions -{ - std::string profileMapFile; - std::string portMapFile; - std::string initScript; -}; - -cmdOptions handleCmdLine(int argc, char **argv) -{ - - cmdOptions options = {}; - - while(true) - { - static struct option long_options[] = - { - { "profile", required_argument, 0, 'p' }, - { "portmap", required_argument, 0, 'f' }, - { "init-script", required_argument, 0, 'S' }, - { 0, 0, 0, 0 } - }; - - int option_index = 0; - - int c = getopt_long(argc, argv, "p:f:S:", long_options, &option_index); - - if (c == -1) - break; - - switch (c) - { - case 'p': - printf("profile map file: %s\n", optarg); - options.profileMapFile = std::string(optarg); - break; - - case 'f': - printf("port map file: %s\n", optarg); - options.portMapFile = std::string(optarg); - break; - - case 'S': - printf("init script: %s\n", optarg); - options.initScript = std::string(optarg); - break; - - default: - printf("getopt_long failure\n"); - exit(EXIT_FAILURE); - } - } - - return options; -} - -void handleProfileMap(const std::string& profileMapFile) -{ - - if (profileMapFile.size() == 0) - return; - - std::ifstream profile(profileMapFile); - - if (!profile.is_open()) - { - printf("failed to open profile map file: %s : %s\n", profileMapFile.c_str(), strerror(errno)); - exit(EXIT_FAILURE); - } - - std::string line; - - while(getline(profile, line)) - { - if (line.size() > 0 && (line[0] == '#' || line[0] == ';')) - continue; - - size_t pos = line.find("="); - - if (pos == std::string::npos) - { - printf("not found '=' in line %s\n", line.c_str()); - continue; - } - - std::string key = line.substr(0, pos); - std::string value = line.substr(pos + 1); - - gProfileMap[key] = value; - - printf("insert: %s:%s\n", key.c_str(), value.c_str()); - } -} - -void handlePortMap(const std::string& portMapFile) -{ - - if (portMapFile.size() == 0) - return; - - std::ifstream portmap(portMapFile); - - if (!portmap.is_open()) - { - printf("failed to open port map file: %s : %s\n", portMapFile.c_str(), strerror(errno)); - exit(EXIT_FAILURE); - } - - std::string line; - - while(getline(portmap, line)) - { - if (line.size() > 0 && (line[0] == '#' || line[0] == ';')) - continue; - - size_t pos = line.find(" "); - - if (pos == std::string::npos) - { - printf("not found ' ' in line %s\n", line.c_str()); - continue; - } - - std::string fp_value = line.substr(0, pos); - std::string lanes = line.substr(pos + 1); - - // ::isspace : C-Style white space predicate. Locale independent. - lanes.erase(std::remove_if(lanes.begin(), lanes.end(), ::isspace), lanes.end()); - - std::istringstream iss(lanes); - std::string lane_str; - std::set lane_set; - - while (getline(iss, lane_str, ',')) - { - int lane = stoi(lane_str); - lane_set.insert(lane); - } - - gPortMap.insert(std::pair,std::string>(lane_set,fp_value)); - } -} - -void handleInitScript(const std::string& initScript) -{ - - if (initScript.size() == 0) - return; - - printf("Running %s ...\n", initScript.c_str()); - system(initScript.c_str()); -} - -int -main(int argc, char* argv[]) -{ - int rv = 0; - - auto options = handleCmdLine(argc, argv); - handleProfileMap(options.profileMapFile); - handlePortMap(options.portMapFile); - - sai_api_initialize(0, (service_method_table_t *)&test_services); - sai_api_query(SAI_API_SWITCH, (void**)&sai_switch_api); - - constexpr std::uint32_t attrSz = 6; - - sai_attribute_t attr[attrSz]; - std::memset(attr, '\0', sizeof(attr)); - - attr[0].id = SAI_SWITCH_ATTR_INIT_SWITCH; - attr[0].value.booldata = true; - - attr[1].id = SAI_SWITCH_ATTR_SWITCH_STATE_CHANGE_NOTIFY; - attr[1].value.ptr = reinterpret_cast(&on_switch_state_change); - - attr[2].id = SAI_SWITCH_ATTR_SHUTDOWN_REQUEST_NOTIFY; - attr[2].value.ptr = reinterpret_cast(&on_shutdown_request); - - attr[3].id = SAI_SWITCH_ATTR_FDB_EVENT_NOTIFY; - attr[3].value.ptr = reinterpret_cast(&on_fdb_event); - - attr[4].id = SAI_SWITCH_ATTR_PORT_STATE_CHANGE_NOTIFY; - attr[4].value.ptr = reinterpret_cast(&on_port_state_change); - - attr[5].id = SAI_SWITCH_ATTR_PACKET_EVENT_NOTIFY; - attr[5].value.ptr = reinterpret_cast(&on_packet_event); - - sai_status_t status = sai_switch_api->create_switch(&gSwitchId, attrSz, attr); - if (status != SAI_STATUS_SUCCESS) - { - exit(EXIT_FAILURE); - } - - handleInitScript(options.initScript); - -#ifdef BRCMSAI - std::thread bcm_diag_shell_thread = std::thread(sai_diag_shell); - bcm_diag_shell_thread.detach(); -#endif - - start_sai_thrift_rpc_server(SWITCH_SAI_THRIFT_RPC_SERVER_PORT); - - sai_log_set(SAI_API_SWITCH, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_FDB, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_PORT, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_VLAN, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_ROUTE, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_VIRTUAL_ROUTER, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_ROUTER_INTERFACE, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_NEXT_HOP, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_NEXT_HOP_GROUP, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_NEIGHBOR, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_ACL, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_MIRROR, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_LAG, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_BUFFER, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_POLICER, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_WRED, SAI_LOG_LEVEL_NOTICE); - sai_log_set(SAI_API_QOS_MAP, SAI_LOG_LEVEL_NOTICE); - - while (1) pause(); - - return rv; -} diff --git a/bm/sai_adapter/test/sai_thrift_src/switch_sai.thrift b/bm/sai_adapter/test/sai_thrift_src/switch_sai.thrift deleted file mode 100644 index 72e775f75..000000000 --- a/bm/sai_adapter/test/sai_thrift_src/switch_sai.thrift +++ /dev/null @@ -1,379 +0,0 @@ -/* -Copyright 2013-present Barefoot Networks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -namespace py switch_sai -namespace cpp switch_sai - -typedef i64 sai_thrift_object_id_t -typedef i16 sai_thrift_vlan_id_t -typedef string sai_thrift_mac_t -typedef byte sai_thrift_vlan_tagging_mode_t -typedef i32 sai_thrift_status_t -typedef string sai_thrift_ip4_t -typedef string sai_thrift_ip6_t -typedef byte sai_thrift_ip_addr_family_t -typedef byte sai_thrift_port_stp_port_state_t -typedef i32 sai_thrift_hostif_trap_id_t -typedef i32 sai_thrift_next_hop_type_t -typedef i32 sai_thrift_vlan_stat_counter_t -typedef i32 sai_thrift_policer_stat_counter_t -typedef i32 sai_thrift_port_stat_counter_t -typedef i32 sai_thrift_queue_stat_counter_t -typedef i32 sai_thrift_pg_stat_counter_t - -enum sai_thrift_fdb_entry_bridge_type_t { - SAI_FDB_ENTRY_BRIDGE_TYPE_1Q, - SAI_FDB_ENTRY_BRIDGE_TYPE_1D -} -union sai_thrift_result_data_t { - 1: sai_thrift_object_id_t oid; - 2: i16 u16; -} - -struct sai_thrift_result_t { - 1: sai_thrift_result_data_t data; - 2: sai_thrift_status_t status; -} - -struct sai_thrift_fdb_entry_t { - 1: sai_thrift_mac_t mac_address; - 2: sai_thrift_vlan_id_t vlan_id; - 3: sai_thrift_fdb_entry_bridge_type_t bridge_type; - 4: sai_thrift_object_id_t bridge_id; -} - -struct sai_thrift_vlan_port_t { - 1: sai_thrift_object_id_t port_id; - 2: sai_thrift_vlan_tagging_mode_t tagging_mode; -} - -union sai_thrift_ip_t { - 1: sai_thrift_ip4_t ip4; - 2: sai_thrift_ip6_t ip6; -} - -struct sai_thrift_ip_address_t { - 1: sai_thrift_ip_addr_family_t addr_family; - 2: sai_thrift_ip_t addr; -} - -struct sai_thrift_ip_prefix_t { - 1: sai_thrift_ip_addr_family_t addr_family; - 2: sai_thrift_ip_t addr; - 3: sai_thrift_ip_t mask; -} - -struct sai_thrift_object_list_t { - 1: i32 count; - 2: list object_id_list; -} - -struct sai_thrift_vlan_list_t { - 1: i32 vlan_count; - 2: list vlan_list; -} - -struct sai_thrift_s32_list_t { - 1: i32 count; - 2: list s32list; -} - -union sai_thrift_acl_mask_t { - 1: byte u8; - 2: byte s8; - 3: i16 u16; - 4: i16 s16; - 5: i32 u32; - 6: i32 s32; - 7: sai_thrift_mac_t mac; - 8: sai_thrift_ip4_t ip4; - 9: sai_thrift_ip6_t ip6; -} - -union sai_thrift_acl_data_t { - 1: byte u8; - 2: byte s8; - 3: i16 u16; - 4: i16 s16; - 5: i32 u32; - 6: i32 s32; - 7: sai_thrift_mac_t mac; - 8: sai_thrift_ip4_t ip4; - 9: sai_thrift_ip6_t ip6; - 10: sai_thrift_object_id_t oid; - 11: sai_thrift_object_list_t objlist; -} - -struct sai_thrift_acl_field_data_t -{ - 1: bool enable; - 2: sai_thrift_acl_mask_t mask; - 3: sai_thrift_acl_data_t data; -} - -union sai_thrift_acl_parameter_t { - 1: byte u8; - 2: byte s8; - 3: i16 u16; - 4: i16 s16; - 5: i32 u32; - 6: i32 s32; - 7: sai_thrift_mac_t mac; - 8: sai_thrift_ip4_t ip4; - 9: sai_thrift_ip6_t ip6; - 10: sai_thrift_object_id_t oid; -} - -struct sai_thrift_acl_action_data_t { - 1: bool enable; - 2: sai_thrift_acl_parameter_t parameter; -} - -struct sai_thrift_u32_list_t { - 1: i32 count; - 2: list u32list; -} - -struct sai_thrift_qos_map_params_t { - 1: byte tc; - 2: byte dscp; - 3: byte dot1p; - 4: byte prio; - 5: byte pg; - 6: byte queue_index; - 7: byte color; -} - -struct sai_thrift_qos_map_t { - 1: sai_thrift_qos_map_params_t key; - 2: sai_thrift_qos_map_params_t value; -} - -struct sai_thrift_qos_map_list_t { - 1: i32 count; - 2: list map_list; -} - -union sai_thrift_attribute_value_t { - 1: bool booldata; - 2: string chardata; - 3: byte u8; - 4: byte s8; - 5: i16 u16; - 6: i16 s16; - 7: i32 u32; - 8: i32 s32; - 9: i64 u64; - 10: i64 s64; - 11: sai_thrift_mac_t mac; - 12: sai_thrift_object_id_t oid; - 13: sai_thrift_ip4_t ip4; - 14: sai_thrift_ip6_t ip6; - 15: sai_thrift_ip_address_t ipaddr; - 16: sai_thrift_object_list_t objlist; - 17: sai_thrift_vlan_list_t vlanlist; - 18: sai_thrift_acl_field_data_t aclfield; - 19: sai_thrift_acl_action_data_t aclaction; - 20: sai_thrift_u32_list_t u32list; - 21: sai_thrift_s32_list_t s32list; - 22: sai_thrift_qos_map_list_t qosmap; -} - -struct sai_thrift_attribute_t { - 1: i32 id; - 2: sai_thrift_attribute_value_t value; -} - -struct sai_thrift_route_entry_t { - 1: sai_thrift_object_id_t vr_id; - 2: sai_thrift_ip_prefix_t destination; -} - -struct sai_thrift_neighbor_entry_t { - 1: sai_thrift_object_id_t rif_id; - 2: sai_thrift_ip_address_t ip_address; -} - -struct sai_thrift_attribute_list_t { - 1: list attr_list; - 2: i32 attr_count; // redundant -} - -service switch_sai_rpc { - //port API - sai_thrift_status_t sai_thrift_set_port_attribute(1: sai_thrift_object_id_t port_id, 2: sai_thrift_attribute_t thrift_attr); - sai_thrift_attribute_list_t sai_thrift_get_port_attribute(1: sai_thrift_object_id_t port_id, 2: list thrift_attr_list); - list sai_thrift_get_port_stats( - 1: sai_thrift_object_id_t port_id, - 2: list counter_ids, - 3: i32 number_of_counters); - sai_thrift_status_t sai_thrift_clear_port_all_stats(1: sai_thrift_object_id_t port_id); - - sai_thrift_status_t sai_thrift_remove_port(1: sai_thrift_object_id_t port_id); - sai_thrift_object_id_t sai_thrift_create_port(1: list thrift_attr_list); - - //bridge API - sai_thrift_object_id_t sai_thrift_create_bridge(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_bridge(1: sai_thrift_object_id_t bridge_id); - sai_thrift_attribute_list_t sai_thirft_get_bridge_attribute(1: sai_thrift_object_id_t bridge_id, 2: list thrift_attr_list); - sai_thrift_object_id_t sai_thrift_create_bridge_port(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_bridge_port(1: sai_thrift_object_id_t bridge_port_id); - sai_thrift_attribute_list_t sai_thirft_get_bridge_port_attribute(1: sai_thrift_object_id_t bridge_port_id, 2: list thrift_attr_list); - sai_thrift_status_t sai_thrift_set_bridge_port_attribute(1: sai_thrift_object_id_t bridge_port_id, 2: sai_thrift_attribute_t thrift_attr); - - - - //fdb API - sai_thrift_status_t sai_thrift_create_fdb_entry(1: sai_thrift_fdb_entry_t thrift_fdb_entry, 2: list thrift_attr_list); - sai_thrift_status_t sai_thrift_delete_fdb_entry(1: sai_thrift_fdb_entry_t thrift_fdb_entry); - sai_thrift_status_t sai_thrift_flush_fdb_entries(1: list thrift_attr_list); - - //vlan API - sai_thrift_object_id_t sai_thrift_create_vlan(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_vlan(1: sai_thrift_object_id_t vlan_oid); - list sai_thrift_get_vlan_stats( - 1: sai_thrift_vlan_id_t vlan_id, - 2: list counter_ids, - 3: i32 number_of_counters); - sai_thrift_object_id_t sai_thrift_create_vlan_member(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_vlan_member(1: sai_thrift_object_id_t vlan_member_id); - sai_thrift_attribute_list_t sai_thrift_get_vlan_attribute(1: sai_thrift_object_id_t vlan_id); - sai_thrift_result_t sai_thrift_get_vlan_id(1: sai_thrift_object_id_t vlan_id); - - //virtual router API - sai_thrift_object_id_t sai_thrift_create_virtual_router(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_virtual_router(1: sai_thrift_object_id_t vr_id); - - //route API - sai_thrift_status_t sai_thrift_create_route(1: sai_thrift_route_entry_t thrift_route_entry, 2: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_route(1: sai_thrift_route_entry_t thrift_route_entry); - - //router interface API - sai_thrift_object_id_t sai_thrift_create_router_interface(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_router_interface(1: sai_thrift_object_id_t rif_id); - sai_thrift_status_t sai_thrift_set_router_interface_attribute(1: sai_thrift_object_id_t rif_id, 2: sai_thrift_attribute_t thrift_attr); - - //next hop API - sai_thrift_object_id_t sai_thrift_create_next_hop(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_next_hop(1: sai_thrift_object_id_t next_hop_id); - - // Next Hop Group API. - sai_thrift_object_id_t sai_thrift_create_next_hop_group(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_next_hop_group(1: sai_thrift_object_id_t nhop_group_oid); - sai_thrift_object_id_t sai_thrift_create_next_hop_group_member(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_next_hop_group_member(1: sai_thrift_object_id_t nhop_group_member_oid); - - //lag API - sai_thrift_object_id_t sai_thrift_create_lag(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_lag(1: sai_thrift_object_id_t lag_id); - sai_thrift_object_id_t sai_thrift_create_lag_member(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_lag_member(1: sai_thrift_object_id_t lag_member_id); - - //stp API - sai_thrift_object_id_t sai_thrift_create_stp_entry(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_stp_entry(1: sai_thrift_object_id_t stp_id); - sai_thrift_status_t sai_thrift_set_stp_port_state(1: sai_thrift_object_id_t stp_id, 2: sai_thrift_object_id_t port_id, 3: sai_thrift_port_stp_port_state_t stp_port_state); - sai_thrift_port_stp_port_state_t sai_thrift_get_stp_port_state(1: sai_thrift_object_id_t stp_id, 2: sai_thrift_object_id_t port_id); - - //neighbor API - sai_thrift_status_t sai_thrift_create_neighbor_entry(1: sai_thrift_neighbor_entry_t thrift_neighbor_entry, 2: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_neighbor_entry(1: sai_thrift_neighbor_entry_t thrift_neighbor_entry); - - //switch API - sai_thrift_object_id_t sai_thrift_create_switch(1: list thrift_attr_list); - sai_thrift_attribute_list_t sai_thrift_get_switch_attribute(1: list thrift_attr_list); - sai_thrift_attribute_t sai_thrift_get_port_list_by_front_port(); - sai_thrift_object_id_t sai_thrift_get_cpu_port_id(); - sai_thrift_object_id_t sai_thrift_get_default_trap_group(); - sai_thrift_object_id_t sai_thrift_get_default_router_id(); - sai_thrift_result_t sai_thrift_get_default_vlan_id(); - sai_thrift_object_id_t sai_thrift_get_port_id_by_front_port(1: string port_name); - sai_thrift_status_t sai_thrift_set_switch_attribute(1: sai_thrift_attribute_t attribute); - - //Trap API - sai_thrift_object_id_t sai_thrift_create_hostif(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_hostif(1: sai_thrift_object_id_t hif_id); - sai_thrift_object_id_t sai_thrift_create_hostif_trap_group(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_hostif_trap_group(1: sai_thrift_object_id_t trap_group_id); - sai_thrift_status_t sai_thrift_create_hostif_trap(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_hostif_trap(1: sai_thrift_hostif_trap_id_t trap_id); - sai_thrift_status_t sai_thrift_set_hostif_trap(1: sai_thrift_object_id_t trap_id, 2: sai_thrift_attribute_t thrift_attr); - sai_thrift_status_t sai_thrift_set_hostif_trap_group(1: sai_thrift_object_id_t trap_group_id, 2: sai_thrift_attribute_t thrift_attr); - - // ACL API - sai_thrift_object_id_t sai_thrift_create_acl_table(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_acl_table(1: sai_thrift_object_id_t acl_table_id); - - sai_thrift_object_id_t sai_thrift_create_acl_entry(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_acl_entry(1: sai_thrift_object_id_t acl_entry); - - sai_thrift_object_id_t sai_thrift_create_acl_table_group(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_acl_table_group(1: sai_thrift_object_id_t acl_table_group_id); - - sai_thrift_object_id_t sai_thrift_create_acl_table_group_member(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_acl_table_group_member(1: sai_thrift_object_id_t acl_table_group_member_id); - - sai_thrift_object_id_t sai_thrift_create_acl_counter(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_acl_counter(1: sai_thrift_object_id_t acl_counter_id); - list sai_thrift_get_acl_counter_attribute( - 1: sai_thrift_object_id_t acl_counter_id, - 2: list thrift_attr_ids); - - // Mirror API - sai_thrift_object_id_t sai_thrift_create_mirror_session(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_mirror_session(1: sai_thrift_object_id_t session_id); - - // Policer API - sai_thrift_object_id_t sai_thrift_create_policer(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_policer(1: sai_thrift_object_id_t policer_id); - list sai_thrift_get_policer_stats( - 1: sai_thrift_object_id_t policer_id, - 2: list counter_ids); - - // Scheduler API - sai_thrift_object_id_t sai_thrift_create_scheduler_profile(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_scheduler_profile(1: sai_thrift_object_id_t scheduler_id); - - // Queue API - list sai_thrift_get_queue_stats( - 1: sai_thrift_object_id_t queue_id, - 2: list counter_ids, - 3: i32 number_of_counters); - sai_thrift_status_t sai_thrift_clear_queue_stats( - 1: sai_thrift_object_id_t queue_id, - 2: list counter_ids, - 3: i32 number_of_counters); - sai_thrift_status_t sai_thrift_set_queue_attribute(1: sai_thrift_object_id_t queue_id, - 2: sai_thrift_attribute_t thrift_attr) - - // Buffer API - sai_thrift_object_id_t sai_thrift_create_buffer_profile(1: list thrift_attr_list); - sai_thrift_object_id_t sai_thrift_create_pool_profile(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_set_priority_group_attribute(1: sai_thrift_object_id_t pg_id, - 2: sai_thrift_attribute_t thrift_attr) - list sai_thrift_get_pg_stats( - 1: sai_thrift_object_id_t pg_id, - 2: list counter_ids, - 3: i32 number_of_counters); - - // WRED API - sai_thrift_object_id_t sai_thrift_create_wred_profile(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_wred_profile(1: sai_thrift_object_id_t wred_id); - - // QoS Map API - sai_thrift_object_id_t sai_thrift_create_qos_map(1: list thrift_attr_list); - sai_thrift_status_t sai_thrift_remove_qos_map(1: sai_thrift_object_id_t qos_map_id); -} diff --git a/bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.cpp b/bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.cpp deleted file mode 100644 index 12da301a5..000000000 --- a/bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.cpp +++ /dev/null @@ -1,2848 +0,0 @@ -/* -Copyright 2013-present Barefoot Networks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This autogenerated skeleton file illustrates how to build a server. -// You should copy it to another filename to avoid overwriting it. - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include "switch_sai_rpc.h" -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "arpa/inet.h" - -#define SAI_THRIFT_LOG_DBG(msg, ...) sai_thrift_timestamp_print(); \ - printf("SAI THRIFT DEBUG: %s(): " msg "\n", __FUNCTION__, ##__VA_ARGS__); - -#define SAI_THRIFT_LOG_ERR(msg, ...) sai_thrift_timestamp_print(); \ - printf("SAI THRIFT ERROR: %s(): " msg "\n", __FUNCTION__, ##__VA_ARGS__); - -#define SAI_THRIFT_FUNC_LOG() SAI_THRIFT_LOG_DBG("Called.") - -using namespace ::apache::thrift; -using namespace ::apache::thrift::protocol; -using namespace ::apache::thrift::transport; -using namespace ::apache::thrift::server; - -using boost::shared_ptr; - -using namespace ::switch_sai; - -extern sai_object_id_t gSwitchId; - -typedef std::vector std_sai_thrift_attr_vctr_t; - -class switch_sai_rpcHandler : virtual public switch_sai_rpcIf { -public: - switch_sai_rpcHandler() noexcept - { - // Your initialization goes here - } - - inline void sai_thrift_timestamp_print() const noexcept - { - const auto ltime = std::time(nullptr); - const auto tm = std::localtime(<ime); - - std::printf("%02d:%02d:%02d ", tm->tm_hour, tm->tm_min, tm->tm_sec); - } - - unsigned int sai_thrift_string_to_mac(const std::string s, unsigned char *m) { - unsigned int i, j=0; - memset(m, 0, 6); - for(i=0;i= '0' && let <= '9') { - m[j/2] = (m[j/2] << 4) + (let - '0'); j++; - } else if (let >= 'a' && let <= 'f') { - m[j/2] = (m[j/2] << 4) + (let - 'a'+10); j++; - } else if (let >= 'A' && let <= 'F') { - m[j/2] = (m[j/2] << 4) + (let - 'A'+10); j++; - } - } - return (j == 12); - } - - void sai_thrift_string_to_v4_ip(const std::string s, unsigned int *m) { - unsigned char r=0; - unsigned int i; - *m = 0; - for(i=0;i= '0' && let <= '9') { - r = (r * 10) + (let - '0'); - } else { - *m = (*m << 8) | r; - r=0; - } - } - *m = (*m << 8) | (r & 0xFF); - *m = htonl(*m); - return; - } - - void sai_thrift_string_to_v6_ip(const std::string s, unsigned char *v6_ip) { - const char *v6_str = s.c_str(); - inet_pton(AF_INET6, v6_str, v6_ip); - return; - } - - inline void sai_thrift_alloc_attr(sai_attribute_t* &attr, const sai_uint32_t &size) const noexcept - { attr = new (std::nothrow) sai_attribute_t[size]; } - - inline void sai_thrift_free_attr(sai_attribute_t* &attr) const noexcept - { delete[] attr; attr = nullptr; } - - void sai_thrift_parse_object_id_list(const std::vector & thrift_object_id_list, sai_object_id_t *object_id_list) { - std::vector::const_iterator it = thrift_object_id_list.begin(); - for(uint32_t i = 0; i < thrift_object_id_list.size(); i++, it++) { - object_id_list[i] = (sai_object_id_t)*it; - } - } - - void sai_thrift_parse_ip_address(const sai_thrift_ip_address_t &thrift_ip_address, sai_ip_address_t *ip_address) { - ip_address->addr_family = (sai_ip_addr_family_t) thrift_ip_address.addr_family; - if ((sai_ip_addr_family_t)thrift_ip_address.addr_family == SAI_IP_ADDR_FAMILY_IPV4) { - sai_thrift_string_to_v4_ip(thrift_ip_address.addr.ip4, &ip_address->addr.ip4); - } else { - sai_thrift_string_to_v6_ip(thrift_ip_address.addr.ip6, ip_address->addr.ip6); - } - } - - void sai_thrift_parse_ip_prefix(const sai_thrift_ip_prefix_t &thrift_ip_prefix, sai_ip_prefix_t *ip_prefix) { - ip_prefix->addr_family = (sai_ip_addr_family_t) thrift_ip_prefix.addr_family; - if ((sai_ip_addr_family_t)thrift_ip_prefix.addr_family == SAI_IP_ADDR_FAMILY_IPV4) { - sai_thrift_string_to_v4_ip(thrift_ip_prefix.addr.ip4, &ip_prefix->addr.ip4); - sai_thrift_string_to_v4_ip(thrift_ip_prefix.mask.ip4, &ip_prefix->mask.ip4); - } else { - sai_thrift_string_to_v6_ip(thrift_ip_prefix.addr.ip6, ip_prefix->addr.ip6); - sai_thrift_string_to_v6_ip(thrift_ip_prefix.mask.ip6, ip_prefix->mask.ip6); - } - } - - void sai_thrift_parse_attribute_ids(const std::vector &thrift_attr_id_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_id_list.begin(); - for(uint32_t i = 0; i < thrift_attr_id_list.size(); i++, it++) { - attr_list[i].id = (int32_t) *it; - } - } - - void sai_thrift_parse_fdb_entry(const sai_thrift_fdb_entry_t &thrift_fdb_entry, sai_fdb_entry_t *fdb_entry) { - fdb_entry->vlan_id = (sai_vlan_id_t) thrift_fdb_entry.vlan_id; - sai_thrift_string_to_mac(thrift_fdb_entry.mac_address, fdb_entry->mac_address); - } - - void sai_thrift_parse_route_entry(const sai_thrift_route_entry_t &thrift_route_entry, sai_route_entry_t *route_entry) { - route_entry->switch_id = gSwitchId; - route_entry->vr_id = (sai_object_id_t) thrift_route_entry.vr_id; - sai_thrift_parse_ip_prefix(thrift_route_entry.destination, &route_entry->destination); - } - - void sai_thrift_parse_neighbor_entry(const sai_thrift_neighbor_entry_t &thrift_neighbor_entry, sai_neighbor_entry_t *neighbor_entry) { - neighbor_entry->switch_id = gSwitchId; - neighbor_entry->rif_id = (sai_object_id_t) thrift_neighbor_entry.rif_id; - sai_thrift_parse_ip_address(thrift_neighbor_entry.ip_address, &neighbor_entry->ip_address); - } - - void sai_thrift_parse_port_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list, sai_object_id_t **buffer_profile_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_PORT_ATTR_ADMIN_STATE: - case SAI_PORT_ATTR_UPDATE_DSCP: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_PORT_ATTR_PORT_VLAN_ID: - attr_list[i].value.u16 = attribute.value.u16; - break; - case SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL: - case SAI_PORT_ATTR_QOS_DEFAULT_TC: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_PORT_ATTR_QOS_INGRESS_BUFFER_PROFILE_LIST: - case SAI_PORT_ATTR_QOS_EGRESS_BUFFER_PROFILE_LIST: - { - *buffer_profile_list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * attribute.value.objlist.count); - std::vector::const_iterator it2 = attribute.value.objlist.object_id_list.begin(); - for (uint32_t j = 0; j < attribute.value.objlist.object_id_list.size(); j++, *it2++) { - *buffer_profile_list[j] = (sai_object_id_t) *it2; - } - attr_list[i].value.objlist.count = attribute.value.objlist.count; - attr_list[i].value.objlist.list = *buffer_profile_list; - break; - } - case SAI_PORT_ATTR_INGRESS_MIRROR_SESSION: - case SAI_PORT_ATTR_EGRESS_MIRROR_SESSION: - { - *buffer_profile_list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * attribute.value.objlist.count); - std::vector::const_iterator it2 = attribute.value.objlist.object_id_list.begin(); - for (uint32_t j = 0; j < attribute.value.objlist.object_id_list.size(); j++, *it2++) { - *buffer_profile_list[j] = (sai_object_id_t) *it2; - } - attr_list[i].value.objlist.count = attribute.value.objlist.count; - attr_list[i].value.objlist.list=*buffer_profile_list; - break; - } - case SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID: - case SAI_PORT_ATTR_QOS_WRED_PROFILE_ID: - case SAI_PORT_ATTR_QOS_DOT1P_TO_TC_MAP: - case SAI_PORT_ATTR_QOS_DOT1P_TO_COLOR_MAP: - case SAI_PORT_ATTR_QOS_DSCP_TO_TC_MAP: - case SAI_PORT_ATTR_QOS_DSCP_TO_COLOR_MAP: - case SAI_PORT_ATTR_QOS_TC_TO_QUEUE_MAP: - case SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP: - case SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP: - case SAI_PORT_ATTR_QOS_TC_TO_PRIORITY_GROUP_MAP: - case SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_PRIORITY_GROUP_MAP: - case SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_QUEUE_MAP: - case SAI_PORT_ATTR_INGRESS_ACL: - attr_list[i].value.oid = attribute.value.oid; - break; - - default: - break; - } - } - } - - void sai_thrift_parse_fdb_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_FDB_ENTRY_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_FDB_ENTRY_ATTR_PACKET_ACTION: - attr_list[i].value.s32 = attribute.value.s32; - break; - default: - break; - } - } - } - - void sai_thrift_parse_fdb_flush_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID: - attr_list[i].value.oid = (sai_object_id_t) attribute.value.oid; - break; - case SAI_FDB_FLUSH_ATTR_VLAN_ID: - attr_list[i].value.u16 = attribute.value.u16; - break; - case SAI_FDB_FLUSH_ATTR_ENTRY_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - } - } - } - - void sai_thrift_parse_vr_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE: - case SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_VIRTUAL_ROUTER_ATTR_SRC_MAC_ADDRESS: - sai_thrift_string_to_mac(attribute.value.mac, attr_list[i].value.mac); - break; - } - } - } - - void sai_thrift_parse_route_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION: - attr_list[i].value.s32 = attribute.value.s32; - break; - default: - break; - } - } - } - - void sai_thrift_parse_router_interface_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID: - case SAI_ROUTER_INTERFACE_ATTR_PORT_ID: - case SAI_ROUTER_INTERFACE_ATTR_VLAN_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_ROUTER_INTERFACE_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS: - sai_thrift_string_to_mac(attribute.value.mac, attr_list[i].value.mac); - break; - case SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE: - case SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_ROUTER_INTERFACE_ATTR_INGRESS_ACL: - attr_list[i].value.oid = attribute.value.oid; - default: - break; - } - } - } - - void sai_thrift_parse_next_hop_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_NEXT_HOP_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_NEXT_HOP_ATTR_IP: - sai_thrift_parse_ip_address(attribute.value.ipaddr, &attr_list[i].value.ipaddr); - break; - case SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - } - } - } - - void sai_thrift_parse_lag_member_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it1 = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it1++) { - attribute = (sai_thrift_attribute_t)*it1; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_LAG_MEMBER_ATTR_LAG_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_LAG_MEMBER_ATTR_PORT_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_LAG_MEMBER_ATTR_EGRESS_DISABLE: - break; - case SAI_LAG_MEMBER_ATTR_INGRESS_DISABLE: - break; - } - } - } - - void sai_thrift_parse_stp_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list, sai_vlan_id_t **vlan_list) { - std::vector::const_iterator it1 = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it1++) { - attribute = (sai_thrift_attribute_t)*it1; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_STP_ATTR_VLAN_LIST: - *vlan_list = (sai_vlan_id_t *) malloc(sizeof(sai_vlan_id_t) * attribute.value.vlanlist.vlan_count); - std::vector::const_iterator it2 = attribute.value.vlanlist.vlan_list.begin(); - for (uint32_t j = 0; j < attribute.value.vlanlist.vlan_list.size(); j++, *it2++) { - *vlan_list[j] = (sai_vlan_id_t) *it2; - } - attr_list[i].value.vlanlist.count = attribute.value.vlanlist.vlan_count; - attr_list[i].value.vlanlist.list = *vlan_list; - break; - } - } - } - - void sai_thrift_parse_neighbor_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it1 = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it1++) { - attribute = (sai_thrift_attribute_t)*it1; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS: - sai_thrift_string_to_mac(attribute.value.mac, attr_list[i].value.mac); - break; - } - } - } - - void sai_thrift_parse_hostif_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it1 = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it1++) { - attribute = (sai_thrift_attribute_t)*it1; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_HOSTIF_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_HOSTIF_ATTR_OBJ_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_HOSTIF_ATTR_NAME: - memcpy(attr_list[i].value.chardata, attribute.value.chardata.c_str(), HOSTIF_NAME_SIZE); - break; - } - } - } - - void sai_thrift_parse_hostif_trap_group_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it1 = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it1++) { - attribute = (sai_thrift_attribute_t)*it1; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER: - attr_list[i].value.oid = attribute.value.oid; - break; - } - } - } - - void sai_thrift_parse_hostif_trap_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it1 = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it1++) { - attribute = (sai_thrift_attribute_t)*it1; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP: - attr_list[i].value.oid = attribute.value.oid; - break; - default: - break; - } - } - } - - void sai_thrift_parse_hostif_trap_attribute(const sai_thrift_attribute_t &thrift_attr, sai_attribute_t *attr) { - attr->id = thrift_attr.id; - switch (thrift_attr.id) { - case SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION: - attr->value.s32 = thrift_attr.value.s32; - break; - case SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY: - attr->value.u32 = thrift_attr.value.u32; - break; - case SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP: - attr->value.oid = thrift_attr.value.oid; - break; - default: - break; - } - } - - sai_thrift_status_t sai_thrift_set_port_attribute(const sai_thrift_object_id_t port_id, const sai_thrift_attribute_t &thrift_attr) { - printf("sai_thrift_set_port\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_port_api_t *port_api; - status = sai_api_query(SAI_API_PORT, (void **) &port_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_object_id_t *buffer_profile_list = NULL; - std::vector thrift_attr_list; - thrift_attr_list.push_back(thrift_attr); - sai_attribute_t attr; - sai_thrift_parse_port_attributes(thrift_attr_list, &attr, &buffer_profile_list); - status = port_api->set_port_attribute((sai_object_id_t)port_id, &attr); - if (status != SAI_STATUS_SUCCESS) { - SAI_THRIFT_LOG_ERR("Failed to set port attributes."); - } - if (buffer_profile_list) free(buffer_profile_list); - return status; - } - - sai_thrift_status_t sai_thrift_set_router_interface_attribute(const sai_thrift_object_id_t rif_id, const sai_thrift_attribute_t &thrift_attr) { - printf("sai_thrift_set_router_interface\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_router_interface_api_t *rif_api; - status = sai_api_query(SAI_API_ROUTER_INTERFACE, (void **) &rif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - std::vector thrift_attr_list; - thrift_attr_list.push_back(thrift_attr); - sai_attribute_t attr; - sai_thrift_parse_router_interface_attributes(thrift_attr_list, &attr); - status = rif_api->set_router_interface_attribute((sai_object_id_t)rif_id, &attr); - if (status != SAI_STATUS_SUCCESS) { - SAI_THRIFT_LOG_ERR("Failed to set router interface attributes."); - } - return status; - } - - sai_thrift_status_t sai_thrift_create_fdb_entry(const sai_thrift_fdb_entry_t& thrift_fdb_entry, const std::vector & thrift_attr_list) { - printf("sai_thrift_create_fdb_entry\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_fdb_api_t *fdb_api; - sai_fdb_entry_t fdb_entry; - status = sai_api_query(SAI_API_FDB, (void **) &fdb_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_fdb_entry(thrift_fdb_entry, &fdb_entry); - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_fdb_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = fdb_api->create_fdb_entry(&fdb_entry, attr_count, attr_list); - free(attr_list); - return status; - } - - sai_thrift_status_t sai_thrift_delete_fdb_entry(const sai_thrift_fdb_entry_t& thrift_fdb_entry) { - printf("sai_thrift_delete_fdb_entry\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_fdb_api_t *fdb_api; - sai_fdb_entry_t fdb_entry; - status = sai_api_query(SAI_API_FDB, (void **) &fdb_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_fdb_entry(thrift_fdb_entry, &fdb_entry); - status = fdb_api->remove_fdb_entry(&fdb_entry); - return status; - } - - sai_thrift_status_t sai_thrift_flush_fdb_entries(const std::vector & thrift_attr_list) { - printf("sai_thrift_flush_fdb_entries\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_fdb_api_t *fdb_api; - status = sai_api_query(SAI_API_FDB, (void **) &fdb_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_fdb_flush_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = fdb_api->flush_fdb_entries(gSwitchId, attr_count, attr_list); - free(attr_list); - return status; - } - - void sai_thrift_parse_vlan_attributes(const std_sai_thrift_attr_vctr_t &thrift_attr_list, sai_attribute_t *attr_list) { - SAI_THRIFT_LOG_DBG("Called."); - - std_sai_thrift_attr_vctr_t::const_iterator cit = thrift_attr_list.begin(); - - for (sai_uint32_t i = 0; i < thrift_attr_list.size(); i++, cit++) - { - sai_thrift_attribute_t attribute = *cit; - attr_list[i].id = attribute.id; - - switch (attribute.id) - { - case SAI_VLAN_ATTR_VLAN_ID: - attr_list[i].value.u16 = attribute.value.u16; - break; - - default: - SAI_THRIFT_LOG_ERR("Failed to parse VLAN attributes."); - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_vlan(const std_sai_thrift_attr_vctr_t &thrift_attr_list) { - SAI_THRIFT_LOG_DBG("Called."); - - sai_vlan_api_t *vlan_api = nullptr; - auto status = sai_api_query(SAI_API_VLAN, reinterpret_cast(&vlan_api)); - - if (status != SAI_STATUS_SUCCESS) - { SAI_THRIFT_LOG_ERR("Failed to get VLAN API."); return SAI_NULL_OBJECT_ID; } - - sai_attribute_t *attr_list = nullptr; - sai_uint32_t attr_size = thrift_attr_list.size(); - sai_thrift_alloc_attr(attr_list, attr_size); - sai_thrift_parse_vlan_attributes(thrift_attr_list, attr_list); - - sai_object_id_t vlanObjId = 0; - status = vlan_api->create_vlan(&vlanObjId, gSwitchId, attr_size, attr_list); - sai_thrift_free_attr(attr_list); - - if (status == SAI_STATUS_SUCCESS) { return vlanObjId; } - - SAI_THRIFT_LOG_ERR("Failed to create VLAN."); - - return SAI_NULL_OBJECT_ID; - } - - sai_thrift_status_t sai_thrift_remove_vlan(const sai_thrift_object_id_t vlan_oid) { - printf("sai_thrift_delete_vlan\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - status = sai_api_query(SAI_API_VLAN, (void **) &vlan_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = vlan_api->remove_vlan(vlan_oid); - return status; - } - - void sai_thrift_get_vlan_stats(std::vector &thrift_counters, - const sai_thrift_vlan_id_t vlan_id, - const std::vector &thrift_counter_ids, - const int32_t number_of_counters) - { - printf("sai_thrift_get_vlan_stats\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - status = sai_api_query(SAI_API_VLAN, (void **) &vlan_api); - - if (status != SAI_STATUS_SUCCESS) { return; } - - sai_vlan_stat_t *counter_ids = (sai_vlan_stat_t *) malloc(sizeof(sai_vlan_stat_t) * thrift_counter_ids.size()); - std::vector::const_iterator it = thrift_counter_ids.begin(); - uint64_t *counters = (uint64_t *) malloc(sizeof(uint64_t) * thrift_counter_ids.size()); - - for(uint32_t i = 0; i < thrift_counter_ids.size(); i++, it++) - { counter_ids[i] = (sai_vlan_stat_t) *it; } - - status = vlan_api->get_vlan_stats((sai_vlan_id_t) vlan_id, - counter_ids, - number_of_counters, - counters); - - for (uint32_t i = 0; i < thrift_counter_ids.size(); i++) { thrift_counters.push_back(counters[i]); } - - free(counter_ids); - free(counters); - - return; - } - - void sai_thrift_get_vlan_attribute(sai_thrift_attribute_list_t& thrift_attr_list, const sai_thrift_object_id_t vlan_id) { - printf("sai_thrift_get_vlan_attribute\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - sai_attribute_t vlan_member_list_object_attribute; - sai_thrift_attribute_t thrift_vlan_member_list_attribute; - sai_object_list_t *vlan_member_list_object; - status = sai_api_query(SAI_API_VLAN, (void **) &vlan_api); - if (status != SAI_STATUS_SUCCESS) { - return; - } - - vlan_member_list_object_attribute.id = SAI_VLAN_ATTR_MEMBER_LIST; - vlan_member_list_object_attribute.value.objlist.list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * 128); - vlan_member_list_object_attribute.value.objlist.count = 128; - vlan_api->get_vlan_attribute(vlan_id, 1, &vlan_member_list_object_attribute); - - thrift_attr_list.attr_count = 1; - std::vector& attr_list = thrift_attr_list.attr_list; - thrift_vlan_member_list_attribute.id = SAI_VLAN_ATTR_MEMBER_LIST; - thrift_vlan_member_list_attribute.value.objlist.count = vlan_member_list_object_attribute.value.objlist.count; - std::vector& vlan_member_list = thrift_vlan_member_list_attribute.value.objlist.object_id_list; - vlan_member_list_object = &vlan_member_list_object_attribute.value.objlist; - for (int index = 0; index < vlan_member_list_object_attribute.value.objlist.count; index++) { - vlan_member_list.push_back((sai_thrift_object_id_t) vlan_member_list_object->list[index]); - } - attr_list.push_back(thrift_vlan_member_list_attribute); - free(vlan_member_list_object_attribute.value.objlist.list); - } - - sai_thrift_object_id_t sai_thrift_create_vlan_member(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_vlan_member\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - sai_object_id_t vlan_member_id = 0; - status = sai_api_query(SAI_API_VLAN, (void **) &vlan_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_vlan_member_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - vlan_api->create_vlan_member(&vlan_member_id, gSwitchId, attr_count, attr_list); - return vlan_member_id; - } - - void sai_thrift_parse_vlan_member_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_VLAN_MEMBER_ATTR_VLAN_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE: - attr_list[i].value.s32 = attribute.value.s32; - break; - } - } - } - - sai_thrift_status_t sai_thrift_remove_vlan_member(const sai_thrift_object_id_t vlan_member_id) { - printf("sai_thrift_remove_vlan_member\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_vlan_api_t *vlan_api; - status = sai_api_query(SAI_API_VLAN, (void **) &vlan_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = vlan_api->remove_vlan_member((sai_object_id_t) vlan_member_id); - return status; - } - - void sai_thrift_get_vlan_id(sai_thrift_result_t &ret, sai_thrift_object_id_t vlan_id) - { - sai_attribute_t vlan_attr; - sai_vlan_api_t *vlan_api; - - SAI_THRIFT_FUNC_LOG(); - - ret.status = sai_api_query(SAI_API_VLAN, (void **) &vlan_api); - if (ret.status != SAI_STATUS_SUCCESS) { - SAI_THRIFT_LOG_ERR("failed to obtain vlan_api, status:%d", ret.status); - return; - } - - vlan_attr.id = SAI_VLAN_ATTR_VLAN_ID; - ret.status = vlan_api->get_vlan_attribute((sai_object_id_t)vlan_id, 1, &vlan_attr); - if (ret.status != SAI_STATUS_SUCCESS) { - SAI_THRIFT_LOG_ERR("failed to get vlan ID, status:%d", ret.status); - return; - } - - ret.data.u16 = vlan_attr.value.u16; - } - - sai_thrift_object_id_t sai_thrift_create_virtual_router(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_virtual_router\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_virtual_router_api_t *vr_api; - sai_object_id_t vr_id = 0; - status = sai_api_query(SAI_API_VIRTUAL_ROUTER, (void **) &vr_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_vr_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - vr_api->create_virtual_router(&vr_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return vr_id; - } - - sai_thrift_status_t sai_thrift_remove_virtual_router(const sai_thrift_object_id_t vr_id) { - printf("sai_thrift_remove_virtual_router\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_virtual_router_api_t *vr_api; - status = sai_api_query(SAI_API_VIRTUAL_ROUTER, (void **) &vr_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = vr_api->remove_virtual_router((sai_object_id_t)vr_id); - return status; - } - - sai_thrift_status_t sai_thrift_create_route(const sai_thrift_route_entry_t &thrift_route_entry, const std::vector & thrift_attr_list) - { - printf("sai_thrift_create_route\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_route_api_t *route_api; - sai_route_entry_t route_entry; - status = sai_api_query(SAI_API_ROUTE, (void **) &route_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_route_entry(thrift_route_entry, &route_entry); - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_route_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = route_api->create_route_entry(&route_entry, attr_count, attr_list); - free(attr_list); - SAI_THRIFT_LOG_DBG("Exit."); - return status; - } - - sai_thrift_status_t sai_thrift_remove_route(const sai_thrift_route_entry_t &thrift_route_entry) { - printf("sai_thrift_remove_route\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_route_api_t *route_api; - sai_route_entry_t route_entry; - status = sai_api_query(SAI_API_ROUTE, (void **) &route_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_route_entry(thrift_route_entry, &route_entry); - status = route_api->remove_route_entry(&route_entry); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_router_interface(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_router_interface\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_router_interface_api_t *rif_api; - sai_object_id_t rif_id = 0; - status = sai_api_query(SAI_API_ROUTER_INTERFACE, (void **) &rif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_router_interface_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = rif_api->create_router_interface(&rif_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return rif_id; - } - - sai_thrift_status_t sai_thrift_remove_router_interface(const sai_thrift_object_id_t rif_id) { - printf("sai_thrift_remove_router_interface\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_router_interface_api_t *rif_api; - status = sai_api_query(SAI_API_ROUTER_INTERFACE, (void **) &rif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = rif_api->remove_router_interface((sai_object_id_t)rif_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_next_hop(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_next_hop\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_next_hop_api_t *nhop_api; - sai_object_id_t nhop_id = 0; - status = sai_api_query(SAI_API_NEXT_HOP, (void **) &nhop_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_next_hop_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = nhop_api->create_next_hop(&nhop_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return nhop_id; - } - - sai_thrift_status_t sai_thrift_remove_next_hop(const sai_thrift_object_id_t next_hop_id) { - printf("sai_thrift_remove_next_hop\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_next_hop_api_t *nhop_api; - status = sai_api_query(SAI_API_NEXT_HOP, (void **) &nhop_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = nhop_api->remove_next_hop((sai_object_id_t)next_hop_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_lag(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_lag\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - sai_object_id_t lag_id = 0; - - status = sai_api_query(SAI_API_LAG, (void **) &lag_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - - status = lag_api->create_lag(&lag_id, gSwitchId, 0, nullptr); - return lag_id; - } - - sai_thrift_status_t sai_thrift_remove_lag(const sai_thrift_object_id_t lag_id) { - printf("sai_thrift_remove_lag\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - status = sai_api_query(SAI_API_LAG, (void **) &lag_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = lag_api->remove_lag((sai_object_id_t)lag_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_lag_member(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_lag_member\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - sai_object_id_t lag_member_id; - status = sai_api_query(SAI_API_LAG, (void **) &lag_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_lag_member_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = lag_api->create_lag_member(&lag_member_id, gSwitchId, attr_count, attr_list); - return lag_member_id; - } - - sai_thrift_status_t sai_thrift_remove_lag_member(const sai_thrift_object_id_t lag_member_id) { - printf("sai_thrift_remove_lag_member\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_lag_api_t *lag_api; - status = sai_api_query(SAI_API_LAG, (void **) &lag_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = lag_api->remove_lag_member(lag_member_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_stp_entry(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_stp\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_stp_api_t *stp_api; - sai_vlan_id_t *vlan_list; - sai_object_id_t stp_id; - status = sai_api_query(SAI_API_STP, (void **) &stp_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_stp_attributes(thrift_attr_list, attr_list, &vlan_list); - uint32_t attr_count = thrift_attr_list.size(); - status = (sai_object_id_t) stp_api->create_stp(&stp_id, gSwitchId, attr_count, attr_list); - if (vlan_list) free(vlan_list); - free(attr_list); - return stp_id; - } - - sai_thrift_status_t sai_thrift_remove_stp_entry(const sai_thrift_object_id_t stp_id) { - printf("sai_thrift_remove_stp\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_stp_api_t *stp_api; - status = sai_api_query(SAI_API_STP, (void **) &stp_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = (sai_thrift_status_t) stp_api->remove_stp(stp_id); - return status; - } - - sai_thrift_status_t sai_thrift_set_stp_port_state(const sai_thrift_object_id_t stp_id, const sai_thrift_object_id_t port_id, const sai_thrift_port_stp_port_state_t stp_port_state) { - printf("sai_thrift_set_stp_port_state\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_stp_api_t *stp_api; - status = sai_api_query(SAI_API_STP, (void **) &stp_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t attr[1]; - std::memset(attr, '\0', sizeof(attr)); - attr[0].id = SAI_STP_PORT_ATTR_STATE; - attr[0].value.s32 = stp_port_state; - status = stp_api->set_stp_port_attribute(port_id, attr); - return status; - } - - sai_thrift_port_stp_port_state_t sai_thrift_get_stp_port_state(const sai_thrift_object_id_t stp_id, const sai_thrift_object_id_t port_id) { - printf("sai_thrift_get_stp_port_state\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_stp_api_t *stp_api; - status = sai_api_query(SAI_API_STP, (void **) &stp_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t attr[1]; - std::memset(attr, '\0', sizeof(attr)); - attr[0].id = SAI_STP_PORT_ATTR_STATE; - status = stp_api->get_stp_port_attribute(port_id, 1, attr); - return (sai_thrift_port_stp_port_state_t) attr[0].value.s32; - } - - sai_thrift_status_t sai_thrift_create_neighbor_entry(const sai_thrift_neighbor_entry_t& thrift_neighbor_entry, const std::vector & thrift_attr_list) { - printf("sai_thrift_create_neighbor_entry\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_neighbor_api_t *neighbor_api; - status = sai_api_query(SAI_API_NEIGHBOR, (void **) &neighbor_api); - sai_neighbor_entry_t neighbor_entry; - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_neighbor_entry(thrift_neighbor_entry, &neighbor_entry); - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_neighbor_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = neighbor_api->create_neighbor_entry(&neighbor_entry, attr_count, attr_list); - free(attr_list); - return status; - } - - sai_thrift_status_t sai_thrift_remove_neighbor_entry(const sai_thrift_neighbor_entry_t& thrift_neighbor_entry) { - printf("sai_thrift_remove_neighbor_entry\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_neighbor_api_t *neighbor_api; - sai_neighbor_entry_t neighbor_entry; - status = sai_api_query(SAI_API_NEIGHBOR, (void **) &neighbor_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_neighbor_entry(thrift_neighbor_entry, &neighbor_entry); - status = neighbor_api->remove_neighbor_entry(&neighbor_entry); - return status; - } - - sai_thrift_object_id_t sai_thrift_get_cpu_port_id() { - sai_status_t status; - sai_attribute_t attr; - sai_switch_api_t *switch_api; - sai_thrift_object_id_t cpu_port_id; - const char* f_name = __FUNCTION__; - printf("%s\n", f_name); - status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (status != SAI_STATUS_SUCCESS) { - printf("%s failed to obtain switch_api, status:%d\n", f_name, status); - return SAI_NULL_OBJECT_ID; - } - attr.id = SAI_SWITCH_ATTR_CPU_PORT; - status = switch_api->get_switch_attribute(gSwitchId, 1, &attr); - if (status != SAI_STATUS_SUCCESS) - { - printf("%s failed, status:%d\n", f_name, status); - return SAI_NULL_OBJECT_ID; - } - cpu_port_id = (sai_thrift_object_id_t) attr.value.oid; - return cpu_port_id; - } - - sai_thrift_object_id_t sai_thrift_get_default_router_id() { - sai_status_t status; - sai_attribute_t attr; - sai_switch_api_t *switch_api; - sai_thrift_object_id_t default_router_id; - const char* f_name = __FUNCTION__; - printf("%s\n", f_name); - status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (status != SAI_STATUS_SUCCESS) { - printf("%s failed to obtain switch_api, status:%d\n", f_name, status); - return SAI_NULL_OBJECT_ID; - } - attr.id = SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID; - status = switch_api->get_switch_attribute(gSwitchId, 1, &attr); - if (status != SAI_STATUS_SUCCESS) - { - printf("%s. Failed to get switch virtual router ID, status %d", f_name, status); - return SAI_NULL_OBJECT_ID; - } - default_router_id = (sai_thrift_object_id_t)attr.value.oid; - return default_router_id; - } - - void sai_thrift_get_default_vlan_id(sai_thrift_result_t &ret) { - sai_switch_api_t *switch_api; - sai_attribute_t attr; - - SAI_THRIFT_FUNC_LOG(); - - ret.status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (ret.status != SAI_STATUS_SUCCESS) { - SAI_THRIFT_LOG_ERR("failed to obtain switch_api, status:%d", ret.status); - return; - } - - attr.id = SAI_SWITCH_ATTR_DEFAULT_VLAN_ID; - ret.status = switch_api->get_switch_attribute(gSwitchId, 1, &attr); - if (ret.status != SAI_STATUS_SUCCESS) - { - SAI_THRIFT_LOG_ERR("failed to get switch default vlan ID, status:%d", ret.status); - return; - } - - ret.data.oid = (sai_thrift_object_id_t)attr.value.oid; - } - - sai_thrift_object_id_t sai_thrift_get_default_trap_group() { - sai_status_t status; - sai_attribute_t attr; - sai_switch_api_t *switch_api; - sai_thrift_object_id_t default_trap_group; - const char* f_name = __FUNCTION__; - printf("%s\n", f_name); - status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (status != SAI_STATUS_SUCCESS) { - printf("%s failed to obtain switch_api, status:%d\n", f_name, status); - return SAI_NULL_OBJECT_ID; - } - attr.id = SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP; - status = switch_api->get_switch_attribute(gSwitchId, 1, &attr); - if (status != SAI_STATUS_SUCCESS) - { - printf("%s. Failed to get switch default trap group, status %d", f_name, status); - return SAI_NULL_OBJECT_ID; - } - default_trap_group = (sai_thrift_object_id_t)attr.value.oid; - return default_trap_group; - } - - void sai_thrift_get_switch_attribute(sai_thrift_attribute_list_t& thrift_attr_list) { - printf("sai_thrift_get_switch_attribute\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_switch_api_t *switch_api; - sai_attribute_t max_port_attribute; - sai_attribute_t port_list_object_attribute; - sai_thrift_attribute_t thrift_port_list_attribute; - sai_object_list_t *port_list_object; - int max_ports = 0; - status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (status != SAI_STATUS_SUCCESS) { - printf("sai_api_query failed!!!\n"); - return; - } - - max_port_attribute.id = SAI_SWITCH_ATTR_PORT_NUMBER; - switch_api->get_switch_attribute(gSwitchId, 1, &max_port_attribute); - max_ports = max_port_attribute.value.u32; - port_list_object_attribute.id = SAI_SWITCH_ATTR_PORT_LIST; - port_list_object_attribute.value.objlist.list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * max_ports); - port_list_object_attribute.value.objlist.count = max_ports; - switch_api->get_switch_attribute(gSwitchId, 1, &port_list_object_attribute); - - thrift_attr_list.attr_count = 1; - std::vector& attr_list = thrift_attr_list.attr_list; - thrift_port_list_attribute.id = SAI_SWITCH_ATTR_PORT_LIST; - thrift_port_list_attribute.value.objlist.count = max_ports; - std::vector& port_list = thrift_port_list_attribute.value.objlist.object_id_list; - port_list_object = &port_list_object_attribute.value.objlist; - for (int index = 0; index < max_ports; index++) { - port_list.push_back((sai_thrift_object_id_t) port_list_object->list[index]); - } - attr_list.push_back(thrift_port_list_attribute); - free(port_list_object_attribute.value.objlist.list); - } - - sai_thrift_status_t sai_thrift_set_switch_attribute(const sai_thrift_attribute_t& thrift_attr) { - printf("sai_thrift_set_switch_attribute\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_switch_api_t *switch_api; - sai_attribute_t attr; - status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (status != SAI_STATUS_SUCCESS) { - printf("sai_api_query failed!!!\n"); - return status; - } - - sai_thrift_parse_switch_attribute(thrift_attr, &attr); - - status = switch_api->set_switch_attribute(gSwitchId, &attr); - return status; - } - - void sai_thrift_parse_switch_attribute(const sai_thrift_attribute_t &thrift_attr, sai_attribute_t *attr) { - attr->id = thrift_attr.id; - - switch(thrift_attr.id) { - case SAI_SWITCH_ATTR_SRC_MAC_ADDRESS: - sai_thrift_string_to_mac(thrift_attr.value.mac, attr->value.mac); - break; - - case SAI_SWITCH_ATTR_FDB_UNICAST_MISS_PACKET_ACTION: - case SAI_SWITCH_ATTR_FDB_BROADCAST_MISS_PACKET_ACTION: - case SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION: - attr->value.s32 = thrift_attr.value.s32; - break; - } - } - - void sai_thrift_get_port_list_by_front_port(sai_thrift_attribute_t& thrift_attr) { - printf("sai_thrift_get_port_list_by_front_port\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_switch_api_t *switch_api; - sai_port_api_t *port_api; - sai_attribute_t max_port_attribute; - sai_attribute_t port_list_object_attribute; - sai_attribute_t port_lane_list_attribute; - sai_thrift_attribute_t thrift_port_list_attribute; - sai_object_list_t *port_list_object; - int max_ports = 0; - extern std::map, std::string> gPortMap; - std::map, std::string>::iterator gPortMapIt; - - status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (status != SAI_STATUS_SUCCESS) { - printf("sai_api_query failed!!!\n"); - return; - } - - status = sai_api_query(SAI_API_PORT, (void **) &port_api); - if (status != SAI_STATUS_SUCCESS) { - printf("sai_api_query failed!!!\n"); - return; - } - - max_port_attribute.id = SAI_SWITCH_ATTR_PORT_NUMBER; - switch_api->get_switch_attribute(gSwitchId, 1, &max_port_attribute); - max_ports = max_port_attribute.value.u32; - port_list_object_attribute.id = SAI_SWITCH_ATTR_PORT_LIST; - port_list_object_attribute.value.objlist.list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * max_ports); - port_list_object_attribute.value.objlist.count = max_ports; - switch_api->get_switch_attribute(gSwitchId, 1, &port_list_object_attribute); - std::map front_to_sai_map; - - for (int i=0 ; iget_port_attribute(port_list_object_attribute.value.objlist.list[i], 1, &port_lane_list_attribute); - - std::set port_lanes; - uint32_t laneCnt = port_lane_list_attribute.value.u32list.count; - for (int j=0 ; jsecond.c_str(); - std::string front_port_number; - int front_num_to_sort=0; - for (int k=0 ; k= '0' && front_port_alias[k] <= '9'){ - front_port_number.push_back(front_port_alias[k]); - } - } - front_num_to_sort = std::stoi(front_port_number); - front_to_sai_map.insert(std::pair(front_num_to_sort,port_list_object_attribute.value.objlist.list[i])); - } - else { - printf("DIDN'T FOUND FRONT PORT FOR LANE SET\n"); - } - free(port_lane_list_attribute.value.u32list.list); - } - - sai_thrift_attribute_t& attr = thrift_attr; - thrift_port_list_attribute.id = SAI_SWITCH_ATTR_PORT_LIST; - thrift_port_list_attribute.value.objlist.count = max_ports; - std::vector& port_list = thrift_port_list_attribute.value.objlist.object_id_list; - for (std::map::iterator it = front_to_sai_map.begin() ; it != front_to_sai_map.end(); it++) { - port_list.push_back((sai_thrift_object_id_t) it->second); - } - attr = thrift_port_list_attribute; - free(port_list_object_attribute.value.objlist.list); - } - - sai_thrift_object_id_t sai_thrift_get_port_id_by_front_port(const std::string& port_name) { - printf("sai_thrift_get_port_id_by_front_port\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_switch_api_t *switch_api; - sai_port_api_t *port_api; - sai_attribute_t max_port_attribute; - sai_attribute_t port_list_object_attribute; - sai_attribute_t port_lane_list_attribute; - sai_object_list_t *port_list_object; - int max_ports = 0; - sai_thrift_object_id_t port_id; - extern std::map, std::string> gPortMap; - std::map, std::string>::iterator gPortMapIt; - - status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); - if (status != SAI_STATUS_SUCCESS) { - printf("sai_api_query failed!!!\n"); - return SAI_NULL_OBJECT_ID; - } - status = sai_api_query(SAI_API_PORT, (void **) &port_api); - if (status != SAI_STATUS_SUCCESS) { - printf("sai_api_query failed!!!\n"); - return SAI_NULL_OBJECT_ID; - } - for (gPortMapIt = gPortMap.begin() ; gPortMapIt != gPortMap.end() ; gPortMapIt++){ - if (gPortMapIt->second == port_name){ - break; - } - } - - std::set lane_set; - if (gPortMapIt != gPortMap.end()){ - lane_set = gPortMapIt->first; - } - else { - printf("Didn't find matching port to received name!\n"); - return SAI_NULL_OBJECT_ID; - } - - max_port_attribute.id = SAI_SWITCH_ATTR_PORT_NUMBER; - switch_api->get_switch_attribute(gSwitchId, 1, &max_port_attribute); - max_ports = max_port_attribute.value.u32; - port_list_object_attribute.id = SAI_SWITCH_ATTR_PORT_LIST; - port_list_object_attribute.value.objlist.list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * max_ports); - port_list_object_attribute.value.objlist.count = max_ports; - switch_api->get_switch_attribute(gSwitchId, 1, &port_list_object_attribute); - - for (int i=0 ; iget_port_attribute(port_list_object_attribute.value.objlist.list[i], 1, &port_lane_list_attribute); - - std::set port_lanes; - uint32_t laneCnt = port_lane_list_attribute.value.u32list.count; - for (int j=0 ; j & thrift_attr_list) { - printf("sai_thrift_create_hostif\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_hostif_api_t *hostif_api; - sai_object_id_t hif_id; - status = sai_api_query(SAI_API_HOSTIF, (void **) &hostif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_hostif_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = hostif_api->create_hostif(&hif_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return hif_id; - } - - sai_thrift_status_t sai_thrift_remove_hostif(const sai_thrift_object_id_t hif_id) { - printf("sai_thrift_remove_hostif\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_hostif_api_t *hostif_api; - status = sai_api_query(SAI_API_HOSTIF, (void **) &hostif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = hostif_api->remove_hostif((sai_object_id_t) hif_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_hostif_trap_group(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_hostif_trap_group\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_hostif_api_t *hostif_api; - sai_object_id_t hif_trap_group_id; - status = sai_api_query(SAI_API_HOSTIF, (void **) &hostif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_hostif_trap_group_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = hostif_api->create_hostif_trap_group(&hif_trap_group_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return hif_trap_group_id; - } - - sai_thrift_status_t sai_thrift_remove_hostif_trap_group(const sai_thrift_object_id_t hif_trap_group_id) { - printf("sai_thrift_remove_hostif_trap_group\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_hostif_api_t *hostif_api; - status = sai_api_query(SAI_API_HOSTIF, (void **) &hostif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = hostif_api->remove_hostif_trap_group((sai_object_id_t) hif_trap_group_id); - return status; - } - - sai_thrift_status_t sai_thrift_create_hostif_trap(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_hostif_trap\n"); - return 0; - } - - sai_thrift_status_t sai_thrift_remove_hostif_trap(const sai_thrift_hostif_trap_id_t trap_id) { - printf("sai_thrift_remove_hostif_trap\n"); - return 0; - } - - sai_thrift_status_t sai_thrift_set_hostif_trap(const sai_thrift_object_id_t trap_id, const sai_thrift_attribute_t& thrift_attr) { - printf("sai_thrift_set_hostif_trap\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_hostif_api_t *hostif_api; - sai_attribute_t attr; - status = sai_api_query(SAI_API_HOSTIF, (void **) &hostif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_hostif_trap_attribute(thrift_attr, &attr); - status = hostif_api->set_hostif_trap_attribute((sai_object_id_t) trap_id, &attr); - return status; - } - - void sai_thrift_parse_hostif_trap_group_attribute(const sai_thrift_attribute_t &thrift_attr, sai_attribute_t *attr) { - attr->id = thrift_attr.id; - switch (thrift_attr.id) { - case SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER: - attr->value.oid = thrift_attr.value.oid; - break; - default: - break; - } - } - - sai_thrift_status_t sai_thrift_set_hostif_trap_group(const sai_thrift_object_id_t trap_group_id, const sai_thrift_attribute_t& thrift_attr) { - printf("%s\n", __FUNCTION__); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_hostif_api_t *hostif_api; - sai_attribute_t attr; - status = sai_api_query(SAI_API_HOSTIF, (void **) &hostif_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_thrift_parse_hostif_trap_group_attribute(thrift_attr, &attr); - status = hostif_api->set_hostif_trap_group_attribute((sai_object_id_t) trap_group_id, &attr); - return status; - } - - void sai_thrift_parse_acl_table_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_ACL_TABLE_ATTR_ACL_STAGE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST: - { - int count = attribute.value.s32list.s32list.size(); - sai_int32_t *aclbp_list = NULL; - std::vector::const_iterator it = attribute.value.s32list.s32list.begin(); - aclbp_list = (sai_int32_t *) malloc(sizeof(sai_int32_t) * count); - for(int j = 0; j < count; j++, it++) - *(aclbp_list + j) = (sai_int32_t) *it; - attr_list[i].value.s32list.list = aclbp_list; - attr_list[i].value.s32list.count = count; - } - break; - case SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6: - case SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6: - case SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC: - case SAI_ACL_TABLE_ATTR_FIELD_DST_MAC: - case SAI_ACL_TABLE_ATTR_FIELD_SRC_IP: - case SAI_ACL_TABLE_ATTR_FIELD_DST_IP: - case SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS: - case SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS: - case SAI_ACL_TABLE_ATTR_FIELD_IN_PORT: - case SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT: - case SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID: - case SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_PRI: - case SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_CFI: - case SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_ID: - case SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_PRI: - case SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_CFI: - case SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT: - case SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT: - case SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE: - case SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL: - case SAI_ACL_TABLE_ATTR_FIELD_DSCP: - case SAI_ACL_TABLE_ATTR_FIELD_ECN: - case SAI_ACL_TABLE_ATTR_FIELD_TTL: - case SAI_ACL_TABLE_ATTR_FIELD_TOS: - case SAI_ACL_TABLE_ATTR_FIELD_IP_FLAGS: - case SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS: - case SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE: - case SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_FRAG: - case SAI_ACL_TABLE_ATTR_FIELD_IPV6_FLOW_LABEL: - case SAI_ACL_TABLE_ATTR_FIELD_TC: - attr_list[i].value.booldata = attribute.value.booldata; - break; - default: - break; - } - } - } - - void sai_thrift_parse_acl_entry_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_ACL_ENTRY_ATTR_TABLE_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_ACL_ENTRY_ATTR_PRIORITY: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_ACL_ENTRY_ATTR_ADMIN_STATE: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_ACL_ENTRY_ATTR_FIELD_SRC_IPV6: - case SAI_ACL_ENTRY_ATTR_FIELD_DST_IPV6: - sai_thrift_string_to_v6_ip(attribute.value.aclfield.data.ip6, attr_list[i].value.aclfield.data.ip6); - sai_thrift_string_to_v6_ip(attribute.value.aclfield.mask.ip6, attr_list[i].value.aclfield.mask.ip6); - break; - case SAI_ACL_ENTRY_ATTR_FIELD_SRC_MAC: - case SAI_ACL_ENTRY_ATTR_FIELD_DST_MAC: - sai_thrift_string_to_mac(attribute.value.aclfield.data.mac, attr_list[i].value.aclfield.data.mac); - sai_thrift_string_to_mac(attribute.value.aclfield.mask.mac, attr_list[i].value.aclfield.mask.mac); - break; - case SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP: - case SAI_ACL_ENTRY_ATTR_FIELD_DST_IP: - sai_thrift_string_to_v4_ip(attribute.value.aclfield.data.ip4, &attr_list[i].value.aclfield.data.ip4); - sai_thrift_string_to_v4_ip(attribute.value.aclfield.mask.ip4, &attr_list[i].value.aclfield.mask.ip4); - break; - case SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT: - attr_list[i].value.aclfield.data.oid = attribute.value.aclfield.data.oid; - break; - case SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS: - { - int count = attribute.value.aclfield.data.objlist.object_id_list.size(); - sai_object_id_t *oid_list = NULL; - std::vector::const_iterator it = attribute.value.aclfield.data.objlist.object_id_list.begin(); - oid_list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * count); - for(int j = 0; j < count; j++, it++) - *(oid_list + j) = (sai_object_id_t) *it; - attr_list[i].value.aclfield.data.objlist.list = oid_list; - attr_list[i].value.aclfield.data.objlist.count = count; - } - break; - case SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT: - attr_list[i].value.aclfield.data.oid = attribute.value.aclfield.data.oid; - break; - /* - case SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS: - */ - case SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_PRI: - case SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_CFI: - case SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_PRI: - case SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_CFI: - break; - case SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_ID: - case SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_ID: - case SAI_ACL_ENTRY_ATTR_FIELD_L4_SRC_PORT: - case SAI_ACL_ENTRY_ATTR_FIELD_L4_DST_PORT: - case SAI_ACL_ENTRY_ATTR_FIELD_ETHER_TYPE: - attr_list[i].value.aclfield.data.u16 = attribute.value.aclfield.data.u16; - attr_list[i].value.aclfield.mask.u16 = attribute.value.aclfield.mask.u16; - break; - case SAI_ACL_ENTRY_ATTR_FIELD_IP_PROTOCOL: - case SAI_ACL_ENTRY_ATTR_FIELD_DSCP: - case SAI_ACL_ENTRY_ATTR_FIELD_ECN: - case SAI_ACL_ENTRY_ATTR_FIELD_TTL: - case SAI_ACL_ENTRY_ATTR_FIELD_TOS: - case SAI_ACL_ENTRY_ATTR_FIELD_IP_FLAGS: - case SAI_ACL_ENTRY_ATTR_FIELD_TCP_FLAGS: - case SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE: - case SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_FRAG: - case SAI_ACL_ENTRY_ATTR_FIELD_TC: - attr_list[i].value.aclfield.data.u8 = attribute.value.aclfield.data.u8; - attr_list[i].value.aclfield.mask.u8 = attribute.value.aclfield.mask.u8; - break; - case SAI_ACL_ENTRY_ATTR_FIELD_IPV6_FLOW_LABEL: - attr_list[i].value.aclfield.data.u16 = attribute.value.aclfield.data.u16; - attr_list[i].value.aclfield.mask.u16 = attribute.value.aclfield.mask.u16; - break; - case SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS: - attr_list[i].value.aclaction.parameter.oid = attribute.value.aclaction.parameter.oid; - break; - case SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS: - attr_list[i].value.aclaction.parameter.oid = attribute.value.aclaction.parameter.oid; - break; - case SAI_ACL_ENTRY_ATTR_ACTION_SET_POLICER: - attr_list[i].value.aclfield.data.oid = attribute.value.aclfield.data.oid; - break; - case SAI_ACL_ENTRY_ATTR_ACTION_COUNTER: - attr_list[i].value.aclfield.data.oid = attribute.value.aclfield.data.oid; - break; - case SAI_ACL_ENTRY_ATTR_ACTION_PACKET_ACTION: - attr_list[i].value.aclaction.parameter.u32 = attribute.value.aclaction.parameter.u32; - break; - default: - break; - } - } - } - - void sai_thrift_parse_acl_table_group_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST: - { - int count = attribute.value.s32list.s32list.size(); - sai_int32_t *s32_list = NULL; - std::vector::const_iterator it = attribute.value.s32list.s32list.begin(); - s32_list = (sai_int32_t *) malloc(sizeof(sai_int32_t) * count); - for(int j = 0; j < count; j++, it++) - *(s32_list + j) = (sai_int32_t) *it; - attr_list[i].value.s32list.list = s32_list; - attr_list[i].value.s32list.count = count; - } - break; - case SAI_ACL_TABLE_GROUP_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - default: - break; - } - } - } - - void sai_thrift_parse_acl_table_group_member_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_ACL_TABLE_GROUP_MEMBER_ATTR_PRIORITY: - attr_list[i].value.u32 = attribute.value.u32; - break; - default: - break; - } - } - } - - void sai_thrift_convert_to_acl_counter_attributes( - const std::vector &thrift_attr_list, - sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_ACL_COUNTER_ATTR_TABLE_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_ACL_COUNTER_ATTR_ENABLE_PACKET_COUNT: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_ACL_COUNTER_ATTR_ENABLE_BYTE_COUNT: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_ACL_COUNTER_ATTR_PACKETS: - attr_list[i].value.u64= attribute.value.u64; - break; - case SAI_ACL_COUNTER_ATTR_BYTES: - attr_list[i].value.u64= attribute.value.u64; - break; - } - } - } - - void sai_thrift_convert_to_acl_thrift_counter_attributes( - sai_attribute_t *attr_list, - uint32_t attr_count, - std::vector &thrift_attr_value_list) { - sai_attribute_t attribute; - sai_thrift_attribute_value_t thrift_attribute_value; - for(uint32_t i = 0; i < attr_count; i++) { - attribute = attr_list[i]; - switch (attribute.id) { - case SAI_ACL_COUNTER_ATTR_TABLE_ID: - thrift_attribute_value.oid = attribute.value.oid; - break; - case SAI_ACL_COUNTER_ATTR_ENABLE_PACKET_COUNT: - thrift_attribute_value.booldata = attribute.value.booldata; - break; - case SAI_ACL_COUNTER_ATTR_ENABLE_BYTE_COUNT: - thrift_attribute_value.booldata = attribute.value.booldata; - break; - case SAI_ACL_COUNTER_ATTR_PACKETS: - thrift_attribute_value.u64= attribute.value.u64; - break; - case SAI_ACL_COUNTER_ATTR_BYTES: - thrift_attribute_value.u64= attribute.value.u64; - break; - } - thrift_attr_value_list.push_back(thrift_attribute_value); - } - } - - sai_thrift_object_id_t sai_thrift_create_acl_table(const std::vector & thrift_attr_list) { - sai_object_id_t acl_table = 0ULL; - sai_acl_api_t *acl_api; - sai_status_t status = SAI_STATUS_SUCCESS; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_acl_table_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = acl_api->create_acl_table(&acl_table, gSwitchId, attr_count, attr_list); - free(attr_list); - return acl_table; - } - - sai_thrift_status_t sai_thrift_remove_acl_table(const sai_thrift_object_id_t acl_table_id) { - sai_status_t status = SAI_STATUS_SUCCESS; - sai_acl_api_t *acl_api; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = acl_api->remove_acl_table(acl_table_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_acl_entry(const std::vector & thrift_attr_list) { - sai_object_id_t acl_entry = 0ULL; - sai_acl_api_t *acl_api; - sai_status_t status = SAI_STATUS_SUCCESS; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_acl_entry_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = acl_api->create_acl_entry(&acl_entry, gSwitchId, attr_count, attr_list); - free(attr_list); - return acl_entry; - } - - sai_thrift_status_t sai_thrift_remove_acl_entry(const sai_thrift_object_id_t acl_entry) { - sai_status_t status = SAI_STATUS_SUCCESS; - sai_acl_api_t *acl_api; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = acl_api->remove_acl_entry(acl_entry); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_acl_table_group(const std::vector & thrift_attr_list) { - sai_object_id_t acl_table_group_id = 0ULL; - sai_acl_api_t *acl_api; - sai_status_t status = SAI_STATUS_SUCCESS; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_acl_table_group_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = acl_api->create_acl_table_group(&acl_table_group_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return acl_table_group_id; - } - - sai_thrift_status_t sai_thrift_remove_acl_table_group(const sai_thrift_object_id_t acl_table_group_id) { - sai_status_t status = SAI_STATUS_SUCCESS; - sai_acl_api_t *acl_api; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = acl_api->remove_acl_table_group(acl_table_group_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_acl_table_group_member(const std::vector & thrift_attr_list) { - sai_object_id_t acl_table_group_member_id = 0ULL; - sai_acl_api_t *acl_api; - sai_status_t status = SAI_STATUS_SUCCESS; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_acl_table_group_member_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = acl_api->create_acl_table_group_member(&acl_table_group_member_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return acl_table_group_member_id; - } - - sai_thrift_status_t sai_thrift_remove_acl_table_group_member(const sai_thrift_object_id_t acl_table_group_member_id) { - sai_status_t status = SAI_STATUS_SUCCESS; - sai_acl_api_t *acl_api; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = acl_api->remove_acl_table_group_member(acl_table_group_member_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_acl_counter(const std::vector & thrift_attr_list) { - sai_object_id_t acl_counter_id = 0ULL; - sai_acl_api_t *acl_api; - sai_status_t status = SAI_STATUS_SUCCESS; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_convert_to_acl_counter_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - status = acl_api->create_acl_counter(&acl_counter_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return acl_counter_id; - } - - sai_thrift_status_t sai_thrift_remove_acl_counter(const sai_thrift_object_id_t acl_counter_id) { - sai_object_id_t acl_entry = 0ULL; - sai_acl_api_t *acl_api; - sai_status_t status = SAI_STATUS_SUCCESS; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = acl_api->remove_acl_counter(acl_counter_id); - return status; - } - - void sai_thrift_get_acl_counter_attribute( - std::vector & thrift_attr_values, - const sai_thrift_object_id_t acl_counter_id, - const std::vector & thrift_attr_ids) { - sai_object_id_t acl_entry = 0ULL; - sai_acl_api_t *acl_api; - sai_status_t status = SAI_STATUS_SUCCESS; - status = sai_api_query(SAI_API_ACL, (void **) &acl_api); - if (status != SAI_STATUS_SUCCESS) { - return; - } - - uint32_t attr_count = thrift_attr_ids.size(); - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_ids.size()); - memset(attr_list, 0x0, sizeof(sizeof(sai_attribute_t) * thrift_attr_ids.size())); - sai_thrift_parse_attribute_ids(thrift_attr_ids, attr_list); - status = acl_api->get_acl_counter_attribute(acl_counter_id, attr_count, attr_list); - if (status != SAI_STATUS_SUCCESS) { - return; - } - - sai_thrift_convert_to_acl_thrift_counter_attributes( - attr_list, - attr_count, - thrift_attr_values); - return; - } - - void sai_thrift_parse_mirror_session_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_MIRROR_SESSION_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_MIRROR_SESSION_ATTR_MONITOR_PORT: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_MIRROR_SESSION_ATTR_TC: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_MIRROR_SESSION_ATTR_VLAN_TPID: - attr_list[i].value.u16 = attribute.value.u16; - break; - case SAI_MIRROR_SESSION_ATTR_VLAN_ID: - attr_list[i].value.u16 = attribute.value.u16; - break; - case SAI_MIRROR_SESSION_ATTR_VLAN_PRI: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_MIRROR_SESSION_ATTR_IPHDR_VERSION: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_MIRROR_SESSION_ATTR_TOS: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_MIRROR_SESSION_ATTR_TTL: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS: - sai_thrift_parse_ip_address(attribute.value.ipaddr, &attr_list[i].value.ipaddr); - break; - case SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS: - sai_thrift_parse_ip_address(attribute.value.ipaddr, &attr_list[i].value.ipaddr); - break; - case SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS: - sai_thrift_string_to_mac(attribute.value.mac, attr_list[i].value.mac); - break; - case SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS: - sai_thrift_string_to_mac(attribute.value.mac, attr_list[i].value.mac); - break; - case SAI_MIRROR_SESSION_ATTR_GRE_PROTOCOL_TYPE: - attr_list[i].value.u16 = attribute.value.u16; - break; - default: - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_mirror_session(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_mirror_session\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_mirror_api_t *mirror_api; - sai_object_id_t session_id = 0; - status = sai_api_query(SAI_API_MIRROR, (void **) &mirror_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_mirror_session_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - mirror_api->create_mirror_session(&session_id, gSwitchId, attr_count, attr_list); - return session_id; - } - - sai_thrift_status_t sai_thrift_remove_mirror_session(const sai_thrift_object_id_t session_id) { - printf("sai_thrift_remove_mirror_session\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_mirror_api_t *mirror_api; - status = sai_api_query(SAI_API_MIRROR, (void **) &mirror_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = mirror_api->remove_mirror_session((sai_object_id_t) session_id); - return status; - } - - void sai_thrift_parse_policer_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_POLICER_ATTR_METER_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_POLICER_ATTR_MODE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_POLICER_ATTR_COLOR_SOURCE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_POLICER_ATTR_CBS: - attr_list[i].value.u64 = attribute.value.u64; - break; - case SAI_POLICER_ATTR_CIR: - attr_list[i].value.u64 = attribute.value.u64; - break; - case SAI_POLICER_ATTR_PBS: - attr_list[i].value.u64 = attribute.value.u64; - break; - case SAI_POLICER_ATTR_PIR: - attr_list[i].value.u64 = attribute.value.u64; - break; - case SAI_POLICER_ATTR_GREEN_PACKET_ACTION: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_POLICER_ATTR_YELLOW_PACKET_ACTION: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_POLICER_ATTR_RED_PACKET_ACTION: - attr_list[i].value.s32 = attribute.value.s32; - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_policer(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_policer\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_policer_api_t *policer_api; - sai_object_id_t policer_id = 0; - status = sai_api_query(SAI_API_POLICER, (void **) &policer_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_policer_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - policer_api->create_policer(&policer_id, gSwitchId, attr_count, attr_list); - return policer_id; - } - - sai_thrift_status_t sai_thrift_remove_policer(const sai_thrift_object_id_t policer_id) { - printf("sai_thrift_remove_policer\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_policer_api_t *policer_api; - status = sai_api_query(SAI_API_POLICER, (void **) &policer_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = policer_api->remove_policer((sai_object_id_t) policer_id); - return status; - } - - void sai_thrift_get_policer_stats(std::vector & thrift_counters, - const sai_thrift_object_id_t policer_id, - const std::vector & thrift_counter_ids) { - printf("sai_thrift_get_policer_stats\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_policer_api_t *policer_api; - status = sai_api_query(SAI_API_POLICER, (void **) &policer_api); - if (status != SAI_STATUS_SUCCESS) { - return; - } - _sai_policer_stat_t *counter_ids = (_sai_policer_stat_t *) malloc(sizeof(_sai_policer_stat_t) * thrift_counter_ids.size()); - std::vector::const_iterator it = thrift_counter_ids.begin(); - uint64_t *counters = (uint64_t *) malloc(sizeof(uint64_t) * thrift_counter_ids.size()); - for(uint32_t i = 0; i < thrift_counter_ids.size(); i++, it++) { - counter_ids[i] = (_sai_policer_stat_t) *it; - } - - int32_t number_of_counters = thrift_counter_ids.size(); - status = policer_api->get_policer_stats( - (sai_object_id_t) policer_id, - counter_ids, - number_of_counters, - counters); - - for (uint32_t i = 0; i < thrift_counter_ids.size(); i++) { - thrift_counters.push_back(counters[i]); - } - free(counter_ids); - free(counters); - return; - } - - sai_thrift_object_id_t sai_thrift_create_scheduler_profile(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_scheduler_profile\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_scheduler_api_t *scheduler_api; - sai_object_id_t scheduler_id = 0; - status = sai_api_query(SAI_API_SCHEDULER, (void **) &scheduler_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_scheduler_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - scheduler_api->create_scheduler(&scheduler_id, gSwitchId, attr_count, attr_list); - free (attr_list); - return scheduler_id; - } - - sai_thrift_status_t sai_thrift_remove_scheduler_profile(const sai_thrift_object_id_t scheduler_id) { - printf("sai_thrift_remove_scheduler\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_scheduler_api_t *scheduler_api; - status = sai_api_query(SAI_API_SCHEDULER, (void **) &scheduler_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = scheduler_api->remove_scheduler((sai_object_id_t) scheduler_id); - return status; - } - - void sai_thrift_parse_scheduler_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_SCHEDULER_ATTR_SCHEDULING_WEIGHT: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_RATE: - attr_list[i].value.u64 = attribute.value.u64; - break; - case SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_BURST_RATE: - attr_list[i].value.u64 = attribute.value.u64; - break; - case SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE : - attr_list[i].value.u64 = attribute.value.u64; - break; - case SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_BURST_RATE: - attr_list[i].value.u64 = attribute.value.u64; - break; - } - } - } - - void sai_thrift_get_port_stats(std::vector & thrift_counters, - const sai_thrift_object_id_t port_id, - const std::vector & thrift_counter_ids, - const int32_t number_of_counters) { - printf("sai_thrift_get_port_stats\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_port_api_t *port_api; - status = sai_api_query(SAI_API_PORT, (void **) &port_api); - if (status != SAI_STATUS_SUCCESS) { - return; - } - sai_port_stat_t *counter_ids = (sai_port_stat_t *) malloc(sizeof(sai_port_stat_t) * thrift_counter_ids.size()); - std::vector::const_iterator it = thrift_counter_ids.begin(); - uint64_t *counters = (uint64_t *) malloc(sizeof(uint64_t) * thrift_counter_ids.size()); - for(uint32_t i = 0; i < thrift_counter_ids.size(); i++, it++) { - counter_ids[i] = (sai_port_stat_t) *it; - } - - status = port_api->get_port_stats((sai_object_id_t) port_id, - counter_ids, - number_of_counters, - counters); - - for (uint32_t i = 0; i < thrift_counter_ids.size(); i++) { - thrift_counters.push_back(counters[i]); - } - free(counter_ids); - free(counters); - return; - } - - sai_thrift_status_t sai_thrift_clear_port_all_stats(const sai_thrift_object_id_t port_id) { - printf("sai_thrift_clear_port_all_stats\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_port_api_t *port_api; - status = sai_api_query(SAI_API_PORT, (void **) &port_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = port_api->clear_port_all_stats( (sai_object_id_t) port_id); - return status; - } - - void sai_thrift_get_port_attribute(sai_thrift_attribute_list_t& thrift_attr_list, const sai_thrift_object_id_t port_id) { - printf("sai_thrift_get_port_attribute\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_port_api_t *port_api; - sai_attribute_t max_queue_attribute; - sai_attribute_t queue_list_object_attribute; - sai_thrift_attribute_t thrift_queue_list_attribute; - sai_object_list_t *queue_list_object; - int max_queues = 0; - status = sai_api_query(SAI_API_PORT, (void **) &port_api); - if (status != SAI_STATUS_SUCCESS) { - return; - } - - max_queue_attribute.id = SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES; - port_api->get_port_attribute(port_id, 1, &max_queue_attribute); - max_queues = max_queue_attribute.value.u32; - queue_list_object_attribute.id = SAI_PORT_ATTR_QOS_QUEUE_LIST; - queue_list_object_attribute.value.objlist.list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * max_queues); - queue_list_object_attribute.value.objlist.count = max_queues; - port_api->get_port_attribute(port_id, 1, &queue_list_object_attribute); - - thrift_attr_list.attr_count = 2; - std::vector& attr_list = thrift_attr_list.attr_list; - thrift_queue_list_attribute.id = SAI_PORT_ATTR_QOS_QUEUE_LIST; - thrift_queue_list_attribute.value.objlist.count = max_queues; - std::vector& queue_list = thrift_queue_list_attribute.value.objlist.object_id_list; - queue_list_object = &queue_list_object_attribute.value.objlist; - for (int index = 0; index < max_queues; index++) { - queue_list.push_back((sai_thrift_object_id_t) queue_list_object->list[index]); - } - attr_list.push_back(thrift_queue_list_attribute); - free(queue_list_object_attribute.value.objlist.list); - - sai_attribute_t max_pg_attribute; - sai_attribute_t pg_list_object_attribute; - sai_thrift_attribute_t thrift_pg_list_attribute; - sai_object_list_t *pg_list_object; - int max_pg = 0; - - max_pg_attribute.id = SAI_PORT_ATTR_NUMBER_OF_INGRESS_PRIORITY_GROUPS; - port_api->get_port_attribute(port_id, 1, &max_pg_attribute); - max_pg = max_pg_attribute.value.u32; - pg_list_object_attribute.id = SAI_PORT_ATTR_INGRESS_PRIORITY_GROUP_LIST; - pg_list_object_attribute.value.objlist.list = (sai_object_id_t *) malloc(sizeof(sai_object_id_t) * max_pg); - pg_list_object_attribute.value.objlist.count = max_pg; - port_api->get_port_attribute(port_id, 1, &pg_list_object_attribute); - - thrift_attr_list.attr_count = 3; - thrift_pg_list_attribute.id = SAI_PORT_ATTR_INGRESS_PRIORITY_GROUP_LIST; - thrift_pg_list_attribute.value.objlist.count = max_pg; - std::vector& pg_list = thrift_pg_list_attribute.value.objlist.object_id_list; - pg_list_object = &pg_list_object_attribute.value.objlist; - for (int index = 0; index < max_pg; index++) { - pg_list.push_back((sai_thrift_object_id_t) pg_list_object->list[index]); - } - attr_list.push_back(thrift_pg_list_attribute); - free(pg_list_object_attribute.value.objlist.list); - - sai_attribute_t port_hw_lane; - sai_thrift_attribute_t thrift_port_hw_lane; - sai_u32_list_t *lane_list_num; - - port_hw_lane.id = SAI_PORT_ATTR_HW_LANE_LIST; - port_hw_lane.value.u32list.list = (uint32_t *) malloc(sizeof(uint32_t) * 4); - port_hw_lane.value.u32list.count = 4; - port_api->get_port_attribute(port_id, 1, &port_hw_lane); - - thrift_attr_list.attr_count = 4; - thrift_port_hw_lane.id = SAI_PORT_ATTR_HW_LANE_LIST; - thrift_port_hw_lane.value.u32list.count = port_hw_lane.value.u32list.count; - std::vector& lane_list = thrift_port_hw_lane.value.u32list.u32list; - lane_list_num = &port_hw_lane.value.u32list; - for (int index = 0; index < port_hw_lane.value.u32list.count ; index++) { - lane_list.push_back((uint32_t) lane_list_num->list[index]); - } - attr_list.push_back(thrift_port_hw_lane); - free(port_hw_lane.value.u32list.list); - - sai_attribute_t port_oper_status_attribute; - sai_thrift_attribute_t thrift_port_status; - port_oper_status_attribute.id = SAI_PORT_ATTR_OPER_STATUS; - port_api->get_port_attribute(port_id, 1, &port_oper_status_attribute); - - thrift_attr_list.attr_count = 5; - thrift_port_status.id = SAI_PORT_ATTR_OPER_STATUS; - thrift_port_status.value.s32 = port_oper_status_attribute.value.s32; - attr_list.push_back(thrift_port_status); - } - - void sai_thrift_get_queue_stats(std::vector & thrift_counters, - const sai_thrift_object_id_t queue_id, - const std::vector & thrift_counter_ids, - const int32_t number_of_counters) { - printf("sai_thrift_get_queue_stats\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_queue_api_t *queue_api; - status = sai_api_query(SAI_API_QUEUE, (void **) &queue_api); - if (status != SAI_STATUS_SUCCESS) { - return; - } - sai_queue_stat_t *counter_ids = (sai_queue_stat_t *) malloc(sizeof(sai_queue_stat_t) * thrift_counter_ids.size()); - std::vector::const_iterator it = thrift_counter_ids.begin(); - uint64_t *counters = (uint64_t *) malloc(sizeof(uint64_t) * thrift_counter_ids.size()); - for(uint32_t i = 0; i < thrift_counter_ids.size(); i++, it++) { - counter_ids[i] = (sai_queue_stat_t) *it; - } - - status = queue_api->get_queue_stats( - (sai_object_id_t) queue_id, - counter_ids, - number_of_counters, - counters); - - for (uint32_t i = 0; i < thrift_counter_ids.size(); i++) { - thrift_counters.push_back(counters[i]); - } - free(counter_ids); - free(counters); - return; - } - - sai_thrift_status_t sai_thrift_set_queue_attribute(const sai_thrift_object_id_t queue_id, - const sai_thrift_attribute_t& thrift_attr) { - printf("sai_thrift_set_queue_attribute\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_queue_api_t *queue_api; - status = sai_api_query(SAI_API_QUEUE, (void **) &queue_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t attr; - attr.id = thrift_attr.id; - attr.value.oid = thrift_attr.value.oid; - status = queue_api->set_queue_attribute((sai_object_id_t)queue_id, &attr); - return status; - } - - sai_thrift_status_t sai_thrift_clear_queue_stats(const sai_thrift_object_id_t queue_id, - const std::vector & thrift_counter_ids, - const int32_t number_of_counters) { - printf("sai_thrift_clear_queue_stats\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_queue_api_t *queue_api; - status = sai_api_query(SAI_API_QUEUE, (void **) &queue_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_queue_stat_t *counter_ids = (sai_queue_stat_t *) malloc(sizeof(sai_queue_stat_t) * thrift_counter_ids.size()); - std::vector::const_iterator it = thrift_counter_ids.begin(); - for(uint32_t i = 0; i < thrift_counter_ids.size(); i++, it++) { - counter_ids[i] = (sai_queue_stat_t) *it; - } - - status = queue_api->clear_queue_stats( - (sai_object_id_t) queue_id, - counter_ids, - number_of_counters); - - free(counter_ids); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_buffer_profile(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_buffer_profile\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_buffer_api_t *buffer_api; - sai_object_id_t buffer_id = 0; - status = sai_api_query(SAI_API_BUFFER, (void **) &buffer_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_buffer_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - buffer_api->create_buffer_profile(&buffer_id, gSwitchId, attr_count, attr_list); - - return buffer_id; - } - - void sai_thrift_parse_buffer_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_BUFFER_PROFILE_ATTR_POOL_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - case SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_BUFFER_PROFILE_ATTR_THRESHOLD_MODE: - attr_list[i].value.s32 = attribute.value.s32; - break; - case SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_BUFFER_PROFILE_ATTR_SHARED_STATIC_TH: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_BUFFER_PROFILE_ATTR_XOFF_TH: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_BUFFER_PROFILE_ATTR_XON_TH: - attr_list[i].value.u32 = attribute.value.u32; - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_pool_profile(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_pool\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_buffer_api_t *buffer_api; - sai_object_id_t pool_id = 0; - status = sai_api_query(SAI_API_BUFFER, (void **) &buffer_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_pool_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - buffer_api->create_buffer_pool(&pool_id, gSwitchId, attr_count, attr_list); - return pool_id; - } - - void sai_thrift_parse_pool_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_BUFFER_POOL_ATTR_TYPE: - attr_list[i].value.u32 = attribute.value.s32; - break; - case SAI_BUFFER_POOL_ATTR_SIZE: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_BUFFER_POOL_ATTR_THRESHOLD_MODE: - attr_list[i].value.u32 = attribute.value.s32; - break; - } - } - } - - sai_thrift_status_t sai_thrift_set_priority_group_attribute(const sai_thrift_object_id_t pg_id, const sai_thrift_attribute_t& thrift_attr) { - printf("sai_thrift_set_priority_group_attribute\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_buffer_api_t *buffer_api; - status = sai_api_query(SAI_API_BUFFER, (void **) &buffer_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t attr; - attr.id = thrift_attr.id; - attr.value.oid = thrift_attr.value.oid; - status = buffer_api->set_ingress_priority_group_attribute((sai_object_id_t)pg_id, &attr); - return status; - } - - void sai_thrift_get_pg_stats(std::vector & thrift_counters, - const sai_thrift_object_id_t pg_id, - const std::vector & thrift_counter_ids, - const int32_t number_of_counters) { - printf("sai_thrift_get_pg_stats\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_buffer_api_t *buffer_api; - status = sai_api_query(SAI_API_BUFFER, (void **) &buffer_api); - if (status != SAI_STATUS_SUCCESS) { - return; - } - sai_ingress_priority_group_stat_t *counter_ids = (sai_ingress_priority_group_stat_t *) malloc(sizeof(sai_ingress_priority_group_stat_t) * thrift_counter_ids.size()); - std::vector::const_iterator it = thrift_counter_ids.begin(); - uint64_t *counters = (uint64_t *) malloc(sizeof(uint64_t) * thrift_counter_ids.size()); - for(uint32_t i = 0; i < thrift_counter_ids.size(); i++, it++) { - counter_ids[i] = (sai_ingress_priority_group_stat_t) *it; - } - - status = buffer_api->get_ingress_priority_group_stats((sai_object_id_t) pg_id, - counter_ids, - number_of_counters, - counters); - - for (uint32_t i = 0; i < thrift_counter_ids.size(); i++) { - thrift_counters.push_back(counters[i]); - } - free(counter_ids); - free(counters); - return; - } - - sai_thrift_object_id_t sai_thrift_create_wred_profile(const std::vector & thrift_attr_list) { - printf("sai_thrift_create_wred_profile\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_wred_api_t *wred_api; - sai_object_id_t wred_id = 0; - status = sai_api_query(SAI_API_WRED, (void **) &wred_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - sai_attribute_t *attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - sai_thrift_parse_wred_attributes(thrift_attr_list, attr_list); - uint32_t attr_count = thrift_attr_list.size(); - wred_api->create_wred(&wred_id, gSwitchId, attr_count, attr_list); - free(attr_list); - return wred_id; - } - - void sai_thrift_parse_wred_attributes(const std::vector &thrift_attr_list, sai_attribute_t *attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - for(uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - switch (attribute.id) { - case SAI_WRED_ATTR_GREEN_ENABLE: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_WRED_ATTR_GREEN_MIN_THRESHOLD: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_GREEN_MAX_THRESHOLD: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_GREEN_DROP_PROBABILITY: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_YELLOW_ENABLE: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_WRED_ATTR_YELLOW_MIN_THRESHOLD: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_YELLOW_MAX_THRESHOLD: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_YELLOW_DROP_PROBABILITY: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_RED_ENABLE: - attr_list[i].value.booldata = attribute.value.booldata; - break; - case SAI_WRED_ATTR_RED_MIN_THRESHOLD: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_RED_MAX_THRESHOLD: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_RED_DROP_PROBABILITY: - attr_list[i].value.u32 = attribute.value.u32; - break; - case SAI_WRED_ATTR_WEIGHT: - attr_list[i].value.u8 = attribute.value.u8; - break; - case SAI_WRED_ATTR_ECN_MARK_MODE: - attr_list[i].value.s32 = attribute.value.s32; - break; - } - } - } - - sai_thrift_status_t sai_thrift_remove_wred_profile(const sai_thrift_object_id_t wred_id) { - printf("sai_thrift_remove_wred_profile\n"); - sai_status_t status = SAI_STATUS_SUCCESS; - sai_wred_api_t *wred_api; - status = sai_api_query(SAI_API_WRED, (void **) &wred_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - status = wred_api->remove_wred((sai_object_id_t) wred_id); - return status; - } - - sai_thrift_object_id_t sai_thrift_create_qos_map(const std::vector & thrift_attr_list) { - std::vector::const_iterator it = thrift_attr_list.begin(); - sai_thrift_attribute_t attribute; - sai_attribute_t *attr_list; - sai_status_t status = SAI_STATUS_SUCCESS; - sai_qos_map_api_t *qos_map_api; - sai_object_id_t qos_map_id = 0; - sai_qos_map_t *qos_map_list = NULL; - - printf("sai_thrift_create_qos_map\n"); - - status = sai_api_query(SAI_API_QOS_MAP, (void **) &qos_map_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - - attr_list = (sai_attribute_t *) malloc(sizeof(sai_attribute_t) * thrift_attr_list.size()); - - for (uint32_t i = 0; i < thrift_attr_list.size(); i++, it++) { - attribute = (sai_thrift_attribute_t)*it; - attr_list[i].id = attribute.id; - - switch (attribute.id) { - case SAI_QOS_MAP_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - - case SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST: - sai_attribute_t *attr = &attr_list[i]; - - attr->value.qosmap.count = attribute.value.qosmap.count; - - qos_map_list = (sai_qos_map_t *) malloc(attr->value.qosmap.count * sizeof(sai_qos_map_t)); - attr->value.qosmap.list = qos_map_list; - - for (uint32_t j = 0; j < attribute.value.qosmap.count; j++) { - sai_thrift_parse_qos_map_params(&attribute.value.qosmap.map_list[j].key, &attr->value.qosmap.list[j].key); - sai_thrift_parse_qos_map_params(&attribute.value.qosmap.map_list[j].value, &attr->value.qosmap.list[j].value); - } - break; - } - } - - qos_map_api->create_qos_map(&qos_map_id, gSwitchId, thrift_attr_list.size(), attr_list); - - free(qos_map_list); - free(attr_list); - return qos_map_id; - } - - void sai_thrift_parse_qos_map_params(const sai_thrift_qos_map_params_t *thrift_qos_params, sai_qos_map_params_t *qos_params) { - qos_params->tc = thrift_qos_params->tc; - qos_params->dscp = thrift_qos_params->dscp; - qos_params->dot1p = thrift_qos_params->dot1p; - qos_params->prio = thrift_qos_params->prio; - qos_params->pg = thrift_qos_params->pg; - qos_params->queue_index = thrift_qos_params->queue_index; - qos_params->color = (sai_packet_color_t) thrift_qos_params->color; - } - - sai_thrift_status_t sai_thrift_remove_qos_map(const sai_thrift_object_id_t qos_map_id) { - sai_status_t status = SAI_STATUS_SUCCESS; - sai_qos_map_api_t *qos_map_api; - - printf("sai_thrift_remove_qos_map\n"); - - status = sai_api_query(SAI_API_QOS_MAP, (void **) &qos_map_api); - if (status != SAI_STATUS_SUCCESS) { - return status; - } - - status = qos_map_api->remove_qos_map((sai_object_id_t) qos_map_id); - return status; - } - - // - // SAI Next Hop Group API ***************************************************************************************** - // - - void sai_thrift_parse_next_hop_group_attributes - (sai_attribute_t *attr_list, const std::vector &thrift_attr_list) noexcept - { - if (thrift_attr_list.empty() || attr_list == nullptr) { SAI_THRIFT_LOG_ERR("Invalid input arguments."); } - - std::vector::const_iterator cit = thrift_attr_list.begin(); - - for (sai_uint32_t i = 0; i < thrift_attr_list.size(); i++, cit++) - { - sai_thrift_attribute_t attribute = *cit; - attr_list[i].id = attribute.id; - - switch (attribute.id) - { - case SAI_NEXT_HOP_GROUP_ATTR_TYPE: - attr_list[i].value.s32 = attribute.value.s32; - break; - - default: - SAI_THRIFT_LOG_ERR("Failed to parse attributes."); - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_next_hop_group - (const std::vector &thrift_attr_list) noexcept - { - SAI_THRIFT_LOG_DBG("Called."); - - sai_next_hop_group_api_t *nhop_group_api = nullptr; - auto status = sai_api_query(SAI_API_NEXT_HOP_GROUP, reinterpret_cast(&nhop_group_api)); - - if (status != SAI_STATUS_SUCCESS) - { SAI_THRIFT_LOG_ERR("Failed to get API."); return SAI_NULL_OBJECT_ID; } - - sai_attribute_t *attr_list = nullptr; - sai_uint32_t attr_size = thrift_attr_list.size(); - sai_thrift_alloc_attr(attr_list, attr_size); - sai_thrift_parse_next_hop_group_attributes(attr_list, thrift_attr_list); - - sai_object_id_t nhop_group_oid = 0; - status = nhop_group_api->create_next_hop_group(&nhop_group_oid, gSwitchId, attr_size, attr_list); - sai_thrift_free_attr(attr_list); - - if (status == SAI_STATUS_SUCCESS) - { SAI_THRIFT_LOG_DBG("Exited."); return nhop_group_oid; } - - SAI_THRIFT_LOG_ERR("Failed to create group."); - - return SAI_NULL_OBJECT_ID; - } - - sai_thrift_status_t sai_thrift_remove_next_hop_group - (const sai_thrift_object_id_t nhop_group_oid) noexcept - { - SAI_THRIFT_LOG_DBG("Called."); - - sai_next_hop_group_api_t *nhop_group_api = nullptr; - auto status = sai_api_query(SAI_API_NEXT_HOP_GROUP, reinterpret_cast(&nhop_group_api)); - - if (status != SAI_STATUS_SUCCESS) - { SAI_THRIFT_LOG_ERR("Failed to get API."); return status; } - - status = nhop_group_api->remove_next_hop_group(nhop_group_oid); - - SAI_THRIFT_LOG_DBG("Exited."); - - return status; - } - - void sai_thrift_parse_next_hop_group_member_attributes - (sai_attribute_t *attr_list, const std::vector &thrift_attr_list) noexcept - { - if (thrift_attr_list.empty() || attr_list == nullptr) { SAI_THRIFT_LOG_ERR("Invalid input arguments."); } - - std::vector::const_iterator cit = thrift_attr_list.begin(); - - for (sai_uint32_t i = 0; i < thrift_attr_list.size(); i++, cit++) - { - sai_thrift_attribute_t attribute = *cit; - attr_list[i].id = attribute.id; - - switch (attribute.id) - { - case SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_GROUP_ID: - case SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_ID: - attr_list[i].value.oid = attribute.value.oid; - break; - - case SAI_NEXT_HOP_GROUP_MEMBER_ATTR_WEIGHT: - attr_list[i].value.u32 = attribute.value.u32; - break; - - default: - SAI_THRIFT_LOG_ERR("Failed to parse attributes."); - break; - } - } - } - - sai_thrift_object_id_t sai_thrift_create_next_hop_group_member - (const std::vector &thrift_attr_list) noexcept - { - SAI_THRIFT_LOG_DBG("Called."); - - sai_next_hop_group_api_t *nhop_group_api = nullptr; - auto status = sai_api_query(SAI_API_NEXT_HOP_GROUP, reinterpret_cast(&nhop_group_api)); - - if (status != SAI_STATUS_SUCCESS) - { SAI_THRIFT_LOG_ERR("Failed to get API."); return SAI_NULL_OBJECT_ID; } - - sai_attribute_t *attr_list = nullptr; - sai_uint32_t attr_size = thrift_attr_list.size(); - sai_thrift_alloc_attr(attr_list, attr_size); - sai_thrift_parse_next_hop_group_member_attributes(attr_list, thrift_attr_list); - - sai_object_id_t nhop_group_member_oid = 0; - status = nhop_group_api->create_next_hop_group_member(&nhop_group_member_oid, gSwitchId, attr_size, attr_list); - sai_thrift_free_attr(attr_list); - - if (status == SAI_STATUS_SUCCESS) - { SAI_THRIFT_LOG_DBG("Exited."); return nhop_group_member_oid; } - - SAI_THRIFT_LOG_ERR("Failed to create group member."); - - return SAI_NULL_OBJECT_ID; - } - - sai_thrift_status_t sai_thrift_remove_next_hop_group_member - (const sai_thrift_object_id_t nhop_group_member_oid) noexcept - { - SAI_THRIFT_LOG_DBG("Called."); - - sai_next_hop_group_api_t *nhop_group_api = nullptr; - auto status = sai_api_query(SAI_API_NEXT_HOP_GROUP, reinterpret_cast(&nhop_group_api)); - - if (status != SAI_STATUS_SUCCESS) - { SAI_THRIFT_LOG_ERR("Failed to get API."); return status; } - - status = nhop_group_api->remove_next_hop_group_member(nhop_group_member_oid); - - SAI_THRIFT_LOG_DBG("Exited."); - - return status; - } -}; - -static void * switch_sai_thrift_rpc_server_thread(void *arg) { - int port = *(int *) arg; - shared_ptr handler(new switch_sai_rpcHandler()); - shared_ptr processor(new switch_sai_rpcProcessor(handler)); - shared_ptr serverTransport(new TServerSocket(port)); - shared_ptr transportFactory(new TBufferedTransportFactory()); - shared_ptr protocolFactory(new TBinaryProtocolFactory()); - - TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); - server.serve(); - return 0; -} - -static pthread_t switch_sai_thrift_rpc_thread; - -extern "C" { - -int start_sai_thrift_rpc_server(int port) -{ - static int param = port; - - std::cerr << "Starting SAI RPC server on port " << port << std::endl; - - int rc = pthread_create(&switch_sai_thrift_rpc_thread, NULL, switch_sai_thrift_rpc_server_thread, ¶m); - std::cerr << "create pthread switch_sai_thrift_rpc_server_thread result " << rc << std::endl; - - rc = pthread_detach(switch_sai_thrift_rpc_thread); - std::cerr << "detach switch_sai_thrift_rpc_server_thread rc" << rc << std::endl; - - return rc; -} -} diff --git a/bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.h b/bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.h deleted file mode 100644 index ceece254c..000000000 --- a/bm/sai_adapter/test/sai_thrift_src/switch_sai_rpc_server.h +++ /dev/null @@ -1,3 +0,0 @@ -extern "C" { -int start_sai_thrift_rpc_server(int port); -} diff --git a/bm/sai_adapter/test/sai_types.py b/bm/sai_adapter/test/sai_types.py deleted file mode 100644 index e6ed2917d..000000000 --- a/bm/sai_adapter/test/sai_types.py +++ /dev/null @@ -1,6801 +0,0 @@ -'''Wrapper for sai.h - -Generated with: -/usr/local/bin/ctypesgen.py ../../../inc/sai.h ../../../inc/saiacl.h ../../../inc/saibridge.h ../../../inc/saibuffer.h ../../../inc/saifdb.h ../../../inc/saihash.h ../../../inc/saihostif.h ../../../inc/saiipmc.h ../../../inc/saiipmcgroup.h ../../../inc/sail2mc.h ../../../inc/sail2mcgroup.h ../../../inc/sailag.h ../../../inc/saimcastfdb.h ../../../inc/saimirror.h ../../../inc/saineighbor.h ../../../inc/sainexthop.h ../../../inc/sainexthopgroup.h ../../../inc/saiobject.h ../../../inc/saipolicer.h ../../../inc/saiport.h ../../../inc/saiqosmap.h ../../../inc/saiqueue.h ../../../inc/sairoute.h ../../../inc/sairouterinterface.h ../../../inc/sairpfgroup.h ../../../inc/saisamplepacket.h ../../../inc/saischeduler.h ../../../inc/saischedulergroup.h ../../../inc/saistatus.h ../../../inc/saistp.h ../../../inc/saiswitch.h ../../../inc/saitunnel.h ../../../inc/saitypes.h ../../../inc/saiudf.h ../../../inc/saivirtualrouter.h ../../../inc/saivlan.h ../../../inc/saiwred.h -o sai_types.py -I../../../inc - -Do not modify this file. -''' - -__docformat__ = 'restructuredtext' - -# Begin preamble - -import ctypes, os, sys -from ctypes import * - -_int_types = (c_int16, c_int32) -if hasattr(ctypes, 'c_int64'): - # Some builds of ctypes apparently do not have c_int64 - # defined; it's a pretty good bet that these builds do not - # have 64-bit pointers. - _int_types += (c_int64,) -for t in _int_types: - if sizeof(t) == sizeof(c_size_t): - c_ptrdiff_t = t -del t -del _int_types - -class c_void(Structure): - # c_void_p is a buggy return type, converting to int, so - # POINTER(None) == c_void_p is actually written as - # POINTER(c_void), so it can be treated as a real pointer. - _fields_ = [('dummy', c_int)] - -def POINTER(obj): - p = ctypes.POINTER(obj) - - # Convert None to a real NULL pointer to work around bugs - # in how ctypes handles None on 64-bit platforms - if not isinstance(p.from_param, classmethod): - def from_param(cls, x): - if x is None: - return cls() - else: - return x - p.from_param = classmethod(from_param) - - return p - -class UserString: - def __init__(self, seq): - if isinstance(seq, basestring): - self.data = seq - elif isinstance(seq, UserString): - self.data = seq.data[:] - else: - self.data = str(seq) - def __str__(self): return str(self.data) - def __repr__(self): return repr(self.data) - def __int__(self): return int(self.data) - def __long__(self): return long(self.data) - def __float__(self): return float(self.data) - def __complex__(self): return complex(self.data) - def __hash__(self): return hash(self.data) - - def __cmp__(self, string): - if isinstance(string, UserString): - return cmp(self.data, string.data) - else: - return cmp(self.data, string) - def __contains__(self, char): - return char in self.data - - def __len__(self): return len(self.data) - def __getitem__(self, index): return self.__class__(self.data[index]) - def __getslice__(self, start, end): - start = max(start, 0); end = max(end, 0) - return self.__class__(self.data[start:end]) - - def __add__(self, other): - if isinstance(other, UserString): - return self.__class__(self.data + other.data) - elif isinstance(other, basestring): - return self.__class__(self.data + other) - else: - return self.__class__(self.data + str(other)) - def __radd__(self, other): - if isinstance(other, basestring): - return self.__class__(other + self.data) - else: - return self.__class__(str(other) + self.data) - def __mul__(self, n): - return self.__class__(self.data*n) - __rmul__ = __mul__ - def __mod__(self, args): - return self.__class__(self.data % args) - - # the following methods are defined in alphabetical order: - def capitalize(self): return self.__class__(self.data.capitalize()) - def center(self, width, *args): - return self.__class__(self.data.center(width, *args)) - def count(self, sub, start=0, end=sys.maxint): - return self.data.count(sub, start, end) - def decode(self, encoding=None, errors=None): # XXX improve this? - if encoding: - if errors: - return self.__class__(self.data.decode(encoding, errors)) - else: - return self.__class__(self.data.decode(encoding)) - else: - return self.__class__(self.data.decode()) - def encode(self, encoding=None, errors=None): # XXX improve this? - if encoding: - if errors: - return self.__class__(self.data.encode(encoding, errors)) - else: - return self.__class__(self.data.encode(encoding)) - else: - return self.__class__(self.data.encode()) - def endswith(self, suffix, start=0, end=sys.maxint): - return self.data.endswith(suffix, start, end) - def expandtabs(self, tabsize=8): - return self.__class__(self.data.expandtabs(tabsize)) - def find(self, sub, start=0, end=sys.maxint): - return self.data.find(sub, start, end) - def index(self, sub, start=0, end=sys.maxint): - return self.data.index(sub, start, end) - def isalpha(self): return self.data.isalpha() - def isalnum(self): return self.data.isalnum() - def isdecimal(self): return self.data.isdecimal() - def isdigit(self): return self.data.isdigit() - def islower(self): return self.data.islower() - def isnumeric(self): return self.data.isnumeric() - def isspace(self): return self.data.isspace() - def istitle(self): return self.data.istitle() - def isupper(self): return self.data.isupper() - def join(self, seq): return self.data.join(seq) - def ljust(self, width, *args): - return self.__class__(self.data.ljust(width, *args)) - def lower(self): return self.__class__(self.data.lower()) - def lstrip(self, chars=None): return self.__class__(self.data.lstrip(chars)) - def partition(self, sep): - return self.data.partition(sep) - def replace(self, old, new, maxsplit=-1): - return self.__class__(self.data.replace(old, new, maxsplit)) - def rfind(self, sub, start=0, end=sys.maxint): - return self.data.rfind(sub, start, end) - def rindex(self, sub, start=0, end=sys.maxint): - return self.data.rindex(sub, start, end) - def rjust(self, width, *args): - return self.__class__(self.data.rjust(width, *args)) - def rpartition(self, sep): - return self.data.rpartition(sep) - def rstrip(self, chars=None): return self.__class__(self.data.rstrip(chars)) - def split(self, sep=None, maxsplit=-1): - return self.data.split(sep, maxsplit) - def rsplit(self, sep=None, maxsplit=-1): - return self.data.rsplit(sep, maxsplit) - def splitlines(self, keepends=0): return self.data.splitlines(keepends) - def startswith(self, prefix, start=0, end=sys.maxint): - return self.data.startswith(prefix, start, end) - def strip(self, chars=None): return self.__class__(self.data.strip(chars)) - def swapcase(self): return self.__class__(self.data.swapcase()) - def title(self): return self.__class__(self.data.title()) - def translate(self, *args): - return self.__class__(self.data.translate(*args)) - def upper(self): return self.__class__(self.data.upper()) - def zfill(self, width): return self.__class__(self.data.zfill(width)) - -class MutableString(UserString): - """mutable string objects - - Python strings are immutable objects. This has the advantage, that - strings may be used as dictionary keys. If this property isn't needed - and you insist on changing string values in place instead, you may cheat - and use MutableString. - - But the purpose of this class is an educational one: to prevent - people from inventing their own mutable string class derived - from UserString and than forget thereby to remove (override) the - __hash__ method inherited from UserString. This would lead to - errors that would be very hard to track down. - - A faster and better solution is to rewrite your program using lists.""" - def __init__(self, string=""): - self.data = string - def __hash__(self): - raise TypeError("unhashable type (it is mutable)") - def __setitem__(self, index, sub): - if index < 0: - index += len(self.data) - if index < 0 or index >= len(self.data): raise IndexError - self.data = self.data[:index] + sub + self.data[index+1:] - def __delitem__(self, index): - if index < 0: - index += len(self.data) - if index < 0 or index >= len(self.data): raise IndexError - self.data = self.data[:index] + self.data[index+1:] - def __setslice__(self, start, end, sub): - start = max(start, 0); end = max(end, 0) - if isinstance(sub, UserString): - self.data = self.data[:start]+sub.data+self.data[end:] - elif isinstance(sub, basestring): - self.data = self.data[:start]+sub+self.data[end:] - else: - self.data = self.data[:start]+str(sub)+self.data[end:] - def __delslice__(self, start, end): - start = max(start, 0); end = max(end, 0) - self.data = self.data[:start] + self.data[end:] - def immutable(self): - return UserString(self.data) - def __iadd__(self, other): - if isinstance(other, UserString): - self.data += other.data - elif isinstance(other, basestring): - self.data += other - else: - self.data += str(other) - return self - def __imul__(self, n): - self.data *= n - return self - -class String(MutableString, Union): - - _fields_ = [('raw', POINTER(c_char)), - ('data', c_char_p)] - - def __init__(self, obj=""): - if isinstance(obj, (str, unicode, UserString)): - self.data = str(obj) - else: - self.raw = obj - - def __len__(self): - return self.data and len(self.data) or 0 - - def from_param(cls, obj): - # Convert None or 0 - if obj is None or obj == 0: - return cls(POINTER(c_char)()) - - # Convert from String - elif isinstance(obj, String): - return obj - - # Convert from str - elif isinstance(obj, str): - return cls(obj) - - # Convert from c_char_p - elif isinstance(obj, c_char_p): - return obj - - # Convert from POINTER(c_char) - elif isinstance(obj, POINTER(c_char)): - return obj - - # Convert from raw pointer - elif isinstance(obj, int): - return cls(cast(obj, POINTER(c_char))) - - # Convert from object - else: - return String.from_param(obj._as_parameter_) - from_param = classmethod(from_param) - -def ReturnString(obj, func=None, arguments=None): - return String.from_param(obj) - -# As of ctypes 1.0, ctypes does not support custom error-checking -# functions on callbacks, nor does it support custom datatypes on -# callbacks, so we must ensure that all callbacks return -# primitive datatypes. -# -# Non-primitive return values wrapped with UNCHECKED won't be -# typechecked, and will be converted to c_void_p. -def UNCHECKED(type): - if (hasattr(type, "_type_") and isinstance(type._type_, str) - and type._type_ != "P"): - return type - else: - return c_void_p - -# ctypes doesn't have direct support for variadic functions, so we have to write -# our own wrapper class -class _variadic_function(object): - def __init__(self,func,restype,argtypes): - self.func=func - self.func.restype=restype - self.argtypes=argtypes - def _as_parameter_(self): - # So we can pass this variadic function as a function pointer - return self.func - def __call__(self,*args): - fixed_args=[] - i=0 - for argtype in self.argtypes: - # Typecheck what we can - fixed_args.append(argtype.from_param(args[i])) - i+=1 - return self.func(*fixed_args+list(args[i:])) - -# End preamble - -_libs = {} -_libdirs = [] - -# Begin loader - -# ---------------------------------------------------------------------------- -# Copyright (c) 2008 David James -# Copyright (c) 2006-2008 Alex Holkner -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of pyglet nor the names of its -# contributors may be used to endorse or promote products -# derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# ---------------------------------------------------------------------------- - -import os.path, re, sys, glob -import ctypes -import ctypes.util - -def _environ_path(name): - if name in os.environ: - return os.environ[name].split(":") - else: - return [] - -class LibraryLoader(object): - def __init__(self): - self.other_dirs=[] - - def load_library(self,libname): - """Given the name of a library, load it.""" - paths = self.getpaths(libname) - - for path in paths: - if os.path.exists(path): - return self.load(path) - - raise ImportError("%s not found." % libname) - - def load(self,path): - """Given a path to a library, load it.""" - try: - # Darwin requires dlopen to be called with mode RTLD_GLOBAL instead - # of the default RTLD_LOCAL. Without this, you end up with - # libraries not being loadable, resulting in "Symbol not found" - # errors - if sys.platform == 'darwin': - return ctypes.CDLL(path, ctypes.RTLD_GLOBAL) - else: - return ctypes.cdll.LoadLibrary(path) - except OSError,e: - raise ImportError(e) - - def getpaths(self,libname): - """Return a list of paths where the library might be found.""" - if os.path.isabs(libname): - yield libname - - else: - for path in self.getplatformpaths(libname): - yield path - - path = ctypes.util.find_library(libname) - if path: yield path - - def getplatformpaths(self, libname): - return [] - -# Darwin (Mac OS X) - -class DarwinLibraryLoader(LibraryLoader): - name_formats = ["lib%s.dylib", "lib%s.so", "lib%s.bundle", "%s.dylib", - "%s.so", "%s.bundle", "%s"] - - def getplatformpaths(self,libname): - if os.path.pathsep in libname: - names = [libname] - else: - names = [format % libname for format in self.name_formats] - - for dir in self.getdirs(libname): - for name in names: - yield os.path.join(dir,name) - - def getdirs(self,libname): - '''Implements the dylib search as specified in Apple documentation: - - http://developer.apple.com/documentation/DeveloperTools/Conceptual/ - DynamicLibraries/Articles/DynamicLibraryUsageGuidelines.html - - Before commencing the standard search, the method first checks - the bundle's ``Frameworks`` directory if the application is running - within a bundle (OS X .app). - ''' - - dyld_fallback_library_path = _environ_path("DYLD_FALLBACK_LIBRARY_PATH") - if not dyld_fallback_library_path: - dyld_fallback_library_path = [os.path.expanduser('~/lib'), - '/usr/local/lib', '/usr/lib'] - - dirs = [] - - if '/' in libname: - dirs.extend(_environ_path("DYLD_LIBRARY_PATH")) - else: - dirs.extend(_environ_path("LD_LIBRARY_PATH")) - dirs.extend(_environ_path("DYLD_LIBRARY_PATH")) - - dirs.extend(self.other_dirs) - dirs.append(".") - - if hasattr(sys, 'frozen') and sys.frozen == 'macosx_app': - dirs.append(os.path.join( - os.environ['RESOURCEPATH'], - '..', - 'Frameworks')) - - dirs.extend(dyld_fallback_library_path) - - return dirs - -# Posix - -class PosixLibraryLoader(LibraryLoader): - _ld_so_cache = None - - def _create_ld_so_cache(self): - # Recreate search path followed by ld.so. This is going to be - # slow to build, and incorrect (ld.so uses ld.so.cache, which may - # not be up-to-date). Used only as fallback for distros without - # /sbin/ldconfig. - # - # We assume the DT_RPATH and DT_RUNPATH binary sections are omitted. - - directories = [] - for name in ("LD_LIBRARY_PATH", - "SHLIB_PATH", # HPUX - "LIBPATH", # OS/2, AIX - "LIBRARY_PATH", # BE/OS - ): - if name in os.environ: - directories.extend(os.environ[name].split(os.pathsep)) - directories.extend(self.other_dirs) - directories.append(".") - - try: directories.extend([dir.strip() for dir in open('/etc/ld.so.conf')]) - except IOError: pass - - directories.extend(['/lib', '/usr/lib', '/lib64', '/usr/lib64']) - - cache = {} - lib_re = re.compile(r'lib(.*)\.s[ol]') - ext_re = re.compile(r'\.s[ol]$') - for dir in directories: - try: - for path in glob.glob("%s/*.s[ol]*" % dir): - file = os.path.basename(path) - - # Index by filename - if file not in cache: - cache[file] = path - - # Index by library name - match = lib_re.match(file) - if match: - library = match.group(1) - if library not in cache: - cache[library] = path - except OSError: - pass - - self._ld_so_cache = cache - - def getplatformpaths(self, libname): - if self._ld_so_cache is None: - self._create_ld_so_cache() - - result = self._ld_so_cache.get(libname) - if result: yield result - - path = ctypes.util.find_library(libname) - if path: yield os.path.join("/lib",path) - -# Windows - -class _WindowsLibrary(object): - def __init__(self, path): - self.cdll = ctypes.cdll.LoadLibrary(path) - self.windll = ctypes.windll.LoadLibrary(path) - - def __getattr__(self, name): - try: return getattr(self.cdll,name) - except AttributeError: - try: return getattr(self.windll,name) - except AttributeError: - raise - -class WindowsLibraryLoader(LibraryLoader): - name_formats = ["%s.dll", "lib%s.dll", "%slib.dll"] - - def load_library(self, libname): - try: - result = LibraryLoader.load_library(self, libname) - except ImportError: - result = None - if os.path.sep not in libname: - for name in self.name_formats: - try: - result = getattr(ctypes.cdll, name % libname) - if result: - break - except WindowsError: - result = None - if result is None: - try: - result = getattr(ctypes.cdll, libname) - except WindowsError: - result = None - if result is None: - raise ImportError("%s not found." % libname) - return result - - def load(self, path): - return _WindowsLibrary(path) - - def getplatformpaths(self, libname): - if os.path.sep not in libname: - for name in self.name_formats: - dll_in_current_dir = os.path.abspath(name % libname) - if os.path.exists(dll_in_current_dir): - yield dll_in_current_dir - path = ctypes.util.find_library(name % libname) - if path: - yield path - -# Platform switching - -# If your value of sys.platform does not appear in this dict, please contact -# the Ctypesgen maintainers. - -loaderclass = { - "darwin": DarwinLibraryLoader, - "cygwin": WindowsLibraryLoader, - "win32": WindowsLibraryLoader -} - -loader = loaderclass.get(sys.platform, PosixLibraryLoader)() - -def add_library_search_dirs(other_dirs): - loader.other_dirs = other_dirs - -load_library = loader.load_library - -del loaderclass - -# End loader - -add_library_search_dirs([]) - -# No libraries - -# No modules - -sai_status_t = c_int32 # /home/omer/P4/SAI/inc/saitypes.h: 84 - -sai_switch_profile_id_t = c_uint32 # /home/omer/P4/SAI/inc/saitypes.h: 85 - -sai_vlan_id_t = c_uint16 # /home/omer/P4/SAI/inc/saitypes.h: 86 - -sai_attr_id_t = c_uint32 # /home/omer/P4/SAI/inc/saitypes.h: 87 - -sai_cos_t = c_uint8 # /home/omer/P4/SAI/inc/saitypes.h: 88 - -sai_queue_index_t = c_uint8 # /home/omer/P4/SAI/inc/saitypes.h: 89 - -sai_mac_t = c_uint8 * 6 # /home/omer/P4/SAI/inc/saitypes.h: 90 - -sai_ip4_t = c_uint32 # /home/omer/P4/SAI/inc/saitypes.h: 91 - -sai_ip6_t = c_uint8 * 16 # /home/omer/P4/SAI/inc/saitypes.h: 92 - -sai_switch_hash_seed_t = c_uint32 # /home/omer/P4/SAI/inc/saitypes.h: 93 - -sai_uint64_t = c_uint64 # /home/omer/P4/SAI/inc/saitypes.h: 107 - -sai_int64_t = c_int64 # /home/omer/P4/SAI/inc/saitypes.h: 108 - -sai_uint32_t = c_uint32 # /home/omer/P4/SAI/inc/saitypes.h: 109 - -sai_int32_t = c_int32 # /home/omer/P4/SAI/inc/saitypes.h: 110 - -sai_uint16_t = c_uint16 # /home/omer/P4/SAI/inc/saitypes.h: 111 - -sai_int16_t = c_int16 # /home/omer/P4/SAI/inc/saitypes.h: 112 - -sai_uint8_t = c_uint8 # /home/omer/P4/SAI/inc/saitypes.h: 113 - -sai_int8_t = c_int8 # /home/omer/P4/SAI/inc/saitypes.h: 114 - -sai_size_t = c_size_t # /home/omer/P4/SAI/inc/saitypes.h: 115 - -sai_object_id_t = c_uint64 # /home/omer/P4/SAI/inc/saitypes.h: 116 - -sai_pointer_t = POINTER(None) # /home/omer/P4/SAI/inc/saitypes.h: 117 - -# /home/omer/P4/SAI/inc/saitypes.h: 143 -class struct__sai_object_list_t(Structure): - pass - -struct__sai_object_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_object_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_object_id_t)), -] - -sai_object_list_t = struct__sai_object_list_t # /home/omer/P4/SAI/inc/saitypes.h: 143 - -enum__sai_common_api_t = c_int # /home/omer/P4/SAI/inc/saitypes.h: 154 - -SAI_COMMON_API_CREATE = 0 # /home/omer/P4/SAI/inc/saitypes.h: 154 - -SAI_COMMON_API_REMOVE = 1 # /home/omer/P4/SAI/inc/saitypes.h: 154 - -SAI_COMMON_API_SET = 2 # /home/omer/P4/SAI/inc/saitypes.h: 154 - -SAI_COMMON_API_GET = 3 # /home/omer/P4/SAI/inc/saitypes.h: 154 - -SAI_COMMON_API_MAX = 4 # /home/omer/P4/SAI/inc/saitypes.h: 154 - -sai_common_api_t = enum__sai_common_api_t # /home/omer/P4/SAI/inc/saitypes.h: 154 - -enum__sai_object_type_t = c_int # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_NULL = 0 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_PORT = 1 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_LAG = 2 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_VIRTUAL_ROUTER = 3 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_NEXT_HOP = 4 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_NEXT_HOP_GROUP = 5 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ROUTER_INTERFACE = 6 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ACL_TABLE = 7 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ACL_ENTRY = 8 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ACL_COUNTER = 9 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ACL_RANGE = 10 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ACL_TABLE_GROUP = 11 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ACL_TABLE_GROUP_MEMBER = 12 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_HOSTIF = 13 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_MIRROR_SESSION = 14 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_SAMPLEPACKET = 15 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_STP = 16 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_HOSTIF_TRAP_GROUP = 17 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_POLICER = 18 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_WRED = 19 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_QOS_MAP = 20 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_QUEUE = 21 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_SCHEDULER = 22 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_SCHEDULER_GROUP = 23 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_BUFFER_POOL = 24 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_BUFFER_PROFILE = 25 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_INGRESS_PRIORITY_GROUP = 26 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_LAG_MEMBER = 27 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_HASH = 28 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_UDF = 29 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_UDF_MATCH = 30 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_UDF_GROUP = 31 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_FDB_ENTRY = 32 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_SWITCH = 33 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_HOSTIF_TRAP = 34 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_HOSTIF_TABLE_ENTRY = 35 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_NEIGHBOR_ENTRY = 36 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_ROUTE_ENTRY = 37 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_VLAN = 38 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_VLAN_MEMBER = 39 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_HOSTIF_PACKET = 40 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_TUNNEL_MAP = 41 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_TUNNEL = 42 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY = 43 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_FDB_FLUSH = 44 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_NEXT_HOP_GROUP_MEMBER = 45 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_STP_PORT = 46 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_RPF_GROUP = 47 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_RPF_GROUP_MEMBER = 48 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_L2MC_GROUP = 49 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_L2MC_GROUP_MEMBER = 50 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_IPMC_GROUP = 51 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_IPMC_GROUP_MEMBER = 52 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_L2MC_ENTRY = 53 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_IPMC_ENTRY = 54 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_MCAST_FDB_ENTRY = 55 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_HOSTIF_USER_DEFINED_TRAP = 56 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_BRIDGE = 57 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_BRIDGE_PORT = 58 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_TUNNEL_MAP_ENTRY = 59 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -SAI_OBJECT_TYPE_MAX = 60 # /home/omer/P4/SAI/inc/saitypes.h: 221 - -sai_object_type_t = enum__sai_object_type_t # /home/omer/P4/SAI/inc/saitypes.h: 221 - -# /home/omer/P4/SAI/inc/saitypes.h: 226 -class struct__sai_u8_list_t(Structure): - pass - -struct__sai_u8_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_u8_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_uint8)), -] - -sai_u8_list_t = struct__sai_u8_list_t # /home/omer/P4/SAI/inc/saitypes.h: 226 - -# /home/omer/P4/SAI/inc/saitypes.h: 235 -class struct__sai_s8_list_t(Structure): - pass - -struct__sai_s8_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_s8_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_int8)), -] - -sai_s8_list_t = struct__sai_s8_list_t # /home/omer/P4/SAI/inc/saitypes.h: 235 - -# /home/omer/P4/SAI/inc/saitypes.h: 240 -class struct__sai_u16_list_t(Structure): - pass - -struct__sai_u16_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_u16_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_uint16)), -] - -sai_u16_list_t = struct__sai_u16_list_t # /home/omer/P4/SAI/inc/saitypes.h: 240 - -# /home/omer/P4/SAI/inc/saitypes.h: 245 -class struct__sai_s16_list_t(Structure): - pass - -struct__sai_s16_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_s16_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_int16)), -] - -sai_s16_list_t = struct__sai_s16_list_t # /home/omer/P4/SAI/inc/saitypes.h: 245 - -# /home/omer/P4/SAI/inc/saitypes.h: 250 -class struct__sai_u32_list_t(Structure): - pass - -struct__sai_u32_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_u32_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_uint32)), -] - -sai_u32_list_t = struct__sai_u32_list_t # /home/omer/P4/SAI/inc/saitypes.h: 250 - -# /home/omer/P4/SAI/inc/saitypes.h: 255 -class struct__sai_s32_list_t(Structure): - pass - -struct__sai_s32_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_s32_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(c_int32)), -] - -sai_s32_list_t = struct__sai_s32_list_t # /home/omer/P4/SAI/inc/saitypes.h: 255 - -# /home/omer/P4/SAI/inc/saitypes.h: 260 -class struct__sai_u32_range_t(Structure): - pass - -struct__sai_u32_range_t.__slots__ = [ - 'min', - 'max', -] -struct__sai_u32_range_t._fields_ = [ - ('min', c_uint32), - ('max', c_uint32), -] - -sai_u32_range_t = struct__sai_u32_range_t # /home/omer/P4/SAI/inc/saitypes.h: 260 - -# /home/omer/P4/SAI/inc/saitypes.h: 265 -class struct__sai_s32_range_t(Structure): - pass - -struct__sai_s32_range_t.__slots__ = [ - 'min', - 'max', -] -struct__sai_s32_range_t._fields_ = [ - ('min', c_int32), - ('max', c_int32), -] - -sai_s32_range_t = struct__sai_s32_range_t # /home/omer/P4/SAI/inc/saitypes.h: 265 - -# /home/omer/P4/SAI/inc/saitypes.h: 278 -class struct__sai_vlan_list_t(Structure): - pass - -struct__sai_vlan_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_vlan_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_vlan_id_t)), -] - -sai_vlan_list_t = struct__sai_vlan_list_t # /home/omer/P4/SAI/inc/saitypes.h: 278 - -enum__sai_ip_addr_family_t = c_int # /home/omer/P4/SAI/inc/saitypes.h: 286 - -SAI_IP_ADDR_FAMILY_IPV4 = 0 # /home/omer/P4/SAI/inc/saitypes.h: 286 - -SAI_IP_ADDR_FAMILY_IPV6 = (SAI_IP_ADDR_FAMILY_IPV4 + 1) # /home/omer/P4/SAI/inc/saitypes.h: 286 - -sai_ip_addr_family_t = enum__sai_ip_addr_family_t # /home/omer/P4/SAI/inc/saitypes.h: 286 - -# /home/omer/P4/SAI/inc/saitypes.h: 290 -class union_anon_14(Union): - pass - -union_anon_14.__slots__ = [ - 'ip4', - 'ip6', -] -union_anon_14._fields_ = [ - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), -] - -# /home/omer/P4/SAI/inc/saitypes.h: 294 -class struct__sai_ip_address_t(Structure): - pass - -struct__sai_ip_address_t.__slots__ = [ - 'addr_family', - 'addr', -] -struct__sai_ip_address_t._fields_ = [ - ('addr_family', sai_ip_addr_family_t), - ('addr', union_anon_14), -] - -sai_ip_address_t = struct__sai_ip_address_t # /home/omer/P4/SAI/inc/saitypes.h: 294 - -# /home/omer/P4/SAI/inc/saitypes.h: 298 -class union_anon_15(Union): - pass - -union_anon_15.__slots__ = [ - 'ip4', - 'ip6', -] -union_anon_15._fields_ = [ - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), -] - -# /home/omer/P4/SAI/inc/saitypes.h: 302 -class union_anon_16(Union): - pass - -union_anon_16.__slots__ = [ - 'ip4', - 'ip6', -] -union_anon_16._fields_ = [ - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), -] - -# /home/omer/P4/SAI/inc/saitypes.h: 306 -class struct__sai_ip_prefix_t(Structure): - pass - -struct__sai_ip_prefix_t.__slots__ = [ - 'addr_family', - 'addr', - 'mask', -] -struct__sai_ip_prefix_t._fields_ = [ - ('addr_family', sai_ip_addr_family_t), - ('addr', union_anon_15), - ('mask', union_anon_16), -] - -sai_ip_prefix_t = struct__sai_ip_prefix_t # /home/omer/P4/SAI/inc/saitypes.h: 306 - -# /home/omer/P4/SAI/inc/saitypes.h: 323 -class union_anon_17(Union): - pass - -union_anon_17.__slots__ = [ - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'mac', - 'ip4', - 'ip6', - 'u8list', -] -union_anon_17._fields_ = [ - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('u8list', sai_u8_list_t), -] - -# /home/omer/P4/SAI/inc/saitypes.h: 339 -class union_anon_18(Union): - pass - -union_anon_18.__slots__ = [ - 'booldata', - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'mac', - 'ip4', - 'ip6', - 'oid', - 'objlist', - 'u8list', -] -union_anon_18._fields_ = [ - ('booldata', c_uint8), - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('oid', sai_object_id_t), - ('objlist', sai_object_list_t), - ('u8list', sai_u8_list_t), -] - -# /home/omer/P4/SAI/inc/saitypes.h: 354 -class struct__sai_acl_field_data_t(Structure): - pass - -struct__sai_acl_field_data_t.__slots__ = [ - 'enable', - 'mask', - 'data', -] -struct__sai_acl_field_data_t._fields_ = [ - ('enable', c_uint8), - ('mask', union_anon_17), - ('data', union_anon_18), -] - -sai_acl_field_data_t = struct__sai_acl_field_data_t # /home/omer/P4/SAI/inc/saitypes.h: 354 - -# /home/omer/P4/SAI/inc/saitypes.h: 371 -class union_anon_19(Union): - pass - -union_anon_19.__slots__ = [ - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'mac', - 'ip4', - 'ip6', - 'oid', - 'objlist', -] -union_anon_19._fields_ = [ - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('oid', sai_object_id_t), - ('objlist', sai_object_list_t), -] - -# /home/omer/P4/SAI/inc/saitypes.h: 385 -class struct__sai_acl_action_data_t(Structure): - pass - -struct__sai_acl_action_data_t.__slots__ = [ - 'enable', - 'parameter', -] -struct__sai_acl_action_data_t._fields_ = [ - ('enable', c_uint8), - ('parameter', union_anon_19), -] - -sai_acl_action_data_t = struct__sai_acl_action_data_t # /home/omer/P4/SAI/inc/saitypes.h: 385 - -enum__sai_packet_color_t = c_int # /home/omer/P4/SAI/inc/saitypes.h: 407 - -SAI_PACKET_COLOR_GREEN = 0 # /home/omer/P4/SAI/inc/saitypes.h: 407 - -SAI_PACKET_COLOR_YELLOW = (SAI_PACKET_COLOR_GREEN + 1) # /home/omer/P4/SAI/inc/saitypes.h: 407 - -SAI_PACKET_COLOR_RED = (SAI_PACKET_COLOR_YELLOW + 1) # /home/omer/P4/SAI/inc/saitypes.h: 407 - -sai_packet_color_t = enum__sai_packet_color_t # /home/omer/P4/SAI/inc/saitypes.h: 407 - -# /home/omer/P4/SAI/inc/saitypes.h: 447 -class struct__sai_qos_map_params_t(Structure): - pass - -struct__sai_qos_map_params_t.__slots__ = [ - 'tc', - 'dscp', - 'dot1p', - 'prio', - 'pg', - 'queue_index', - 'color', -] -struct__sai_qos_map_params_t._fields_ = [ - ('tc', sai_cos_t), - ('dscp', sai_uint8_t), - ('dot1p', sai_uint8_t), - ('prio', sai_uint8_t), - ('pg', sai_uint8_t), - ('queue_index', sai_queue_index_t), - ('color', sai_packet_color_t), -] - -sai_qos_map_params_t = struct__sai_qos_map_params_t # /home/omer/P4/SAI/inc/saitypes.h: 447 - -# /home/omer/P4/SAI/inc/saitypes.h: 457 -class struct__sai_qos_map_t(Structure): - pass - -struct__sai_qos_map_t.__slots__ = [ - 'key', - 'value', -] -struct__sai_qos_map_t._fields_ = [ - ('key', sai_qos_map_params_t), - ('value', sai_qos_map_params_t), -] - -sai_qos_map_t = struct__sai_qos_map_t # /home/omer/P4/SAI/inc/saitypes.h: 457 - -# /home/omer/P4/SAI/inc/saitypes.h: 466 -class struct__sai_qos_map_list_t(Structure): - pass - -struct__sai_qos_map_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_qos_map_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_qos_map_t)), -] - -sai_qos_map_list_t = struct__sai_qos_map_list_t # /home/omer/P4/SAI/inc/saitypes.h: 466 - -# /home/omer/P4/SAI/inc/saitypes.h: 482 -class struct__sai_tunnel_map_params_t(Structure): - pass - -struct__sai_tunnel_map_params_t.__slots__ = [ - 'oecn', - 'uecn', - 'vlan_id', - 'vni_id', -] -struct__sai_tunnel_map_params_t._fields_ = [ - ('oecn', sai_uint8_t), - ('uecn', sai_uint8_t), - ('vlan_id', sai_vlan_id_t), - ('vni_id', sai_uint32_t), -] - -sai_tunnel_map_params_t = struct__sai_tunnel_map_params_t # /home/omer/P4/SAI/inc/saitypes.h: 482 - -# /home/omer/P4/SAI/inc/saitypes.h: 492 -class struct__sai_tunnel_map_t(Structure): - pass - -struct__sai_tunnel_map_t.__slots__ = [ - 'key', - 'value', -] -struct__sai_tunnel_map_t._fields_ = [ - ('key', sai_tunnel_map_params_t), - ('value', sai_tunnel_map_params_t), -] - -sai_tunnel_map_t = struct__sai_tunnel_map_t # /home/omer/P4/SAI/inc/saitypes.h: 492 - -# /home/omer/P4/SAI/inc/saitypes.h: 502 -class struct__sai_tunnel_map_list_t(Structure): - pass - -struct__sai_tunnel_map_list_t.__slots__ = [ - 'count', - 'list', -] -struct__sai_tunnel_map_list_t._fields_ = [ - ('count', c_uint32), - ('list', POINTER(sai_tunnel_map_t)), -] - -sai_tunnel_map_list_t = struct__sai_tunnel_map_list_t # /home/omer/P4/SAI/inc/saitypes.h: 502 - -# /home/omer/P4/SAI/inc/saitypes.h: 524 -class struct__sai_acl_capability_t(Structure): - pass - -struct__sai_acl_capability_t.__slots__ = [ - 'is_action_list_mandatory', - 'action_list', -] -struct__sai_acl_capability_t._fields_ = [ - ('is_action_list_mandatory', c_uint8), - ('action_list', sai_s32_list_t), -] - -sai_acl_capability_t = struct__sai_acl_capability_t # /home/omer/P4/SAI/inc/saitypes.h: 524 - -enum__sai_fdb_entry_bridge_type_t = c_int # /home/omer/P4/SAI/inc/saitypes.h: 537 - -SAI_FDB_ENTRY_BRIDGE_TYPE_1Q = 0 # /home/omer/P4/SAI/inc/saitypes.h: 537 - -SAI_FDB_ENTRY_BRIDGE_TYPE_1D = (SAI_FDB_ENTRY_BRIDGE_TYPE_1Q + 1) # /home/omer/P4/SAI/inc/saitypes.h: 537 - -sai_fdb_entry_bridge_type_t = enum__sai_fdb_entry_bridge_type_t # /home/omer/P4/SAI/inc/saitypes.h: 537 - -# /home/omer/P4/SAI/inc/saitypes.h: 576 -class union_anon_20(Union): - pass - -union_anon_20.__slots__ = [ - 'booldata', - 'chardata', - 'u8', - 's8', - 'u16', - 's16', - 'u32', - 's32', - 'u64', - 's64', - 'ptr', - 'mac', - 'ip4', - 'ip6', - 'ipaddr', - 'ipprefix', - 'oid', - 'objlist', - 'u8list', - 's8list', - 'u16list', - 's16list', - 'u32list', - 's32list', - 'u32range', - 's32range', - 'vlanlist', - 'aclfield', - 'aclaction', - 'qosmap', - 'tunnelmap', - 'aclcapability', -] -union_anon_20._fields_ = [ - ('booldata', c_uint8), - ('chardata', c_char * 32), - ('u8', sai_uint8_t), - ('s8', sai_int8_t), - ('u16', sai_uint16_t), - ('s16', sai_int16_t), - ('u32', sai_uint32_t), - ('s32', sai_int32_t), - ('u64', sai_uint64_t), - ('s64', sai_int64_t), - ('ptr', sai_pointer_t), - ('mac', sai_mac_t), - ('ip4', sai_ip4_t), - ('ip6', sai_ip6_t), - ('ipaddr', sai_ip_address_t), - ('ipprefix', sai_ip_prefix_t), - ('oid', sai_object_id_t), - ('objlist', sai_object_list_t), - ('u8list', sai_u8_list_t), - ('s8list', sai_s8_list_t), - ('u16list', sai_u16_list_t), - ('s16list', sai_s16_list_t), - ('u32list', sai_u32_list_t), - ('s32list', sai_s32_list_t), - ('u32range', sai_u32_range_t), - ('s32range', sai_s32_range_t), - ('vlanlist', sai_vlan_list_t), - ('aclfield', sai_acl_field_data_t), - ('aclaction', sai_acl_action_data_t), - ('qosmap', sai_qos_map_list_t), - ('tunnelmap', sai_tunnel_map_list_t), - ('aclcapability', sai_acl_capability_t), -] - -sai_attribute_value_t = union_anon_20 # /home/omer/P4/SAI/inc/saitypes.h: 576 - -# /home/omer/P4/SAI/inc/saitypes.h: 581 -class struct__sai_attribute_t(Structure): - pass - -struct__sai_attribute_t.__slots__ = [ - 'id', - 'value', -] -struct__sai_attribute_t._fields_ = [ - ('id', sai_attr_id_t), - ('value', sai_attribute_value_t), -] - -sai_attribute_t = struct__sai_attribute_t # /home/omer/P4/SAI/inc/saitypes.h: 581 - -enum__sai_bulk_op_type_t = c_int # /home/omer/P4/SAI/inc/saitypes.h: 591 - -SAI_BULK_OP_TYPE_STOP_ON_ERROR = 0 # /home/omer/P4/SAI/inc/saitypes.h: 591 - -SAI_BULK_OP_TYPE_INGORE_ERROR = (SAI_BULK_OP_TYPE_STOP_ON_ERROR + 1) # /home/omer/P4/SAI/inc/saitypes.h: 591 - -sai_bulk_op_type_t = enum__sai_bulk_op_type_t # /home/omer/P4/SAI/inc/saitypes.h: 591 - -sai_bulk_object_create_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(c_uint32), POINTER(POINTER(sai_attribute_t)), sai_bulk_op_type_t, POINTER(sai_object_id_t), POINTER(sai_status_t)) # /home/omer/P4/SAI/inc/saitypes.h: 611 - -sai_bulk_object_remove_fn = CFUNCTYPE(UNCHECKED(sai_status_t), c_uint32, POINTER(sai_object_id_t), sai_bulk_op_type_t, POINTER(sai_status_t)) # /home/omer/P4/SAI/inc/saitypes.h: 633 - -enum__sai_acl_stage_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 47 - -SAI_ACL_STAGE_INGRESS = 0 # /home/omer/P4/SAI/inc/saiacl.h: 47 - -SAI_ACL_STAGE_EGRESS = (SAI_ACL_STAGE_INGRESS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 47 - -sai_acl_stage_t = enum__sai_acl_stage_t # /home/omer/P4/SAI/inc/saiacl.h: 47 - -enum__sai_acl_bind_point_type_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_PORT = 0 # /home/omer/P4/SAI/inc/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_LAG = (SAI_ACL_BIND_POINT_TYPE_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_VLAN = (SAI_ACL_BIND_POINT_TYPE_LAG + 1) # /home/omer/P4/SAI/inc/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_ROUTER_INTF = (SAI_ACL_BIND_POINT_TYPE_VLAN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 69 - -SAI_ACL_BIND_POINT_TYPE_SWITCH = (SAI_ACL_BIND_POINT_TYPE_ROUTER_INTF + 1) # /home/omer/P4/SAI/inc/saiacl.h: 69 - -sai_acl_bind_point_type_t = enum__sai_acl_bind_point_type_t # /home/omer/P4/SAI/inc/saiacl.h: 69 - -enum__sai_acl_ip_type_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ANY = 0 # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_IP = (SAI_ACL_IP_TYPE_ANY + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_NON_IP = (SAI_ACL_IP_TYPE_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_IPV4ANY = (SAI_ACL_IP_TYPE_NON_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_NON_IPV4 = (SAI_ACL_IP_TYPE_IPV4ANY + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_IPV6ANY = (SAI_ACL_IP_TYPE_NON_IPV4 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_NON_IPV6 = (SAI_ACL_IP_TYPE_IPV6ANY + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ARP = (SAI_ACL_IP_TYPE_NON_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ARP_REQUEST = (SAI_ACL_IP_TYPE_ARP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -SAI_ACL_IP_TYPE_ARP_REPLY = (SAI_ACL_IP_TYPE_ARP_REQUEST + 1) # /home/omer/P4/SAI/inc/saiacl.h: 106 - -sai_acl_ip_type_t = enum__sai_acl_ip_type_t # /home/omer/P4/SAI/inc/saiacl.h: 106 - -enum__sai_acl_ip_frag_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 128 - -SAI_ACL_IP_FRAG_ANY = 0 # /home/omer/P4/SAI/inc/saiacl.h: 128 - -SAI_ACL_IP_FRAG_NON_FRAG = (SAI_ACL_IP_FRAG_ANY + 1) # /home/omer/P4/SAI/inc/saiacl.h: 128 - -SAI_ACL_IP_FRAG_NON_FRAG_OR_HEAD = (SAI_ACL_IP_FRAG_NON_FRAG + 1) # /home/omer/P4/SAI/inc/saiacl.h: 128 - -SAI_ACL_IP_FRAG_HEAD = (SAI_ACL_IP_FRAG_NON_FRAG_OR_HEAD + 1) # /home/omer/P4/SAI/inc/saiacl.h: 128 - -SAI_ACL_IP_FRAG_NON_HEAD = (SAI_ACL_IP_FRAG_HEAD + 1) # /home/omer/P4/SAI/inc/saiacl.h: 128 - -sai_acl_ip_frag_t = enum__sai_acl_ip_frag_t # /home/omer/P4/SAI/inc/saiacl.h: 128 - -enum__sai_acl_action_type_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_REDIRECT = 0 # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_REDIRECT_LIST = (SAI_ACL_ACTION_TYPE_REDIRECT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_PACKET_ACTION = (SAI_ACL_ACTION_TYPE_REDIRECT_LIST + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_FLOOD = (SAI_ACL_ACTION_TYPE_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_COUNTER = (SAI_ACL_ACTION_TYPE_FLOOD + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_MIRROR_INGRESS = (SAI_ACL_ACTION_TYPE_COUNTER + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_MIRROR_EGRESS = (SAI_ACL_ACTION_TYPE_MIRROR_INGRESS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_POLICER = (SAI_ACL_ACTION_TYPE_MIRROR_EGRESS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_DECREMENT_TTL = (SAI_ACL_ACTION_TYPE_SET_POLICER + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_TC = (SAI_ACL_ACTION_TYPE_DECREMENT_TTL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_PACKET_COLOR = (SAI_ACL_ACTION_TYPE_SET_TC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_ID = (SAI_ACL_ACTION_TYPE_SET_PACKET_COLOR + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_PRI = (SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_ID = (SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_PRI = (SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_SRC_MAC = (SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DST_MAC = (SAI_ACL_ACTION_TYPE_SET_SRC_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_SRC_IP = (SAI_ACL_ACTION_TYPE_SET_DST_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DST_IP = (SAI_ACL_ACTION_TYPE_SET_SRC_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_SRC_IPV6 = (SAI_ACL_ACTION_TYPE_SET_DST_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DST_IPV6 = (SAI_ACL_ACTION_TYPE_SET_SRC_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DSCP = (SAI_ACL_ACTION_TYPE_SET_DST_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_ECN = (SAI_ACL_ACTION_TYPE_SET_DSCP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_L4_SRC_PORT = (SAI_ACL_ACTION_TYPE_SET_ECN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_L4_DST_PORT = (SAI_ACL_ACTION_TYPE_SET_L4_SRC_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_INGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ACTION_TYPE_SET_L4_DST_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_EGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ACTION_TYPE_INGRESS_SAMPLEPACKET_ENABLE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_CPU_QUEUE = (SAI_ACL_ACTION_TYPE_EGRESS_SAMPLEPACKET_ENABLE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_ACL_META_DATA = (SAI_ACL_ACTION_TYPE_SET_CPU_QUEUE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_EGRESS_BLOCK_PORT_LIST = (SAI_ACL_ACTION_TYPE_SET_ACL_META_DATA + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_USER_TRAP_ID = (SAI_ACL_ACTION_TYPE_EGRESS_BLOCK_PORT_LIST + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -SAI_ACL_ACTION_TYPE_SET_DO_NOT_LEARN = (SAI_ACL_ACTION_TYPE_SET_USER_TRAP_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 231 - -sai_acl_action_type_t = enum__sai_acl_action_type_t # /home/omer/P4/SAI/inc/saiacl.h: 231 - -enum__sai_acl_table_group_type_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 244 - -SAI_ACL_TABLE_GROUP_TYPE_SEQUENTIAL = 0 # /home/omer/P4/SAI/inc/saiacl.h: 244 - -SAI_ACL_TABLE_GROUP_TYPE_PARALLEL = (SAI_ACL_TABLE_GROUP_TYPE_SEQUENTIAL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 244 - -sai_acl_table_group_type_t = enum__sai_acl_table_group_type_t # /home/omer/P4/SAI/inc/saiacl.h: 244 - -enum__sai_acl_table_group_attr_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE = SAI_ACL_TABLE_GROUP_ATTR_START # /home/omer/P4/SAI/inc/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST = (SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_TYPE = (SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST + 1) # /home/omer/P4/SAI/inc/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_END = (SAI_ACL_TABLE_GROUP_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiacl.h: 313 - -SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiacl.h: 313 - -sai_acl_table_group_attr_t = enum__sai_acl_table_group_attr_t # /home/omer/P4/SAI/inc/saiacl.h: 313 - -enum__sai_acl_table_group_member_attr_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 382 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiacl.h: 382 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID = SAI_ACL_TABLE_GROUP_MEMBER_ATTR_START # /home/omer/P4/SAI/inc/saiacl.h: 382 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 382 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_PRIORITY = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 382 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_END = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiacl.h: 382 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiacl.h: 382 - -SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiacl.h: 382 - -sai_acl_table_group_member_attr_t = enum__sai_acl_table_group_member_attr_t # /home/omer/P4/SAI/inc/saiacl.h: 382 - -enum__sai_acl_table_attr_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_ACL_STAGE = SAI_ACL_TABLE_ATTR_START # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST = (SAI_ACL_TABLE_ATTR_ACL_STAGE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_SIZE = (SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_ACL_ACTION_TYPE_LIST = (SAI_ACL_TABLE_ATTR_SIZE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_START = 4096 # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6 = SAI_ACL_TABLE_ATTR_FIELD_START # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6 = (SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IPV6 = (SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IPV6 = (SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC = (SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_DST_MAC = (SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_IP = (SAI_ACL_TABLE_ATTR_FIELD_DST_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_DST_IP = (SAI_ACL_TABLE_ATTR_FIELD_SRC_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IP = (SAI_ACL_TABLE_ATTR_FIELD_DST_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IP = (SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS = (SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS = (SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_IN_PORT = (SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT = (SAI_ACL_TABLE_ATTR_FIELD_IN_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_SRC_PORT = (SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID = (SAI_ACL_TABLE_ATTR_FIELD_SRC_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_PRI = (SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_CFI = (SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_ID = (SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_CFI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_PRI = (SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_CFI = (SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT = (SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_CFI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT = (SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE = (SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL = (SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_IP_IDENTIFICATION = (SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_DSCP = (SAI_ACL_TABLE_ATTR_FIELD_IP_IDENTIFICATION + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ECN = (SAI_ACL_TABLE_ATTR_FIELD_DSCP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_TTL = (SAI_ACL_TABLE_ATTR_FIELD_ECN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_TOS = (SAI_ACL_TABLE_ATTR_FIELD_TTL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_IP_FLAGS = (SAI_ACL_TABLE_ATTR_FIELD_TOS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS = (SAI_ACL_TABLE_ATTR_FIELD_IP_FLAGS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE = (SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_FRAG = (SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_IPV6_FLOW_LABEL = (SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_FRAG + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_TC = (SAI_ACL_TABLE_ATTR_FIELD_IPV6_FLOW_LABEL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE = (SAI_ACL_TABLE_ATTR_FIELD_TC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE = (SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_PACKET_VLAN = (SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_FDB_DST_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_PACKET_VLAN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_FDB_DST_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_DST_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_ROUTE_DST_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_PORT_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_DST_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_VLAN_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_PORT_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_USER_META = (SAI_ACL_TABLE_ATTR_FIELD_VLAN_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_FDB_NPU_META_DST_HIT = (SAI_ACL_TABLE_ATTR_FIELD_ACL_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT = (SAI_ACL_TABLE_ATTR_FIELD_FDB_NPU_META_DST_HIT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ROUTE_NPU_META_DST_HIT = (SAI_ACL_TABLE_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MIN = (SAI_ACL_TABLE_ATTR_FIELD_ROUTE_NPU_META_DST_HIT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MAX = (SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MIN + 255) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE = (SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MAX + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_IPV6_NEXT_HEADER = (SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_IPV6_NEXT_HEADER # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_END = (SAI_ACL_TABLE_ATTR_FIELD_END + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiacl.h: 959 - -SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_END = (SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiacl.h: 959 - -sai_acl_table_attr_t = enum__sai_acl_table_attr_t # /home/omer/P4/SAI/inc/saiacl.h: 959 - -enum__sai_acl_entry_attr_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_TABLE_ID = SAI_ACL_ENTRY_ATTR_START # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_PRIORITY = (SAI_ACL_ENTRY_ATTR_TABLE_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ADMIN_STATE = (SAI_ACL_ENTRY_ATTR_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_START = 4096 # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_IPV6 = SAI_ACL_ENTRY_ATTR_FIELD_START # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_DST_IPV6 = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IPV6 = (SAI_ACL_ENTRY_ATTR_FIELD_DST_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IPV6 = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_MAC = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_DST_MAC = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP = (SAI_ACL_ENTRY_ATTR_FIELD_DST_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_DST_IP = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IP = (SAI_ACL_ENTRY_ATTR_FIELD_DST_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IP = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS = (SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORTS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_IN_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_SRC_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_FIELD_SRC_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_CFI = (SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_CFI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_CFI = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_L4_SRC_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_CFI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_L4_DST_PORT = (SAI_ACL_ENTRY_ATTR_FIELD_L4_SRC_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ETHER_TYPE = (SAI_ACL_ENTRY_ATTR_FIELD_L4_DST_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_IP_PROTOCOL = (SAI_ACL_ENTRY_ATTR_FIELD_ETHER_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_IP_IDENTIFICATION = (SAI_ACL_ENTRY_ATTR_FIELD_IP_PROTOCOL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_DSCP = (SAI_ACL_ENTRY_ATTR_FIELD_IP_IDENTIFICATION + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ECN = (SAI_ACL_ENTRY_ATTR_FIELD_DSCP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_TTL = (SAI_ACL_ENTRY_ATTR_FIELD_ECN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_TOS = (SAI_ACL_ENTRY_ATTR_FIELD_TTL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_IP_FLAGS = (SAI_ACL_ENTRY_ATTR_FIELD_TOS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_TCP_FLAGS = (SAI_ACL_ENTRY_ATTR_FIELD_IP_FLAGS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE = (SAI_ACL_ENTRY_ATTR_FIELD_TCP_FLAGS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_FRAG = (SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_IPV6_FLOW_LABEL = (SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_FRAG + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_TC = (SAI_ACL_ENTRY_ATTR_FIELD_IPV6_FLOW_LABEL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ICMP_TYPE = (SAI_ACL_ENTRY_ATTR_FIELD_TC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ICMP_CODE = (SAI_ACL_ENTRY_ATTR_FIELD_ICMP_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_PACKET_VLAN = (SAI_ACL_ENTRY_ATTR_FIELD_ICMP_CODE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_FDB_DST_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_PACKET_VLAN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_DST_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_FDB_DST_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_DST_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_DST_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_PORT_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_DST_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_VLAN_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_PORT_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_USER_META = (SAI_ACL_ENTRY_ATTR_FIELD_VLAN_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_FDB_NPU_META_DST_HIT = (SAI_ACL_ENTRY_ATTR_FIELD_ACL_USER_META + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT = (SAI_ACL_ENTRY_ATTR_FIELD_FDB_NPU_META_DST_HIT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_NPU_META_DST_HIT = (SAI_ACL_ENTRY_ATTR_FIELD_NEIGHBOR_NPU_META_DST_HIT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MIN = (SAI_ACL_ENTRY_ATTR_FIELD_ROUTE_NPU_META_DST_HIT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MAX = (SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MIN + 255) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_ACL_RANGE_TYPE = (SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MAX + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_IPV6_NEXT_HEADER = (SAI_ACL_ENTRY_ATTR_FIELD_ACL_RANGE_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_IPV6_NEXT_HEADER # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_START = 8192 # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT = SAI_ACL_ENTRY_ATTR_ACTION_START # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT_LIST = (SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_PACKET_ACTION = (SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT_LIST + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_FLOOD = (SAI_ACL_ENTRY_ATTR_ACTION_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_COUNTER = (SAI_ACL_ENTRY_ATTR_ACTION_FLOOD + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS = (SAI_ACL_ENTRY_ATTR_ACTION_COUNTER + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS = (SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_POLICER = (SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_DECREMENT_TTL = (SAI_ACL_ENTRY_ATTR_ACTION_SET_POLICER + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_TC = (SAI_ACL_ENTRY_ATTR_ACTION_DECREMENT_TTL + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_PACKET_COLOR = (SAI_ACL_ENTRY_ATTR_ACTION_SET_TC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_ACTION_SET_PACKET_COLOR + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_ID = (SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_PRI = (SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_MAC = (SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_MAC = (SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IP = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_MAC + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IP = (SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IPV6 = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IPV6 = (SAI_ACL_ENTRY_ATTR_ACTION_SET_SRC_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DSCP = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DST_IPV6 + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_ECN = (SAI_ACL_ENTRY_ATTR_ACTION_SET_DSCP + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_SRC_PORT = (SAI_ACL_ENTRY_ATTR_ACTION_SET_ECN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_DST_PORT = (SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_SRC_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_INGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_DST_PORT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_SAMPLEPACKET_ENABLE = (SAI_ACL_ENTRY_ATTR_ACTION_INGRESS_SAMPLEPACKET_ENABLE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_CPU_QUEUE = (SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_SAMPLEPACKET_ENABLE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_ACL_META_DATA = (SAI_ACL_ENTRY_ATTR_ACTION_SET_CPU_QUEUE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_BLOCK_PORT_LIST = (SAI_ACL_ENTRY_ATTR_ACTION_SET_ACL_META_DATA + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_USER_TRAP_ID = (SAI_ACL_ENTRY_ATTR_ACTION_EGRESS_BLOCK_PORT_LIST + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_SET_DO_NOT_LEARN = (SAI_ACL_ENTRY_ATTR_ACTION_SET_USER_TRAP_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_ACTION_END = SAI_ACL_ENTRY_ATTR_ACTION_SET_DO_NOT_LEARN # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -SAI_ACL_ENTRY_ATTR_END = (SAI_ACL_ENTRY_ATTR_ACTION_END + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -sai_acl_entry_attr_t = enum__sai_acl_entry_attr_t # /home/omer/P4/SAI/inc/saiacl.h: 1781 - -enum__sai_acl_counter_attr_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -SAI_ACL_COUNTER_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -SAI_ACL_COUNTER_ATTR_TABLE_ID = SAI_ACL_COUNTER_ATTR_START # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -SAI_ACL_COUNTER_ATTR_ENABLE_PACKET_COUNT = (SAI_ACL_COUNTER_ATTR_TABLE_ID + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -SAI_ACL_COUNTER_ATTR_ENABLE_BYTE_COUNT = (SAI_ACL_COUNTER_ATTR_ENABLE_PACKET_COUNT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -SAI_ACL_COUNTER_ATTR_PACKETS = (SAI_ACL_COUNTER_ATTR_ENABLE_BYTE_COUNT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -SAI_ACL_COUNTER_ATTR_BYTES = (SAI_ACL_COUNTER_ATTR_PACKETS + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -SAI_ACL_COUNTER_ATTR_END = (SAI_ACL_COUNTER_ATTR_BYTES + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -sai_acl_counter_attr_t = enum__sai_acl_counter_attr_t # /home/omer/P4/SAI/inc/saiacl.h: 1851 - -enum__sai_acl_range_type_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 1873 - -SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE = 0 # /home/omer/P4/SAI/inc/saiacl.h: 1873 - -SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE = (SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1873 - -SAI_ACL_RANGE_TYPE_OUTER_VLAN = (SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1873 - -SAI_ACL_RANGE_TYPE_INNER_VLAN = (SAI_ACL_RANGE_TYPE_OUTER_VLAN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1873 - -SAI_ACL_RANGE_TYPE_PACKET_LENGTH = (SAI_ACL_RANGE_TYPE_INNER_VLAN + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1873 - -sai_acl_range_type_t = enum__sai_acl_range_type_t # /home/omer/P4/SAI/inc/saiacl.h: 1873 - -enum__sai_acl_range_attr_t = c_int # /home/omer/P4/SAI/inc/saiacl.h: 1913 - -SAI_ACL_RANGE_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiacl.h: 1913 - -SAI_ACL_RANGE_ATTR_TYPE = SAI_ACL_RANGE_ATTR_START # /home/omer/P4/SAI/inc/saiacl.h: 1913 - -SAI_ACL_RANGE_ATTR_LIMIT = (SAI_ACL_RANGE_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1913 - -SAI_ACL_RANGE_ATTR_END = (SAI_ACL_RANGE_ATTR_LIMIT + 1) # /home/omer/P4/SAI/inc/saiacl.h: 1913 - -sai_acl_range_attr_t = enum__sai_acl_range_attr_t # /home/omer/P4/SAI/inc/saiacl.h: 1913 - -sai_create_acl_table_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 1925 - -sai_remove_acl_table_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiacl.h: 1938 - -sai_set_acl_table_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 1949 - -sai_get_acl_table_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 1962 - -sai_create_acl_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 1977 - -sai_remove_acl_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiacl.h: 1990 - -sai_set_acl_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2001 - -sai_get_acl_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2014 - -sai_create_acl_counter_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2029 - -sai_remove_acl_counter_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiacl.h: 2042 - -sai_set_acl_counter_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2053 - -sai_get_acl_counter_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2066 - -sai_create_acl_range_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2081 - -sai_remove_acl_range_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiacl.h: 2094 - -sai_set_acl_range_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2104 - -sai_get_acl_range_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2117 - -sai_create_acl_table_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2131 - -sai_remove_acl_table_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiacl.h: 2144 - -sai_set_acl_table_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2155 - -sai_get_acl_table_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2168 - -sai_create_acl_table_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2182 - -sai_remove_acl_table_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiacl.h: 2195 - -sai_set_acl_table_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2206 - -sai_get_acl_table_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiacl.h: 2219 - -# /home/omer/P4/SAI/inc/saiacl.h: 2253 -class struct__sai_acl_api_t(Structure): - pass - -struct__sai_acl_api_t.__slots__ = [ - 'create_acl_table', - 'remove_acl_table', - 'set_acl_table_attribute', - 'get_acl_table_attribute', - 'create_acl_entry', - 'remove_acl_entry', - 'set_acl_entry_attribute', - 'get_acl_entry_attribute', - 'create_acl_counter', - 'remove_acl_counter', - 'set_acl_counter_attribute', - 'get_acl_counter_attribute', - 'create_acl_range', - 'remove_acl_range', - 'set_acl_range_attribute', - 'get_acl_range_attribute', - 'create_acl_table_group', - 'remove_acl_table_group', - 'set_acl_table_group_attribute', - 'get_acl_table_group_attribute', - 'create_acl_table_group_member', - 'remove_acl_table_group_member', - 'set_acl_table_group_member_attribute', - 'get_acl_table_group_member_attribute', -] -struct__sai_acl_api_t._fields_ = [ - ('create_acl_table', sai_create_acl_table_fn), - ('remove_acl_table', sai_remove_acl_table_fn), - ('set_acl_table_attribute', sai_set_acl_table_attribute_fn), - ('get_acl_table_attribute', sai_get_acl_table_attribute_fn), - ('create_acl_entry', sai_create_acl_entry_fn), - ('remove_acl_entry', sai_remove_acl_entry_fn), - ('set_acl_entry_attribute', sai_set_acl_entry_attribute_fn), - ('get_acl_entry_attribute', sai_get_acl_entry_attribute_fn), - ('create_acl_counter', sai_create_acl_counter_fn), - ('remove_acl_counter', sai_remove_acl_counter_fn), - ('set_acl_counter_attribute', sai_set_acl_counter_attribute_fn), - ('get_acl_counter_attribute', sai_get_acl_counter_attribute_fn), - ('create_acl_range', sai_create_acl_range_fn), - ('remove_acl_range', sai_remove_acl_range_fn), - ('set_acl_range_attribute', sai_set_acl_range_attribute_fn), - ('get_acl_range_attribute', sai_get_acl_range_attribute_fn), - ('create_acl_table_group', sai_create_acl_table_group_fn), - ('remove_acl_table_group', sai_remove_acl_table_group_fn), - ('set_acl_table_group_attribute', sai_set_acl_table_group_attribute_fn), - ('get_acl_table_group_attribute', sai_get_acl_table_group_attribute_fn), - ('create_acl_table_group_member', sai_create_acl_table_group_member_fn), - ('remove_acl_table_group_member', sai_remove_acl_table_group_member_fn), - ('set_acl_table_group_member_attribute', sai_set_acl_table_group_member_attribute_fn), - ('get_acl_table_group_member_attribute', sai_get_acl_table_group_member_attribute_fn), -] - -sai_acl_api_t = struct__sai_acl_api_t # /home/omer/P4/SAI/inc/saiacl.h: 2253 - -enum__sai_ingress_priority_group_attr_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 64 - -SAI_INGRESS_PRIORITY_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 64 - -SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE = SAI_INGRESS_PRIORITY_GROUP_ATTR_START # /home/omer/P4/SAI/inc/saibuffer.h: 64 - -SAI_INGRESS_PRIORITY_GROUP_ATTR_END = (SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 64 - -sai_ingress_priority_group_attr_t = enum__sai_ingress_priority_group_attr_t # /home/omer/P4/SAI/inc/saibuffer.h: 64 - -enum__sai_ingress_priority_group_stat_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_PACKETS = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_BYTES = 1 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_CURR_OCCUPANCY_BYTES = 2 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_WATERMARK_BYTES = 3 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_CURR_OCCUPANCY_BYTES = 4 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_WATERMARK_BYTES = 5 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_CURR_OCCUPANCY_BYTES = 6 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_WATERMARK_BYTES = 7 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS = 8 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -SAI_INGRESS_PRIORITY_GROUP_STAT_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -sai_ingress_priority_group_stat_t = enum__sai_ingress_priority_group_stat_t # /home/omer/P4/SAI/inc/saibuffer.h: 101 - -sai_create_ingress_priority_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 113 - -sai_remove_ingress_priority_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saibuffer.h: 126 - -sai_set_ingress_priority_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 137 - -sai_get_ingress_priority_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 150 - -sai_get_ingress_priority_group_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_ingress_priority_group_stat_t), c_uint32, POINTER(c_uint64)) # /home/omer/P4/SAI/inc/saibuffer.h: 165 - -sai_clear_ingress_priority_group_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_ingress_priority_group_stat_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 180 - -enum__sai_buffer_pool_type_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 196 - -SAI_BUFFER_POOL_TYPE_INGRESS = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 196 - -SAI_BUFFER_POOL_TYPE_EGRESS = (SAI_BUFFER_POOL_TYPE_INGRESS + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 196 - -sai_buffer_pool_type_t = enum__sai_buffer_pool_type_t # /home/omer/P4/SAI/inc/saibuffer.h: 196 - -enum__sai_buffer_pool_threshold_mode_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 209 - -SAI_BUFFER_POOL_THRESHOLD_MODE_STATIC = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 209 - -SAI_BUFFER_POOL_THRESHOLD_MODE_DYNAMIC = (SAI_BUFFER_POOL_THRESHOLD_MODE_STATIC + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 209 - -sai_buffer_pool_threshold_mode_t = enum__sai_buffer_pool_threshold_mode_t # /home/omer/P4/SAI/inc/saibuffer.h: 209 - -enum__sai_buffer_pool_attr_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -SAI_BUFFER_POOL_ATTR_START = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -SAI_BUFFER_POOL_ATTR_SHARED_SIZE = SAI_BUFFER_POOL_ATTR_START # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -SAI_BUFFER_POOL_ATTR_TYPE = (SAI_BUFFER_POOL_ATTR_SHARED_SIZE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -SAI_BUFFER_POOL_ATTR_SIZE = (SAI_BUFFER_POOL_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -SAI_BUFFER_POOL_ATTR_THRESHOLD_MODE = (SAI_BUFFER_POOL_ATTR_SIZE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -SAI_BUFFER_POOL_ATTR_XOFF_SIZE = (SAI_BUFFER_POOL_ATTR_THRESHOLD_MODE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -SAI_BUFFER_POOL_ATTR_END = (SAI_BUFFER_POOL_ATTR_XOFF_SIZE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -sai_buffer_pool_attr_t = enum__sai_buffer_pool_attr_t # /home/omer/P4/SAI/inc/saibuffer.h: 273 - -enum__sai_buffer_pool_stat_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 292 - -SAI_BUFFER_POOL_STAT_CURR_OCCUPANCY_BYTES = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 292 - -SAI_BUFFER_POOL_STAT_WATERMARK_BYTES = 1 # /home/omer/P4/SAI/inc/saibuffer.h: 292 - -SAI_BUFFER_POOL_STAT_DROPPED_PACKETS = 2 # /home/omer/P4/SAI/inc/saibuffer.h: 292 - -SAI_BUFFER_POOL_STAT_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saibuffer.h: 292 - -sai_buffer_pool_stat_t = enum__sai_buffer_pool_stat_t # /home/omer/P4/SAI/inc/saibuffer.h: 292 - -sai_create_buffer_pool_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 304 - -sai_remove_buffer_pool_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saibuffer.h: 317 - -sai_set_buffer_pool_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 328 - -sai_get_buffer_pool_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 341 - -sai_get_buffer_pool_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_buffer_pool_stat_t), c_uint32, POINTER(c_uint64)) # /home/omer/P4/SAI/inc/saibuffer.h: 356 - -sai_clear_buffer_pool_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_buffer_pool_stat_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 371 - -enum__sai_buffer_profile_threshold_mode_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 390 - -SAI_BUFFER_PROFILE_THRESHOLD_MODE_STATIC = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 390 - -SAI_BUFFER_PROFILE_THRESHOLD_MODE_DYNAMIC = (SAI_BUFFER_PROFILE_THRESHOLD_MODE_STATIC + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 390 - -SAI_BUFFER_PROFILE_THRESHOLD_MODE_INHERIT_BUFFER_POOL_MODE = (SAI_BUFFER_PROFILE_THRESHOLD_MODE_DYNAMIC + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 390 - -sai_buffer_profile_threshold_mode_t = enum__sai_buffer_profile_threshold_mode_t # /home/omer/P4/SAI/inc/saibuffer.h: 390 - -enum__sai_buffer_profile_attr_t = c_int # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_START = 0 # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_POOL_ID = SAI_BUFFER_PROFILE_ATTR_START # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE = (SAI_BUFFER_PROFILE_ATTR_POOL_ID + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_THRESHOLD_MODE = (SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH = (SAI_BUFFER_PROFILE_ATTR_THRESHOLD_MODE + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_SHARED_STATIC_TH = (SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_XOFF_TH = (SAI_BUFFER_PROFILE_ATTR_SHARED_STATIC_TH + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_XON_TH = (SAI_BUFFER_PROFILE_ATTR_XOFF_TH + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_XON_OFFSET_TH = (SAI_BUFFER_PROFILE_ATTR_XON_TH + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -SAI_BUFFER_PROFILE_ATTR_END = (SAI_BUFFER_PROFILE_ATTR_XON_OFFSET_TH + 1) # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -sai_buffer_profile_attr_t = enum__sai_buffer_profile_attr_t # /home/omer/P4/SAI/inc/saibuffer.h: 514 - -sai_create_buffer_profile_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 526 - -sai_remove_buffer_profile_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saibuffer.h: 539 - -sai_set_buffer_profile_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 550 - -sai_get_buffer_profile_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibuffer.h: 563 - -# /home/omer/P4/SAI/inc/saibuffer.h: 589 -class struct__sai_buffer_api_t(Structure): - pass - -struct__sai_buffer_api_t.__slots__ = [ - 'create_buffer_pool', - 'remove_buffer_pool', - 'set_buffer_pool_attribute', - 'get_buffer_pool_attribute', - 'get_buffer_pool_stats', - 'clear_buffer_pool_stats', - 'create_ingress_priority_group', - 'remove_ingress_priority_group', - 'set_ingress_priority_group_attribute', - 'get_ingress_priority_group_attribute', - 'get_ingress_priority_group_stats', - 'clear_ingress_priority_group_stats', - 'create_buffer_profile', - 'remove_buffer_profile', - 'set_buffer_profile_attribute', - 'get_buffer_profile_attribute', -] -struct__sai_buffer_api_t._fields_ = [ - ('create_buffer_pool', sai_create_buffer_pool_fn), - ('remove_buffer_pool', sai_remove_buffer_pool_fn), - ('set_buffer_pool_attribute', sai_set_buffer_pool_attribute_fn), - ('get_buffer_pool_attribute', sai_get_buffer_pool_attribute_fn), - ('get_buffer_pool_stats', sai_get_buffer_pool_stats_fn), - ('clear_buffer_pool_stats', sai_clear_buffer_pool_stats_fn), - ('create_ingress_priority_group', sai_create_ingress_priority_group_fn), - ('remove_ingress_priority_group', sai_remove_ingress_priority_group_fn), - ('set_ingress_priority_group_attribute', sai_set_ingress_priority_group_attribute_fn), - ('get_ingress_priority_group_attribute', sai_get_ingress_priority_group_attribute_fn), - ('get_ingress_priority_group_stats', sai_get_ingress_priority_group_stats_fn), - ('clear_ingress_priority_group_stats', sai_clear_ingress_priority_group_stats_fn), - ('create_buffer_profile', sai_create_buffer_profile_fn), - ('remove_buffer_profile', sai_remove_buffer_profile_fn), - ('set_buffer_profile_attribute', sai_set_buffer_profile_attribute_fn), - ('get_buffer_profile_attribute', sai_get_buffer_profile_attribute_fn), -] - -sai_buffer_api_t = struct__sai_buffer_api_t # /home/omer/P4/SAI/inc/saibuffer.h: 589 - -enum__sai_fdb_entry_type_t = c_int # /home/omer/P4/SAI/inc/saifdb.h: 47 - -SAI_FDB_ENTRY_TYPE_DYNAMIC = 0 # /home/omer/P4/SAI/inc/saifdb.h: 47 - -SAI_FDB_ENTRY_TYPE_STATIC = (SAI_FDB_ENTRY_TYPE_DYNAMIC + 1) # /home/omer/P4/SAI/inc/saifdb.h: 47 - -sai_fdb_entry_type_t = enum__sai_fdb_entry_type_t # /home/omer/P4/SAI/inc/saifdb.h: 47 - -# /home/omer/P4/SAI/inc/saifdb.h: 77 -class struct__sai_fdb_entry_t(Structure): - pass - -struct__sai_fdb_entry_t.__slots__ = [ - 'switch_id', - 'mac_address', - 'bridge_type', - 'vlan_id', - 'bridge_id', -] -struct__sai_fdb_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('mac_address', sai_mac_t), - ('bridge_type', sai_fdb_entry_bridge_type_t), - ('vlan_id', sai_vlan_id_t), - ('bridge_id', sai_object_id_t), -] - -sai_fdb_entry_t = struct__sai_fdb_entry_t # /home/omer/P4/SAI/inc/saifdb.h: 77 - -enum__sai_fdb_event_t = c_int # /home/omer/P4/SAI/inc/saifdb.h: 96 - -SAI_FDB_EVENT_LEARNED = 0 # /home/omer/P4/SAI/inc/saifdb.h: 96 - -SAI_FDB_EVENT_AGED = (SAI_FDB_EVENT_LEARNED + 1) # /home/omer/P4/SAI/inc/saifdb.h: 96 - -SAI_FDB_EVENT_MOVE = (SAI_FDB_EVENT_AGED + 1) # /home/omer/P4/SAI/inc/saifdb.h: 96 - -SAI_FDB_EVENT_FLUSHED = (SAI_FDB_EVENT_MOVE + 1) # /home/omer/P4/SAI/inc/saifdb.h: 96 - -sai_fdb_event_t = enum__sai_fdb_event_t # /home/omer/P4/SAI/inc/saifdb.h: 96 - -enum__sai_fdb_entry_attr_t = c_int # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_START = 0 # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_TYPE = SAI_FDB_ENTRY_ATTR_START # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_PACKET_ACTION = (SAI_FDB_ENTRY_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID = (SAI_FDB_ENTRY_ATTR_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_META_DATA = (SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID + 1) # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_ENDPOINT_IP = (SAI_FDB_ENTRY_ATTR_META_DATA + 1) # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_END = (SAI_FDB_ENTRY_ATTR_ENDPOINT_IP + 1) # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saifdb.h: 172 - -SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saifdb.h: 172 - -sai_fdb_entry_attr_t = enum__sai_fdb_entry_attr_t # /home/omer/P4/SAI/inc/saifdb.h: 172 - -enum__sai_fdb_flush_entry_type_t = c_int # /home/omer/P4/SAI/inc/saifdb.h: 185 - -SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC = 0 # /home/omer/P4/SAI/inc/saifdb.h: 185 - -SAI_FDB_FLUSH_ENTRY_TYPE_STATIC = (SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC + 1) # /home/omer/P4/SAI/inc/saifdb.h: 185 - -sai_fdb_flush_entry_type_t = enum__sai_fdb_flush_entry_type_t # /home/omer/P4/SAI/inc/saifdb.h: 185 - -enum__sai_fdb_flush_attr_t = c_int # /home/omer/P4/SAI/inc/saifdb.h: 245 - -SAI_FDB_FLUSH_ATTR_START = 0 # /home/omer/P4/SAI/inc/saifdb.h: 245 - -SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID = SAI_FDB_FLUSH_ATTR_START # /home/omer/P4/SAI/inc/saifdb.h: 245 - -SAI_FDB_FLUSH_ATTR_VLAN_ID = (SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID + 1) # /home/omer/P4/SAI/inc/saifdb.h: 245 - -SAI_FDB_FLUSH_ATTR_ENTRY_TYPE = (SAI_FDB_FLUSH_ATTR_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saifdb.h: 245 - -SAI_FDB_FLUSH_ATTR_END = (SAI_FDB_FLUSH_ATTR_ENTRY_TYPE + 1) # /home/omer/P4/SAI/inc/saifdb.h: 245 - -sai_fdb_flush_attr_t = enum__sai_fdb_flush_attr_t # /home/omer/P4/SAI/inc/saifdb.h: 245 - -# /home/omer/P4/SAI/inc/saifdb.h: 264 -class struct__sai_fdb_event_notification_data_t(Structure): - pass - -struct__sai_fdb_event_notification_data_t.__slots__ = [ - 'event_type', - 'fdb_entry', - 'attr_count', - 'attr', -] -struct__sai_fdb_event_notification_data_t._fields_ = [ - ('event_type', sai_fdb_event_t), - ('fdb_entry', sai_fdb_entry_t), - ('attr_count', c_uint32), - ('attr', POINTER(sai_attribute_t)), -] - -sai_fdb_event_notification_data_t = struct__sai_fdb_event_notification_data_t # /home/omer/P4/SAI/inc/saifdb.h: 264 - -sai_create_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saifdb.h: 275 - -sai_remove_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t)) # /home/omer/P4/SAI/inc/saifdb.h: 287 - -sai_set_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t), POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saifdb.h: 298 - -sai_get_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saifdb.h: 311 - -sai_flush_fdb_entries_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saifdb.h: 325 - -sai_fdb_event_notification_fn = CFUNCTYPE(UNCHECKED(None), c_uint32, POINTER(sai_fdb_event_notification_data_t)) # /home/omer/P4/SAI/inc/saifdb.h: 336 - -# /home/omer/P4/SAI/inc/saifdb.h: 351 -class struct__sai_fdb_api_t(Structure): - pass - -struct__sai_fdb_api_t.__slots__ = [ - 'create_fdb_entry', - 'remove_fdb_entry', - 'set_fdb_entry_attribute', - 'get_fdb_entry_attribute', - 'flush_fdb_entries', -] -struct__sai_fdb_api_t._fields_ = [ - ('create_fdb_entry', sai_create_fdb_entry_fn), - ('remove_fdb_entry', sai_remove_fdb_entry_fn), - ('set_fdb_entry_attribute', sai_set_fdb_entry_attribute_fn), - ('get_fdb_entry_attribute', sai_get_fdb_entry_attribute_fn), - ('flush_fdb_entries', sai_flush_fdb_entries_fn), -] - -sai_fdb_api_t = struct__sai_fdb_api_t # /home/omer/P4/SAI/inc/saifdb.h: 351 - -enum__sai_native_hash_field_t = c_int # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_SRC_IP = 0 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_DST_IP = 1 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_INNER_SRC_IP = 2 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_INNER_DST_IP = 3 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_VLAN_ID = 4 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_IP_PROTOCOL = 5 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_ETHERTYPE = 6 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_L4_SRC_PORT = 7 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_L4_DST_PORT = 8 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_SRC_MAC = 9 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_DST_MAC = 10 # /home/omer/P4/SAI/inc/saihash.h: 85 - -SAI_NATIVE_HASH_FIELD_IN_PORT = 11 # /home/omer/P4/SAI/inc/saihash.h: 85 - -sai_native_hash_field_t = enum__sai_native_hash_field_t # /home/omer/P4/SAI/inc/saihash.h: 85 - -enum__sai_hash_attr_t = c_int # /home/omer/P4/SAI/inc/saihash.h: 121 - -SAI_HASH_ATTR_START = 0 # /home/omer/P4/SAI/inc/saihash.h: 121 - -SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST = SAI_HASH_ATTR_START # /home/omer/P4/SAI/inc/saihash.h: 121 - -SAI_HASH_ATTR_UDF_GROUP_LIST = (SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST + 1) # /home/omer/P4/SAI/inc/saihash.h: 121 - -SAI_HASH_ATTR_END = (SAI_HASH_ATTR_UDF_GROUP_LIST + 1) # /home/omer/P4/SAI/inc/saihash.h: 121 - -sai_hash_attr_t = enum__sai_hash_attr_t # /home/omer/P4/SAI/inc/saihash.h: 121 - -sai_create_hash_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihash.h: 133 - -sai_remove_hash_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saihash.h: 146 - -sai_set_hash_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihash.h: 157 - -sai_get_hash_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihash.h: 170 - -# /home/omer/P4/SAI/inc/saihash.h: 185 -class struct__sai_hash_api_t(Structure): - pass - -struct__sai_hash_api_t.__slots__ = [ - 'create_hash', - 'remove_hash', - 'set_hash_attribute', - 'get_hash_attribute', -] -struct__sai_hash_api_t._fields_ = [ - ('create_hash', sai_create_hash_fn), - ('remove_hash', sai_remove_hash_fn), - ('set_hash_attribute', sai_set_hash_attribute_fn), - ('get_hash_attribute', sai_get_hash_attribute_fn), -] - -sai_hash_api_t = struct__sai_hash_api_t # /home/omer/P4/SAI/inc/saihash.h: 185 - -enum__sai_hostif_trap_group_attr_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_ADMIN_STATE = SAI_HOSTIF_TRAP_GROUP_ATTR_START # /home/omer/P4/SAI/inc/saihostif.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE = (SAI_HOSTIF_TRAP_GROUP_ATTR_ADMIN_STATE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER = (SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_END = (SAI_HOSTIF_TRAP_GROUP_ATTR_POLICER + 1) # /home/omer/P4/SAI/inc/saihostif.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saihostif.h: 99 - -SAI_HOSTIF_TRAP_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_TRAP_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saihostif.h: 99 - -sai_hostif_trap_group_attr_t = enum__sai_hostif_trap_group_attr_t # /home/omer/P4/SAI/inc/saihostif.h: 99 - -sai_create_hostif_trap_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 111 - -sai_remove_hostif_trap_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saihostif.h: 124 - -sai_set_hostif_trap_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 135 - -sai_get_hostif_trap_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 148 - -enum__sai_hostif_trap_type_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_STP = SAI_HOSTIF_TRAP_TYPE_START # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_LACP = 1 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_EAPOL = 2 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_LLDP = 3 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_PVRST = 4 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_QUERY = 5 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_LEAVE = 6 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_V1_REPORT = 7 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_V2_REPORT = 8 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IGMP_TYPE_V3_REPORT = 9 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SAMPLEPACKET = 10 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SWITCH_CUSTOM_RANGE_BASE = 4096 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_ARP_REQUEST = 8192 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_ARP_RESPONSE = 8193 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_DHCP = 8194 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_OSPF = 8195 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_PIM = 8196 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_VRRP = 8197 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_DHCPV6 = 8198 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_OSPFV6 = 8199 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_VRRPV6 = 8200 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_NEIGHBOR_DISCOVERY = 8201 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_MLD_V1_V2 = 8202 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_MLD_V1_REPORT = 8203 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IPV6_MLD_V1_DONE = 8204 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_MLD_V2_REPORT = 8205 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_UNKNOWN_L3_MULTICAST = 8206 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_ROUTER_CUSTOM_RANGE_BASE = 12288 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_IP2ME = 16384 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SSH = 16385 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_SNMP = 16386 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_BGP = 16387 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_BGPV6 = 16388 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_LOCAL_IP_CUSTOM_RANGE_BASE = 20480 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_L3_MTU_ERROR = 24576 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_TTL_ERROR = 24577 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_CUSTOM_EXCEPTION_RANGE_BASE = 28672 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -SAI_HOSTIF_TRAP_TYPE_END = 32768 # /home/omer/P4/SAI/inc/saihostif.h: 314 - -sai_hostif_trap_type_t = enum__sai_hostif_trap_type_t # /home/omer/P4/SAI/inc/saihostif.h: 314 - -enum__sai_hostif_trap_attr_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_TRAP_TYPE = SAI_HOSTIF_TRAP_ATTR_START # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION = (SAI_HOSTIF_TRAP_ATTR_TRAP_TYPE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY = (SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_EXCLUDE_PORT_LIST = (SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY + 1) # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP = (SAI_HOSTIF_TRAP_ATTR_EXCLUDE_PORT_LIST + 1) # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_END = (SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP + 1) # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saihostif.h: 386 - -SAI_HOSTIF_TRAP_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_TRAP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saihostif.h: 386 - -sai_hostif_trap_attr_t = enum__sai_hostif_trap_attr_t # /home/omer/P4/SAI/inc/saihostif.h: 386 - -sai_create_hostif_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 398 - -sai_remove_hostif_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saihostif.h: 411 - -sai_set_hostif_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 422 - -sai_get_hostif_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 435 - -enum__sai_hostif_user_defined_trap_type_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 470 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 470 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ROUTER = SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_START # /home/omer/P4/SAI/inc/saihostif.h: 470 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_NEIGH = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ROUTER + 1) # /home/omer/P4/SAI/inc/saihostif.h: 470 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ACL = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_NEIGH + 1) # /home/omer/P4/SAI/inc/saihostif.h: 470 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_FDB = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ACL + 1) # /home/omer/P4/SAI/inc/saihostif.h: 470 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE = 4096 # /home/omer/P4/SAI/inc/saihostif.h: 470 - -SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_END = (SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 470 - -sai_hostif_user_defined_trap_type_t = enum__sai_hostif_user_defined_trap_type_t # /home/omer/P4/SAI/inc/saihostif.h: 470 - -enum__sai_hostif_user_defined_trap_attr_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 523 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 523 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TYPE = SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_START # /home/omer/P4/SAI/inc/saihostif.h: 523 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_PRIORITY = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 523 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_GROUP = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_PRIORITY + 1) # /home/omer/P4/SAI/inc/saihostif.h: 523 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_END = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_TRAP_GROUP + 1) # /home/omer/P4/SAI/inc/saihostif.h: 523 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saihostif.h: 523 - -SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_USER_DEFINED_TRAP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saihostif.h: 523 - -sai_hostif_user_defined_trap_attr_t = enum__sai_hostif_user_defined_trap_attr_t # /home/omer/P4/SAI/inc/saihostif.h: 523 - -sai_create_hostif_user_defined_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 535 - -sai_remove_hostif_user_defined_trap_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saihostif.h: 548 - -sai_set_hostif_user_defined_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 559 - -sai_get_hostif_user_defined_trap_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 572 - -enum__sai_hostif_type_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 588 - -SAI_HOSTIF_TYPE_NETDEV = 0 # /home/omer/P4/SAI/inc/saihostif.h: 588 - -SAI_HOSTIF_TYPE_FD = (SAI_HOSTIF_TYPE_NETDEV + 1) # /home/omer/P4/SAI/inc/saihostif.h: 588 - -sai_hostif_type_t = enum__sai_hostif_type_t # /home/omer/P4/SAI/inc/saihostif.h: 588 - -enum__sai_hostif_attr_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_TYPE = SAI_HOSTIF_ATTR_START # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_OBJ_ID = (SAI_HOSTIF_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_NAME = (SAI_HOSTIF_ATTR_OBJ_ID + 1) # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_OPER_STATUS = (SAI_HOSTIF_ATTR_NAME + 1) # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_QUEUE = (SAI_HOSTIF_ATTR_OPER_STATUS + 1) # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_END = (SAI_HOSTIF_ATTR_QUEUE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saihostif.h: 666 - -SAI_HOSTIF_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saihostif.h: 666 - -sai_hostif_attr_t = enum__sai_hostif_attr_t # /home/omer/P4/SAI/inc/saihostif.h: 666 - -sai_create_hostif_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 678 - -sai_remove_hostif_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saihostif.h: 691 - -sai_set_hostif_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 702 - -sai_get_hostif_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 715 - -enum__sai_hostif_table_entry_type_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 740 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_PORT = 0 # /home/omer/P4/SAI/inc/saihostif.h: 740 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_LAG = (SAI_HOSTIF_TABLE_ENTRY_TYPE_PORT + 1) # /home/omer/P4/SAI/inc/saihostif.h: 740 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_VLAN = (SAI_HOSTIF_TABLE_ENTRY_TYPE_LAG + 1) # /home/omer/P4/SAI/inc/saihostif.h: 740 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_TRAP_ID = (SAI_HOSTIF_TABLE_ENTRY_TYPE_VLAN + 1) # /home/omer/P4/SAI/inc/saihostif.h: 740 - -SAI_HOSTIF_TABLE_ENTRY_TYPE_WILDCARD = (SAI_HOSTIF_TABLE_ENTRY_TYPE_TRAP_ID + 1) # /home/omer/P4/SAI/inc/saihostif.h: 740 - -sai_hostif_table_entry_type_t = enum__sai_hostif_table_entry_type_t # /home/omer/P4/SAI/inc/saihostif.h: 740 - -enum__sai_hostif_table_entry_channel_type_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 762 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_CB = 0 # /home/omer/P4/SAI/inc/saihostif.h: 762 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_FD = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_CB + 1) # /home/omer/P4/SAI/inc/saihostif.h: 762 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_PHYSICAL_PORT = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_FD + 1) # /home/omer/P4/SAI/inc/saihostif.h: 762 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_LOGICAL_PORT = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_PHYSICAL_PORT + 1) # /home/omer/P4/SAI/inc/saihostif.h: 762 - -SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_L3 = (SAI_HOSTIF_TABLE_ENTRY_CHANNEL_TYPE_NETDEV_LOGICAL_PORT + 1) # /home/omer/P4/SAI/inc/saihostif.h: 762 - -sai_hostif_table_entry_channel_type_t = enum__sai_hostif_table_entry_channel_type_t # /home/omer/P4/SAI/inc/saihostif.h: 762 - -enum__sai_hostif_table_entry_attr_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_TYPE = SAI_HOSTIF_ATTR_START # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_OBJ_ID = (SAI_HOSTIF_TABLE_ENTRY_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_TRAP_ID = (SAI_HOSTIF_TABLE_ENTRY_ATTR_OBJ_ID + 1) # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_CHANNEL_TYPE = (SAI_HOSTIF_TABLE_ENTRY_ATTR_TRAP_ID + 1) # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_HOST_IF = (SAI_HOSTIF_TABLE_ENTRY_ATTR_CHANNEL_TYPE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_END = (SAI_HOSTIF_TABLE_ENTRY_ATTR_HOST_IF + 1) # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saihostif.h: 843 - -SAI_HOSTIF_TABLE_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_HOSTIF_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saihostif.h: 843 - -sai_hostif_table_entry_attr_t = enum__sai_hostif_table_entry_attr_t # /home/omer/P4/SAI/inc/saihostif.h: 843 - -sai_create_hostif_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 855 - -sai_remove_hostif_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saihostif.h: 868 - -sai_set_hostif_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 879 - -sai_get_hostif_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 892 - -enum__sai_hostif_tx_type_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 914 - -SAI_HOSTIF_TX_TYPE_PIPELINE_BYPASS = 0 # /home/omer/P4/SAI/inc/saihostif.h: 914 - -SAI_HOSTIF_TX_TYPE_PIPELINE_LOOKUP = (SAI_HOSTIF_TX_TYPE_PIPELINE_BYPASS + 1) # /home/omer/P4/SAI/inc/saihostif.h: 914 - -SAI_HOSTIF_TX_TYPE_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saihostif.h: 914 - -sai_hostif_tx_type_t = enum__sai_hostif_tx_type_t # /home/omer/P4/SAI/inc/saihostif.h: 914 - -enum__sai_hostif_packet_attr_t = c_int # /home/omer/P4/SAI/inc/saihostif.h: 980 - -SAI_HOSTIF_PACKET_ATTR_START = 0 # /home/omer/P4/SAI/inc/saihostif.h: 980 - -SAI_HOSTIF_PACKET_ATTR_HOSTIF_TRAP_ID = SAI_HOSTIF_PACKET_ATTR_START # /home/omer/P4/SAI/inc/saihostif.h: 980 - -SAI_HOSTIF_PACKET_ATTR_INGRESS_PORT = (SAI_HOSTIF_PACKET_ATTR_HOSTIF_TRAP_ID + 1) # /home/omer/P4/SAI/inc/saihostif.h: 980 - -SAI_HOSTIF_PACKET_ATTR_INGRESS_LAG = (SAI_HOSTIF_PACKET_ATTR_INGRESS_PORT + 1) # /home/omer/P4/SAI/inc/saihostif.h: 980 - -SAI_HOSTIF_PACKET_ATTR_HOSTIF_TX_TYPE = (SAI_HOSTIF_PACKET_ATTR_INGRESS_LAG + 1) # /home/omer/P4/SAI/inc/saihostif.h: 980 - -SAI_HOSTIF_PACKET_ATTR_EGRESS_PORT_OR_LAG = (SAI_HOSTIF_PACKET_ATTR_HOSTIF_TX_TYPE + 1) # /home/omer/P4/SAI/inc/saihostif.h: 980 - -SAI_HOSTIF_PACKET_ATTR_END = (SAI_HOSTIF_PACKET_ATTR_EGRESS_PORT_OR_LAG + 1) # /home/omer/P4/SAI/inc/saihostif.h: 980 - -sai_hostif_packet_attr_t = enum__sai_hostif_packet_attr_t # /home/omer/P4/SAI/inc/saihostif.h: 980 - -sai_recv_hostif_packet_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(None), POINTER(sai_size_t), POINTER(c_uint32), POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 996 - -sai_send_hostif_packet_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(None), sai_size_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 1016 - -sai_packet_event_notification_fn = CFUNCTYPE(UNCHECKED(None), sai_object_id_t, POINTER(None), sai_size_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saihostif.h: 1032 - -# /home/omer/P4/SAI/inc/saihostif.h: 1066 -class struct__sai_hostif_api_t(Structure): - pass - -struct__sai_hostif_api_t.__slots__ = [ - 'create_hostif', - 'remove_hostif', - 'set_hostif_attribute', - 'get_hostif_attribute', - 'create_hostif_table_entry', - 'remove_hostif_table_entry', - 'set_hostif_table_entry_attribute', - 'get_hostif_table_entry_attribute', - 'create_hostif_trap_group', - 'remove_hostif_trap_group', - 'set_hostif_trap_group_attribute', - 'get_hostif_trap_group_attribute', - 'create_hostif_trap', - 'remove_hostif_trap', - 'set_hostif_trap_attribute', - 'get_hostif_trap_attribute', - 'create_hostif_user_defined_trap', - 'remove_hostif_user_defined_trap', - 'set_hostif_user_defined_trap_attribute', - 'get_hostif_user_defined_trap_attribute', - 'recv_hostif_packet', - 'send_hostif_packet', -] -struct__sai_hostif_api_t._fields_ = [ - ('create_hostif', sai_create_hostif_fn), - ('remove_hostif', sai_remove_hostif_fn), - ('set_hostif_attribute', sai_set_hostif_attribute_fn), - ('get_hostif_attribute', sai_get_hostif_attribute_fn), - ('create_hostif_table_entry', sai_create_hostif_table_entry_fn), - ('remove_hostif_table_entry', sai_remove_hostif_table_entry_fn), - ('set_hostif_table_entry_attribute', sai_set_hostif_table_entry_attribute_fn), - ('get_hostif_table_entry_attribute', sai_get_hostif_table_entry_attribute_fn), - ('create_hostif_trap_group', sai_create_hostif_trap_group_fn), - ('remove_hostif_trap_group', sai_remove_hostif_trap_group_fn), - ('set_hostif_trap_group_attribute', sai_set_hostif_trap_group_attribute_fn), - ('get_hostif_trap_group_attribute', sai_get_hostif_trap_group_attribute_fn), - ('create_hostif_trap', sai_create_hostif_trap_fn), - ('remove_hostif_trap', sai_remove_hostif_trap_fn), - ('set_hostif_trap_attribute', sai_set_hostif_trap_attribute_fn), - ('get_hostif_trap_attribute', sai_get_hostif_trap_attribute_fn), - ('create_hostif_user_defined_trap', sai_create_hostif_user_defined_trap_fn), - ('remove_hostif_user_defined_trap', sai_remove_hostif_user_defined_trap_fn), - ('set_hostif_user_defined_trap_attribute', sai_set_hostif_user_defined_trap_attribute_fn), - ('get_hostif_user_defined_trap_attribute', sai_get_hostif_user_defined_trap_attribute_fn), - ('recv_hostif_packet', sai_recv_hostif_packet_fn), - ('send_hostif_packet', sai_send_hostif_packet_fn), -] - -sai_hostif_api_t = struct__sai_hostif_api_t # /home/omer/P4/SAI/inc/saihostif.h: 1066 - -enum__sai_lag_attr_t = c_int # /home/omer/P4/SAI/inc/sailag.h: 100 - -SAI_LAG_ATTR_START = 0 # /home/omer/P4/SAI/inc/sailag.h: 100 - -SAI_LAG_ATTR_PORT_LIST = SAI_LAG_ATTR_START # /home/omer/P4/SAI/inc/sailag.h: 100 - -SAI_LAG_ATTR_INGRESS_ACL = (SAI_LAG_ATTR_PORT_LIST + 1) # /home/omer/P4/SAI/inc/sailag.h: 100 - -SAI_LAG_ATTR_EGRESS_ACL = (SAI_LAG_ATTR_INGRESS_ACL + 1) # /home/omer/P4/SAI/inc/sailag.h: 100 - -SAI_LAG_ATTR_END = (SAI_LAG_ATTR_EGRESS_ACL + 1) # /home/omer/P4/SAI/inc/sailag.h: 100 - -SAI_LAG_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sailag.h: 100 - -SAI_LAG_ATTR_CUSTOM_RANGE_END = (SAI_LAG_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sailag.h: 100 - -sai_lag_attr_t = enum__sai_lag_attr_t # /home/omer/P4/SAI/inc/sailag.h: 100 - -sai_create_lag_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sailag.h: 112 - -sai_remove_lag_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sailag.h: 125 - -sai_set_lag_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sailag.h: 136 - -sai_get_lag_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sailag.h: 149 - -enum__sai_lag_member_attr_t = c_int # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_START = 0 # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_LAG_ID = SAI_LAG_MEMBER_ATTR_START # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_PORT_ID = (SAI_LAG_MEMBER_ATTR_LAG_ID + 1) # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_EGRESS_DISABLE = (SAI_LAG_MEMBER_ATTR_PORT_ID + 1) # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_INGRESS_DISABLE = (SAI_LAG_MEMBER_ATTR_EGRESS_DISABLE + 1) # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_END = (SAI_LAG_MEMBER_ATTR_INGRESS_DISABLE + 1) # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sailag.h: 211 - -SAI_LAG_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_LAG_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sailag.h: 211 - -sai_lag_member_attr_t = enum__sai_lag_member_attr_t # /home/omer/P4/SAI/inc/sailag.h: 211 - -sai_create_lag_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sailag.h: 223 - -sai_remove_lag_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sailag.h: 236 - -sai_set_lag_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sailag.h: 247 - -sai_get_lag_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sailag.h: 260 - -# /home/omer/P4/SAI/inc/sailag.h: 280 -class struct__sai_lag_api_t(Structure): - pass - -struct__sai_lag_api_t.__slots__ = [ - 'create_lag', - 'remove_lag', - 'set_lag_attribute', - 'get_lag_attribute', - 'create_lag_member', - 'remove_lag_member', - 'set_lag_member_attribute', - 'get_lag_member_attribute', - 'create_lag_members', - 'remove_lag_members', -] -struct__sai_lag_api_t._fields_ = [ - ('create_lag', sai_create_lag_fn), - ('remove_lag', sai_remove_lag_fn), - ('set_lag_attribute', sai_set_lag_attribute_fn), - ('get_lag_attribute', sai_get_lag_attribute_fn), - ('create_lag_member', sai_create_lag_member_fn), - ('remove_lag_member', sai_remove_lag_member_fn), - ('set_lag_member_attribute', sai_set_lag_member_attribute_fn), - ('get_lag_member_attribute', sai_get_lag_member_attribute_fn), - ('create_lag_members', sai_bulk_object_create_fn), - ('remove_lag_members', sai_bulk_object_remove_fn), -] - -sai_lag_api_t = struct__sai_lag_api_t # /home/omer/P4/SAI/inc/sailag.h: 280 - -enum__sai_mirror_session_type_t = c_int # /home/omer/P4/SAI/inc/saimirror.h: 50 - -SAI_MIRROR_SESSION_TYPE_LOCAL = 0 # /home/omer/P4/SAI/inc/saimirror.h: 50 - -SAI_MIRROR_SESSION_TYPE_REMOTE = (SAI_MIRROR_SESSION_TYPE_LOCAL + 1) # /home/omer/P4/SAI/inc/saimirror.h: 50 - -SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE = (SAI_MIRROR_SESSION_TYPE_REMOTE + 1) # /home/omer/P4/SAI/inc/saimirror.h: 50 - -sai_mirror_session_type_t = enum__sai_mirror_session_type_t # /home/omer/P4/SAI/inc/saimirror.h: 50 - -enum__sai_erspan_encapsulation_type_t = c_int # /home/omer/P4/SAI/inc/saimirror.h: 62 - -SAI_ERSPAN_ENCAPSULATION_TYPE_MIRROR_L3_GRE_TUNNEL = 0 # /home/omer/P4/SAI/inc/saimirror.h: 62 - -sai_erspan_encapsulation_type_t = enum__sai_erspan_encapsulation_type_t # /home/omer/P4/SAI/inc/saimirror.h: 62 - -enum__sai_mirror_session_attr_t = c_int # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_START = 0 # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_TYPE = SAI_MIRROR_SESSION_ATTR_START # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_MONITOR_PORT = (SAI_MIRROR_SESSION_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_TRUNCATE_SIZE = (SAI_MIRROR_SESSION_ATTR_MONITOR_PORT + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_TC = (SAI_MIRROR_SESSION_ATTR_TRUNCATE_SIZE + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_VLAN_TPID = (SAI_MIRROR_SESSION_ATTR_TC + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_VLAN_ID = (SAI_MIRROR_SESSION_ATTR_VLAN_TPID + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_VLAN_PRI = (SAI_MIRROR_SESSION_ATTR_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_VLAN_CFI = (SAI_MIRROR_SESSION_ATTR_VLAN_PRI + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE = (SAI_MIRROR_SESSION_ATTR_VLAN_CFI + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_IPHDR_VERSION = (SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_TOS = (SAI_MIRROR_SESSION_ATTR_IPHDR_VERSION + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_TTL = (SAI_MIRROR_SESSION_ATTR_TOS + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS = (SAI_MIRROR_SESSION_ATTR_TTL + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS = (SAI_MIRROR_SESSION_ATTR_SRC_IP_ADDRESS + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS = (SAI_MIRROR_SESSION_ATTR_DST_IP_ADDRESS + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS = (SAI_MIRROR_SESSION_ATTR_SRC_MAC_ADDRESS + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_GRE_PROTOCOL_TYPE = (SAI_MIRROR_SESSION_ATTR_DST_MAC_ADDRESS + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -SAI_MIRROR_SESSION_ATTR_END = (SAI_MIRROR_SESSION_ATTR_GRE_PROTOCOL_TYPE + 1) # /home/omer/P4/SAI/inc/saimirror.h: 244 - -sai_mirror_session_attr_t = enum__sai_mirror_session_attr_t # /home/omer/P4/SAI/inc/saimirror.h: 244 - -sai_create_mirror_session_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saimirror.h: 257 - -sai_remove_mirror_session_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saimirror.h: 271 - -sai_set_mirror_session_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saimirror.h: 283 - -sai_get_mirror_session_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saimirror.h: 297 - -# /home/omer/P4/SAI/inc/saimirror.h: 312 -class struct__sai_mirror_api_t(Structure): - pass - -struct__sai_mirror_api_t.__slots__ = [ - 'create_mirror_session', - 'remove_mirror_session', - 'set_mirror_session_attribute', - 'get_mirror_session_attribute', -] -struct__sai_mirror_api_t._fields_ = [ - ('create_mirror_session', sai_create_mirror_session_fn), - ('remove_mirror_session', sai_remove_mirror_session_fn), - ('set_mirror_session_attribute', sai_set_mirror_session_attribute_fn), - ('get_mirror_session_attribute', sai_get_mirror_session_attribute_fn), -] - -sai_mirror_api_t = struct__sai_mirror_api_t # /home/omer/P4/SAI/inc/saimirror.h: 312 - -enum__sai_neighbor_entry_attr_t = c_int # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_START = 0 # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS = SAI_NEIGHBOR_ENTRY_ATTR_START # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_PACKET_ACTION = (SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS + 1) # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE = (SAI_NEIGHBOR_ENTRY_ATTR_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_META_DATA = (SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE + 1) # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_END = (SAI_NEIGHBOR_ENTRY_ATTR_META_DATA + 1) # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -SAI_NEIGHBOR_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_NEIGHBOR_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -sai_neighbor_entry_attr_t = enum__sai_neighbor_entry_attr_t # /home/omer/P4/SAI/inc/saineighbor.h: 104 - -# /home/omer/P4/SAI/inc/saineighbor.h: 130 -class struct__sai_neighbor_entry_t(Structure): - pass - -struct__sai_neighbor_entry_t.__slots__ = [ - 'switch_id', - 'rif_id', - 'ip_address', -] -struct__sai_neighbor_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('rif_id', sai_object_id_t), - ('ip_address', sai_ip_address_t), -] - -sai_neighbor_entry_t = struct__sai_neighbor_entry_t # /home/omer/P4/SAI/inc/saineighbor.h: 130 - -sai_create_neighbor_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t), c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saineighbor.h: 143 - -sai_remove_neighbor_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t)) # /home/omer/P4/SAI/inc/saineighbor.h: 157 - -sai_set_neighbor_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t), POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saineighbor.h: 168 - -sai_get_neighbor_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_neighbor_entry_t), c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saineighbor.h: 181 - -sai_remove_all_neighbor_entries_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saineighbor.h: 192 - -# /home/omer/P4/SAI/inc/saineighbor.h: 206 -class struct__sai_neighbor_api_t(Structure): - pass - -struct__sai_neighbor_api_t.__slots__ = [ - 'create_neighbor_entry', - 'remove_neighbor_entry', - 'set_neighbor_entry_attribute', - 'get_neighbor_entry_attribute', - 'remove_all_neighbor_entries', -] -struct__sai_neighbor_api_t._fields_ = [ - ('create_neighbor_entry', sai_create_neighbor_entry_fn), - ('remove_neighbor_entry', sai_remove_neighbor_entry_fn), - ('set_neighbor_entry_attribute', sai_set_neighbor_entry_attribute_fn), - ('get_neighbor_entry_attribute', sai_get_neighbor_entry_attribute_fn), - ('remove_all_neighbor_entries', sai_remove_all_neighbor_entries_fn), -] - -sai_neighbor_api_t = struct__sai_neighbor_api_t # /home/omer/P4/SAI/inc/saineighbor.h: 206 - -enum__sai_next_hop_group_type_t = c_int # /home/omer/P4/SAI/inc/sainexthopgroup.h: 46 - -SAI_NEXT_HOP_GROUP_TYPE_ECMP = 0 # /home/omer/P4/SAI/inc/sainexthopgroup.h: 46 - -sai_next_hop_group_type_t = enum__sai_next_hop_group_type_t # /home/omer/P4/SAI/inc/sainexthopgroup.h: 46 - -enum__sai_next_hop_group_attr_t = c_int # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -SAI_NEXT_HOP_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_COUNT = SAI_NEXT_HOP_GROUP_ATTR_START # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_MEMBER_LIST = (SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_COUNT + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -SAI_NEXT_HOP_GROUP_ATTR_TYPE = (SAI_NEXT_HOP_GROUP_ATTR_NEXT_HOP_MEMBER_LIST + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -SAI_NEXT_HOP_GROUP_ATTR_END = (SAI_NEXT_HOP_GROUP_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -SAI_NEXT_HOP_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -SAI_NEXT_HOP_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_NEXT_HOP_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -sai_next_hop_group_attr_t = enum__sai_next_hop_group_attr_t # /home/omer/P4/SAI/inc/sainexthopgroup.h: 94 - -enum__sai_next_hop_group_member_attr_t = c_int # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_START = 0 # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_GROUP_ID = SAI_NEXT_HOP_GROUP_MEMBER_ATTR_START # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_ID = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_GROUP_ID + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_WEIGHT = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_NEXT_HOP_ID + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_END = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_WEIGHT + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_NEXT_HOP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -sai_next_hop_group_member_attr_t = enum__sai_next_hop_group_member_attr_t # /home/omer/P4/SAI/inc/sainexthopgroup.h: 141 - -sai_create_next_hop_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 153 - -sai_remove_next_hop_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 166 - -sai_set_next_hop_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 177 - -sai_get_next_hop_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 190 - -sai_create_next_hop_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 204 - -sai_remove_next_hop_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 217 - -sai_set_next_hop_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 228 - -sai_get_next_hop_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthopgroup.h: 241 - -# /home/omer/P4/SAI/inc/sainexthopgroup.h: 261 -class struct__sai_next_hop_group_api_t(Structure): - pass - -struct__sai_next_hop_group_api_t.__slots__ = [ - 'create_next_hop_group', - 'remove_next_hop_group', - 'set_next_hop_group_attribute', - 'get_next_hop_group_attribute', - 'create_next_hop_group_member', - 'remove_next_hop_group_member', - 'set_next_hop_group_member_attribute', - 'get_next_hop_group_member_attribute', - 'create_next_hop_group_members', - 'remove_next_hop_group_members', -] -struct__sai_next_hop_group_api_t._fields_ = [ - ('create_next_hop_group', sai_create_next_hop_group_fn), - ('remove_next_hop_group', sai_remove_next_hop_group_fn), - ('set_next_hop_group_attribute', sai_set_next_hop_group_attribute_fn), - ('get_next_hop_group_attribute', sai_get_next_hop_group_attribute_fn), - ('create_next_hop_group_member', sai_create_next_hop_group_member_fn), - ('remove_next_hop_group_member', sai_remove_next_hop_group_member_fn), - ('set_next_hop_group_member_attribute', sai_set_next_hop_group_member_attribute_fn), - ('get_next_hop_group_member_attribute', sai_get_next_hop_group_member_attribute_fn), - ('create_next_hop_group_members', sai_bulk_object_create_fn), - ('remove_next_hop_group_members', sai_bulk_object_remove_fn), -] - -sai_next_hop_group_api_t = struct__sai_next_hop_group_api_t # /home/omer/P4/SAI/inc/sainexthopgroup.h: 261 - -enum__sai_next_hop_type_t = c_int # /home/omer/P4/SAI/inc/sainexthop.h: 50 - -SAI_NEXT_HOP_TYPE_IP = 0 # /home/omer/P4/SAI/inc/sainexthop.h: 50 - -SAI_NEXT_HOP_TYPE_MPLS = (SAI_NEXT_HOP_TYPE_IP + 1) # /home/omer/P4/SAI/inc/sainexthop.h: 50 - -SAI_NEXT_HOP_TYPE_TUNNEL_ENCAP = (SAI_NEXT_HOP_TYPE_MPLS + 1) # /home/omer/P4/SAI/inc/sainexthop.h: 50 - -sai_next_hop_type_t = enum__sai_next_hop_type_t # /home/omer/P4/SAI/inc/sainexthop.h: 50 - -enum__sai_next_hop_attr_t = c_int # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_START = 0 # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_TYPE = SAI_NEXT_HOP_ATTR_START # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_IP = (SAI_NEXT_HOP_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID = (SAI_NEXT_HOP_ATTR_IP + 1) # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_TUNNEL_ID = (SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID + 1) # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_END = (SAI_NEXT_HOP_ATTR_TUNNEL_ID + 1) # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -SAI_NEXT_HOP_ATTR_CUSTOM_RANGE_END = (SAI_NEXT_HOP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -sai_next_hop_attr_t = enum__sai_next_hop_attr_t # /home/omer/P4/SAI/inc/sainexthop.h: 109 - -sai_create_next_hop_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthop.h: 123 - -sai_remove_next_hop_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sainexthop.h: 136 - -sai_set_next_hop_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthop.h: 147 - -sai_get_next_hop_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sainexthop.h: 160 - -# /home/omer/P4/SAI/inc/sainexthop.h: 175 -class struct__sai_next_hop_api_t(Structure): - pass - -struct__sai_next_hop_api_t.__slots__ = [ - 'create_next_hop', - 'remove_next_hop', - 'set_next_hop_attribute', - 'get_next_hop_attribute', -] -struct__sai_next_hop_api_t._fields_ = [ - ('create_next_hop', sai_create_next_hop_fn), - ('remove_next_hop', sai_remove_next_hop_fn), - ('set_next_hop_attribute', sai_set_next_hop_attribute_fn), - ('get_next_hop_attribute', sai_get_next_hop_attribute_fn), -] - -sai_next_hop_api_t = struct__sai_next_hop_api_t # /home/omer/P4/SAI/inc/sainexthop.h: 175 - -# ../../../inc/saimcastfdb.h: 54 -class struct__sai_mcast_fdb_entry_t(Structure): - pass - -struct__sai_mcast_fdb_entry_t.__slots__ = [ - 'switch_id', - 'mac_address', - 'vlan_id', -] -struct__sai_mcast_fdb_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('mac_address', sai_mac_t), - ('vlan_id', sai_vlan_id_t), -] - -sai_mcast_fdb_entry_t = struct__sai_mcast_fdb_entry_t # ../../../inc/saimcastfdb.h: 54 - -enum__sai_mcast_fdb_entry_attr_t = c_int # ../../../inc/saimcastfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_START = 0 # ../../../inc/saimcastfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_GROUP_ID = SAI_MCAST_FDB_ENTRY_ATTR_START # ../../../inc/saimcastfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_PACKET_ACTION = (SAI_MCAST_FDB_ENTRY_ATTR_GROUP_ID + 1) # ../../../inc/saimcastfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_META_DATA = (SAI_MCAST_FDB_ENTRY_ATTR_PACKET_ACTION + 1) # ../../../inc/saimcastfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_END = (SAI_MCAST_FDB_ENTRY_ATTR_META_DATA + 1) # ../../../inc/saimcastfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # ../../../inc/saimcastfdb.h: 108 - -SAI_MCAST_FDB_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_MCAST_FDB_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # ../../../inc/saimcastfdb.h: 108 - -sai_mcast_fdb_entry_attr_t = enum__sai_mcast_fdb_entry_attr_t # ../../../inc/saimcastfdb.h: 108 - -sai_create_mcast_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/saimcastfdb.h: 119 - -sai_remove_mcast_fdb_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t)) # ../../../inc/saimcastfdb.h: 131 - -sai_set_mcast_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t), POINTER(sai_attribute_t)) # ../../../inc/saimcastfdb.h: 142 - -sai_get_mcast_fdb_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_mcast_fdb_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/saimcastfdb.h: 155 - -# ../../../inc/saimcastfdb.h: 170 -class struct__sai_mcast_fdb_api_t(Structure): - pass - -struct__sai_mcast_fdb_api_t.__slots__ = [ - 'create_mcast_fdb_entry', - 'remove_mcast_fdb_entry', - 'set_mcast_fdb_entry_attribute', - 'get_mcast_fdb_entry_attribute', -] -struct__sai_mcast_fdb_api_t._fields_ = [ - ('create_mcast_fdb_entry', sai_create_mcast_fdb_entry_fn), - ('remove_mcast_fdb_entry', sai_remove_mcast_fdb_entry_fn), - ('set_mcast_fdb_entry_attribute', sai_set_mcast_fdb_entry_attribute_fn), - ('get_mcast_fdb_entry_attribute', sai_get_mcast_fdb_entry_attribute_fn), -] - -sai_mcast_fdb_api_t = struct__sai_mcast_fdb_api_t # ../../../inc/saimcastfdb.h: 170 - -enum__sai_l2mc_entry_type_t = c_int # ../../../inc/sail2mc.h: 47 - -SAI_L2MC_ENTRY_TYPE_SG = 0 # ../../../inc/sail2mc.h: 47 - -SAI_L2MC_ENTRY_TYPE_XG = (SAI_L2MC_ENTRY_TYPE_SG + 1) # ../../../inc/sail2mc.h: 47 - -sai_l2mc_entry_type_t = enum__sai_l2mc_entry_type_t # ../../../inc/sail2mc.h: 47 - -# ../../../inc/sail2mc.h: 82 -class struct__sai_l2mc_entry_t(Structure): - pass - -struct__sai_l2mc_entry_t.__slots__ = [ - 'switch_id', - 'bridge_type', - 'vlan_id', - 'bridge_id', - 'type', - 'destination', - 'source', -] -struct__sai_l2mc_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('bridge_type', sai_fdb_entry_bridge_type_t), - ('vlan_id', sai_vlan_id_t), - ('bridge_id', sai_object_id_t), - ('type', sai_l2mc_entry_type_t), - ('destination', sai_ip_address_t), - ('source', sai_ip_address_t), -] - -sai_l2mc_entry_t = struct__sai_l2mc_entry_t # ../../../inc/sail2mc.h: 82 - -enum__sai_l2mc_entry_attr_t = c_int # ../../../inc/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_START = 0 # ../../../inc/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_PACKET_ACTION = SAI_L2MC_ENTRY_ATTR_START # ../../../inc/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_OUTPUT_GROUP_ID = (SAI_L2MC_ENTRY_ATTR_PACKET_ACTION + 1) # ../../../inc/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_END = (SAI_L2MC_ENTRY_ATTR_OUTPUT_GROUP_ID + 1) # ../../../inc/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_BASE = 268435456 # ../../../inc/sail2mc.h: 128 - -SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_BASE + 1) # ../../../inc/sail2mc.h: 128 - -sai_l2mc_entry_attr_t = enum__sai_l2mc_entry_attr_t # ../../../inc/sail2mc.h: 128 - -sai_create_l2mc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/sail2mc.h: 139 - -sai_remove_l2mc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t)) # ../../../inc/sail2mc.h: 151 - -sai_set_l2mc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t), POINTER(sai_attribute_t)) # ../../../inc/sail2mc.h: 162 - -sai_get_l2mc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_l2mc_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/sail2mc.h: 175 - -# ../../../inc/sail2mc.h: 190 -class struct__sai_l2mc_api_t(Structure): - pass - -struct__sai_l2mc_api_t.__slots__ = [ - 'create_l2mc_entry', - 'remove_l2mc_entry', - 'set_l2mc_entry_attribute', - 'get_l2mc_entry_attribute', -] -struct__sai_l2mc_api_t._fields_ = [ - ('create_l2mc_entry', sai_create_l2mc_entry_fn), - ('remove_l2mc_entry', sai_remove_l2mc_entry_fn), - ('set_l2mc_entry_attribute', sai_set_l2mc_entry_attribute_fn), - ('get_l2mc_entry_attribute', sai_get_l2mc_entry_attribute_fn), -] - -sai_l2mc_api_t = struct__sai_l2mc_api_t # ../../../inc/sail2mc.h: 190 - -enum__sai_ipmc_entry_type_t = c_int # ../../../inc/saiipmc.h: 47 - -SAI_IPMC_ENTRY_TYPE_SG = 0 # ../../../inc/saiipmc.h: 47 - -SAI_IPMC_ENTRY_TYPE_XG = (SAI_IPMC_ENTRY_TYPE_SG + 1) # ../../../inc/saiipmc.h: 47 - -sai_ipmc_entry_type_t = enum__sai_ipmc_entry_type_t # ../../../inc/saiipmc.h: 47 - -# ../../../inc/saiipmc.h: 76 -class struct__sai_ipmc_entry_t(Structure): - pass - -struct__sai_ipmc_entry_t.__slots__ = [ - 'switch_id', - 'vr_id', - 'type', - 'destination', - 'source', -] -struct__sai_ipmc_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('vr_id', sai_object_id_t), - ('type', sai_ipmc_entry_type_t), - ('destination', sai_ip_address_t), - ('source', sai_ip_address_t), -] - -sai_ipmc_entry_t = struct__sai_ipmc_entry_t # ../../../inc/saiipmc.h: 76 - -enum__sai_ipmc_entry_attr_t = c_int # ../../../inc/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_START = 0 # ../../../inc/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_PACKET_ACTION = SAI_IPMC_ENTRY_ATTR_START # ../../../inc/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_OUTPUT_GROUP_ID = (SAI_IPMC_ENTRY_ATTR_PACKET_ACTION + 1) # ../../../inc/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_RPF_GROUP_ID = (SAI_IPMC_ENTRY_ATTR_OUTPUT_GROUP_ID + 1) # ../../../inc/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_END = (SAI_IPMC_ENTRY_ATTR_RPF_GROUP_ID + 1) # ../../../inc/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_BASE = 268435456 # ../../../inc/saiipmc.h: 133 - -SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_BASE + 1) # ../../../inc/saiipmc.h: 133 - -sai_ipmc_entry_attr_t = enum__sai_ipmc_entry_attr_t # ../../../inc/saiipmc.h: 133 - -sai_create_ipmc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/saiipmc.h: 144 - -sai_remove_ipmc_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t)) # ../../../inc/saiipmc.h: 156 - -sai_set_ipmc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t), POINTER(sai_attribute_t)) # ../../../inc/saiipmc.h: 167 - -sai_get_ipmc_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_ipmc_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/saiipmc.h: 180 - -# ../../../inc/saiipmc.h: 195 -class struct__sai_ipmc_api_t(Structure): - pass - -struct__sai_ipmc_api_t.__slots__ = [ - 'create_ipmc_entry', - 'remove_ipmc_entry', - 'set_ipmc_entry_attribute', - 'get_ipmc_entry_attribute', -] -struct__sai_ipmc_api_t._fields_ = [ - ('create_ipmc_entry', sai_create_ipmc_entry_fn), - ('remove_ipmc_entry', sai_remove_ipmc_entry_fn), - ('set_ipmc_entry_attribute', sai_set_ipmc_entry_attribute_fn), - ('get_ipmc_entry_attribute', sai_get_ipmc_entry_attribute_fn), -] - -sai_ipmc_api_t = struct__sai_ipmc_api_t # ../../../inc/saiipmc.h: 195 - -enum__sai_route_entry_attr_t = c_int # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_START = 0 # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION = SAI_ROUTE_ENTRY_ATTR_START # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_TRAP_PRIORITY = (SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION + 1) # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID = (SAI_ROUTE_ENTRY_ATTR_TRAP_PRIORITY + 1) # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_META_DATA = (SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID + 1) # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_END = (SAI_ROUTE_ENTRY_ATTR_META_DATA + 1) # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # ../../../inc/sairoute.h: 112 - -SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_ROUTE_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # ../../../inc/sairoute.h: 112 - -sai_route_entry_attr_t = enum__sai_route_entry_attr_t # ../../../inc/sairoute.h: 112 - -# ../../../inc/sairoute.h: 138 -class struct__sai_route_entry_t(Structure): - pass - -struct__sai_route_entry_t.__slots__ = [ - 'switch_id', - 'vr_id', - 'destination', -] -struct__sai_route_entry_t._fields_ = [ - ('switch_id', sai_object_id_t), - ('vr_id', sai_object_id_t), - ('destination', sai_ip_prefix_t), -] - -sai_route_entry_t = struct__sai_route_entry_t # ../../../inc/sairoute.h: 138 - -sai_create_route_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/sairoute.h: 151 - -sai_remove_route_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t)) # ../../../inc/sairoute.h: 165 - -sai_set_route_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t), POINTER(sai_attribute_t)) # ../../../inc/sairoute.h: 176 - -sai_get_route_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_route_entry_t), c_uint32, POINTER(sai_attribute_t)) # ../../../inc/sairoute.h: 189 - -# ../../../inc/sairoute.h: 204 -class struct__sai_route_api_t(Structure): - pass - -struct__sai_route_api_t.__slots__ = [ - 'create_route_entry', - 'remove_route_entry', - 'set_route_entry_attribute', - 'get_route_entry_attribute', -] -struct__sai_route_api_t._fields_ = [ - ('create_route_entry', sai_create_route_entry_fn), - ('remove_route_entry', sai_remove_route_entry_fn), - ('set_route_entry_attribute', sai_set_route_entry_attribute_fn), - ('get_route_entry_attribute', sai_get_route_entry_attribute_fn), -] - -sai_route_api_t = struct__sai_route_api_t # ../../../inc/sairoute.h: 204 - -# /home/omer/P4/SAI/inc/saiobject.h: 49 -class union_anon_21(Union): - pass - -union_anon_21.__slots__ = [ - 'object_id', - 'fdb_entry', - 'neighbor_entry', - 'route_entry', - 'mcast_fdb_entry', - 'l2mc_entry', - 'ipmc_entry', -] -union_anon_21._fields_ = [ - ('object_id', sai_object_id_t), - ('fdb_entry', sai_fdb_entry_t), - ('neighbor_entry', sai_neighbor_entry_t), - ('route_entry', sai_route_entry_t), - ('mcast_fdb_entry', sai_mcast_fdb_entry_t), - ('l2mc_entry', sai_l2mc_entry_t), - ('ipmc_entry', sai_ipmc_entry_t), -] - -# /home/omer/P4/SAI/inc/saiobject.h: 61 -class struct__sai_object_key_t(Structure): - pass - -struct__sai_object_key_t.__slots__ = [ - 'key', -] -struct__sai_object_key_t._fields_ = [ - ('key', union_anon_21), -] - -sai_object_key_t = struct__sai_object_key_t # /home/omer/P4/SAI/inc/saiobject.h: 61 - -# /home/omer/P4/SAI/inc/saiobject.h: 72 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_get_maximum_attribute_count'): - continue - sai_get_maximum_attribute_count = _lib.sai_get_maximum_attribute_count - sai_get_maximum_attribute_count.argtypes = [sai_object_id_t, sai_object_type_t, POINTER(c_uint32)] - sai_get_maximum_attribute_count.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/saiobject.h: 86 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_get_object_count'): - continue - sai_get_object_count = _lib.sai_get_object_count - sai_get_object_count.argtypes = [sai_object_id_t, sai_object_type_t, POINTER(c_uint32)] - sai_get_object_count.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/saiobject.h: 101 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_get_object_key'): - continue - sai_get_object_key = _lib.sai_get_object_key - sai_get_object_key.argtypes = [sai_object_id_t, sai_object_type_t, c_uint32, POINTER(sai_object_key_t)] - sai_get_object_key.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/saiobject.h: 136 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_bulk_get_attribute'): - continue - sai_bulk_get_attribute = _lib.sai_bulk_get_attribute - sai_bulk_get_attribute.argtypes = [sai_object_id_t, sai_object_type_t, c_uint32, POINTER(sai_object_key_t), POINTER(c_uint32), POINTER(POINTER(sai_attribute_t)), POINTER(sai_status_t)] - sai_bulk_get_attribute.restype = sai_status_t - break - -enum__sai_meter_type_t = c_int # /home/omer/P4/SAI/inc/saipolicer.h: 50 - -SAI_METER_TYPE_PACKETS = 0 # /home/omer/P4/SAI/inc/saipolicer.h: 50 - -SAI_METER_TYPE_BYTES = 1 # /home/omer/P4/SAI/inc/saipolicer.h: 50 - -SAI_METER_TYPE_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saipolicer.h: 50 - -sai_meter_type_t = enum__sai_meter_type_t # /home/omer/P4/SAI/inc/saipolicer.h: 50 - -enum__sai_policer_mode_t = c_int # /home/omer/P4/SAI/inc/saipolicer.h: 69 - -SAI_POLICER_MODE_SR_TCM = 0 # /home/omer/P4/SAI/inc/saipolicer.h: 69 - -SAI_POLICER_MODE_TR_TCM = 1 # /home/omer/P4/SAI/inc/saipolicer.h: 69 - -SAI_POLICER_MODE_STORM_CONTROL = 2 # /home/omer/P4/SAI/inc/saipolicer.h: 69 - -SAI_POLICER_MODE_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saipolicer.h: 69 - -sai_policer_mode_t = enum__sai_policer_mode_t # /home/omer/P4/SAI/inc/saipolicer.h: 69 - -enum__sai_policer_color_source_t = c_int # /home/omer/P4/SAI/inc/saipolicer.h: 85 - -SAI_POLICER_COLOR_SOURCE_BLIND = 0 # /home/omer/P4/SAI/inc/saipolicer.h: 85 - -SAI_POLICER_COLOR_SOURCE_AWARE = 1 # /home/omer/P4/SAI/inc/saipolicer.h: 85 - -SAI_POLICER_COLOR_SOURCE_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saipolicer.h: 85 - -sai_policer_color_source_t = enum__sai_policer_color_source_t # /home/omer/P4/SAI/inc/saipolicer.h: 85 - -enum__sai_policer_attr_t = c_int # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_START = 0 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_METER_TYPE = SAI_POLICER_ATTR_START # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_MODE = 1 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_COLOR_SOURCE = 2 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_CBS = 3 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_CIR = 4 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_PBS = 5 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_PIR = 6 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_GREEN_PACKET_ACTION = 7 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_YELLOW_PACKET_ACTION = 8 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_RED_PACKET_ACTION = 9 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_ENABLE_COUNTER_PACKET_ACTION_LIST = 10 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_END = (SAI_POLICER_ATTR_ENABLE_COUNTER_PACKET_ACTION_LIST + 1) # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -SAI_POLICER_ATTR_CUSTOM_RANGE_END = (SAI_POLICER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -sai_policer_attr_t = enum__sai_policer_attr_t # /home/omer/P4/SAI/inc/saipolicer.h: 213 - -enum__sai_policer_stat_t = c_int # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_PACKETS = 0 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_ATTR_BYTES = 1 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_GREEN_PACKETS = 2 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_GREEN_BYTES = 3 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_YELLOW_PACKETS = 4 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_YELLOW_BYTES = 5 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_RED_PACKETS = 6 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_RED_BYTES = 7 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -SAI_POLICER_STAT_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -sai_policer_stat_t = enum__sai_policer_stat_t # /home/omer/P4/SAI/inc/saipolicer.h: 247 - -sai_create_policer_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saipolicer.h: 259 - -sai_remove_policer_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saipolicer.h: 272 - -sai_set_policer_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saipolicer.h: 283 - -sai_get_policer_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saipolicer.h: 296 - -sai_get_policer_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_policer_stat_t), c_uint32, POINTER(c_uint64)) # /home/omer/P4/SAI/inc/saipolicer.h: 311 - -sai_clear_policer_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_policer_stat_t)) # /home/omer/P4/SAI/inc/saipolicer.h: 327 - -# /home/omer/P4/SAI/inc/saipolicer.h: 344 -class struct__sai_policer_api_t(Structure): - pass - -struct__sai_policer_api_t.__slots__ = [ - 'create_policer', - 'remove_policer', - 'set_policer_attribute', - 'get_policer_attribute', - 'get_policer_stats', - 'clear_policer_stats', -] -struct__sai_policer_api_t._fields_ = [ - ('create_policer', sai_create_policer_fn), - ('remove_policer', sai_remove_policer_fn), - ('set_policer_attribute', sai_set_policer_attribute_fn), - ('get_policer_attribute', sai_get_policer_attribute_fn), - ('get_policer_stats', sai_get_policer_stats_fn), - ('clear_policer_stats', sai_clear_policer_stats_fn), -] - -sai_policer_api_t = struct__sai_policer_api_t # /home/omer/P4/SAI/inc/saipolicer.h: 344 - -enum__sai_port_type_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 47 - -SAI_PORT_TYPE_LOGICAL = 0 # /home/omer/P4/SAI/inc/saiport.h: 47 - -SAI_PORT_TYPE_CPU = (SAI_PORT_TYPE_LOGICAL + 1) # /home/omer/P4/SAI/inc/saiport.h: 47 - -sai_port_type_t = enum__sai_port_type_t # /home/omer/P4/SAI/inc/saiport.h: 47 - -enum__sai_port_bind_mode_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 60 - -SAI_PORT_BIND_MODE_PORT = 0 # /home/omer/P4/SAI/inc/saiport.h: 60 - -SAI_PORT_BIND_MODE_SUB_PORT = (SAI_PORT_BIND_MODE_PORT + 1) # /home/omer/P4/SAI/inc/saiport.h: 60 - -sai_port_bind_mode_t = enum__sai_port_bind_mode_t # /home/omer/P4/SAI/inc/saiport.h: 60 - -enum__sai_port_oper_status_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 82 - -SAI_PORT_OPER_STATUS_UNKNOWN = 0 # /home/omer/P4/SAI/inc/saiport.h: 82 - -SAI_PORT_OPER_STATUS_UP = (SAI_PORT_OPER_STATUS_UNKNOWN + 1) # /home/omer/P4/SAI/inc/saiport.h: 82 - -SAI_PORT_OPER_STATUS_DOWN = (SAI_PORT_OPER_STATUS_UP + 1) # /home/omer/P4/SAI/inc/saiport.h: 82 - -SAI_PORT_OPER_STATUS_TESTING = (SAI_PORT_OPER_STATUS_DOWN + 1) # /home/omer/P4/SAI/inc/saiport.h: 82 - -SAI_PORT_OPER_STATUS_NOT_PRESENT = (SAI_PORT_OPER_STATUS_TESTING + 1) # /home/omer/P4/SAI/inc/saiport.h: 82 - -sai_port_oper_status_t = enum__sai_port_oper_status_t # /home/omer/P4/SAI/inc/saiport.h: 82 - -# /home/omer/P4/SAI/inc/saiport.h: 95 -class struct__sai_port_oper_status_notification_t(Structure): - pass - -struct__sai_port_oper_status_notification_t.__slots__ = [ - 'port_id', - 'port_state', -] -struct__sai_port_oper_status_notification_t._fields_ = [ - ('port_id', sai_object_id_t), - ('port_state', sai_port_oper_status_t), -] - -sai_port_oper_status_notification_t = struct__sai_port_oper_status_notification_t # /home/omer/P4/SAI/inc/saiport.h: 95 - -enum__sai_port_flow_control_mode_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_DISABLE = 0 # /home/omer/P4/SAI/inc/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_TX_ONLY = (SAI_PORT_FLOW_CONTROL_MODE_DISABLE + 1) # /home/omer/P4/SAI/inc/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_RX_ONLY = (SAI_PORT_FLOW_CONTROL_MODE_TX_ONLY + 1) # /home/omer/P4/SAI/inc/saiport.h: 114 - -SAI_PORT_FLOW_CONTROL_MODE_BOTH_ENABLE = (SAI_PORT_FLOW_CONTROL_MODE_RX_ONLY + 1) # /home/omer/P4/SAI/inc/saiport.h: 114 - -sai_port_flow_control_mode_t = enum__sai_port_flow_control_mode_t # /home/omer/P4/SAI/inc/saiport.h: 114 - -enum__sai_port_internal_loopback_mode_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 130 - -SAI_PORT_INTERNAL_LOOPBACK_MODE_NONE = 0 # /home/omer/P4/SAI/inc/saiport.h: 130 - -SAI_PORT_INTERNAL_LOOPBACK_MODE_PHY = (SAI_PORT_INTERNAL_LOOPBACK_MODE_NONE + 1) # /home/omer/P4/SAI/inc/saiport.h: 130 - -SAI_PORT_INTERNAL_LOOPBACK_MODE_MAC = (SAI_PORT_INTERNAL_LOOPBACK_MODE_PHY + 1) # /home/omer/P4/SAI/inc/saiport.h: 130 - -sai_port_internal_loopback_mode_t = enum__sai_port_internal_loopback_mode_t # /home/omer/P4/SAI/inc/saiport.h: 130 - -enum__sai_port_media_type_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_NOT_PRESENT = 0 # /home/omer/P4/SAI/inc/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_UNKNONWN = (SAI_PORT_MEDIA_TYPE_NOT_PRESENT + 1) # /home/omer/P4/SAI/inc/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_FIBER = (SAI_PORT_MEDIA_TYPE_UNKNONWN + 1) # /home/omer/P4/SAI/inc/saiport.h: 148 - -SAI_PORT_MEDIA_TYPE_COPPER = (SAI_PORT_MEDIA_TYPE_FIBER + 1) # /home/omer/P4/SAI/inc/saiport.h: 148 - -sai_port_media_type_t = enum__sai_port_media_type_t # /home/omer/P4/SAI/inc/saiport.h: 148 - -enum__sai_port_breakout_mode_type_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_1_LANE = 0 # /home/omer/P4/SAI/inc/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_2_LANE = 1 # /home/omer/P4/SAI/inc/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_4_LANE = 2 # /home/omer/P4/SAI/inc/saiport.h: 167 - -SAI_PORT_BREAKOUT_MODE_TYPE_MAX = (SAI_PORT_BREAKOUT_MODE_TYPE_4_LANE + 1) # /home/omer/P4/SAI/inc/saiport.h: 167 - -sai_port_breakout_mode_type_t = enum__sai_port_breakout_mode_type_t # /home/omer/P4/SAI/inc/saiport.h: 167 - -enum__sai_port_fec_mode_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 182 - -SAI_PORT_FEC_MODE_NONE = 0 # /home/omer/P4/SAI/inc/saiport.h: 182 - -SAI_PORT_FEC_MODE_RS = (SAI_PORT_FEC_MODE_NONE + 1) # /home/omer/P4/SAI/inc/saiport.h: 182 - -SAI_PORT_FEC_MODE_FC = (SAI_PORT_FEC_MODE_RS + 1) # /home/omer/P4/SAI/inc/saiport.h: 182 - -sai_port_fec_mode_t = enum__sai_port_fec_mode_t # /home/omer/P4/SAI/inc/saiport.h: 182 - -enum__sai_port_attr_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_TYPE = SAI_PORT_ATTR_START # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_OPER_STATUS = (SAI_PORT_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_BREAKOUT_MODE_TYPE = (SAI_PORT_ATTR_OPER_STATUS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_CURRENT_BREAKOUT_MODE_TYPE = (SAI_PORT_ATTR_SUPPORTED_BREAKOUT_MODE_TYPE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES = (SAI_PORT_ATTR_CURRENT_BREAKOUT_MODE_TYPE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_QUEUE_LIST = (SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_NUMBER_OF_SCHEDULER_GROUPS = (SAI_PORT_ATTR_QOS_QUEUE_LIST + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_SCHEDULER_GROUP_LIST = (SAI_PORT_ATTR_QOS_NUMBER_OF_SCHEDULER_GROUPS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_SPEED = (SAI_PORT_ATTR_QOS_SCHEDULER_GROUP_LIST + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_FEC_MODE = (SAI_PORT_ATTR_SUPPORTED_SPEED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_HALF_DUPLEX_SPEED = (SAI_PORT_ATTR_SUPPORTED_FEC_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE = (SAI_PORT_ATTR_SUPPORTED_HALF_DUPLEX_SPEED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_SUPPORTED_AUTO_NEG_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_ASYMMETRIC_PAUSE_MODE = (SAI_PORT_ATTR_SUPPORTED_FLOW_CONTROL_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SUPPORTED_MEDIA_TYPE = (SAI_PORT_ATTR_SUPPORTED_ASYMMETRIC_PAUSE_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_SPEED = (SAI_PORT_ATTR_SUPPORTED_MEDIA_TYPE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_FEC_MODE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_SPEED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_HALF_DUPLEX_SPEED = (SAI_PORT_ATTR_REMOTE_ADVERTISED_FEC_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_AUTO_NEG_MODE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_HALF_DUPLEX_SPEED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_AUTO_NEG_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_ASYMMETRIC_PAUSE_MODE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_FLOW_CONTROL_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_REMOTE_ADVERTISED_MEDIA_TYPE = (SAI_PORT_ATTR_REMOTE_ADVERTISED_ASYMMETRIC_PAUSE_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_NUMBER_OF_INGRESS_PRIORITY_GROUPS = (SAI_PORT_ATTR_REMOTE_ADVERTISED_MEDIA_TYPE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_INGRESS_PRIORITY_GROUP_LIST = (SAI_PORT_ATTR_NUMBER_OF_INGRESS_PRIORITY_GROUPS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_HW_LANE_LIST = (SAI_PORT_ATTR_INGRESS_PRIORITY_GROUP_LIST + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_SPEED = (SAI_PORT_ATTR_HW_LANE_LIST + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_FULL_DUPLEX_MODE = (SAI_PORT_ATTR_SPEED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_AUTO_NEG_MODE = (SAI_PORT_ATTR_FULL_DUPLEX_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADMIN_STATE = (SAI_PORT_ATTR_AUTO_NEG_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_MEDIA_TYPE = (SAI_PORT_ATTR_ADMIN_STATE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADVERTISED_SPEED = (SAI_PORT_ATTR_MEDIA_TYPE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADVERTISED_FEC_MODE = (SAI_PORT_ATTR_ADVERTISED_SPEED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADVERTISED_HALF_DUPLEX_SPEED = (SAI_PORT_ATTR_ADVERTISED_FEC_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADVERTISED_AUTO_NEG_MODE = (SAI_PORT_ATTR_ADVERTISED_HALF_DUPLEX_SPEED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADVERTISED_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_ADVERTISED_AUTO_NEG_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADVERTISED_ASYMMETRIC_PAUSE_MODE = (SAI_PORT_ATTR_ADVERTISED_FLOW_CONTROL_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_ADVERTISED_MEDIA_TYPE = (SAI_PORT_ATTR_ADVERTISED_ASYMMETRIC_PAUSE_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_PORT_VLAN_ID = (SAI_PORT_ATTR_ADVERTISED_MEDIA_TYPE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_DEFAULT_VLAN_PRIORITY = (SAI_PORT_ATTR_PORT_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_INGRESS_FILTERING = (SAI_PORT_ATTR_DEFAULT_VLAN_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_DROP_UNTAGGED = (SAI_PORT_ATTR_INGRESS_FILTERING + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_DROP_TAGGED = (SAI_PORT_ATTR_DROP_UNTAGGED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_INTERNAL_LOOPBACK_MODE = (SAI_PORT_ATTR_DROP_TAGGED + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_FEC_MODE = (SAI_PORT_ATTR_INTERNAL_LOOPBACK_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_UPDATE_DSCP = (SAI_PORT_ATTR_FEC_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_MTU = (SAI_PORT_ATTR_UPDATE_DSCP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_FLOOD_STORM_CONTROL_POLICER_ID = (SAI_PORT_ATTR_MTU + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_BROADCAST_STORM_CONTROL_POLICER_ID = (SAI_PORT_ATTR_FLOOD_STORM_CONTROL_POLICER_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_MULTICAST_STORM_CONTROL_POLICER_ID = (SAI_PORT_ATTR_BROADCAST_STORM_CONTROL_POLICER_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_GLOBAL_FLOW_CONTROL_MODE = (SAI_PORT_ATTR_MULTICAST_STORM_CONTROL_POLICER_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_INGRESS_ACL = (SAI_PORT_ATTR_GLOBAL_FLOW_CONTROL_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_EGRESS_ACL = (SAI_PORT_ATTR_INGRESS_ACL + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_INGRESS_MIRROR_SESSION = (SAI_PORT_ATTR_EGRESS_ACL + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_EGRESS_MIRROR_SESSION = (SAI_PORT_ATTR_INGRESS_MIRROR_SESSION + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE = (SAI_PORT_ATTR_EGRESS_MIRROR_SESSION + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_EGRESS_SAMPLEPACKET_ENABLE = (SAI_PORT_ATTR_INGRESS_SAMPLEPACKET_ENABLE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_POLICER_ID = (SAI_PORT_ATTR_EGRESS_SAMPLEPACKET_ENABLE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_DEFAULT_TC = (SAI_PORT_ATTR_POLICER_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_DOT1P_TO_TC_MAP = (SAI_PORT_ATTR_QOS_DEFAULT_TC + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_DOT1P_TO_COLOR_MAP = (SAI_PORT_ATTR_QOS_DOT1P_TO_TC_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_DSCP_TO_TC_MAP = (SAI_PORT_ATTR_QOS_DOT1P_TO_COLOR_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_DSCP_TO_COLOR_MAP = (SAI_PORT_ATTR_QOS_DSCP_TO_TC_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_TC_TO_QUEUE_MAP = (SAI_PORT_ATTR_QOS_DSCP_TO_COLOR_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP = (SAI_PORT_ATTR_QOS_TC_TO_QUEUE_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP = (SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_TC_TO_PRIORITY_GROUP_MAP = (SAI_PORT_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_PRIORITY_GROUP_MAP = (SAI_PORT_ATTR_QOS_TC_TO_PRIORITY_GROUP_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_QUEUE_MAP = (SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_PRIORITY_GROUP_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_WRED_PROFILE_ID = (SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_QUEUE_MAP + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID = (SAI_PORT_ATTR_QOS_WRED_PROFILE_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_INGRESS_BUFFER_PROFILE_LIST = (SAI_PORT_ATTR_QOS_SCHEDULER_PROFILE_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_QOS_EGRESS_BUFFER_PROFILE_LIST = (SAI_PORT_ATTR_QOS_INGRESS_BUFFER_PROFILE_LIST + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL = (SAI_PORT_ATTR_QOS_EGRESS_BUFFER_PROFILE_LIST + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_META_DATA = (SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_EGRESS_BLOCK_PORT_LIST = (SAI_PORT_ATTR_META_DATA + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_HW_PROFILE_ID = (SAI_PORT_ATTR_EGRESS_BLOCK_PORT_LIST + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_EEE_ENABLE = (SAI_PORT_ATTR_HW_PROFILE_ID + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_EEE_IDLE_TIME = (SAI_PORT_ATTR_EEE_ENABLE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_EEE_WAKE_TIME = (SAI_PORT_ATTR_EEE_IDLE_TIME + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_BIND_MODE = (SAI_PORT_ATTR_EEE_WAKE_TIME + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_END = (SAI_PORT_ATTR_BIND_MODE + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiport.h: 1051 - -SAI_PORT_ATTR_CUSTOM_RANGE_END = (SAI_PORT_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiport.h: 1051 - -sai_port_attr_t = enum__sai_port_attr_t # /home/omer/P4/SAI/inc/saiport.h: 1051 - -enum__sai_port_stat_t = c_int # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_OCTETS = 0 # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_UCAST_PKTS = (SAI_PORT_STAT_IF_IN_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS = (SAI_PORT_STAT_IF_IN_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_DISCARDS = (SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_ERRORS = (SAI_PORT_STAT_IF_IN_DISCARDS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS = (SAI_PORT_STAT_IF_IN_ERRORS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_BROADCAST_PKTS = (SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_MULTICAST_PKTS = (SAI_PORT_STAT_IF_IN_BROADCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_IN_VLAN_DISCARDS = (SAI_PORT_STAT_IF_IN_MULTICAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_OCTETS = (SAI_PORT_STAT_IF_IN_VLAN_DISCARDS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_UCAST_PKTS = (SAI_PORT_STAT_IF_OUT_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_NON_UCAST_PKTS = (SAI_PORT_STAT_IF_OUT_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_DISCARDS = (SAI_PORT_STAT_IF_OUT_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_ERRORS = (SAI_PORT_STAT_IF_OUT_DISCARDS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_QLEN = (SAI_PORT_STAT_IF_OUT_ERRORS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_BROADCAST_PKTS = (SAI_PORT_STAT_IF_OUT_QLEN + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IF_OUT_MULTICAST_PKTS = (SAI_PORT_STAT_IF_OUT_BROADCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS = (SAI_PORT_STAT_IF_OUT_MULTICAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_MULTICAST_PKTS = (SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS = (SAI_PORT_STAT_ETHER_STATS_MULTICAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS = (SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_FRAGMENTS = (SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_64_OCTETS = (SAI_PORT_STAT_ETHER_STATS_FRAGMENTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_65_TO_127_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_64_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_128_TO_255_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_65_TO_127_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_256_TO_511_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_128_TO_255_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_512_TO_1023_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_256_TO_511_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_1024_TO_1518_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_512_TO_1023_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_1519_TO_2047_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_1024_TO_1518_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_2048_TO_4095_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_1519_TO_2047_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_2048_TO_4095_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS_9217_TO_16383_OCTETS = (SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS = (SAI_PORT_STAT_ETHER_STATS_PKTS_9217_TO_16383_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS = (SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_TX_OVERSIZE_PKTS = (SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_JABBERS = (SAI_PORT_STAT_ETHER_TX_OVERSIZE_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_OCTETS = (SAI_PORT_STAT_ETHER_STATS_JABBERS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_PKTS = (SAI_PORT_STAT_ETHER_STATS_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_COLLISIONS = (SAI_PORT_STAT_ETHER_STATS_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_CRC_ALIGN_ERRORS = (SAI_PORT_STAT_ETHER_STATS_COLLISIONS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS = (SAI_PORT_STAT_ETHER_STATS_CRC_ALIGN_ERRORS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_STATS_RX_NO_ERRORS = (SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_IN_RECEIVES = (SAI_PORT_STAT_ETHER_STATS_RX_NO_ERRORS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_IN_OCTETS = (SAI_PORT_STAT_IP_IN_RECEIVES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_IN_UCAST_PKTS = (SAI_PORT_STAT_IP_IN_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_IN_NON_UCAST_PKTS = (SAI_PORT_STAT_IP_IN_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_IN_DISCARDS = (SAI_PORT_STAT_IP_IN_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_OUT_OCTETS = (SAI_PORT_STAT_IP_IN_DISCARDS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_OUT_UCAST_PKTS = (SAI_PORT_STAT_IP_OUT_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_OUT_NON_UCAST_PKTS = (SAI_PORT_STAT_IP_OUT_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IP_OUT_DISCARDS = (SAI_PORT_STAT_IP_OUT_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_IN_RECEIVES = (SAI_PORT_STAT_IP_OUT_DISCARDS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_IN_OCTETS = (SAI_PORT_STAT_IPV6_IN_RECEIVES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_IN_UCAST_PKTS = (SAI_PORT_STAT_IPV6_IN_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_IN_NON_UCAST_PKTS = (SAI_PORT_STAT_IPV6_IN_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_IN_MCAST_PKTS = (SAI_PORT_STAT_IPV6_IN_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_IN_DISCARDS = (SAI_PORT_STAT_IPV6_IN_MCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_OUT_OCTETS = (SAI_PORT_STAT_IPV6_IN_DISCARDS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_OUT_UCAST_PKTS = (SAI_PORT_STAT_IPV6_OUT_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_OUT_NON_UCAST_PKTS = (SAI_PORT_STAT_IPV6_OUT_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS = (SAI_PORT_STAT_IPV6_OUT_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IPV6_OUT_DISCARDS = (SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_GREEN_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_IPV6_OUT_DISCARDS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_GREEN_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_GREEN_DISCARD_DROPPED_PACKETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_GREEN_DISCARD_DROPPED_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_PACKETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_RED_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_YELLOW_DISCARD_DROPPED_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_RED_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_RED_DISCARD_DROPPED_PACKETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_DISCARD_DROPPED_PACKETS = (SAI_PORT_STAT_RED_DISCARD_DROPPED_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_DISCARD_DROPPED_BYTES = (SAI_PORT_STAT_DISCARD_DROPPED_PACKETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ECN_MARKED_PACKETS = (SAI_PORT_STAT_DISCARD_DROPPED_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS = (SAI_PORT_STAT_ECN_MARKED_PACKETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_128_TO_255_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_128_TO_255_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS = (SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS = (SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IN_CURR_OCCUPANCY_BYTES = (SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IN_WATERMARK_BYTES = (SAI_PORT_STAT_IN_CURR_OCCUPANCY_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IN_SHARED_CURR_OCCUPANCY_BYTES = (SAI_PORT_STAT_IN_WATERMARK_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IN_SHARED_WATERMARK_BYTES = (SAI_PORT_STAT_IN_SHARED_CURR_OCCUPANCY_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_OUT_CURR_OCCUPANCY_BYTES = (SAI_PORT_STAT_IN_SHARED_WATERMARK_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_OUT_WATERMARK_BYTES = (SAI_PORT_STAT_OUT_CURR_OCCUPANCY_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_OUT_SHARED_CURR_OCCUPANCY_BYTES = (SAI_PORT_STAT_OUT_WATERMARK_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_OUT_SHARED_WATERMARK_BYTES = (SAI_PORT_STAT_OUT_SHARED_CURR_OCCUPANCY_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_IN_DROPPED_PKTS = (SAI_PORT_STAT_OUT_SHARED_WATERMARK_BYTES + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_OUT_DROPPED_PKTS = (SAI_PORT_STAT_IN_DROPPED_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PAUSE_RX_PKTS = (SAI_PORT_STAT_OUT_DROPPED_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PAUSE_TX_PKTS = (SAI_PORT_STAT_PAUSE_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_0_RX_PKTS = (SAI_PORT_STAT_PAUSE_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_0_TX_PKTS = (SAI_PORT_STAT_PFC_0_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_1_RX_PKTS = (SAI_PORT_STAT_PFC_0_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_1_TX_PKTS = (SAI_PORT_STAT_PFC_1_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_2_RX_PKTS = (SAI_PORT_STAT_PFC_1_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_2_TX_PKTS = (SAI_PORT_STAT_PFC_2_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_3_RX_PKTS = (SAI_PORT_STAT_PFC_2_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_3_TX_PKTS = (SAI_PORT_STAT_PFC_3_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_4_RX_PKTS = (SAI_PORT_STAT_PFC_3_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_4_TX_PKTS = (SAI_PORT_STAT_PFC_4_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_5_RX_PKTS = (SAI_PORT_STAT_PFC_4_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_5_TX_PKTS = (SAI_PORT_STAT_PFC_5_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_6_RX_PKTS = (SAI_PORT_STAT_PFC_5_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_6_TX_PKTS = (SAI_PORT_STAT_PFC_6_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_7_RX_PKTS = (SAI_PORT_STAT_PFC_6_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_7_TX_PKTS = (SAI_PORT_STAT_PFC_7_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_0_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_7_TX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_1_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_0_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_2_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_1_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_3_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_2_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_4_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_3_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_5_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_4_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_6_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_5_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_PFC_7_ON2OFF_RX_PKTS = (SAI_PORT_STAT_PFC_6_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_EEE_TX_EVENT_COUNT = (SAI_PORT_STAT_PFC_7_ON2OFF_RX_PKTS + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_EEE_RX_EVENT_COUNT = (SAI_PORT_STAT_EEE_TX_EVENT_COUNT + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_EEE_TX_DURATION = (SAI_PORT_STAT_EEE_RX_EVENT_COUNT + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -SAI_PORT_STAT_EEE_RX_DURATION = (SAI_PORT_STAT_EEE_TX_DURATION + 1) # /home/omer/P4/SAI/inc/saiport.h: 1465 - -sai_port_stat_t = enum__sai_port_stat_t # /home/omer/P4/SAI/inc/saiport.h: 1465 - -sai_create_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiport.h: 1477 - -sai_remove_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiport.h: 1489 - -sai_set_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiport.h: 1500 - -sai_get_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiport.h: 1513 - -sai_get_port_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_port_stat_t), c_uint32, POINTER(c_uint64)) # /home/omer/P4/SAI/inc/saiport.h: 1528 - -sai_clear_port_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_port_stat_t), c_uint32) # /home/omer/P4/SAI/inc/saiport.h: 1543 - -sai_clear_port_all_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiport.h: 1555 - -sai_port_state_change_notification_fn = CFUNCTYPE(UNCHECKED(None), c_uint32, POINTER(sai_port_oper_status_notification_t)) # /home/omer/P4/SAI/inc/saiport.h: 1566 - -# /home/omer/P4/SAI/inc/saiport.h: 1583 -class struct__sai_port_api_t(Structure): - pass - -struct__sai_port_api_t.__slots__ = [ - 'create_port', - 'remove_port', - 'set_port_attribute', - 'get_port_attribute', - 'get_port_stats', - 'clear_port_stats', - 'clear_port_all_stats', -] -struct__sai_port_api_t._fields_ = [ - ('create_port', sai_create_port_fn), - ('remove_port', sai_remove_port_fn), - ('set_port_attribute', sai_set_port_attribute_fn), - ('get_port_attribute', sai_get_port_attribute_fn), - ('get_port_stats', sai_get_port_stats_fn), - ('clear_port_stats', sai_clear_port_stats_fn), - ('clear_port_all_stats', sai_clear_port_all_stats_fn), -] - -sai_port_api_t = struct__sai_port_api_t # /home/omer/P4/SAI/inc/saiport.h: 1583 - -enum__sai_qos_map_type_t = c_int # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_DOT1P_TO_TC = 0 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_DOT1P_TO_COLOR = 1 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_DSCP_TO_TC = 2 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_DSCP_TO_COLOR = 3 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_TC_TO_QUEUE = 4 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_TC_AND_COLOR_TO_DSCP = 5 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_TC_AND_COLOR_TO_DOT1P = 6 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_TC_TO_PRIORITY_GROUP = 7 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_PRIORITY_GROUP = 8 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_QUEUE = 9 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -SAI_QOS_MAP_TYPE_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -sai_qos_map_type_t = enum__sai_qos_map_type_t # /home/omer/P4/SAI/inc/saiqosmap.h: 74 - -enum__sai_qos_map_attr_t = c_int # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -SAI_QOS_MAP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -SAI_QOS_MAP_ATTR_TYPE = SAI_QOS_MAP_ATTR_START # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST = 1 # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -SAI_QOS_MAP_ATTR_END = (SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST + 1) # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -SAI_QOS_MAP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -SAI_QOS_MAP_ATTR_CUSTOM_RANGE_END = (SAI_QOS_MAP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -sai_qos_map_attr_t = enum__sai_qos_map_attr_t # /home/omer/P4/SAI/inc/saiqosmap.h: 118 - -sai_create_qos_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiqosmap.h: 130 - -sai_remove_qos_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiqosmap.h: 143 - -sai_set_qos_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiqosmap.h: 154 - -sai_get_qos_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiqosmap.h: 167 - -# /home/omer/P4/SAI/inc/saiqosmap.h: 182 -class struct__sai_qos_map_api_t(Structure): - pass - -struct__sai_qos_map_api_t.__slots__ = [ - 'create_qos_map', - 'remove_qos_map', - 'set_qos_map_attribute', - 'get_qos_map_attribute', -] -struct__sai_qos_map_api_t._fields_ = [ - ('create_qos_map', sai_create_qos_map_fn), - ('remove_qos_map', sai_remove_qos_map_fn), - ('set_qos_map_attribute', sai_set_qos_map_attribute_fn), - ('get_qos_map_attribute', sai_get_qos_map_attribute_fn), -] - -sai_qos_map_api_t = struct__sai_qos_map_api_t # /home/omer/P4/SAI/inc/saiqosmap.h: 182 - -enum__sai_queue_type_t = c_int # /home/omer/P4/SAI/inc/saiqueue.h: 53 - -SAI_QUEUE_TYPE_ALL = 0 # /home/omer/P4/SAI/inc/saiqueue.h: 53 - -SAI_QUEUE_TYPE_UNICAST = 1 # /home/omer/P4/SAI/inc/saiqueue.h: 53 - -SAI_QUEUE_TYPE_MULTICAST = 2 # /home/omer/P4/SAI/inc/saiqueue.h: 53 - -SAI_QUEUE_TYPE_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saiqueue.h: 53 - -sai_queue_type_t = enum__sai_queue_type_t # /home/omer/P4/SAI/inc/saiqueue.h: 53 - -enum__sai_queue_attr_t = c_int # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_TYPE = SAI_QUEUE_ATTR_START # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_PORT = 1 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_INDEX = 2 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_PARENT_SCHEDULER_NODE = 3 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_WRED_PROFILE_ID = 4 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_BUFFER_PROFILE_ID = 5 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_SCHEDULER_PROFILE_ID = 6 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_PAUSE_STATUS = 7 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_END = (SAI_QUEUE_ATTR_PAUSE_STATUS + 1) # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -SAI_QUEUE_ATTR_CUSTOM_RANGE_END = (SAI_QUEUE_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -sai_queue_attr_t = enum__sai_queue_attr_t # /home/omer/P4/SAI/inc/saiqueue.h: 164 - -enum__sai_queue_stat_t = c_int # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_PACKETS = 0 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_BYTES = 1 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_DROPPED_PACKETS = 2 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_DROPPED_BYTES = 3 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_GREEN_PACKETS = 4 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_GREEN_BYTES = 5 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_GREEN_DROPPED_PACKETS = 6 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_GREEN_DROPPED_BYTES = 7 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_YELLOW_PACKETS = 8 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_YELLOW_BYTES = 9 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_YELLOW_DROPPED_PACKETS = 10 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_YELLOW_DROPPED_BYTES = 11 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_RED_PACKETS = 12 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_RED_BYTES = 13 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_RED_DROPPED_PACKETS = 14 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_RED_DROPPED_BYTES = 15 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_GREEN_DISCARD_DROPPED_PACKETS = 16 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_GREEN_DISCARD_DROPPED_BYTES = 17 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_YELLOW_DISCARD_DROPPED_PACKETS = 18 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_YELLOW_DISCARD_DROPPED_BYTES = 19 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_RED_DISCARD_DROPPED_PACKETS = 20 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_RED_DISCARD_DROPPED_BYTES = 21 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_DISCARD_DROPPED_PACKETS = 22 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_DISCARD_DROPPED_BYTES = 23 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_CURR_OCCUPANCY_BYTES = 24 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_WATERMARK_BYTES = 25 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_SHARED_CURR_OCCUPANCY_BYTES = 26 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES = 27 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -SAI_QUEUE_STAT_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -sai_queue_stat_t = enum__sai_queue_stat_t # /home/omer/P4/SAI/inc/saiqueue.h: 258 - -sai_create_queue_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiqueue.h: 270 - -sai_remove_queue_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiqueue.h: 283 - -sai_set_queue_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiqueue.h: 294 - -sai_get_queue_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiqueue.h: 307 - -sai_get_queue_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_queue_stat_t), c_uint32, POINTER(c_uint64)) # /home/omer/P4/SAI/inc/saiqueue.h: 322 - -sai_clear_queue_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_queue_stat_t), c_uint32) # /home/omer/P4/SAI/inc/saiqueue.h: 337 - -# /home/omer/P4/SAI/inc/saiqueue.h: 354 -class struct__sai_queue_api_t(Structure): - pass - -struct__sai_queue_api_t.__slots__ = [ - 'create_queue', - 'remove_queue', - 'set_queue_attribute', - 'get_queue_attribute', - 'get_queue_stats', - 'clear_queue_stats', -] -struct__sai_queue_api_t._fields_ = [ - ('create_queue', sai_create_queue_fn), - ('remove_queue', sai_remove_queue_fn), - ('set_queue_attribute', sai_set_queue_attribute_fn), - ('get_queue_attribute', sai_get_queue_attribute_fn), - ('get_queue_stats', sai_get_queue_stats_fn), - ('clear_queue_stats', sai_clear_queue_stats_fn), -] - -sai_queue_api_t = struct__sai_queue_api_t # /home/omer/P4/SAI/inc/saiqueue.h: 354 - -enum__sai_virtual_router_attr_t = c_int # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_START = 0 # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE = SAI_VIRTUAL_ROUTER_ATTR_START # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE = (SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V4_STATE + 1) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_SRC_MAC_ADDRESS = (SAI_VIRTUAL_ROUTER_ATTR_ADMIN_V6_STATE + 1) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_TTL1_PACKET_ACTION = (SAI_VIRTUAL_ROUTER_ATTR_SRC_MAC_ADDRESS + 1) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_IP_OPTIONS_PACKET_ACTION = (SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_TTL1_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_UNKNOWN_L3_MULTICAST_PACKET_ACTION = (SAI_VIRTUAL_ROUTER_ATTR_VIOLATION_IP_OPTIONS_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_END = (SAI_VIRTUAL_ROUTER_ATTR_UNKNOWN_L3_MULTICAST_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -SAI_VIRTUAL_ROUTER_ATTR_CUSTOM_RANGE_END = (SAI_VIRTUAL_ROUTER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -sai_virtual_router_attr_t = enum__sai_virtual_router_attr_t # /home/omer/P4/SAI/inc/saivirtualrouter.h: 122 - -sai_create_virtual_router_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 136 - -sai_remove_virtual_router_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 149 - -sai_set_virtual_router_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 160 - -sai_get_virtual_router_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivirtualrouter.h: 173 - -# /home/omer/P4/SAI/inc/saivirtualrouter.h: 188 -class struct__sai_virtual_router_api_t(Structure): - pass - -struct__sai_virtual_router_api_t.__slots__ = [ - 'create_virtual_router', - 'remove_virtual_router', - 'set_virtual_router_attribute', - 'get_virtual_router_attribute', -] -struct__sai_virtual_router_api_t._fields_ = [ - ('create_virtual_router', sai_create_virtual_router_fn), - ('remove_virtual_router', sai_remove_virtual_router_fn), - ('set_virtual_router_attribute', sai_set_virtual_router_attribute_fn), - ('get_virtual_router_attribute', sai_get_virtual_router_attribute_fn), -] - -sai_virtual_router_api_t = struct__sai_virtual_router_api_t # /home/omer/P4/SAI/inc/saivirtualrouter.h: 188 - -enum__sai_router_interface_type_t = c_int # /home/omer/P4/SAI/inc/sairouterinterface.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_PORT = 0 # /home/omer/P4/SAI/inc/sairouterinterface.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_VLAN = (SAI_ROUTER_INTERFACE_TYPE_PORT + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_LOOPBACK = (SAI_ROUTER_INTERFACE_TYPE_VLAN + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_SUB_PORT = (SAI_ROUTER_INTERFACE_TYPE_LOOPBACK + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 56 - -SAI_ROUTER_INTERFACE_TYPE_BRIDGE = (SAI_ROUTER_INTERFACE_TYPE_SUB_PORT + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 56 - -sai_router_interface_type_t = enum__sai_router_interface_type_t # /home/omer/P4/SAI/inc/sairouterinterface.h: 56 - -enum__sai_router_interface_attr_t = c_int # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_START = 0 # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID = SAI_ROUTER_INTERFACE_ATTR_START # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_TYPE = (SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_PORT_ID = (SAI_ROUTER_INTERFACE_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_VLAN_ID = (SAI_ROUTER_INTERFACE_ATTR_PORT_ID + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS = (SAI_ROUTER_INTERFACE_ATTR_VLAN_ID + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE = (SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE = (SAI_ROUTER_INTERFACE_ATTR_ADMIN_V4_STATE + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_MTU = (SAI_ROUTER_INTERFACE_ATTR_ADMIN_V6_STATE + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_INGRESS_ACL = (SAI_ROUTER_INTERFACE_ATTR_MTU + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_EGRESS_ACL = (SAI_ROUTER_INTERFACE_ATTR_INGRESS_ACL + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_NEIGHBOR_MISS_PACKET_ACTION = (SAI_ROUTER_INTERFACE_ATTR_EGRESS_ACL + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_V4_MCAST_ENABLE = (SAI_ROUTER_INTERFACE_ATTR_NEIGHBOR_MISS_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_V6_MCAST_ENABLE = (SAI_ROUTER_INTERFACE_ATTR_V4_MCAST_ENABLE + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_END = (SAI_ROUTER_INTERFACE_ATTR_V6_MCAST_ENABLE + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -SAI_ROUTER_INTERFACE_ATTR_CUSTOM_RANGE_END = (SAI_ROUTER_INTERFACE_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -sai_router_interface_attr_t = enum__sai_router_interface_attr_t # /home/omer/P4/SAI/inc/sairouterinterface.h: 218 - -sai_create_router_interface_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairouterinterface.h: 230 - -sai_remove_router_interface_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sairouterinterface.h: 243 - -sai_set_router_interface_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairouterinterface.h: 254 - -sai_get_router_interface_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairouterinterface.h: 267 - -# /home/omer/P4/SAI/inc/sairouterinterface.h: 282 -class struct__sai_router_interface_api_t(Structure): - pass - -struct__sai_router_interface_api_t.__slots__ = [ - 'create_router_interface', - 'remove_router_interface', - 'set_router_interface_attribute', - 'get_router_interface_attribute', -] -struct__sai_router_interface_api_t._fields_ = [ - ('create_router_interface', sai_create_router_interface_fn), - ('remove_router_interface', sai_remove_router_interface_fn), - ('set_router_interface_attribute', sai_set_router_interface_attribute_fn), - ('get_router_interface_attribute', sai_get_router_interface_attribute_fn), -] - -sai_router_interface_api_t = struct__sai_router_interface_api_t # /home/omer/P4/SAI/inc/sairouterinterface.h: 282 - -enum__sai_samplepacket_type_t = c_int # /home/omer/P4/SAI/inc/saisamplepacket.h: 44 - -SAI_SAMPLEPACKET_TYPE_SLOW_PATH = 0 # /home/omer/P4/SAI/inc/saisamplepacket.h: 44 - -sai_samplepacket_type_t = enum__sai_samplepacket_type_t # /home/omer/P4/SAI/inc/saisamplepacket.h: 44 - -enum__sai_samplepacket_mode_t = c_int # /home/omer/P4/SAI/inc/saisamplepacket.h: 69 - -SAI_SAMPLEPACKET_MODE_EXCLUSIVE = 0 # /home/omer/P4/SAI/inc/saisamplepacket.h: 69 - -SAI_SAMPLEPACKET_MODE_SHARED = (SAI_SAMPLEPACKET_MODE_EXCLUSIVE + 1) # /home/omer/P4/SAI/inc/saisamplepacket.h: 69 - -sai_samplepacket_mode_t = enum__sai_samplepacket_mode_t # /home/omer/P4/SAI/inc/saisamplepacket.h: 69 - -enum__sai_samplepacket_attr_t = c_int # /home/omer/P4/SAI/inc/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_START = 0 # /home/omer/P4/SAI/inc/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_SAMPLE_RATE = SAI_SAMPLEPACKET_ATTR_START # /home/omer/P4/SAI/inc/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_TYPE = (SAI_SAMPLEPACKET_ATTR_SAMPLE_RATE + 1) # /home/omer/P4/SAI/inc/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_MODE = (SAI_SAMPLEPACKET_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saisamplepacket.h: 117 - -SAI_SAMPLEPACKET_ATTR_END = (SAI_SAMPLEPACKET_ATTR_MODE + 1) # /home/omer/P4/SAI/inc/saisamplepacket.h: 117 - -sai_samplepacket_attr_t = enum__sai_samplepacket_attr_t # /home/omer/P4/SAI/inc/saisamplepacket.h: 117 - -sai_create_samplepacket_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saisamplepacket.h: 130 - -sai_remove_samplepacket_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saisamplepacket.h: 144 - -sai_set_samplepacket_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saisamplepacket.h: 156 - -sai_get_samplepacket_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saisamplepacket.h: 170 - -# /home/omer/P4/SAI/inc/saisamplepacket.h: 185 -class struct__sai_samplepacket_api_t(Structure): - pass - -struct__sai_samplepacket_api_t.__slots__ = [ - 'create_samplepacket', - 'remove_samplepacket', - 'set_samplepacket_attribute', - 'get_samplepacket_attribute', -] -struct__sai_samplepacket_api_t._fields_ = [ - ('create_samplepacket', sai_create_samplepacket_fn), - ('remove_samplepacket', sai_remove_samplepacket_fn), - ('set_samplepacket_attribute', sai_set_samplepacket_attribute_fn), - ('get_samplepacket_attribute', sai_get_samplepacket_attribute_fn), -] - -sai_samplepacket_api_t = struct__sai_samplepacket_api_t # /home/omer/P4/SAI/inc/saisamplepacket.h: 185 - -enum__sai_scheduler_group_attr_t = c_int # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CHILD_COUNT = SAI_SCHEDULER_GROUP_ATTR_START # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CHILD_LIST = 1 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_PORT_ID = 2 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_LEVEL = 3 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_MAX_CHILDS = 4 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_SCHEDULER_PROFILE_ID = 5 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_PARENT_NODE = 6 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_END = (SAI_SCHEDULER_GROUP_ATTR_PARENT_NODE + 1) # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -SAI_SCHEDULER_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_SCHEDULER_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -sai_scheduler_group_attr_t = enum__sai_scheduler_group_attr_t # /home/omer/P4/SAI/inc/saischedulergroup.h: 119 - -sai_create_scheduler_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saischedulergroup.h: 131 - -sai_remove_scheduler_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saischedulergroup.h: 144 - -sai_set_scheduler_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saischedulergroup.h: 155 - -sai_get_scheduler_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saischedulergroup.h: 168 - -# /home/omer/P4/SAI/inc/saischedulergroup.h: 183 -class struct__sai_scheduler_group_api_t(Structure): - pass - -struct__sai_scheduler_group_api_t.__slots__ = [ - 'create_scheduler_group', - 'remove_scheduler_group', - 'set_scheduler_group_attribute', - 'get_scheduler_group_attribute', -] -struct__sai_scheduler_group_api_t._fields_ = [ - ('create_scheduler_group', sai_create_scheduler_group_fn), - ('remove_scheduler_group', sai_remove_scheduler_group_fn), - ('set_scheduler_group_attribute', sai_set_scheduler_group_attribute_fn), - ('get_scheduler_group_attribute', sai_get_scheduler_group_attribute_fn), -] - -sai_scheduler_group_api_t = struct__sai_scheduler_group_api_t # /home/omer/P4/SAI/inc/saischedulergroup.h: 183 - -enum__sai_scheduling_type_t = c_int # /home/omer/P4/SAI/inc/saischeduler.h: 50 - -SAI_SCHEDULING_TYPE_STRICT = 0 # /home/omer/P4/SAI/inc/saischeduler.h: 50 - -SAI_SCHEDULING_TYPE_WRR = 1 # /home/omer/P4/SAI/inc/saischeduler.h: 50 - -SAI_SCHEDULING_TYPE_DWRR = 2 # /home/omer/P4/SAI/inc/saischeduler.h: 50 - -sai_scheduling_type_t = enum__sai_scheduling_type_t # /home/omer/P4/SAI/inc/saischeduler.h: 50 - -enum__sai_scheduler_attr_t = c_int # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_START = 0 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_SCHEDULING_TYPE = SAI_SCHEDULER_ATTR_START # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_SCHEDULING_WEIGHT = 1 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_METER_TYPE = 2 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_RATE = 3 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_BURST_RATE = 4 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE = 5 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_BURST_RATE = 6 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_END = (SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_BURST_RATE + 1) # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -SAI_SCHEDULER_ATTR_CUSTOM_RANGE_END = (SAI_SCHEDULER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -sai_scheduler_attr_t = enum__sai_scheduler_attr_t # /home/omer/P4/SAI/inc/saischeduler.h: 143 - -sai_create_scheduler_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saischeduler.h: 155 - -sai_remove_scheduler_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saischeduler.h: 168 - -sai_set_scheduler_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saischeduler.h: 179 - -sai_get_scheduler_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saischeduler.h: 192 - -# /home/omer/P4/SAI/inc/saischeduler.h: 207 -class struct__sai_scheduler_api_t(Structure): - pass - -struct__sai_scheduler_api_t.__slots__ = [ - 'create_scheduler', - 'remove_scheduler', - 'set_scheduler_attribute', - 'get_scheduler_attribute', -] -struct__sai_scheduler_api_t._fields_ = [ - ('create_scheduler', sai_create_scheduler_fn), - ('remove_scheduler', sai_remove_scheduler_fn), - ('set_scheduler_attribute', sai_set_scheduler_attribute_fn), - ('get_scheduler_attribute', sai_get_scheduler_attribute_fn), -] - -sai_scheduler_api_t = struct__sai_scheduler_api_t # /home/omer/P4/SAI/inc/saischeduler.h: 207 - -enum__sai_stp_port_state_t = c_int # /home/omer/P4/SAI/inc/saistp.h: 50 - -SAI_STP_PORT_STATE_LEARNING = 0 # /home/omer/P4/SAI/inc/saistp.h: 50 - -SAI_STP_PORT_STATE_FORWARDING = (SAI_STP_PORT_STATE_LEARNING + 1) # /home/omer/P4/SAI/inc/saistp.h: 50 - -SAI_STP_PORT_STATE_BLOCKING = (SAI_STP_PORT_STATE_FORWARDING + 1) # /home/omer/P4/SAI/inc/saistp.h: 50 - -sai_stp_port_state_t = enum__sai_stp_port_state_t # /home/omer/P4/SAI/inc/saistp.h: 50 - -enum__sai_stp_attr_t = c_int # /home/omer/P4/SAI/inc/saistp.h: 95 - -SAI_STP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saistp.h: 95 - -SAI_STP_ATTR_VLAN_LIST = SAI_STP_ATTR_START # /home/omer/P4/SAI/inc/saistp.h: 95 - -SAI_STP_ATTR_BRIDGE_ID = (SAI_STP_ATTR_VLAN_LIST + 1) # /home/omer/P4/SAI/inc/saistp.h: 95 - -SAI_STP_ATTR_PORT_LIST = (SAI_STP_ATTR_BRIDGE_ID + 1) # /home/omer/P4/SAI/inc/saistp.h: 95 - -SAI_STP_ATTR_END = (SAI_STP_ATTR_PORT_LIST + 1) # /home/omer/P4/SAI/inc/saistp.h: 95 - -sai_stp_attr_t = enum__sai_stp_attr_t # /home/omer/P4/SAI/inc/saistp.h: 95 - -enum__sai_stp_port_attr_t = c_int # /home/omer/P4/SAI/inc/saistp.h: 138 - -SAI_STP_PORT_ATTR_START = 0 # /home/omer/P4/SAI/inc/saistp.h: 138 - -SAI_STP_PORT_ATTR_STP = SAI_STP_PORT_ATTR_START # /home/omer/P4/SAI/inc/saistp.h: 138 - -SAI_STP_PORT_ATTR_BRIDGE_PORT = (SAI_STP_PORT_ATTR_STP + 1) # /home/omer/P4/SAI/inc/saistp.h: 138 - -SAI_STP_PORT_ATTR_STATE = (SAI_STP_PORT_ATTR_BRIDGE_PORT + 1) # /home/omer/P4/SAI/inc/saistp.h: 138 - -SAI_STP_PORT_ATTR_END = (SAI_STP_PORT_ATTR_STATE + 1) # /home/omer/P4/SAI/inc/saistp.h: 138 - -sai_stp_port_attr_t = enum__sai_stp_port_attr_t # /home/omer/P4/SAI/inc/saistp.h: 138 - -sai_create_stp_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saistp.h: 151 - -sai_remove_stp_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saistp.h: 165 - -sai_set_stp_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saistp.h: 176 - -sai_get_stp_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saistp.h: 189 - -sai_create_stp_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saistp.h: 203 - -sai_remove_stp_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saistp.h: 216 - -sai_set_stp_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saistp.h: 227 - -sai_get_stp_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saistp.h: 240 - -# /home/omer/P4/SAI/inc/saistp.h: 259 -class struct__sai_stp_api_t(Structure): - pass - -struct__sai_stp_api_t.__slots__ = [ - 'create_stp', - 'remove_stp', - 'set_stp_attribute', - 'get_stp_attribute', - 'create_stp_port', - 'remove_stp_port', - 'set_stp_port_attribute', - 'get_stp_port_attribute', - 'create_stp_ports', - 'remove_stp_ports', -] -struct__sai_stp_api_t._fields_ = [ - ('create_stp', sai_create_stp_fn), - ('remove_stp', sai_remove_stp_fn), - ('set_stp_attribute', sai_set_stp_attribute_fn), - ('get_stp_attribute', sai_get_stp_attribute_fn), - ('create_stp_port', sai_create_stp_port_fn), - ('remove_stp_port', sai_remove_stp_port_fn), - ('set_stp_port_attribute', sai_set_stp_port_attribute_fn), - ('get_stp_port_attribute', sai_get_stp_port_attribute_fn), - ('create_stp_ports', sai_bulk_object_create_fn), - ('remove_stp_ports', sai_bulk_object_remove_fn), -] - -sai_stp_api_t = struct__sai_stp_api_t # /home/omer/P4/SAI/inc/saistp.h: 259 - -enum__sai_switch_oper_status_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_UNKNOWN = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_UP = (SAI_SWITCH_OPER_STATUS_UNKNOWN + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_DOWN = (SAI_SWITCH_OPER_STATUS_UP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 66 - -SAI_SWITCH_OPER_STATUS_FAILED = (SAI_SWITCH_OPER_STATUS_DOWN + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 66 - -sai_switch_oper_status_t = enum__sai_switch_oper_status_t # /home/omer/P4/SAI/inc/saiswitch.h: 66 - -enum__sai_packet_action_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_DROP = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_FORWARD = (SAI_PACKET_ACTION_DROP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_COPY = (SAI_PACKET_ACTION_FORWARD + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_COPY_CANCEL = (SAI_PACKET_ACTION_COPY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_TRAP = (SAI_PACKET_ACTION_COPY_CANCEL + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_LOG = (SAI_PACKET_ACTION_TRAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_DENY = (SAI_PACKET_ACTION_LOG + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -SAI_PACKET_ACTION_TRANSIT = (SAI_PACKET_ACTION_DENY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -sai_packet_action_t = enum__sai_packet_action_t # /home/omer/P4/SAI/inc/saiswitch.h: 119 - -enum__sai_packet_vlan_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 149 - -SAI_PACKET_VLAN_UNTAG = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 149 - -SAI_PACKET_VLAN_SINGLE_OUTER_TAG = (SAI_PACKET_VLAN_UNTAG + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 149 - -SAI_PACKET_VLAN_DOUBLE_TAG = (SAI_PACKET_VLAN_SINGLE_OUTER_TAG + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 149 - -sai_packet_vlan_t = enum__sai_packet_vlan_t # /home/omer/P4/SAI/inc/saiswitch.h: 149 - -enum__sai_switch_switching_mode_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 162 - -SAI_SWITCH_SWITCHING_MODE_CUT_THROUGH = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 162 - -SAI_SWITCH_SWITCHING_MODE_STORE_AND_FORWARD = (SAI_SWITCH_SWITCHING_MODE_CUT_THROUGH + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 162 - -sai_switch_switching_mode_t = enum__sai_switch_switching_mode_t # /home/omer/P4/SAI/inc/saiswitch.h: 162 - -enum__sai_hash_algorithm_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -SAI_HASH_ALGORITHM_CRC = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -SAI_HASH_ALGORITHM_XOR = 1 # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -SAI_HASH_ALGORITHM_RANDOM = 2 # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -SAI_HASH_ALGORITHM_CRC_32LO = 3 # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -SAI_HASH_ALGORITHM_CRC_32HI = 4 # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -SAI_HASH_ALGORITHM_CRC_CCITT = 5 # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -SAI_HASH_ALGORITHM_CRC_XOR = 6 # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -sai_hash_algorithm_t = enum__sai_hash_algorithm_t # /home/omer/P4/SAI/inc/saiswitch.h: 191 - -enum__sai_switch_restart_type_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 207 - -SAI_SWITCH_RESTART_TYPE_NONE = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 207 - -SAI_SWITCH_RESTART_TYPE_PLANNED = 1 # /home/omer/P4/SAI/inc/saiswitch.h: 207 - -SAI_SWITCH_RESTART_TYPE_ANY = 2 # /home/omer/P4/SAI/inc/saiswitch.h: 207 - -sai_switch_restart_type_t = enum__sai_switch_restart_type_t # /home/omer/P4/SAI/inc/saiswitch.h: 207 - -enum__sai_switch_mcast_snooping_capability_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 226 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_NONE = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 226 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_XG = 1 # /home/omer/P4/SAI/inc/saiswitch.h: 226 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_SG = 2 # /home/omer/P4/SAI/inc/saiswitch.h: 226 - -SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_XG_AND_SG = 3 # /home/omer/P4/SAI/inc/saiswitch.h: 226 - -sai_switch_mcast_snooping_capability_t = enum__sai_switch_mcast_snooping_capability_t # /home/omer/P4/SAI/inc/saiswitch.h: 226 - -enum__sai_switch_attr_t = c_int # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_PORT_NUMBER = SAI_SWITCH_ATTR_START # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_PORT_LIST = (SAI_SWITCH_ATTR_PORT_NUMBER + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_PORT_MAX_MTU = (SAI_SWITCH_ATTR_PORT_LIST + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_CPU_PORT = (SAI_SWITCH_ATTR_PORT_MAX_MTU + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MAX_VIRTUAL_ROUTERS = (SAI_SWITCH_ATTR_CPU_PORT + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FDB_TABLE_SIZE = (SAI_SWITCH_ATTR_MAX_VIRTUAL_ROUTERS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_L3_NEIGHBOR_TABLE_SIZE = (SAI_SWITCH_ATTR_FDB_TABLE_SIZE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_L3_ROUTE_TABLE_SIZE = (SAI_SWITCH_ATTR_L3_NEIGHBOR_TABLE_SIZE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_MEMBERS = (SAI_SWITCH_ATTR_L3_ROUTE_TABLE_SIZE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NUMBER_OF_LAGS = (SAI_SWITCH_ATTR_LAG_MEMBERS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_MEMBERS = (SAI_SWITCH_ATTR_NUMBER_OF_LAGS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NUMBER_OF_ECMP_GROUPS = (SAI_SWITCH_ATTR_ECMP_MEMBERS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NUMBER_OF_UNICAST_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_ECMP_GROUPS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NUMBER_OF_MULTICAST_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_UNICAST_QUEUES + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NUMBER_OF_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_MULTICAST_QUEUES + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NUMBER_OF_CPU_QUEUES = (SAI_SWITCH_ATTR_NUMBER_OF_QUEUES + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ON_LINK_ROUTE_SUPPORTED = (SAI_SWITCH_ATTR_NUMBER_OF_CPU_QUEUES + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_OPER_STATUS = (SAI_SWITCH_ATTR_ON_LINK_ROUTE_SUPPORTED + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MAX_TEMP = (SAI_SWITCH_ATTR_OPER_STATUS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_TABLE_MINIMUM_PRIORITY = (SAI_SWITCH_ATTR_MAX_TEMP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_TABLE_MAXIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_TABLE_MINIMUM_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_ENTRY_MINIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_TABLE_MAXIMUM_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_ENTRY_MAXIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_ENTRY_MINIMUM_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MINIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_ENTRY_MAXIMUM_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MAXIMUM_PRIORITY = (SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MINIMUM_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FDB_DST_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MAXIMUM_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ROUTE_DST_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_FDB_DST_USER_META_DATA_RANGE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NEIGHBOR_DST_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_ROUTE_DST_USER_META_DATA_RANGE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_PORT_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_NEIGHBOR_DST_USER_META_DATA_RANGE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_VLAN_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_PORT_USER_META_DATA_RANGE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_USER_META_DATA_RANGE = (SAI_SWITCH_ATTR_VLAN_USER_META_DATA_RANGE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_USER_TRAP_ID_RANGE = (SAI_SWITCH_ATTR_ACL_USER_META_DATA_RANGE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_DEFAULT_VLAN_ID = (SAI_SWITCH_ATTR_ACL_USER_TRAP_ID_RANGE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_DEFAULT_STP_INST_ID = (SAI_SWITCH_ATTR_DEFAULT_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID = (SAI_SWITCH_ATTR_DEFAULT_STP_INST_ID + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID = (SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_INGRESS_ACL = (SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_EGRESS_ACL = (SAI_SWITCH_ATTR_INGRESS_ACL + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_TRAFFIC_CLASSES = (SAI_SWITCH_ATTR_EGRESS_ACL + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUP_HIERARCHY_LEVELS = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_TRAFFIC_CLASSES + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUPS_PER_HIERARCHY_LEVEL = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUP_HIERARCHY_LEVELS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_CHILDS_PER_SCHEDULER_GROUP = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUPS_PER_HIERARCHY_LEVEL + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_TOTAL_BUFFER_SIZE = (SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_CHILDS_PER_SCHEDULER_GROUP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_INGRESS_BUFFER_POOL_NUM = (SAI_SWITCH_ATTR_TOTAL_BUFFER_SIZE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_EGRESS_BUFFER_POOL_NUM = (SAI_SWITCH_ATTR_INGRESS_BUFFER_POOL_NUM + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP = (SAI_SWITCH_ATTR_EGRESS_BUFFER_POOL_NUM + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_HASH = (SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_HASH = (SAI_SWITCH_ATTR_ECMP_HASH + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_RESTART_WARM = (SAI_SWITCH_ATTR_LAG_HASH + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_RESTART_TYPE = (SAI_SWITCH_ATTR_RESTART_WARM + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MIN_PLANNED_RESTART_INTERVAL = (SAI_SWITCH_ATTR_RESTART_TYPE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_NV_STORAGE_SIZE = (SAI_SWITCH_ATTR_MIN_PLANNED_RESTART_INTERVAL + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MAX_ACL_ACTION_COUNT = (SAI_SWITCH_ATTR_NV_STORAGE_SIZE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MCAST_SNOOPING_CAPABILITY = (SAI_SWITCH_ATTR_MAX_ACL_ACTION_COUNT + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_SWITCHING_MODE = (SAI_SWITCH_ATTR_MCAST_SNOOPING_CAPABILITY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_BCAST_CPU_FLOOD_ENABLE = (SAI_SWITCH_ATTR_SWITCHING_MODE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MCAST_CPU_FLOOD_ENABLE = (SAI_SWITCH_ATTR_BCAST_CPU_FLOOD_ENABLE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_SRC_MAC_ADDRESS = (SAI_SWITCH_ATTR_MCAST_CPU_FLOOD_ENABLE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MAX_LEARNED_ADDRESSES = (SAI_SWITCH_ATTR_SRC_MAC_ADDRESS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FDB_AGING_TIME = (SAI_SWITCH_ATTR_MAX_LEARNED_ADDRESSES + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FDB_UNICAST_MISS_PACKET_ACTION = (SAI_SWITCH_ATTR_FDB_AGING_TIME + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FDB_BROADCAST_MISS_PACKET_ACTION = (SAI_SWITCH_ATTR_FDB_UNICAST_MISS_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION = (SAI_SWITCH_ATTR_FDB_BROADCAST_MISS_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM = (SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_SEED = (SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_DEFAULT_SYMMETRIC_HASH = (SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_SEED + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_HASH_IPV4 = (SAI_SWITCH_ATTR_ECMP_DEFAULT_SYMMETRIC_HASH + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_HASH_IPV4_IN_IPV4 = (SAI_SWITCH_ATTR_ECMP_HASH_IPV4 + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ECMP_HASH_IPV6 = (SAI_SWITCH_ATTR_ECMP_HASH_IPV4_IN_IPV4 + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM = (SAI_SWITCH_ATTR_ECMP_HASH_IPV6 + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED = (SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_DEFAULT_SYMMETRIC_HASH = (SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_HASH_IPV4 = (SAI_SWITCH_ATTR_LAG_DEFAULT_SYMMETRIC_HASH + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_HASH_IPV4_IN_IPV4 = (SAI_SWITCH_ATTR_LAG_HASH_IPV4 + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_LAG_HASH_IPV6 = (SAI_SWITCH_ATTR_LAG_HASH_IPV4_IN_IPV4 + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_COUNTER_REFRESH_INTERVAL = (SAI_SWITCH_ATTR_LAG_HASH_IPV6 + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_DEFAULT_TC = (SAI_SWITCH_ATTR_COUNTER_REFRESH_INTERVAL + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_DOT1P_TO_TC_MAP = (SAI_SWITCH_ATTR_QOS_DEFAULT_TC + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_DOT1P_TO_COLOR_MAP = (SAI_SWITCH_ATTR_QOS_DOT1P_TO_TC_MAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP = (SAI_SWITCH_ATTR_QOS_DOT1P_TO_COLOR_MAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_DSCP_TO_COLOR_MAP = (SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_TC_TO_QUEUE_MAP = (SAI_SWITCH_ATTR_QOS_DSCP_TO_COLOR_MAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP = (SAI_SWITCH_ATTR_QOS_TC_TO_QUEUE_MAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP = (SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DOT1P_MAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_SWITCH_SHELL_ENABLE = (SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_SWITCH_PROFILE_ID = (SAI_SWITCH_ATTR_SWITCH_SHELL_ENABLE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO = (SAI_SWITCH_ATTR_SWITCH_PROFILE_ID + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FIRMWARE_PATH_NAME = (SAI_SWITCH_ATTR_SWITCH_HARDWARE_INFO + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_INIT_SWITCH = (SAI_SWITCH_ATTR_FIRMWARE_PATH_NAME + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_SWITCH_STATE_CHANGE_NOTIFY = (SAI_SWITCH_ATTR_INIT_SWITCH + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_SHUTDOWN_REQUEST_NOTIFY = (SAI_SWITCH_ATTR_SWITCH_STATE_CHANGE_NOTIFY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FDB_EVENT_NOTIFY = (SAI_SWITCH_ATTR_SHUTDOWN_REQUEST_NOTIFY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_PORT_STATE_CHANGE_NOTIFY = (SAI_SWITCH_ATTR_FDB_EVENT_NOTIFY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_PACKET_EVENT_NOTIFY = (SAI_SWITCH_ATTR_PORT_STATE_CHANGE_NOTIFY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_FAST_API_ENABLE = (SAI_SWITCH_ATTR_PACKET_EVENT_NOTIFY + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_MIRROR_TC = (SAI_SWITCH_ATTR_FAST_API_ENABLE + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_STAGE_INGRESS = (SAI_SWITCH_ATTR_MIRROR_TC + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_ACL_STAGE_EGRESS = (SAI_SWITCH_ATTR_ACL_STAGE_INGRESS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_END = (SAI_SWITCH_ATTR_ACL_STAGE_EGRESS + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -SAI_SWITCH_ATTR_CUSTOM_RANGE_END = (SAI_SWITCH_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -sai_switch_attr_t = enum__sai_switch_attr_t # /home/omer/P4/SAI/inc/saiswitch.h: 1270 - -sai_switch_shutdown_request_notification_fn = CFUNCTYPE(UNCHECKED(None), sai_object_id_t) # /home/omer/P4/SAI/inc/saiswitch.h: 1389 - -sai_switch_state_change_notification_fn = CFUNCTYPE(UNCHECKED(None), sai_object_id_t, sai_switch_oper_status_t) # /home/omer/P4/SAI/inc/saiswitch.h: 1398 - -sai_create_switch_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiswitch.h: 1415 - -sai_remove_switch_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiswitch.h: 1429 - -sai_set_switch_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiswitch.h: 1440 - -sai_get_switch_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, sai_uint32_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiswitch.h: 1453 - -# /home/omer/P4/SAI/inc/saiswitch.h: 1468 -class struct__sai_switch_api_t(Structure): - pass - -struct__sai_switch_api_t.__slots__ = [ - 'create_switch', - 'remove_switch', - 'set_switch_attribute', - 'get_switch_attribute', -] -struct__sai_switch_api_t._fields_ = [ - ('create_switch', sai_create_switch_fn), - ('remove_switch', sai_remove_switch_fn), - ('set_switch_attribute', sai_set_switch_attribute_fn), - ('get_switch_attribute', sai_get_switch_attribute_fn), -] - -sai_switch_api_t = struct__sai_switch_api_t # /home/omer/P4/SAI/inc/saiswitch.h: 1468 - -enum__sai_tunnel_map_type_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN = 1 # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_VNI_TO_VLAN_ID = 2 # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_VLAN_ID_TO_VNI = 3 # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_VNI_TO_BRIDGE_IF = 4 # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_BRIDGE_IF_TO_VNI = 5 # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -SAI_TUNNEL_MAP_TYPE_CUSTOM_RANGE_BASE = 268435456 # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -sai_tunnel_map_type_t = enum__sai_tunnel_map_type_t # /home/omer/P4/SAI/inc/saitunnel.h: 62 - -enum__sai_tunnel_map_entry_attr_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_START = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_TUNNEL_MAP_TYPE = SAI_TUNNEL_MAP_ENTRY_ATTR_START # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_TUNNEL_MAP = 1 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_OECN_KEY = 2 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_OECN_VALUE = 3 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_UECN_KEY = 4 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_UECN_VALUE = 5 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_VLAN_ID_KEY = 6 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_VLAN_ID_VALUE = 7 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_VNI_ID_KEY = 8 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_VNI_ID_VALUE = 9 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_BRIDGE_ID_KEY = 10 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_BRIDGE_ID_VALUE = 11 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_END = (SAI_TUNNEL_MAP_ENTRY_ATTR_BRIDGE_ID_VALUE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -SAI_TUNNEL_MAP_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_TUNNEL_MAP_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -sai_tunnel_map_entry_attr_t = enum__sai_tunnel_map_entry_attr_t # /home/omer/P4/SAI/inc/saitunnel.h: 193 - -enum__sai_tunnel_map_attr_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -SAI_TUNNEL_MAP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -SAI_TUNNEL_MAP_ATTR_TYPE = SAI_TUNNEL_MAP_ATTR_START # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -SAI_TUNNEL_MAP_ATTR_MAP_TO_VALUE_LIST = 1 # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -SAI_TUNNEL_MAP_ATTR_END = (SAI_TUNNEL_MAP_ATTR_MAP_TO_VALUE_LIST + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -SAI_TUNNEL_MAP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -SAI_TUNNEL_MAP_ATTR_CUSTOM_RANGE_END = (SAI_TUNNEL_MAP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -sai_tunnel_map_attr_t = enum__sai_tunnel_map_attr_t # /home/omer/P4/SAI/inc/saitunnel.h: 235 - -sai_create_tunnel_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 247 - -sai_remove_tunnel_map_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saitunnel.h: 260 - -sai_set_tunnel_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 271 - -sai_get_tunnel_map_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 284 - -enum__sai_tunnel_type_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 302 - -SAI_TUNNEL_TYPE_IPINIP = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 302 - -SAI_TUNNEL_TYPE_IPINIP_GRE = (SAI_TUNNEL_TYPE_IPINIP + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 302 - -SAI_TUNNEL_TYPE_VXLAN = (SAI_TUNNEL_TYPE_IPINIP_GRE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 302 - -SAI_TUNNEL_TYPE_MPLS = (SAI_TUNNEL_TYPE_VXLAN + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 302 - -sai_tunnel_type_t = enum__sai_tunnel_type_t # /home/omer/P4/SAI/inc/saitunnel.h: 302 - -enum__sai_tunnel_ttl_mode_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 330 - -SAI_TUNNEL_TTL_MODE_UNIFORM_MODEL = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 330 - -SAI_TUNNEL_TTL_MODE_PIPE_MODEL = (SAI_TUNNEL_TTL_MODE_UNIFORM_MODEL + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 330 - -sai_tunnel_ttl_mode_t = enum__sai_tunnel_ttl_mode_t # /home/omer/P4/SAI/inc/saitunnel.h: 330 - -enum__sai_tunnel_dscp_mode_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 358 - -SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 358 - -SAI_TUNNEL_DSCP_MODE_PIPE_MODEL = (SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 358 - -sai_tunnel_dscp_mode_t = enum__sai_tunnel_dscp_mode_t # /home/omer/P4/SAI/inc/saitunnel.h: 358 - -enum__sai_tunnel_encap_ecn_mode_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 378 - -SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 378 - -SAI_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED = (SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 378 - -sai_tunnel_encap_ecn_mode_t = enum__sai_tunnel_encap_ecn_mode_t # /home/omer/P4/SAI/inc/saitunnel.h: 378 - -enum__sai_tunnel_decap_ecn_mode_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 402 - -SAI_TUNNEL_DECAP_ECN_MODE_STANDARD = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 402 - -SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER = (SAI_TUNNEL_DECAP_ECN_MODE_STANDARD + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 402 - -SAI_TUNNEL_DECAP_ECN_MODE_USER_DEFINED = (SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 402 - -sai_tunnel_decap_ecn_mode_t = enum__sai_tunnel_decap_ecn_mode_t # /home/omer/P4/SAI/inc/saitunnel.h: 402 - -enum__sai_tunnel_attr_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_START = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_TYPE = SAI_TUNNEL_ATTR_START # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE = (SAI_TUNNEL_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_OVERLAY_INTERFACE = (SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_SRC_IP = (SAI_TUNNEL_ATTR_OVERLAY_INTERFACE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_TTL_MODE = (SAI_TUNNEL_ATTR_ENCAP_SRC_IP + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_TTL_VAL = (SAI_TUNNEL_ATTR_ENCAP_TTL_MODE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_DSCP_MODE = (SAI_TUNNEL_ATTR_ENCAP_TTL_VAL + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_DSCP_VAL = (SAI_TUNNEL_ATTR_ENCAP_DSCP_MODE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_GRE_KEY_VALID = (SAI_TUNNEL_ATTR_ENCAP_DSCP_VAL + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_GRE_KEY = (SAI_TUNNEL_ATTR_ENCAP_GRE_KEY_VALID + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_ECN_MODE = (SAI_TUNNEL_ATTR_ENCAP_GRE_KEY + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_ENCAP_MAPPERS = (SAI_TUNNEL_ATTR_ENCAP_ECN_MODE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_DECAP_ECN_MODE = (SAI_TUNNEL_ATTR_ENCAP_MAPPERS + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_DECAP_MAPPERS = (SAI_TUNNEL_ATTR_DECAP_ECN_MODE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_DECAP_TTL_MODE = (SAI_TUNNEL_ATTR_DECAP_MAPPERS + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_DECAP_DSCP_MODE = (SAI_TUNNEL_ATTR_DECAP_TTL_MODE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_END = (SAI_TUNNEL_ATTR_DECAP_DSCP_MODE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -SAI_TUNNEL_ATTR_CUSTOM_RANGE_END = (SAI_TUNNEL_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -sai_tunnel_attr_t = enum__sai_tunnel_attr_t # /home/omer/P4/SAI/inc/saitunnel.h: 586 - -sai_create_tunnel_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 598 - -sai_remove_tunnel_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saitunnel.h: 611 - -sai_set_tunnel_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 622 - -sai_get_tunnel_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 635 - -enum__sai_tunnel_term_table_entry_type_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 651 - -SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2P = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 651 - -SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2MP = (SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2P + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 651 - -sai_tunnel_term_table_entry_type_t = enum__sai_tunnel_term_table_entry_type_t # /home/omer/P4/SAI/inc/saitunnel.h: 651 - -enum__sai_tunnel_term_table_entry_attr_t = c_int # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_START = 0 # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_VR_ID = SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_START # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TYPE = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_VR_ID + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_DST_IP = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_SRC_IP = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_DST_IP + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TUNNEL_TYPE = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_SRC_IP + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_ACTION_TUNNEL_ID = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TUNNEL_TYPE + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_END = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_ACTION_TUNNEL_ID + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_END = (SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -sai_tunnel_term_table_entry_attr_t = enum__sai_tunnel_term_table_entry_attr_t # /home/omer/P4/SAI/inc/saitunnel.h: 726 - -sai_create_tunnel_term_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 738 - -sai_remove_tunnel_term_table_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saitunnel.h: 751 - -sai_set_tunnel_term_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 762 - -sai_get_tunnel_term_table_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 775 - -sai_create_tunnel_map_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 790 - -sai_remove_tunnel_map_entry_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saitunnel.h: 803 - -sai_set_tunnel_map_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 814 - -sai_get_tunnel_map_entry_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saitunnel.h: 827 - -# /home/omer/P4/SAI/inc/saitunnel.h: 854 -class struct__sai_tunnel_api_t(Structure): - pass - -struct__sai_tunnel_api_t.__slots__ = [ - 'create_tunnel_map', - 'remove_tunnel_map', - 'set_tunnel_map_attribute', - 'get_tunnel_map_attribute', - 'create_tunnel', - 'remove_tunnel', - 'set_tunnel_attribute', - 'get_tunnel_attribute', - 'create_tunnel_term_table_entry', - 'remove_tunnel_term_table_entry', - 'set_tunnel_term_table_entry_attribute', - 'get_tunnel_term_table_entry_attribute', - 'create_tunnel_map_entry', - 'remove_tunnel_map_entry', - 'set_tunnel_map_entry_attribute', - 'get_tunnel_map_entry_attribute', -] -struct__sai_tunnel_api_t._fields_ = [ - ('create_tunnel_map', sai_create_tunnel_map_fn), - ('remove_tunnel_map', sai_remove_tunnel_map_fn), - ('set_tunnel_map_attribute', sai_set_tunnel_map_attribute_fn), - ('get_tunnel_map_attribute', sai_get_tunnel_map_attribute_fn), - ('create_tunnel', sai_create_tunnel_fn), - ('remove_tunnel', sai_remove_tunnel_fn), - ('set_tunnel_attribute', sai_set_tunnel_attribute_fn), - ('get_tunnel_attribute', sai_get_tunnel_attribute_fn), - ('create_tunnel_term_table_entry', sai_create_tunnel_term_table_entry_fn), - ('remove_tunnel_term_table_entry', sai_remove_tunnel_term_table_entry_fn), - ('set_tunnel_term_table_entry_attribute', sai_set_tunnel_term_table_entry_attribute_fn), - ('get_tunnel_term_table_entry_attribute', sai_get_tunnel_term_table_entry_attribute_fn), - ('create_tunnel_map_entry', sai_create_tunnel_map_entry_fn), - ('remove_tunnel_map_entry', sai_remove_tunnel_map_entry_fn), - ('set_tunnel_map_entry_attribute', sai_set_tunnel_map_entry_attribute_fn), - ('get_tunnel_map_entry_attribute', sai_get_tunnel_map_entry_attribute_fn), -] - -sai_tunnel_api_t = struct__sai_tunnel_api_t # /home/omer/P4/SAI/inc/saitunnel.h: 854 - -enum__sai_udf_base_t = c_int # /home/omer/P4/SAI/inc/saiudf.h: 50 - -SAI_UDF_BASE_L2 = 0 # /home/omer/P4/SAI/inc/saiudf.h: 50 - -SAI_UDF_BASE_L3 = (SAI_UDF_BASE_L2 + 1) # /home/omer/P4/SAI/inc/saiudf.h: 50 - -SAI_UDF_BASE_L4 = (SAI_UDF_BASE_L3 + 1) # /home/omer/P4/SAI/inc/saiudf.h: 50 - -sai_udf_base_t = enum__sai_udf_base_t # /home/omer/P4/SAI/inc/saiudf.h: 50 - -enum__sai_udf_attr_t = c_int # /home/omer/P4/SAI/inc/saiudf.h: 118 - -SAI_UDF_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiudf.h: 118 - -SAI_UDF_ATTR_MATCH_ID = SAI_UDF_ATTR_START # /home/omer/P4/SAI/inc/saiudf.h: 118 - -SAI_UDF_ATTR_GROUP_ID = (SAI_UDF_ATTR_MATCH_ID + 1) # /home/omer/P4/SAI/inc/saiudf.h: 118 - -SAI_UDF_ATTR_BASE = (SAI_UDF_ATTR_GROUP_ID + 1) # /home/omer/P4/SAI/inc/saiudf.h: 118 - -SAI_UDF_ATTR_OFFSET = (SAI_UDF_ATTR_BASE + 1) # /home/omer/P4/SAI/inc/saiudf.h: 118 - -SAI_UDF_ATTR_HASH_MASK = (SAI_UDF_ATTR_OFFSET + 1) # /home/omer/P4/SAI/inc/saiudf.h: 118 - -SAI_UDF_ATTR_END = (SAI_UDF_ATTR_HASH_MASK + 1) # /home/omer/P4/SAI/inc/saiudf.h: 118 - -sai_udf_attr_t = enum__sai_udf_attr_t # /home/omer/P4/SAI/inc/saiudf.h: 118 - -enum__sai_udf_match_attr_t = c_int # /home/omer/P4/SAI/inc/saiudf.h: 179 - -SAI_UDF_MATCH_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiudf.h: 179 - -SAI_UDF_MATCH_ATTR_L2_TYPE = SAI_UDF_MATCH_ATTR_START # /home/omer/P4/SAI/inc/saiudf.h: 179 - -SAI_UDF_MATCH_ATTR_L3_TYPE = (SAI_UDF_MATCH_ATTR_L2_TYPE + 1) # /home/omer/P4/SAI/inc/saiudf.h: 179 - -SAI_UDF_MATCH_ATTR_GRE_TYPE = (SAI_UDF_MATCH_ATTR_L3_TYPE + 1) # /home/omer/P4/SAI/inc/saiudf.h: 179 - -SAI_UDF_MATCH_ATTR_PRIORITY = (SAI_UDF_MATCH_ATTR_GRE_TYPE + 1) # /home/omer/P4/SAI/inc/saiudf.h: 179 - -SAI_UDF_MATCH_ATTR_END = (SAI_UDF_MATCH_ATTR_PRIORITY + 1) # /home/omer/P4/SAI/inc/saiudf.h: 179 - -sai_udf_match_attr_t = enum__sai_udf_match_attr_t # /home/omer/P4/SAI/inc/saiudf.h: 179 - -enum__sai_udf_group_type_t = c_int # /home/omer/P4/SAI/inc/saiudf.h: 198 - -SAI_UDF_GROUP_TYPE_START = 0 # /home/omer/P4/SAI/inc/saiudf.h: 198 - -SAI_UDF_GROUP_TYPE_GENERIC = SAI_UDF_GROUP_TYPE_START # /home/omer/P4/SAI/inc/saiudf.h: 198 - -SAI_UDF_GROUP_TYPE_HASH = (SAI_UDF_GROUP_TYPE_GENERIC + 1) # /home/omer/P4/SAI/inc/saiudf.h: 198 - -SAI_UDF_GROUP_TYPE_END = (SAI_UDF_GROUP_TYPE_HASH + 1) # /home/omer/P4/SAI/inc/saiudf.h: 198 - -sai_udf_group_type_t = enum__sai_udf_group_type_t # /home/omer/P4/SAI/inc/saiudf.h: 198 - -enum__sai_udf_group_attr_t = c_int # /home/omer/P4/SAI/inc/saiudf.h: 242 - -SAI_UDF_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiudf.h: 242 - -SAI_UDF_GROUP_ATTR_UDF_LIST = SAI_UDF_GROUP_ATTR_START # /home/omer/P4/SAI/inc/saiudf.h: 242 - -SAI_UDF_GROUP_ATTR_TYPE = (SAI_UDF_GROUP_ATTR_UDF_LIST + 1) # /home/omer/P4/SAI/inc/saiudf.h: 242 - -SAI_UDF_GROUP_ATTR_LENGTH = (SAI_UDF_GROUP_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saiudf.h: 242 - -SAI_UDF_GROUP_ATTR_END = (SAI_UDF_GROUP_ATTR_LENGTH + 1) # /home/omer/P4/SAI/inc/saiudf.h: 242 - -sai_udf_group_attr_t = enum__sai_udf_group_attr_t # /home/omer/P4/SAI/inc/saiudf.h: 242 - -sai_create_udf_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 254 - -sai_remove_udf_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiudf.h: 267 - -sai_set_udf_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 278 - -sai_get_udf_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 291 - -sai_create_udf_match_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 306 - -sai_remove_udf_match_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiudf.h: 319 - -sai_set_udf_match_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 330 - -sai_get_udf_match_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 343 - -sai_create_udf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 358 - -sai_remove_udf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiudf.h: 371 - -sai_set_udf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 382 - -sai_get_udf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiudf.h: 395 - -# /home/omer/P4/SAI/inc/saiudf.h: 418 -class struct__sai_udf_api_t(Structure): - pass - -struct__sai_udf_api_t.__slots__ = [ - 'create_udf', - 'remove_udf', - 'set_udf_attribute', - 'get_udf_attribute', - 'create_udf_match', - 'remove_udf_match', - 'set_udf_match_attribute', - 'get_udf_match_attribute', - 'create_udf_group', - 'remove_udf_group', - 'set_udf_group_attribute', - 'get_udf_group_attribute', -] -struct__sai_udf_api_t._fields_ = [ - ('create_udf', sai_create_udf_fn), - ('remove_udf', sai_remove_udf_fn), - ('set_udf_attribute', sai_set_udf_attribute_fn), - ('get_udf_attribute', sai_get_udf_attribute_fn), - ('create_udf_match', sai_create_udf_match_fn), - ('remove_udf_match', sai_remove_udf_match_fn), - ('set_udf_match_attribute', sai_set_udf_match_attribute_fn), - ('get_udf_match_attribute', sai_get_udf_match_attribute_fn), - ('create_udf_group', sai_create_udf_group_fn), - ('remove_udf_group', sai_remove_udf_group_fn), - ('set_udf_group_attribute', sai_set_udf_group_attribute_fn), - ('get_udf_group_attribute', sai_get_udf_group_attribute_fn), -] - -sai_udf_api_t = struct__sai_udf_api_t # /home/omer/P4/SAI/inc/saiudf.h: 418 - -enum__sai_vlan_tagging_mode_t = c_int # /home/omer/P4/SAI/inc/saivlan.h: 52 - -SAI_VLAN_TAGGING_MODE_UNTAGGED = 0 # /home/omer/P4/SAI/inc/saivlan.h: 52 - -SAI_VLAN_TAGGING_MODE_TAGGED = (SAI_VLAN_TAGGING_MODE_UNTAGGED + 1) # /home/omer/P4/SAI/inc/saivlan.h: 52 - -SAI_VLAN_TAGGING_MODE_PRIORITY_TAGGED = (SAI_VLAN_TAGGING_MODE_TAGGED + 1) # /home/omer/P4/SAI/inc/saivlan.h: 52 - -sai_vlan_tagging_mode_t = enum__sai_vlan_tagging_mode_t # /home/omer/P4/SAI/inc/saivlan.h: 52 - -enum__sai_vlan_mcast_lookup_key_type_t = c_int # /home/omer/P4/SAI/inc/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_MAC_DA = 0 # /home/omer/P4/SAI/inc/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_XG = (SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_MAC_DA + 1) # /home/omer/P4/SAI/inc/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_SG = (SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_XG + 1) # /home/omer/P4/SAI/inc/saivlan.h: 67 - -SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_XG_AND_SG = (SAI_VLAN_MCAST_LOOKUP_KEY_TYPE_SG + 1) # /home/omer/P4/SAI/inc/saivlan.h: 67 - -sai_vlan_mcast_lookup_key_type_t = enum__sai_vlan_mcast_lookup_key_type_t # /home/omer/P4/SAI/inc/saivlan.h: 67 - -enum__sai_vlan_attr_t = c_int # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_START = 0 # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_VLAN_ID = SAI_VLAN_ATTR_START # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_MEMBER_LIST = (SAI_VLAN_ATTR_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_MAX_LEARNED_ADDRESSES = (SAI_VLAN_ATTR_MEMBER_LIST + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_STP_INSTANCE = (SAI_VLAN_ATTR_MAX_LEARNED_ADDRESSES + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_LEARN_DISABLE = (SAI_VLAN_ATTR_STP_INSTANCE + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_IPV4_MCAST_LOOKUP_KEY_TYPE = (SAI_VLAN_ATTR_LEARN_DISABLE + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_IPV6_MCAST_LOOKUP_KEY_TYPE = (SAI_VLAN_ATTR_IPV4_MCAST_LOOKUP_KEY_TYPE + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_UNKNOWN_NON_IP_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_IPV6_MCAST_LOOKUP_KEY_TYPE + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_UNKNOWN_IPV4_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_UNKNOWN_NON_IP_MCAST_OUTPUT_GROUP_ID + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_UNKNOWN_IPV6_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_UNKNOWN_IPV4_MCAST_OUTPUT_GROUP_ID + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_UNKNOWN_LINKLOCAL_MCAST_OUTPUT_GROUP_ID = (SAI_VLAN_ATTR_UNKNOWN_IPV6_MCAST_OUTPUT_GROUP_ID + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_INGRESS_ACL = (SAI_VLAN_ATTR_UNKNOWN_LINKLOCAL_MCAST_OUTPUT_GROUP_ID + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_EGRESS_ACL = (SAI_VLAN_ATTR_INGRESS_ACL + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_META_DATA = (SAI_VLAN_ATTR_EGRESS_ACL + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_END = (SAI_VLAN_ATTR_META_DATA + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saivlan.h: 277 - -SAI_VLAN_ATTR_CUSTOM_RANGE_END = (SAI_VLAN_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saivlan.h: 277 - -sai_vlan_attr_t = enum__sai_vlan_attr_t # /home/omer/P4/SAI/inc/saivlan.h: 277 - -enum__sai_vlan_member_attr_t = c_int # /home/omer/P4/SAI/inc/saivlan.h: 327 - -SAI_VLAN_MEMBER_ATTR_START = 0 # /home/omer/P4/SAI/inc/saivlan.h: 327 - -SAI_VLAN_MEMBER_ATTR_VLAN_ID = SAI_VLAN_MEMBER_ATTR_START # /home/omer/P4/SAI/inc/saivlan.h: 327 - -SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID = (SAI_VLAN_MEMBER_ATTR_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saivlan.h: 327 - -SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE = (SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID + 1) # /home/omer/P4/SAI/inc/saivlan.h: 327 - -SAI_VLAN_MEMBER_ATTR_END = (SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE + 1) # /home/omer/P4/SAI/inc/saivlan.h: 327 - -SAI_VLAN_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saivlan.h: 327 - -SAI_VLAN_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_VLAN_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saivlan.h: 327 - -sai_vlan_member_attr_t = enum__sai_vlan_member_attr_t # /home/omer/P4/SAI/inc/saivlan.h: 327 - -enum__sai_vlan_stat_t = c_int # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_IN_OCTETS = 0 # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_IN_PACKETS = (SAI_VLAN_STAT_IN_OCTETS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_IN_UCAST_PKTS = (SAI_VLAN_STAT_IN_PACKETS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_IN_NON_UCAST_PKTS = (SAI_VLAN_STAT_IN_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_IN_DISCARDS = (SAI_VLAN_STAT_IN_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_IN_ERRORS = (SAI_VLAN_STAT_IN_DISCARDS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_IN_UNKNOWN_PROTOS = (SAI_VLAN_STAT_IN_ERRORS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_OUT_OCTETS = (SAI_VLAN_STAT_IN_UNKNOWN_PROTOS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_OUT_PACKETS = (SAI_VLAN_STAT_OUT_OCTETS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_OUT_UCAST_PKTS = (SAI_VLAN_STAT_OUT_PACKETS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_OUT_NON_UCAST_PKTS = (SAI_VLAN_STAT_OUT_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_OUT_DISCARDS = (SAI_VLAN_STAT_OUT_NON_UCAST_PKTS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_OUT_ERRORS = (SAI_VLAN_STAT_OUT_DISCARDS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -SAI_VLAN_STAT_OUT_QLEN = (SAI_VLAN_STAT_OUT_ERRORS + 1) # /home/omer/P4/SAI/inc/saivlan.h: 349 - -sai_vlan_stat_t = enum__sai_vlan_stat_t # /home/omer/P4/SAI/inc/saivlan.h: 349 - -sai_create_vlan_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivlan.h: 361 - -sai_remove_vlan_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saivlan.h: 374 - -sai_set_vlan_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivlan.h: 385 - -sai_get_vlan_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivlan.h: 398 - -sai_create_vlan_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivlan.h: 413 - -sai_remove_vlan_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saivlan.h: 426 - -sai_set_vlan_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivlan.h: 437 - -sai_get_vlan_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saivlan.h: 450 - -sai_get_vlan_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_vlan_stat_t), c_uint32, POINTER(c_uint64)) # /home/omer/P4/SAI/inc/saivlan.h: 465 - -sai_clear_vlan_stats_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_vlan_stat_t), c_uint32) # /home/omer/P4/SAI/inc/saivlan.h: 480 - -# /home/omer/P4/SAI/inc/saivlan.h: 503 -class struct__sai_vlan_api_t(Structure): - pass - -struct__sai_vlan_api_t.__slots__ = [ - 'create_vlan', - 'remove_vlan', - 'set_vlan_attribute', - 'get_vlan_attribute', - 'create_vlan_member', - 'remove_vlan_member', - 'set_vlan_member_attribute', - 'get_vlan_member_attribute', - 'create_vlan_members', - 'remove_vlan_members', - 'get_vlan_stats', - 'clear_vlan_stats', -] -struct__sai_vlan_api_t._fields_ = [ - ('create_vlan', sai_create_vlan_fn), - ('remove_vlan', sai_remove_vlan_fn), - ('set_vlan_attribute', sai_set_vlan_attribute_fn), - ('get_vlan_attribute', sai_get_vlan_attribute_fn), - ('create_vlan_member', sai_create_vlan_member_fn), - ('remove_vlan_member', sai_remove_vlan_member_fn), - ('set_vlan_member_attribute', sai_set_vlan_member_attribute_fn), - ('get_vlan_member_attribute', sai_get_vlan_member_attribute_fn), - ('create_vlan_members', sai_bulk_object_create_fn), - ('remove_vlan_members', sai_bulk_object_remove_fn), - ('get_vlan_stats', sai_get_vlan_stats_fn), - ('clear_vlan_stats', sai_clear_vlan_stats_fn), -] - -sai_vlan_api_t = struct__sai_vlan_api_t # /home/omer/P4/SAI/inc/saivlan.h: 503 - -enum__sai_ecn_mark_mode_t = c_int # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_NONE = 0 # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_GREEN = (SAI_ECN_MARK_MODE_NONE + 1) # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_YELLOW = (SAI_ECN_MARK_MODE_GREEN + 1) # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_RED = (SAI_ECN_MARK_MODE_YELLOW + 1) # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_GREEN_YELLOW = (SAI_ECN_MARK_MODE_RED + 1) # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_GREEN_RED = (SAI_ECN_MARK_MODE_GREEN_YELLOW + 1) # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_YELLOW_RED = (SAI_ECN_MARK_MODE_GREEN_RED + 1) # /home/omer/P4/SAI/inc/saiwred.h: 65 - -SAI_ECN_MARK_MODE_ALL = (SAI_ECN_MARK_MODE_YELLOW_RED + 1) # /home/omer/P4/SAI/inc/saiwred.h: 65 - -sai_ecn_mark_mode_t = enum__sai_ecn_mark_mode_t # /home/omer/P4/SAI/inc/saiwred.h: 65 - -enum__sai_wred_attr_t = c_int # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_GREEN_ENABLE = SAI_WRED_ATTR_START # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_GREEN_MIN_THRESHOLD = 1 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_GREEN_MAX_THRESHOLD = 2 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_GREEN_DROP_PROBABILITY = 3 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_YELLOW_ENABLE = 4 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_YELLOW_MIN_THRESHOLD = 5 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_YELLOW_MAX_THRESHOLD = 6 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_YELLOW_DROP_PROBABILITY = 7 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_RED_ENABLE = 8 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_RED_MIN_THRESHOLD = 9 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_RED_MAX_THRESHOLD = 10 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_RED_DROP_PROBABILITY = 11 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_WEIGHT = 12 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_ECN_MARK_MODE = 13 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_END = (SAI_WRED_ATTR_ECN_MARK_MODE + 1) # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiwred.h: 240 - -SAI_WRED_ATTR_CUSTOM_RANGE_END = (SAI_WRED_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiwred.h: 240 - -sai_wred_attr_t = enum__sai_wred_attr_t # /home/omer/P4/SAI/inc/saiwred.h: 240 - -sai_create_wred_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiwred.h: 252 - -sai_remove_wred_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiwred.h: 265 - -sai_set_wred_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiwred.h: 276 - -sai_get_wred_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiwred.h: 289 - -# /home/omer/P4/SAI/inc/saiwred.h: 304 -class struct__sai_wred_api_t(Structure): - pass - -struct__sai_wred_api_t.__slots__ = [ - 'create_wred', - 'remove_wred', - 'set_wred_attribute', - 'get_wred_attribute', -] -struct__sai_wred_api_t._fields_ = [ - ('create_wred', sai_create_wred_fn), - ('remove_wred', sai_remove_wred_fn), - ('set_wred_attribute', sai_set_wred_attribute_fn), - ('get_wred_attribute', sai_get_wred_attribute_fn), -] - -sai_wred_api_t = struct__sai_wred_api_t # /home/omer/P4/SAI/inc/saiwred.h: 304 - -enum__sai_bridge_port_fdb_learning_mode_t = c_int # /home/omer/P4/SAI/inc/saibridge.h: 66 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DROP = 0 # /home/omer/P4/SAI/inc/saibridge.h: 66 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DISABLE = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DROP + 1) # /home/omer/P4/SAI/inc/saibridge.h: 66 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_DISABLE + 1) # /home/omer/P4/SAI/inc/saibridge.h: 66 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_TRAP = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW + 1) # /home/omer/P4/SAI/inc/saibridge.h: 66 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_LOG = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_TRAP + 1) # /home/omer/P4/SAI/inc/saibridge.h: 66 - -SAI_BRIDGE_PORT_FDB_LEARNING_MODE_FDB_NOTIFICATION = (SAI_BRIDGE_PORT_FDB_LEARNING_MODE_CPU_LOG + 1) # /home/omer/P4/SAI/inc/saibridge.h: 66 - -sai_bridge_port_fdb_learning_mode_t = enum__sai_bridge_port_fdb_learning_mode_t # /home/omer/P4/SAI/inc/saibridge.h: 66 - -enum__sai_bridge_port_type_t = c_int # /home/omer/P4/SAI/inc/saibridge.h: 88 - -SAI_BRIDGE_PORT_TYPE_PORT = 0 # /home/omer/P4/SAI/inc/saibridge.h: 88 - -SAI_BRIDGE_PORT_TYPE_SUB_PORT = (SAI_BRIDGE_PORT_TYPE_PORT + 1) # /home/omer/P4/SAI/inc/saibridge.h: 88 - -SAI_BRIDGE_PORT_TYPE_1Q_ROUTER = (SAI_BRIDGE_PORT_TYPE_SUB_PORT + 1) # /home/omer/P4/SAI/inc/saibridge.h: 88 - -SAI_BRIDGE_PORT_TYPE_1D_ROUTER = (SAI_BRIDGE_PORT_TYPE_1Q_ROUTER + 1) # /home/omer/P4/SAI/inc/saibridge.h: 88 - -SAI_BRIDGE_PORT_TYPE_TUNNEL = (SAI_BRIDGE_PORT_TYPE_1D_ROUTER + 1) # /home/omer/P4/SAI/inc/saibridge.h: 88 - -sai_bridge_port_type_t = enum__sai_bridge_port_type_t # /home/omer/P4/SAI/inc/saibridge.h: 88 - -enum__sai_bridge_port_attr_t = c_int # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_START = 0 # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_TYPE = SAI_BRIDGE_PORT_ATTR_START # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_PORT_ID = (SAI_BRIDGE_PORT_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_VLAN_ID = (SAI_BRIDGE_PORT_ATTR_PORT_ID + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_RIF_ID = (SAI_BRIDGE_PORT_ATTR_VLAN_ID + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_TUNNEL_ID = (SAI_BRIDGE_PORT_ATTR_RIF_ID + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_BRIDGE_ID = (SAI_BRIDGE_PORT_ATTR_TUNNEL_ID + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE = (SAI_BRIDGE_PORT_ATTR_BRIDGE_ID + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_MAX_LEARNED_ADDRESSES = (SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_LIMIT_VIOLATION_PACKET_ACTION = (SAI_BRIDGE_PORT_ATTR_MAX_LEARNED_ADDRESSES + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_END = (SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_LIMIT_VIOLATION_PACKET_ACTION + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saibridge.h: 200 - -SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_END = (SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saibridge.h: 200 - -sai_bridge_port_attr_t = enum__sai_bridge_port_attr_t # /home/omer/P4/SAI/inc/saibridge.h: 200 - -sai_create_bridge_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibridge.h: 212 - -sai_remove_bridge_port_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saibridge.h: 225 - -sai_set_bridge_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibridge.h: 236 - -sai_get_bridge_port_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibridge.h: 249 - -enum__sai_bridge_type_t = c_int # /home/omer/P4/SAI/inc/saibridge.h: 265 - -SAI_BRIDGE_TYPE_1Q = 0 # /home/omer/P4/SAI/inc/saibridge.h: 265 - -SAI_BRIDGE_TYPE_1D = (SAI_BRIDGE_TYPE_1Q + 1) # /home/omer/P4/SAI/inc/saibridge.h: 265 - -sai_bridge_type_t = enum__sai_bridge_type_t # /home/omer/P4/SAI/inc/saibridge.h: 265 - -enum__sai_bridge_attr_t = c_int # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_START = 0 # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_TYPE = SAI_BRIDGE_ATTR_START # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_PORT_LIST = (SAI_BRIDGE_ATTR_TYPE + 1) # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_MAX_LEARNED_ADDRESSES = (SAI_BRIDGE_ATTR_PORT_LIST + 1) # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_LEARN_DISABLE = (SAI_BRIDGE_ATTR_MAX_LEARNED_ADDRESSES + 1) # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_END = (SAI_BRIDGE_ATTR_LEARN_DISABLE + 1) # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saibridge.h: 325 - -SAI_BRIDGE_ATTR_CUSTOM_RANGE_END = (SAI_BRIDGE_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saibridge.h: 325 - -sai_bridge_attr_t = enum__sai_bridge_attr_t # /home/omer/P4/SAI/inc/saibridge.h: 325 - -sai_create_bridge_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibridge.h: 337 - -sai_remove_bridge_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saibridge.h: 350 - -sai_set_bridge_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibridge.h: 361 - -sai_get_bridge_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saibridge.h: 374 - -# /home/omer/P4/SAI/inc/saibridge.h: 392 -class struct__sai_bridge_api_t(Structure): - pass - -struct__sai_bridge_api_t.__slots__ = [ - 'create_bridge', - 'remove_bridge', - 'set_bridge_attribute', - 'get_bridge_attribute', - 'create_bridge_port', - 'remove_bridge_port', - 'set_bridge_port_attribute', - 'get_bridge_port_attribute', -] -struct__sai_bridge_api_t._fields_ = [ - ('create_bridge', sai_create_bridge_fn), - ('remove_bridge', sai_remove_bridge_fn), - ('set_bridge_attribute', sai_set_bridge_attribute_fn), - ('get_bridge_attribute', sai_get_bridge_attribute_fn), - ('create_bridge_port', sai_create_bridge_port_fn), - ('remove_bridge_port', sai_remove_bridge_port_fn), - ('set_bridge_port_attribute', sai_set_bridge_port_attribute_fn), - ('get_bridge_port_attribute', sai_get_bridge_port_attribute_fn), -] - -sai_bridge_api_t = struct__sai_bridge_api_t # /home/omer/P4/SAI/inc/saibridge.h: 392 - -enum__sai_rpf_group_attr_t = c_int # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -SAI_RPF_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -SAI_RPF_GROUP_ATTR_RPF_INTERFACE_COUNT = SAI_RPF_GROUP_ATTR_START # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -SAI_RPF_GROUP_ATTR_RPF_MEMBER_LIST = (SAI_RPF_GROUP_ATTR_RPF_INTERFACE_COUNT + 1) # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -SAI_RPF_GROUP_ATTR_END = (SAI_RPF_GROUP_ATTR_RPF_MEMBER_LIST + 1) # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -SAI_RPF_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -SAI_RPF_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_RPF_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -sai_rpf_group_attr_t = enum__sai_rpf_group_attr_t # /home/omer/P4/SAI/inc/sairpfgroup.h: 74 - -enum__sai_rpf_group_member_attr_t = c_int # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -SAI_RPF_GROUP_MEMBER_ATTR_START = 0 # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -SAI_RPF_GROUP_MEMBER_ATTR_RPF_GROUP_ID = SAI_RPF_GROUP_MEMBER_ATTR_START # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -SAI_RPF_GROUP_MEMBER_ATTR_RPF_INTERFACE_ID = (SAI_RPF_GROUP_MEMBER_ATTR_RPF_GROUP_ID + 1) # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -SAI_RPF_GROUP_MEMBER_ATTR_END = (SAI_RPF_GROUP_MEMBER_ATTR_RPF_INTERFACE_ID + 1) # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_RPF_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -sai_rpf_group_member_attr_t = enum__sai_rpf_group_member_attr_t # /home/omer/P4/SAI/inc/sairpfgroup.h: 112 - -sai_create_rpf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairpfgroup.h: 124 - -sai_remove_rpf_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sairpfgroup.h: 137 - -sai_set_rpf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairpfgroup.h: 148 - -sai_get_rpf_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairpfgroup.h: 161 - -sai_create_rpf_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairpfgroup.h: 175 - -sai_remove_rpf_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sairpfgroup.h: 188 - -sai_set_rpf_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairpfgroup.h: 199 - -sai_get_rpf_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sairpfgroup.h: 212 - -# /home/omer/P4/SAI/inc/sairpfgroup.h: 231 -class struct__sai_rpf_group_api_t(Structure): - pass - -struct__sai_rpf_group_api_t.__slots__ = [ - 'create_rpf_group', - 'remove_rpf_group', - 'set_rpf_group_attribute', - 'get_rpf_group_attribute', - 'create_rpf_group_member', - 'remove_rpf_group_member', - 'set_rpf_group_member_attribute', - 'get_rpf_group_member_attribute', -] -struct__sai_rpf_group_api_t._fields_ = [ - ('create_rpf_group', sai_create_rpf_group_fn), - ('remove_rpf_group', sai_remove_rpf_group_fn), - ('set_rpf_group_attribute', sai_set_rpf_group_attribute_fn), - ('get_rpf_group_attribute', sai_get_rpf_group_attribute_fn), - ('create_rpf_group_member', sai_create_rpf_group_member_fn), - ('remove_rpf_group_member', sai_remove_rpf_group_member_fn), - ('set_rpf_group_member_attribute', sai_set_rpf_group_member_attribute_fn), - ('get_rpf_group_member_attribute', sai_get_rpf_group_member_attribute_fn), -] - -sai_rpf_group_api_t = struct__sai_rpf_group_api_t # /home/omer/P4/SAI/inc/sairpfgroup.h: 231 - -enum__sai_l2mc_group_attr_t = c_int # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -SAI_L2MC_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -SAI_L2MC_GROUP_ATTR_L2MC_OUTPUT_COUNT = SAI_L2MC_GROUP_ATTR_START # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -SAI_L2MC_GROUP_ATTR_L2MC_MEMBER_LIST = (SAI_L2MC_GROUP_ATTR_L2MC_OUTPUT_COUNT + 1) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -SAI_L2MC_GROUP_ATTR_END = (SAI_L2MC_GROUP_ATTR_L2MC_MEMBER_LIST + 1) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -SAI_L2MC_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -SAI_L2MC_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_L2MC_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -sai_l2mc_group_attr_t = enum__sai_l2mc_group_attr_t # /home/omer/P4/SAI/inc/sail2mcgroup.h: 74 - -enum__sai_l2mc_group_member_attr_t = c_int # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -SAI_L2MC_GROUP_MEMBER_ATTR_START = 0 # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_GROUP_ID = SAI_L2MC_GROUP_MEMBER_ATTR_START # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_OUTPUT_ID = (SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_GROUP_ID + 1) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -SAI_L2MC_GROUP_MEMBER_ATTR_END = (SAI_L2MC_GROUP_MEMBER_ATTR_L2MC_OUTPUT_ID + 1) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_L2MC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -sai_l2mc_group_member_attr_t = enum__sai_l2mc_group_member_attr_t # /home/omer/P4/SAI/inc/sail2mcgroup.h: 112 - -sai_create_l2mc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 124 - -sai_remove_l2mc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 137 - -sai_set_l2mc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 148 - -sai_get_l2mc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 161 - -sai_create_l2mc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 175 - -sai_remove_l2mc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 188 - -sai_set_l2mc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 199 - -sai_get_l2mc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/sail2mcgroup.h: 212 - -# /home/omer/P4/SAI/inc/sail2mcgroup.h: 231 -class struct__sai_l2mc_group_api_t(Structure): - pass - -struct__sai_l2mc_group_api_t.__slots__ = [ - 'create_l2mc_group', - 'remove_l2mc_group', - 'set_l2mc_group_attribute', - 'get_l2mc_group_attribute', - 'create_l2mc_group_member', - 'remove_l2mc_group_member', - 'set_l2mc_group_member_attribute', - 'get_l2mc_group_member_attribute', -] -struct__sai_l2mc_group_api_t._fields_ = [ - ('create_l2mc_group', sai_create_l2mc_group_fn), - ('remove_l2mc_group', sai_remove_l2mc_group_fn), - ('set_l2mc_group_attribute', sai_set_l2mc_group_attribute_fn), - ('get_l2mc_group_attribute', sai_get_l2mc_group_attribute_fn), - ('create_l2mc_group_member', sai_create_l2mc_group_member_fn), - ('remove_l2mc_group_member', sai_remove_l2mc_group_member_fn), - ('set_l2mc_group_member_attribute', sai_set_l2mc_group_member_attribute_fn), - ('get_l2mc_group_member_attribute', sai_get_l2mc_group_member_attribute_fn), -] - -sai_l2mc_group_api_t = struct__sai_l2mc_group_api_t # /home/omer/P4/SAI/inc/sail2mcgroup.h: 231 - -enum__sai_ipmc_group_attr_t = c_int # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -SAI_IPMC_GROUP_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -SAI_IPMC_GROUP_ATTR_IPMC_OUTPUT_COUNT = SAI_IPMC_GROUP_ATTR_START # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -SAI_IPMC_GROUP_ATTR_IPMC_MEMBER_LIST = (SAI_IPMC_GROUP_ATTR_IPMC_OUTPUT_COUNT + 1) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -SAI_IPMC_GROUP_ATTR_END = (SAI_IPMC_GROUP_ATTR_IPMC_MEMBER_LIST + 1) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -SAI_IPMC_GROUP_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -SAI_IPMC_GROUP_ATTR_CUSTOM_RANGE_END = (SAI_IPMC_GROUP_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -sai_ipmc_group_attr_t = enum__sai_ipmc_group_attr_t # /home/omer/P4/SAI/inc/saiipmcgroup.h: 74 - -enum__sai_ipmc_group_member_attr_t = c_int # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -SAI_IPMC_GROUP_MEMBER_ATTR_START = 0 # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_GROUP_ID = SAI_IPMC_GROUP_MEMBER_ATTR_START # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID = (SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_GROUP_ID + 1) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -SAI_IPMC_GROUP_MEMBER_ATTR_END = (SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID + 1) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 268435456 # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END = (SAI_IPMC_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START + 1) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -sai_ipmc_group_member_attr_t = enum__sai_ipmc_group_member_attr_t # /home/omer/P4/SAI/inc/saiipmcgroup.h: 112 - -sai_create_ipmc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 124 - -sai_remove_ipmc_group_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 137 - -sai_set_ipmc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 148 - -sai_get_ipmc_group_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 161 - -sai_create_ipmc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), POINTER(sai_object_id_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 175 - -sai_remove_ipmc_group_member_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 188 - -sai_set_ipmc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 199 - -sai_get_ipmc_group_member_attribute_fn = CFUNCTYPE(UNCHECKED(sai_status_t), sai_object_id_t, c_uint32, POINTER(sai_attribute_t)) # /home/omer/P4/SAI/inc/saiipmcgroup.h: 212 - -# /home/omer/P4/SAI/inc/saiipmcgroup.h: 231 -class struct__sai_ipmc_group_api_t(Structure): - pass - -struct__sai_ipmc_group_api_t.__slots__ = [ - 'create_ipmc_group', - 'remove_ipmc_group', - 'set_ipmc_group_attribute', - 'get_ipmc_group_attribute', - 'create_ipmc_group_member', - 'remove_ipmc_group_member', - 'set_ipmc_group_member_attribute', - 'get_ipmc_group_member_attribute', -] -struct__sai_ipmc_group_api_t._fields_ = [ - ('create_ipmc_group', sai_create_ipmc_group_fn), - ('remove_ipmc_group', sai_remove_ipmc_group_fn), - ('set_ipmc_group_attribute', sai_set_ipmc_group_attribute_fn), - ('get_ipmc_group_attribute', sai_get_ipmc_group_attribute_fn), - ('create_ipmc_group_member', sai_create_ipmc_group_member_fn), - ('remove_ipmc_group_member', sai_remove_ipmc_group_member_fn), - ('set_ipmc_group_member_attribute', sai_set_ipmc_group_member_attribute_fn), - ('get_ipmc_group_member_attribute', sai_get_ipmc_group_member_attribute_fn), -] - -sai_ipmc_group_api_t = struct__sai_ipmc_group_api_t # /home/omer/P4/SAI/inc/saiipmcgroup.h: 231 - -enum__sai_api_t = c_int # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_UNSPECIFIED = 0 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_SWITCH = 1 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_PORT = 2 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_FDB = 3 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_VLAN = 4 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_VIRTUAL_ROUTER = 5 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_ROUTE = 6 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_NEXT_HOP = 7 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_NEXT_HOP_GROUP = 8 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_ROUTER_INTERFACE = 9 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_NEIGHBOR = 10 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_ACL = 11 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_HOSTIF = 12 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_MIRROR = 13 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_SAMPLEPACKET = 14 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_STP = 15 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_LAG = 16 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_POLICER = 17 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_WRED = 18 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_QOS_MAP = 19 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_QUEUE = 20 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_SCHEDULER = 21 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_SCHEDULER_GROUP = 22 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_BUFFER = 23 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_HASH = 24 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_UDF = 25 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_TUNNEL = 26 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_L2MC = 27 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_IPMC = 28 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_RPF_GROUP = 29 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_L2MC_GROUP = 30 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_IPMC_GROUP = 31 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_MCAST_FDB = 32 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_BRIDGE = 33 # /home/omer/P4/SAI/inc/sai.h: 115 - -SAI_API_MAX = 34 # /home/omer/P4/SAI/inc/sai.h: 115 - -sai_api_t = enum__sai_api_t # /home/omer/P4/SAI/inc/sai.h: 115 - -enum__sai_log_level_t = c_int # /home/omer/P4/SAI/inc/sai.h: 140 - -SAI_LOG_LEVEL_DEBUG = 0 # /home/omer/P4/SAI/inc/sai.h: 140 - -SAI_LOG_LEVEL_INFO = 1 # /home/omer/P4/SAI/inc/sai.h: 140 - -SAI_LOG_LEVEL_NOTICE = 2 # /home/omer/P4/SAI/inc/sai.h: 140 - -SAI_LOG_LEVEL_WARN = 3 # /home/omer/P4/SAI/inc/sai.h: 140 - -SAI_LOG_LEVEL_ERROR = 4 # /home/omer/P4/SAI/inc/sai.h: 140 - -SAI_LOG_LEVEL_CRITICAL = 5 # /home/omer/P4/SAI/inc/sai.h: 140 - -sai_log_level_t = enum__sai_log_level_t # /home/omer/P4/SAI/inc/sai.h: 140 - -sai_profile_get_value_fn = CFUNCTYPE(UNCHECKED(String), sai_switch_profile_id_t, String) # /home/omer/P4/SAI/inc/sai.h: 142 - -sai_profile_get_next_value_fn = CFUNCTYPE(UNCHECKED(c_int), sai_switch_profile_id_t, POINTER(POINTER(c_char)), POINTER(POINTER(c_char))) # /home/omer/P4/SAI/inc/sai.h: 146 - -# /home/omer/P4/SAI/inc/sai.h: 170 -class struct__service_method_table_t(Structure): - pass - -struct__service_method_table_t.__slots__ = [ - 'profile_get_value', - 'profile_get_next_value', -] -struct__service_method_table_t._fields_ = [ - ('profile_get_value', sai_profile_get_value_fn), - ('profile_get_next_value', sai_profile_get_next_value_fn), -] - -service_method_table_t = struct__service_method_table_t # /home/omer/P4/SAI/inc/sai.h: 170 - -# /home/omer/P4/SAI/inc/sai.h: 180 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_api_initialize'): - continue - sai_api_initialize = _lib.sai_api_initialize - sai_api_initialize.argtypes = [c_uint64, POINTER(service_method_table_t)] - sai_api_initialize.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/sai.h: 194 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_api_query'): - continue - sai_api_query = _lib.sai_api_query - sai_api_query.argtypes = [sai_api_t, POINTER(POINTER(None))] - sai_api_query.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/sai.h: 204 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_api_uninitialize'): - continue - sai_api_uninitialize = _lib.sai_api_uninitialize - sai_api_uninitialize.argtypes = [] - sai_api_uninitialize.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/sai.h: 214 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_log_set'): - continue - sai_log_set = _lib.sai_log_set - sai_log_set.argtypes = [sai_api_t, sai_log_level_t] - sai_log_set.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/sai.h: 226 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_object_type_query'): - continue - sai_object_type_query = _lib.sai_object_type_query - sai_object_type_query.argtypes = [sai_object_id_t] - sai_object_type_query.restype = sai_object_type_t - break - -# /home/omer/P4/SAI/inc/sai.h: 239 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_switch_id_query'): - continue - sai_switch_id_query = _lib.sai_switch_id_query - sai_switch_id_query.argtypes = [sai_object_id_t] - sai_switch_id_query.restype = sai_object_id_t - break - -# /home/omer/P4/SAI/inc/sai.h: 249 -for _lib in _libs.itervalues(): - if not hasattr(_lib, 'sai_dbg_generate_dump'): - continue - sai_dbg_generate_dump = _lib.sai_dbg_generate_dump - sai_dbg_generate_dump.argtypes = [String] - sai_dbg_generate_dump.restype = sai_status_t - break - -# /home/omer/P4/SAI/inc/saitypes.h: 122 -try: - SAI_NULL_OBJECT_ID = 0L -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 43 -def SAI_STATUS_CODE(_S_): - return (-_S_) - -# /home/omer/P4/SAI/inc/saistatus.h: 50 -try: - SAI_STATUS_SUCCESS = 0L -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 55 -try: - SAI_STATUS_FAILURE = (SAI_STATUS_CODE (1L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 60 -try: - SAI_STATUS_NOT_SUPPORTED = (SAI_STATUS_CODE (2L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 65 -try: - SAI_STATUS_NO_MEMORY = (SAI_STATUS_CODE (3L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 70 -try: - SAI_STATUS_INSUFFICIENT_RESOURCES = (SAI_STATUS_CODE (4L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 75 -try: - SAI_STATUS_INVALID_PARAMETER = (SAI_STATUS_CODE (5L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 81 -try: - SAI_STATUS_ITEM_ALREADY_EXISTS = (SAI_STATUS_CODE (6L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 87 -try: - SAI_STATUS_ITEM_NOT_FOUND = (SAI_STATUS_CODE (7L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 92 -try: - SAI_STATUS_BUFFER_OVERFLOW = (SAI_STATUS_CODE (8L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 97 -try: - SAI_STATUS_INVALID_PORT_NUMBER = (SAI_STATUS_CODE (9L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 102 -try: - SAI_STATUS_INVALID_PORT_MEMBER = (SAI_STATUS_CODE (10L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 107 -try: - SAI_STATUS_INVALID_VLAN_ID = (SAI_STATUS_CODE (11L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 112 -try: - SAI_STATUS_UNINITIALIZED = (SAI_STATUS_CODE (12L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 117 -try: - SAI_STATUS_TABLE_FULL = (SAI_STATUS_CODE (13L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 122 -try: - SAI_STATUS_MANDATORY_ATTRIBUTE_MISSING = (SAI_STATUS_CODE (14L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 127 -try: - SAI_STATUS_NOT_IMPLEMENTED = (SAI_STATUS_CODE (15L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 132 -try: - SAI_STATUS_ADDR_NOT_FOUND = (SAI_STATUS_CODE (16L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 137 -try: - SAI_STATUS_OBJECT_IN_USE = (SAI_STATUS_CODE (17L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 144 -try: - SAI_STATUS_INVALID_OBJECT_TYPE = (SAI_STATUS_CODE (18L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 152 -try: - SAI_STATUS_INVALID_OBJECT_ID = (SAI_STATUS_CODE (19L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 157 -try: - SAI_STATUS_INVALID_NV_STORAGE = (SAI_STATUS_CODE (20L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 162 -try: - SAI_STATUS_NV_STORAGE_FULL = (SAI_STATUS_CODE (21L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 167 -try: - SAI_STATUS_SW_UPGRADE_VERSION_MISMATCH = (SAI_STATUS_CODE (22L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 172 -try: - SAI_STATUS_NOT_EXECUTED = (SAI_STATUS_CODE (23L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 185 -try: - SAI_STATUS_INVALID_ATTRIBUTE_0 = (SAI_STATUS_CODE (65536L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 190 -try: - SAI_STATUS_INVALID_ATTRIBUTE_MAX = (SAI_STATUS_CODE (131071L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 195 -try: - SAI_STATUS_INVALID_ATTR_VALUE_0 = (SAI_STATUS_CODE (131072L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 199 -try: - SAI_STATUS_INVALID_ATTR_VALUE_MAX = (SAI_STATUS_CODE (196607L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 207 -try: - SAI_STATUS_ATTR_NOT_IMPLEMENTED_0 = (SAI_STATUS_CODE (196608L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 212 -try: - SAI_STATUS_ATTR_NOT_IMPLEMENTED_MAX = (SAI_STATUS_CODE (262143L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 220 -try: - SAI_STATUS_UNKNOWN_ATTRIBUTE_0 = (SAI_STATUS_CODE (262144L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 225 -try: - SAI_STATUS_UNKNOWN_ATTRIBUTE_MAX = (SAI_STATUS_CODE (327679L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 233 -try: - SAI_STATUS_ATTR_NOT_SUPPORTED_0 = (SAI_STATUS_CODE (327680L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 238 -try: - SAI_STATUS_ATTR_NOT_SUPPORTED_MAX = (SAI_STATUS_CODE (393215L)) -except: - pass - -# /home/omer/P4/SAI/inc/saistatus.h: 247 -def SAI_STATUS_IS_INVALID_ATTRIBUTE(x): - return (x & ((~65535) == SAI_STATUS_INVALID_ATTRIBUTE_0)) - -# /home/omer/P4/SAI/inc/saistatus.h: 252 -def SAI_STATUS_IS_INVALID_ATTR_VALUE(x): - return (x & ((~65535) == SAI_STATUS_INVALID_ATTR_VALUE_0)) - -# /home/omer/P4/SAI/inc/saistatus.h: 257 -def SAI_STATUS_IS_ATTR_NOT_IMPLEMENTED(x): - return (x & ((~65535) == SAI_STATUS_ATTR_NOT_IMPLEMENTED_0)) - -# /home/omer/P4/SAI/inc/saistatus.h: 262 -def SAI_STATUS_IS_UNKNOWN_ATTRIBUTE(x): - return (x & ((~65535) == SAI_STATUS_INVALID_ATTRIBUTE_0)) - -# /home/omer/P4/SAI/inc/saistatus.h: 267 -def SAI_STATUS_IS_ATTR_NOT_SUPPORTED(x): - return (x & ((~65535) == SAI_STATUS_ATTR_NOT_SUPPORTED_0)) - -# /home/omer/P4/SAI/inc/saiacl.h: 387 -try: - SAI_ACL_USER_DEFINED_FIELD_ATTR_ID_RANGE = 255 -except: - pass - -# /home/omer/P4/SAI/inc/saihostif.h: 47 -try: - HOSTIF_NAME_SIZE = 16 -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 42 -try: - SAI_MAX_HARDWARE_ID_LEN = 255 -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1276 -try: - SAI_SWITCH_ATTR_MAX_KEY_STRING_LEN = 64 -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1285 -try: - SAI_SWITCH_ATTR_MAX_KEY_COUNT = 16 -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1294 -try: - SAI_KEY_FDB_TABLE_SIZE = 'SAI_FDB_TABLE_SIZE' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1299 -try: - SAI_KEY_L3_ROUTE_TABLE_SIZE = 'SAI_L3_ROUTE_TABLE_SIZE' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1304 -try: - SAI_KEY_L3_NEIGHBOR_TABLE_SIZE = 'SAI_L3_NEIGHBOR_TABLE_SIZE' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1309 -try: - SAI_KEY_NUM_LAG_MEMBERS = 'SAI_NUM_LAG_MEMBERS' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1314 -try: - SAI_KEY_NUM_LAGS = 'SAI_NUM_LAGS' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1319 -try: - SAI_KEY_NUM_ECMP_MEMBERS = 'SAI_NUM_ECMP_MEMBERS' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1324 -try: - SAI_KEY_NUM_ECMP_GROUPS = 'SAI_NUM_ECMP_GROUPS' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1329 -try: - SAI_KEY_NUM_UNICAST_QUEUES = 'SAI_NUM_UNICAST_QUEUES' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1334 -try: - SAI_KEY_NUM_MULTICAST_QUEUES = 'SAI_NUM_MULTICAST_QUEUES' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1339 -try: - SAI_KEY_NUM_QUEUES = 'SAI_NUM_QUEUES' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1344 -try: - SAI_KEY_NUM_CPU_QUEUES = 'SAI_NUM_CPU_QUEUES' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1349 -try: - SAI_KEY_INIT_CONFIG_FILE = 'SAI_INIT_CONFIG_FILE' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1359 -try: - SAI_KEY_BOOT_TYPE = 'SAI_BOOT_TYPE' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1365 -try: - SAI_KEY_WARM_BOOT_READ_FILE = 'SAI_WARM_BOOT_READ_FILE' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1371 -try: - SAI_KEY_WARM_BOOT_WRITE_FILE = 'SAI_WARM_BOOT_WRITE_FILE' -except: - pass - -# /home/omer/P4/SAI/inc/saiswitch.h: 1379 -try: - SAI_KEY_HW_PORT_PROFILE_ID_CONFIG_FILE = 'SAI_HW_PORT_PROFILE_ID_CONFIG_FILE' -except: - pass - -# /home/omer/P4/SAI/inc/saivlan.h: 39 -try: - VLAN_COUNTER_SET_DEFAULT = 0 -except: - pass - -_sai_object_list_t = struct__sai_object_list_t # /home/omer/P4/SAI/inc/saitypes.h: 143 - -_sai_u8_list_t = struct__sai_u8_list_t # /home/omer/P4/SAI/inc/saitypes.h: 226 - -_sai_s8_list_t = struct__sai_s8_list_t # /home/omer/P4/SAI/inc/saitypes.h: 235 - -_sai_u16_list_t = struct__sai_u16_list_t # /home/omer/P4/SAI/inc/saitypes.h: 240 - -_sai_s16_list_t = struct__sai_s16_list_t # /home/omer/P4/SAI/inc/saitypes.h: 245 - -_sai_u32_list_t = struct__sai_u32_list_t # /home/omer/P4/SAI/inc/saitypes.h: 250 - -_sai_s32_list_t = struct__sai_s32_list_t # /home/omer/P4/SAI/inc/saitypes.h: 255 - -_sai_u32_range_t = struct__sai_u32_range_t # /home/omer/P4/SAI/inc/saitypes.h: 260 - -_sai_s32_range_t = struct__sai_s32_range_t # /home/omer/P4/SAI/inc/saitypes.h: 265 - -_sai_vlan_list_t = struct__sai_vlan_list_t # /home/omer/P4/SAI/inc/saitypes.h: 278 - -_sai_ip_address_t = struct__sai_ip_address_t # /home/omer/P4/SAI/inc/saitypes.h: 294 - -_sai_ip_prefix_t = struct__sai_ip_prefix_t # /home/omer/P4/SAI/inc/saitypes.h: 306 - -_sai_acl_field_data_t = struct__sai_acl_field_data_t # /home/omer/P4/SAI/inc/saitypes.h: 354 - -_sai_acl_action_data_t = struct__sai_acl_action_data_t # /home/omer/P4/SAI/inc/saitypes.h: 385 - -_sai_qos_map_params_t = struct__sai_qos_map_params_t # /home/omer/P4/SAI/inc/saitypes.h: 447 - -_sai_qos_map_t = struct__sai_qos_map_t # /home/omer/P4/SAI/inc/saitypes.h: 457 - -_sai_qos_map_list_t = struct__sai_qos_map_list_t # /home/omer/P4/SAI/inc/saitypes.h: 466 - -_sai_tunnel_map_params_t = struct__sai_tunnel_map_params_t # /home/omer/P4/SAI/inc/saitypes.h: 482 - -_sai_tunnel_map_t = struct__sai_tunnel_map_t # /home/omer/P4/SAI/inc/saitypes.h: 492 - -_sai_tunnel_map_list_t = struct__sai_tunnel_map_list_t # /home/omer/P4/SAI/inc/saitypes.h: 502 - -_sai_acl_capability_t = struct__sai_acl_capability_t # /home/omer/P4/SAI/inc/saitypes.h: 524 - -_sai_attribute_t = struct__sai_attribute_t # /home/omer/P4/SAI/inc/saitypes.h: 581 - -_sai_acl_api_t = struct__sai_acl_api_t # /home/omer/P4/SAI/inc/saiacl.h: 2253 - -_sai_buffer_api_t = struct__sai_buffer_api_t # /home/omer/P4/SAI/inc/saibuffer.h: 589 - -_sai_fdb_entry_t = struct__sai_fdb_entry_t # /home/omer/P4/SAI/inc/saifdb.h: 77 - -_sai_fdb_event_notification_data_t = struct__sai_fdb_event_notification_data_t # /home/omer/P4/SAI/inc/saifdb.h: 264 - -_sai_fdb_api_t = struct__sai_fdb_api_t # /home/omer/P4/SAI/inc/saifdb.h: 351 - -_sai_hash_api_t = struct__sai_hash_api_t # /home/omer/P4/SAI/inc/saihash.h: 185 - -_sai_hostif_api_t = struct__sai_hostif_api_t # /home/omer/P4/SAI/inc/saihostif.h: 1066 - -_sai_lag_api_t = struct__sai_lag_api_t # /home/omer/P4/SAI/inc/sailag.h: 280 - -_sai_mirror_api_t = struct__sai_mirror_api_t # /home/omer/P4/SAI/inc/saimirror.h: 312 - -_sai_neighbor_entry_t = struct__sai_neighbor_entry_t # /home/omer/P4/SAI/inc/saineighbor.h: 130 - -_sai_neighbor_api_t = struct__sai_neighbor_api_t # /home/omer/P4/SAI/inc/saineighbor.h: 206 - -_sai_next_hop_group_api_t = struct__sai_next_hop_group_api_t # /home/omer/P4/SAI/inc/sainexthopgroup.h: 261 - -_sai_next_hop_api_t = struct__sai_next_hop_api_t # /home/omer/P4/SAI/inc/sainexthop.h: 175 - -_sai_mcast_fdb_entry_t = struct__sai_mcast_fdb_entry_t # ../../../inc/saimcastfdb.h: 54 - -_sai_mcast_fdb_api_t = struct__sai_mcast_fdb_api_t # ../../../inc/saimcastfdb.h: 170 - -_sai_l2mc_entry_t = struct__sai_l2mc_entry_t # ../../../inc/sail2mc.h: 82 - -_sai_l2mc_api_t = struct__sai_l2mc_api_t # ../../../inc/sail2mc.h: 190 - -_sai_ipmc_entry_t = struct__sai_ipmc_entry_t # ../../../inc/saiipmc.h: 76 - -_sai_ipmc_api_t = struct__sai_ipmc_api_t # ../../../inc/saiipmc.h: 195 - -_sai_route_entry_t = struct__sai_route_entry_t # ../../../inc/sairoute.h: 138 - -_sai_route_api_t = struct__sai_route_api_t # ../../../inc/sairoute.h: 204 - -_sai_object_key_t = struct__sai_object_key_t # /home/omer/P4/SAI/inc/saiobject.h: 61 - -_sai_policer_api_t = struct__sai_policer_api_t # /home/omer/P4/SAI/inc/saipolicer.h: 344 - -_sai_port_oper_status_notification_t = struct__sai_port_oper_status_notification_t # /home/omer/P4/SAI/inc/saiport.h: 95 - -_sai_port_api_t = struct__sai_port_api_t # /home/omer/P4/SAI/inc/saiport.h: 1583 - -_sai_qos_map_api_t = struct__sai_qos_map_api_t # /home/omer/P4/SAI/inc/saiqosmap.h: 182 - -_sai_queue_api_t = struct__sai_queue_api_t # /home/omer/P4/SAI/inc/saiqueue.h: 354 - -_sai_virtual_router_api_t = struct__sai_virtual_router_api_t # /home/omer/P4/SAI/inc/saivirtualrouter.h: 188 - -_sai_router_interface_api_t = struct__sai_router_interface_api_t # /home/omer/P4/SAI/inc/sairouterinterface.h: 282 - -_sai_samplepacket_api_t = struct__sai_samplepacket_api_t # /home/omer/P4/SAI/inc/saisamplepacket.h: 185 - -_sai_scheduler_group_api_t = struct__sai_scheduler_group_api_t # /home/omer/P4/SAI/inc/saischedulergroup.h: 183 - -_sai_scheduler_api_t = struct__sai_scheduler_api_t # /home/omer/P4/SAI/inc/saischeduler.h: 207 - -_sai_stp_api_t = struct__sai_stp_api_t # /home/omer/P4/SAI/inc/saistp.h: 259 - -_sai_switch_api_t = struct__sai_switch_api_t # /home/omer/P4/SAI/inc/saiswitch.h: 1468 - -_sai_tunnel_api_t = struct__sai_tunnel_api_t # /home/omer/P4/SAI/inc/saitunnel.h: 854 - -_sai_udf_api_t = struct__sai_udf_api_t # /home/omer/P4/SAI/inc/saiudf.h: 418 - -_sai_vlan_api_t = struct__sai_vlan_api_t # /home/omer/P4/SAI/inc/saivlan.h: 503 - -_sai_wred_api_t = struct__sai_wred_api_t # /home/omer/P4/SAI/inc/saiwred.h: 304 - -_sai_bridge_api_t = struct__sai_bridge_api_t # /home/omer/P4/SAI/inc/saibridge.h: 392 - -_sai_rpf_group_api_t = struct__sai_rpf_group_api_t # /home/omer/P4/SAI/inc/sairpfgroup.h: 231 - -_sai_l2mc_group_api_t = struct__sai_l2mc_group_api_t # /home/omer/P4/SAI/inc/sail2mcgroup.h: 231 - -_sai_ipmc_group_api_t = struct__sai_ipmc_group_api_t # /home/omer/P4/SAI/inc/saiipmcgroup.h: 231 - -_service_method_table_t = struct__service_method_table_t # /home/omer/P4/SAI/inc/sai.h: 170 - -# No inserted files - diff --git a/bm/sai_adapter/test/unittest/.gitignore b/bm/sai_adapter/test/unittest/.gitignore deleted file mode 100644 index 1570cd548..000000000 --- a/bm/sai_adapter/test/unittest/.gitignore +++ /dev/null @@ -1 +0,0 @@ -unittest \ No newline at end of file diff --git a/bm/sai_adapter/test/unittest/logs/.gitkeep b/bm/sai_adapter/test/unittest/logs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/bm/sai_adapter/test/unittest/logs/log.txt b/bm/sai_adapter/test/unittest/logs/log.txt deleted file mode 100644 index 39ea57d6e..000000000 --- a/bm/sai_adapter/test/unittest/logs/log.txt +++ /dev/null @@ -1,26 +0,0 @@ -[thread 734] [info] Switch init with default configurations -[thread 734] [info] create switch -[thread 734] [info] Default 1Q bridge. sai_object_id 0 bridge_id 1 -[thread 734] [info] Default port_id 2. hw_port = 0 -[thread 734] [info] Default bridge_port_id 3. bridge_port = 0 -[thread 734] [info] Default port_id 4. hw_port = 1 -[thread 734] [info] Default bridge_port_id 5. bridge_port = 1 -[thread 734] [info] Default port_id 6. hw_port = 2 -[thread 734] [info] Default bridge_port_id 7. bridge_port = 2 -[thread 734] [info] Default port_id 8. hw_port = 3 -[thread 734] [info] Default bridge_port_id 9. bridge_port = 3 -[thread 734] [info] Default port_id 10. hw_port = 4 -[thread 734] [info] Default bridge_port_id 11. bridge_port = 4 -[thread 734] [info] Default port_id 12. hw_port = 5 -[thread 734] [info] Default bridge_port_id 13. bridge_port = 5 -[thread 734] [info] Default port_id 14. hw_port = 6 -[thread 734] [info] Default bridge_port_id 15. bridge_port = 6 -[thread 734] [info] Default port_id 16. hw_port = 7 -[thread 734] [info] Default bridge_port_id 17. bridge_port = 7 -[thread 734] [info] Switch init with default configurations done -[thread 736] [info] SAI Adapter Thread Started -[thread 736] [info] pcap started on dev host_port -[thread 736] [info] release pcap lock -[thread 734] [info] Sniffer initialization done -[thread 734] [info] BM connection started on port 9090 -[thread 734] [info] --> new port sai_id = 18, tot port num: 9 diff --git a/bm/sai_adapter/test/unittest/obj/.gitignore b/bm/sai_adapter/test/unittest/obj/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/bm/sai_adapter/test/unittest/run_test.sh b/bm/sai_adapter/test/unittest/run_test.sh deleted file mode 100755 index 8f7e1d4a3..000000000 --- a/bm/sai_adapter/test/unittest/run_test.sh +++ /dev/null @@ -1,3 +0,0 @@ -rm -rf logs/log.txt -# sudo ip netns exec hostif_net ./SaiCppServer -sudo ./unittest \ No newline at end of file diff --git a/bm/sai_adapter/test/unittest/unittest.c b/bm/sai_adapter/test/unittest/unittest.c deleted file mode 100644 index e0b3786f5..000000000 --- a/bm/sai_adapter/test/unittest/unittest.c +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -#include -#include -#include -#include - -const char* test_profile_get_value( - _In_ sai_switch_profile_id_t profile_id, - _In_ const char* variable) -{ - // UNREFERENCED_PARAMETER(profile_id); - - if (!strcmp(variable, "SAI_KEY_INIT_CONFIG_FILE")) { - return "/usr/share/sai_2410.xml"; - } - else if (!strcmp(variable, "KV_DEVICE_MAC_ADDRESS")) { - return "20:03:04:05:06:00"; - } - else if (!strcmp(variable, "SAI_KEY_L3_ROUTE_TABLE_SIZE")) { - //return "1000"; - } - else if (!strcmp(variable, "SAI_KEY_L3_NEIGHBOR_TABLE_SIZE")) { - //return "2000"; - } - - return NULL; -} - -/* Enumerate all the K/V pairs in a profile. -Pointer to NULL passed as variable restarts enumeration. -Function returns 0 if next value exists, -1 at the end of the list. */ -int test_profile_get_next_value( - _In_ sai_switch_profile_id_t profile_id, - _Out_ const char** variable, - _Out_ const char** value) -{ - // UNREFERENCED_PARAMETER(profile_id); - // UNREFERENCED_PARAMETER(variable); - // UNREFERENCED_PARAMETER(value); - - return -1; -} - -const service_method_table_t test_services = { - test_profile_get_value, - test_profile_get_next_value -}; - -/* Enumerate all the K/V pairs in a profile. -Pointer to NULL passed as variable restarts enumeration. -Function returns 0 if next value exists, -1 at the end of the list. */ - -int main(int argc, char **argv) -{ - printf("sai_api sai_api_initialize\n"); - sai_port_api_t* port_api; - - sai_api_initialize(0, &test_services); - printf("sai_api_initialized\n"); - sai_api_query(SAI_API_PORT, (void**)&port_api); - sai_object_id_t port_id; - sai_object_id_t switch_id = 0; - uint32_t attr_count = 0; - sai_attribute_t *attr_list = NULL; - printf("sai_create_port\n"); - sai_status_t status = port_api->create_port(&port_id, switch_id, attr_count, attr_list); - printf("port_created\n"); - sai_api_uninitialize(); - printf("sai_api_uninitialized\n"); -}