struct cli_csap_specific_data


struct cli_csap_specific_data {
    // fields

    int io;
    FILE* fp;
    pid_t expect_pid;
    pid_t session_pid;
    te_bool kernel_like_2_4;
    int data_sock;
    int sync_pipe;
    size_t last_cmd_len;
    cli_conn_type_t conn_type;
    char* program;
    char* device;
    char* host;
    unsigned short port;
    char* shell_args;
    char* user;
    char* password;
    uint32_t status;
    cli_csap_prompts_t init_prompts;
    cli_csap_prompts_t cur_prompts;
    struct exp_case prompts[CLI_MAX_PROMPTS];
    int read_timeout;

Detailed Documentation


int io

file descriptor of CLI session stdin and stdout

FILE* fp

file descriptor of CLI session stdin and stdout

pid_t expect_pid

Expect process ID

pid_t session_pid

CLI session process ID

te_bool kernel_like_2_4

Wheter we are working with 2.4 kernel or not

int data_sock

Endpoint for communication with peer:

  • on CSAP Engine: Used for sending commands and for reading command results,

  • on Expect side: For reading commands and for sending command results

int sync_pipe

Used for sync mesages sent from Expect side to CSAP Engine.

size_t last_cmd_len

The length of the last command run

cli_conn_type_t conn_type

CLI protocol type

char* program

Default program to start (millicom, telnet, ssh or sh)

char* device

Default device (NULL if not defined)

char* host

Default remote host (NULL if not defined)

unsigned short port

remote host port

char* shell_args

Shell CLI session arguments (NULL if not defined)

char* user

Default user account (NULL if not defined)

char* password

Default user password (NULL if not defined)

uint32_t status

Status bits of the CSAP

cli_csap_prompts_t init_prompts

A set of prompts found on init. These values are used for any ‘send’ operation that does not have prompt information in its PDU.

cli_csap_prompts_t cur_prompts

A set of prompts to be used in current waiting for response action. The value is copied from init_prompts and then particular prompts are overwritten with values kept in packet PDU (if specified).

struct exp_case prompts[CLI_MAX_PROMPTS]

An array of prompts passed to Expect library. This value is a converted form of cur_prompts field suitable for Expect library.

int read_timeout

Number of second to wait for data