IP rules configuration

Overview

Copyright (C) 2004-2022 OKTET Labs Ltd. More…

// typedefs

typedef struct tapi_rt_ip_rule_entry tapi_rt_ip_rule_entry;

// structs

struct tapi_rt_ip_rule_entry;

// global functions

te_errno tapi_cfg_get_rule_table(const char* ta, int addr_family, tapi_rt_ip_rule_entry** tbl, unsigned int* n);
te_errno tapi_cfg_add_rule(const char* ta, int addr_family, te_conf_ip_rule* ip_rule);
te_errno tapi_cfg_del_rule(const char* ta, int addr_family, uint32_t required, te_conf_ip_rule* ip_rule);

Detailed Documentation

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

Typedefs

typedef struct tapi_rt_ip_rule_entry tapi_rt_ip_rule_entry

Entry to keep ip rule data

Global Functions

te_errno tapi_cfg_get_rule_table(const char* ta, int addr_family, tapi_rt_ip_rule_entry** tbl, unsigned int* n)

Get routing policy database by the specified Test Agent

Function allocates memory with malloc(), which should be free by the caller.

Parameters:

ta

Test Agent name

addr_family

Address family of the rules (AF_INET)

tbl

Pointer to the routing policy database

n

The number of entries in the tbl

Returns:

Status code

te_errno tapi_cfg_add_rule(const char* ta, int addr_family, te_conf_ip_rule* ip_rule)

Add new rule into routing policy database

Parameters:

ta

Test Agent name

addr_family

Address family of the rules (AF_INET)

ip_rule

Rule for adding

Returns:

Status code

te_errno tapi_cfg_del_rule(const char* ta, int addr_family, uint32_t required, te_conf_ip_rule* ip_rule)

Delete the first existing rule from routing policy database

Parameters:

ta

Test Agent name

addr_family

Address family of the rules (AF_INET)

required

Required fields for a rule search

ip_rule

Data to find and delete rule

Returns:

Status code