Command Handler: Traffic Application Domain (TAD) support

Overview

A set of functions exported by a Test Agent to support TAD. More…

// typedefs

typedef enum rcf_ch_trrecv_flags rcf_ch_trrecv_flags;

// enums

enum rcf_ch_trrecv_flags;

// global functions

te_errno rcf_ch_tad_init(void);
te_errno rcf_ch_tad_shutdown(void);
int rcf_ch_csap_create(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, const char* stack, const char* params);
int rcf_ch_csap_destroy(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap);
int rcf_ch_csap_param(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap, const char* param);
int rcf_ch_trsend_start(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, csap_handle_t csap, bool postponed);
int rcf_ch_trsend_stop(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap);
int rcf_ch_trrecv_start(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, csap_handle_t csap, unsigned int num, unsigned int timeout, unsigned int flags);
int rcf_ch_trrecv_stop(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap);
int rcf_ch_trrecv_get(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap);
int rcf_ch_trrecv_wait(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap);
int rcf_ch_trsend_recv(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, csap_handle_t csap, unsigned int timeout, unsigned int flags);
int rcf_ch_trpoll(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap, unsigned int timeout);
int rcf_ch_trpoll_cancel(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap, unsigned int poll_id);

Detailed Documentation

A set of functions exported by a Test Agent to support TAD. The only supported version of TAD available at lib/tad, so Test Agent code located under agents/[agent type] should not care about this interface.

Typedefs

typedef enum rcf_ch_trrecv_flags rcf_ch_trrecv_flags

Traffic receive mode flags

Global Functions

te_errno rcf_ch_tad_init(void)

Initialize RCF TAD (Traffic Application Domain).

Parameters:

TE_ENOSYS

Traffic Application Domain is not supported

Returns:

Status code.

te_errno rcf_ch_tad_shutdown(void)

Shutdown RCF TAD (Traffic Application Domain).

Returns:

Status code.

int rcf_ch_csap_create(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, const char* stack, const char* params)

Create a CSAP (Communication Service Access Point).

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

ba

pointer to location of binary attachment in the command buffer or NULL if no binary attachment is provided

cmdlen

full length of the command including binary attachment

stack

protocol stack identifier

params

parameters passed in the command line or NULL

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_csap_destroy(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap)

Delete the CSAP.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

csap

CSAP handle

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_csap_param(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap, const char* param)

Get CSAP parameter

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be

csap

CSAP handle

param

name of the CSAP-specific parameter

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trsend_start(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, csap_handle_t csap, bool postponed)

“trsend_start” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

ba

pointer to location of binary attachment in the command buffer or NULL if no binary attachment is provided

cmdlen

full length of the command including binary attachment

csap

CSAP handle

postponed

“postponed” flag value

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trsend_stop(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap)

“trsend_stop” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

csap

CSAP handle

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trrecv_start(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, csap_handle_t csap, unsigned int num, unsigned int timeout, unsigned int flags)

“trrecv_start” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

ba

pointer to location of binary attachment in the command buffer or NULL if no binary attachment is provided

cmdlen

full length of the command including binary attachment

csap

CSAP handle

num

number of packets to be sent (0 if number of packets is unlimited)

timeout

maximum duration (in milliseconds) of receiving the traffic

flags

traffic receive flags (see rcf_ch_trrecv_flags)

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trrecv_stop(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap)

“trrecv_stop” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

csap

CSAP handle

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trrecv_get(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap)

“trrecv_get” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

csap

CSAP handle

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trrecv_wait(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap)

“trrecv_wait” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

csap

CSAP handle

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trsend_recv(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, csap_handle_t csap, unsigned int timeout, unsigned int flags)

“trsend_recv” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

ba

pointer to location of binary attachment in the command buffer or NULL if no binary attachment is provided

cmdlen

full length of the command including binary attachment

csap

CSAP handle *

results

“results” flag value

timeout

timeout value in milliseconds (if > 0)

flags

traffic receive flags (see rcf_ch_trrecv_flags)

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trpoll(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap, unsigned int timeout)

“trpoll” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

csap

CSAP handle

timeout

maximum duration (in milliseconds) of poll

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code

int rcf_ch_trpoll_cancel(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, csap_handle_t csap, unsigned int poll_id)

“trpoll_cancel” command handler.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

csap

CSAP handle

poll_id

Poll request ID

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code