Test API to use packetdrill test tool

Overview

Generic API to use packetdrill test tool. More…

// typedefs

typedef struct tapi_packetdrill_opts tapi_packetdrill_opts;
typedef struct tapi_packetdrill_app tapi_packetdrill_app;

// enums

enum tapi_packetdrill_ip_version_t;

// structs

struct tapi_packetdrill_opts;

// global functions

te_errno tapi_packetdrill_app_init(tapi_job_factory_t* factory, tapi_packetdrill_opts* opts, tapi_packetdrill_app** app);
void tapi_packetdrill_app_destroy(tapi_packetdrill_app* app);
te_errno tapi_packetdrill_app_start(tapi_packetdrill_app* app);
te_errno tapi_packetdrill_app_wait(tapi_packetdrill_app* app, int timeout_s);
void tapi_packetdrill_print_logs(tapi_packetdrill_app* app);

// macros

#define IF_NAMESIZE

Detailed Documentation

Generic API to use packetdrill test tool.

Copyright (C) 2018-2022 OKTET Labs Ltd. All rights reserved.

Typedefs

typedef struct tapi_packetdrill_opts tapi_packetdrill_opts

Packetdrill test tool options

typedef struct tapi_packetdrill_app tapi_packetdrill_app

Packetdrill test tool context

Global Functions

te_errno tapi_packetdrill_app_init(tapi_job_factory_t* factory, tapi_packetdrill_opts* opts, tapi_packetdrill_app** app)

Initiate packetdrill app.

Parameters:

factory

Job factory.

opts

Packetdrill options.

app

The application handle.

Returns:

Status code.

See also:

tapi_packetdrill_app_destroy

void tapi_packetdrill_app_destroy(tapi_packetdrill_app* app)

Destroy packetdrill app.

Parameters:

app

Packetdrill app context.

See also:

tapi_packetdrill_app_init

te_errno tapi_packetdrill_app_start(tapi_packetdrill_app* app)

Start packetdrill app

Parameters:

app

Packetdrill app context.

Returns:

Status code.

See also:

tapi_packetdrill_app_stop

te_errno tapi_packetdrill_app_wait(tapi_packetdrill_app* app, int timeout_s)

Wait while packetdrill client-specific app finishes its work. Note, function jumps to cleanup if timeout is expired.

Parameters:

app

Packetdrill app context.

timeout_s

Time to wait for app results It MUST be big enough to finish client normally.

Returns:

Status code.

void tapi_packetdrill_print_logs(tapi_packetdrill_app* app)

Print logs. The function reads packetdrill app output (stdout, stderr).

This function makes sense only with client-specific app.

Parameters:

app

Packetdrill app context.