:orphan: .. index:: pair: group; TAPI definitions for testing TCP states .. _doxid-group__tapi__tcp__states__def: TAPI definitions for testing TCP states ======================================= .. toctree:: :hidden: enum_tsa_flags.rst enum_tsa_tst_type.rst struct_tcp_move_action.rst struct_tsa_config.rst struct_tsa_handlers.rst struct_tsa_packets_counter.rst struct_tsa_session.rst struct_tsa_state.rst struct_tsa_state_csap.rst struct_tsa_state_sock.rst Overview ~~~~~~~~ TCP states API library - public declarations of API used to achieve a requested TCP socket state following specified sequence of TCP states. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef enum :ref:`tsa_tst_type` :ref:`tsa_tst_type`; typedef enum :ref:`tsa_flags` :ref:`tsa_flags`; typedef struct :ref:`tsa_config` :ref:`tsa_config`; typedef struct :ref:`tsa_state_sock` :ref:`tsa_state_sock`; typedef struct :ref:`tsa_state_csap` :ref:`tsa_state_csap`; typedef :ref:`te_errno` (*:ref:`tsa_handler`)(struct tsa_session *ss); typedef struct :ref:`tsa_handlers` :ref:`tsa_handlers`; typedef struct :ref:`tsa_state` :ref:`tsa_state`; typedef struct :ref:`tsa_session` :target:`tsa_session`; typedef struct :ref:`tcp_move_action` :ref:`tcp_move_action`; typedef struct :ref:`tsa_packets_counter` :ref:`tsa_packets_counter`; // enums enum :ref:`tsa_flags`; enum :ref:`tsa_tst_type`; // structs struct :ref:`tcp_move_action`; struct :ref:`tsa_config`; struct :ref:`tsa_handlers`; struct :ref:`tsa_packets_counter`; struct :ref:`tsa_session`; struct :ref:`tsa_state`; struct :ref:`tsa_state_csap`; struct :ref:`tsa_state_sock`; // global functions static int :ref:`tsa_iut_sock`(:ref:`tsa_session`* ss); static int :ref:`tsa_tst_sock`(:ref:`tsa_session`* ss); static :ref:`rpc_tcp_state` :ref:`tsa_state_cur`(:ref:`tsa_session`* ss); static void :ref:`tsa_state_cur_set`(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` state); static :ref:`rpc_tcp_state` :ref:`tsa_state_to`(:ref:`tsa_session`* ss); static :ref:`rpc_tcp_state` :ref:`tsa_state_from`(:ref:`tsa_session`* ss); static const char* :ref:`tsa_rem_path`(:ref:`tsa_session`* ss); static bool :ref:`tsa_timeout_used`(:ref:`tsa_session`* ss); static int :ref:`tsa_elapsed_time`(:ref:`tsa_session`* ss); :ref:`te_errno` :ref:`tsa_state_init`(:ref:`tsa_session`* ss, :ref:`tsa_tst_type` tst_type); :ref:`te_errno` :ref:`tsa_iut_set`(:ref:`tsa_session`* ss, :ref:`rcf_rpc_server`* pco_iut, const struct if_nameindex* iut_if, const struct sockaddr* iut_addr); :ref:`te_errno` :ref:`tsa_tst_set`(:ref:`tsa_session`* ss, :ref:`rcf_rpc_server`* pco_tst, const struct if_nameindex* tst_if, const struct sockaddr* tst_addr, const void* fake_link_addr); :ref:`te_errno` :ref:`tsa_gw_set`(:ref:`tsa_session`* ss, :ref:`rcf_rpc_server`* pco_gw, const struct sockaddr* gw_iut_addr, const struct sockaddr* gw_tst_addr, const struct if_nameindex* gw_iut_if, const struct if_nameindex* gw_tst_if, const void* alien_link_addr); void :ref:`tsa_gw_preconf`(:ref:`tsa_session`* ss, bool preconfigured); :ref:`te_errno` :ref:`tsa_break_tst_iut_conn`(:ref:`tsa_session`* ss); :ref:`te_errno` :ref:`tsa_break_iut_tst_conn`(:ref:`tsa_session`* ss); :ref:`te_errno` :ref:`tsa_repair_tst_iut_conn`(:ref:`tsa_session`* ss); :ref:`te_errno` :ref:`tsa_repair_iut_tst_conn`(:ref:`tsa_session`* ss); :ref:`te_errno` :ref:`tsa_do_tcp_move`(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` state_from, :ref:`rpc_tcp_state` state_to, uint32_t flags); :ref:`te_errno` :ref:`tsa_do_moves`(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` stop_state, uint32_t flags, ...); :ref:`te_errno` :ref:`tsa_do_moves_str`(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` init_state, :ref:`rpc_tcp_state` stop_state, uint32_t flags, const char* s); :ref:`te_errno` :ref:`tsa_create_session`(:ref:`tsa_session`* ss, uint32_t flags); :ref:`te_errno` :ref:`tsa_destroy_session`(:ref:`tsa_session`* ss); :ref:`te_errno` :ref:`tsa_set_start_tcp_state`(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` state, :ref:`rpc_tcp_state` stop_state, uint32_t flags); :ref:`te_errno` :ref:`tsa_update_cur_state`(:ref:`tsa_session`* ss); :ref:`te_errno` :ref:`tsa_tst_send_rst`(:ref:`tsa_session`* ss); void :ref:`tsa_packet_handler`(const char* packet, void* user_param); void :ref:`tsa_print_packet_stats`(:ref:`tsa_packets_counter`* ctx); // macros #define :ref:`TEST_GET_TSA_TST_TYPE_PARAM`(var_) #define :ref:`TSA_ESTOP` #define :ref:`TSA_SESSION_INITIALIZER` .. _details-group__tapi__tcp__states__def: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ TCP states API library - public declarations of API used to achieve a requested TCP socket state following specified sequence of TCP states. Copyright (C) 2004-2022 OKTET Labs Ltd. All rights reserved. Typedefs -------- .. index:: pair: typedef; tsa_tst_type .. _doxid-group__tapi__tcp__states__def_1gafd34e601f440944c9996bb2007c69e0a: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tsa_tst_type` tsa_tst_type What should be used on tester side: .. index:: pair: typedef; tsa_flags .. _doxid-group__tapi__tcp__states__def_1ga9328120581e1840f294a6c271df219c4: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tsa_flags` tsa_flags Flags used by various functions in library .. index:: pair: typedef; tsa_config .. _doxid-group__tapi__tcp__states__def_1ga79b1e335896ca2c19e24807e800bc3c3: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tsa_config` tsa_config Environment configuration for current working session with TSA .. index:: pair: typedef; tsa_state_sock .. _doxid-group__tapi__tcp__states__def_1ga6fa1ab0d5b58f69817c975c5ce91399b: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tsa_state_sock` tsa_state_sock Structure describing variables used in ``TSA_TST_SOCKET`` mode .. index:: pair: typedef; tsa_state_csap .. _doxid-group__tapi__tcp__states__def_1gac8315f17971490ba44badbd4910d8c82: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tsa_state_csap` tsa_state_csap Structure describing variables used in TSA_TST_CSAP mode .. index:: pair: typedef; tsa_handler .. _doxid-group__tapi__tcp__states__def_1ga03dc34b67df9f54529f853a1f7e634ca: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef :ref:`te_errno` (*tsa_handler)(struct tsa_session *ss) Type for handler to be called when moving from one TCP state to another one. .. index:: pair: typedef; tsa_handlers .. _doxid-group__tapi__tcp__states__def_1ga3b18404f473a016838208395cb271bab: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tsa_handlers` tsa_handlers Structure containing handlers to be used for moving between TCP states. TSA session state structure .. index:: pair: typedef; tsa_state .. _doxid-group__tapi__tcp__states__def_1ga9ee0aeab001964180c93a0708761b7fb: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tsa_state` tsa_state TSA session variables .. index:: pair: typedef; tcp_move_action .. _doxid-group__tapi__tcp__states__def_1ga66b5637394f5470333d4073667061f18: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tcp_move_action` tcp_move_action Actions must be performed to move from one TCP state to another .. index:: pair: typedef; tsa_packets_counter .. _doxid-group__tapi__tcp__states__def_1ga914db14e09710c0a30f908ed085459bf: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tsa_packets_counter` tsa_packets_counter Context to count packets in processing in the packet handler function. Global Functions ---------------- .. index:: pair: function; tsa_iut_sock .. _doxid-group__tapi__tcp__states__def_1gae02d0584f6527a483f125d4492d66a84: .. ref-code-block:: cpp :class: doxyrest-title-code-block static int tsa_iut_sock(:ref:`tsa_session`* ss) Accessor for IUT socket. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: IUT socket ID .. index:: pair: function; tsa_tst_sock .. _doxid-group__tapi__tcp__states__def_1ga9a35603d9a7584742f8d4ff403fe9bcb: .. ref-code-block:: cpp :class: doxyrest-title-code-block static int tsa_tst_sock(:ref:`tsa_session`* ss) Accessor for TESTER TCP socket (or its CSAP emulator handler if TSA_TST_CSAP mode is used). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: Socket (CSAP handler) or -1 .. index:: pair: function; tsa_state_cur .. _doxid-group__tapi__tcp__states__def_1gae8538e7f94052047074acf93a9367bb3: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`rpc_tcp_state` tsa_state_cur(:ref:`tsa_session`* ss) Accessor for current TCP state of IUT socket. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: Current TCP state of IUT socket .. index:: pair: function; tsa_state_cur_set .. _doxid-group__tapi__tcp__states__def_1ga410e3b64149b88fb918ff6e65023712c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void tsa_state_cur_set(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` state) Setter for current TCP state of IUT socket. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. index:: pair: function; tsa_state_to .. _doxid-group__tapi__tcp__states__def_1ga7d23909a0cafc9916328a81330086a45: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`rpc_tcp_state` tsa_state_to(:ref:`tsa_session`* ss) Accessor for state_to field of :ref:`tsa_state ` structure. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: Value of state_to field of :ref:`tsa_state ` stucture .. index:: pair: function; tsa_state_from .. _doxid-group__tapi__tcp__states__def_1ga2631e22ff93907a97534f0ff174c92ca: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`rpc_tcp_state` tsa_state_from(:ref:`tsa_session`* ss) Accessor for state_from field of :ref:`tsa_state ` structure. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: Value of state_from field of :ref:`tsa_state ` structure. .. index:: pair: function; tsa_rem_path .. _doxid-group__tapi__tcp__states__def_1ga1af658064bbded3e491af0fee46ed256: .. ref-code-block:: cpp :class: doxyrest-title-code-block static const char* tsa_rem_path(:ref:`tsa_session`* ss) Accessor for rem_path field of :ref:`tsa_state ` structure. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: Value of rem_path field of :ref:`tsa_state ` structure .. index:: pair: function; tsa_timeout_used .. _doxid-group__tapi__tcp__states__def_1ga5ba064350c06b26b30048315d2d5af66: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool tsa_timeout_used(:ref:`tsa_session`* ss) Accessor for timeout_used field of :ref:`tsa_state ` structure. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: Value of timeout_used field of :ref:`tsa_state ` structure .. index:: pair: function; tsa_elapsed_time .. _doxid-group__tapi__tcp__states__def_1gab0335cf023f177880b5d6c004fc0bf16: .. ref-code-block:: cpp :class: doxyrest-title-code-block static int tsa_elapsed_time(:ref:`tsa_session`* ss) Accessor for elapsed_time field of :ref:`tsa_state ` structure. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure of current working session .. rubric:: Returns: Value of elapsed_time field of :ref:`tsa_state ` structure .. index:: pair: function; tsa_state_init .. _doxid-group__tapi__tcp__states__def_1ga900fafc922c95fd441defff2fde6ed77: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_state_init(:ref:`tsa_session`* ss, :ref:`tsa_tst_type` tst_type) Initialize :ref:`tsa_session ` structure. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure to be initialized * - tst_type - What should be used on the tester (socket, CSAP) .. rubric:: Returns: Status code. .. index:: pair: function; tsa_iut_set .. _doxid-group__tapi__tcp__states__def_1ga5c2055d56f0240b8b9cdf20238f3cb3b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_iut_set(:ref:`tsa_session`* ss, :ref:`rcf_rpc_server`* pco_iut, const struct if_nameindex* iut_if, const struct sockaddr* iut_addr) Set :ref:`tsa_session ` structure fields related to RPC server on the IUT side. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - pco_iut - RPC server on the IUT side * - iut_if - Network interface on the IUT side * - iut_addr - Network address on the IUT side .. rubric:: Returns: Status code. .. index:: pair: function; tsa_tst_set .. _doxid-group__tapi__tcp__states__def_1ga3b4d0924922d5f7a6d142d2ed9b6063f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_tst_set(:ref:`tsa_session`* ss, :ref:`rcf_rpc_server`* pco_tst, const struct if_nameindex* tst_if, const struct sockaddr* tst_addr, const void* fake_link_addr) Set :ref:`tsa_session ` structure fields related to RPC server on the TST side. Add entries in ARP and routing tables for fake addresses if we use CSAP emulation on the TESTER (CFG_WAIT_CHANGES should be used after call of this function in such a case). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - pco_tst - RPC server on the TST side * - tst_if - Network interface on the TST side * - tst_addr - Network address on the TST side * - fake_link_addr - Fake ethernet address to be used by CSAP (if we use CSAP implementation of TCP socket) .. rubric:: Returns: Status code. .. index:: pair: function; tsa_gw_set .. _doxid-group__tapi__tcp__states__def_1gadc3e55803f99b7436d7ab92b720a67c7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_gw_set(:ref:`tsa_session`* ss, :ref:`rcf_rpc_server`* pco_gw, const struct sockaddr* gw_iut_addr, const struct sockaddr* gw_tst_addr, const struct if_nameindex* gw_iut_if, const struct if_nameindex* gw_tst_if, const void* alien_link_addr) Set :ref:`tsa_session ` structure fields related to gateway; configure routes via gateway. CFG_WAIT_CHANGES should be used after calling this function. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - pco_gw - RPC server on a gateway * - gw_iut_addr - Gateway IUT address * - gw_tst_addr - Gateway TST address * - gw_iut_if - Gateway IUT interface. * - gw_tst_if - Gateway TST interface. * - alien_link_addr - Invalid ethernet address .. rubric:: Returns: Status code. .. index:: pair: function; tsa_gw_preconf .. _doxid-group__tapi__tcp__states__def_1ga0111af6176701714f9bd1835144c28d2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tsa_gw_preconf(:ref:`tsa_session`* ss, bool preconfigured) Specify whether gateway is already configured. It makes sense to call this function only before :ref:`tsa_gw_set() `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - preconfigured - If ``true``, gateway is already configured, :ref:`tsa_gw_set() ` should not try to configure routes or forwarding. .. index:: pair: function; tsa_break_tst_iut_conn .. _doxid-group__tapi__tcp__states__def_1gaa88310d2d2f9a864dc643d3a9f830c56: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_break_tst_iut_conn(:ref:`tsa_session`* ss) Break network connection from ``pco_tst`` to ``pco_iut`` by adding ARP table entry associating IUT IP address with alien MAC address. CFG_WAIT_CHANGES should be used after calling this function. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure .. rubric:: Returns: Status code. .. index:: pair: function; tsa_break_iut_tst_conn .. _doxid-group__tapi__tcp__states__def_1ga1f69d97355b1e725c62eb46fdbb731f8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_break_iut_tst_conn(:ref:`tsa_session`* ss) Break network connection from ``pco_iut`` to ``pco_tst`` by adding ARP table entry associating Tester IP address with alien MAC address. CFG_WAIT_CHANGES should be used after calling this function. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure .. rubric:: Returns: Status code. .. index:: pair: function; tsa_repair_tst_iut_conn .. _doxid-group__tapi__tcp__states__def_1ga4cf772c328f23d54931321d685862b2e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_repair_tst_iut_conn(:ref:`tsa_session`* ss) Repair network connection from ``pco_tst`` to ``pco_iut`` by removing ARP table entry for alien MAC address. CFG_WAIT_CHANGES should be used after calling this function. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure .. rubric:: Returns: Status code. .. index:: pair: function; tsa_repair_iut_tst_conn .. _doxid-group__tapi__tcp__states__def_1gac1361613e15b201566c03bff001983f9: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_repair_iut_tst_conn(:ref:`tsa_session`* ss) Repair network connection from ``pco_iut`` to ``pco_tst`` by removing ARP table entry for alien MAC address. CFG_WAIT_CHANGES should be used after calling this function. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure .. rubric:: Returns: Status code. .. index:: pair: function; tsa_do_tcp_move .. _doxid-group__tapi__tcp__states__def_1ga446dccab8ee2b79fbe8e740f33b95dad: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_do_tcp_move(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` state_from, :ref:`rpc_tcp_state` state_to, uint32_t flags) Move from one TCP state to another one. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - state_from - Initial TCP state * - state_to - TCP state to move to * - flags - Flags defined in tsa_flags enum .. rubric:: Returns: Status code. .. index:: pair: function; tsa_do_moves .. _doxid-group__tapi__tcp__states__def_1gac34c52e94b29e6e361db65f33a82bad2: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_do_moves(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` stop_state, uint32_t flags, ...) Perform a given sequence of TCP state transitions. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - stop_state - TCP state where to stop (it's useful when we want to perform some actions in some interjacent state and then resume transition) * - flags - Flags defined in tsa_flags enum * - ... - List of TCP states in transition sequence (it should be terminated by RPC_TCP_UNKNOWN) .. rubric:: Returns: Non-negative status code or TSA_ESTOP if function stopped in specificed state. .. index:: pair: function; tsa_do_moves_str .. _doxid-group__tapi__tcp__states__def_1ga2596e97a37da6fc2ee5458b2b97cceb1: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_do_moves_str(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` init_state, :ref:`rpc_tcp_state` stop_state, uint32_t flags, const char* s) Perform a given sequence of TCP state transitions (like **tsa_do_moves** but the sequence is given as a string). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - init_state - TCP state to be considered as initial in search for the first transition actions (it is useful when we work with TCP_LISTEN -> TCP_SYN_RECV -> TCP_ESTABLISHED because TCP_SYN_RECV is not observable in this case) * - stop_state - TCP state where to stop (it's useful when we want to perform some actions in some interjacent state and then resume transition) * - flags - Flags defined in tsa_flags enum * - s - String containing the sequence of TCP states. For example, "TCP_CLOSE -> TCP_SYN_SENT -> timeout -> TCP_CLOSE". TCP states can be separated by spaces, '-', '>', ';', ':', ',' (including any combinations of these symbols). .. rubric:: Returns: Non-negative status code or TSA_ESTOP if function stopped in specificed state. .. index:: pair: function; tsa_create_session .. _doxid-group__tapi__tcp__states__def_1ga112ea2149a0b7098b1a2b92378f23679: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_create_session(:ref:`tsa_session`* ss, uint32_t flags) Create IUT socket and TESTER socket or CSAP emulation (according to working mode determined by ``tst_type`` during initialization), set socket options if needed, bind() socket(s). Cleanup should be done by :ref:`tsa_destroy_session() ` call. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - flags - Flags (described above in tsa_flags enum) .. rubric:: Returns: Status code. .. index:: pair: function; tsa_destroy_session .. _doxid-group__tapi__tcp__states__def_1ga89edeca462df2cc3657847a9d1a33664: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_destroy_session(:ref:`tsa_session`* ss) Perform cleanup on TSA library context. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure .. rubric:: Returns: Status code. .. index:: pair: function; tsa_set_start_tcp_state .. _doxid-group__tapi__tcp__states__def_1ga960097393cb9f1567373f0d234d08300: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_set_start_tcp_state(:ref:`tsa_session`* ss, :ref:`rpc_tcp_state` state, :ref:`rpc_tcp_state` stop_state, uint32_t flags) Move from TCP_CLOSE state to another state using correspoding pre-defined path. Pre-defined path is just sequence of TCP states from TCP_CLOSE to a given state which is defined in tcp_state.c and is used by default. There is only two pre-defined paths for any TCP state - path using active opening of TCP connection and path using passive one (for some paths these make no sense and two paths are defined for simplicity of related functions). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure * - state - TCP state to be achieved * - stop_state - TCP state where to stop (it's useful when we want to perform some actions in some interjacent state and then resume transition) * - flags - Flags defined in tsa_flags enum .. rubric:: Returns: Status code. .. index:: pair: function; tsa_update_cur_state .. _doxid-group__tapi__tcp__states__def_1ga36fb27ca8098f8a3ee4553f0114edc72: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_update_cur_state(:ref:`tsa_session`* ss) Update current TCP state of IUT socket. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure .. rubric:: Returns: Status code. .. index:: pair: function; tsa_tst_send_rst .. _doxid-group__tapi__tcp__states__def_1ga635bc1674dbef5244d5fcf8b4b34d39f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tsa_tst_send_rst(:ref:`tsa_session`* ss) Send RST from TESTER to IUT. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ss - Pointer to TSA session structure .. rubric:: Returns: Status code. .. index:: pair: function; tsa_packet_handler .. _doxid-group__tapi__tcp__states__def_1ga71d32283b713274f0cca3f8ca98a6513: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tsa_packet_handler(const char* packet, void* user_param) Packet handler callback function. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - packet - Packet handler * - user_param - Packet context as opaque argument .. index:: pair: function; tsa_print_packet_stats .. _doxid-group__tapi__tcp__states__def_1ga490e75fea17bb8dcf255c929618c87c2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tsa_print_packet_stats(:ref:`tsa_packets_counter`* ctx) Print captured packets stats. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ctx - Packets stats struct Macros ------ .. index:: pair: define; TEST_GET_TSA_TST_TYPE_PARAM .. _doxid-group__tapi__tcp__states__def_1ga0732eb4aec06bea5ddf32142d6e0c56a: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TEST_GET_TSA_TST_TYPE_PARAM(var_) Get tsa_tst_type parameter determining whether we use socket or CSAP emulation of TCP socket on the TESTER. .. index:: pair: define; TSA_ESTOP .. _doxid-group__tapi__tcp__states__def_1ga93130a414f6ba3363ac72061021aefff: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TSA_ESTOP Value returned when function stopped transition in specified state, before reaching end state in sequence. .. index:: pair: define; TSA_SESSION_INITIALIZER .. _doxid-group__tapi__tcp__states__def_1ga7b31e1aba522c2aa1d14672abb4511f7: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TSA_SESSION_INITIALIZER Initializer for :ref:`tsa_session ` structure.