L2TP configuration

Overview

Definition of TAPI to configure L2TP. More…

// typedefs

typedef struct l2tp_ipaddr_range l2tp_ipaddr_range;
typedef struct l2tp_ppp_secret l2tp_ppp_secret;
typedef struct l2tp_auth l2tp_auth;

// enums

enum l2tp_auth_policy;
enum l2tp_auth_prot;
enum l2tp_bit;
enum l2tp_iprange_class;
enum l2tp_policy;

// structs

struct l2tp_auth;
struct l2tp_ipaddr_range;
struct l2tp_ppp_secret;

// global functions

te_errno tapi_cfg_l2tp_server_set(const char* ta, int status);
te_errno tapi_cfg_l2tp_server_get(const char* ta, int* status);
te_errno tapi_cfg_l2tp_lns_add(const char* ta, const char* lns);
te_errno tapi_cfg_l2tp_tunnel_ip_get(const char* ta, const char* lns, struct sockaddr** addr);
te_errno tapi_cfg_l2tp_tunnel_ip_set(const char* ta, const char* lns, const struct sockaddr* addr);
te_errno tapi_cfg_l2tp_listen_ip_get(const char* ta, struct sockaddr** addr);
te_errno tapi_cfg_l2tp_listen_ip_set(const char* ta, const struct sockaddr* addr);
te_errno tapi_cfg_l2tp_port_get(const char* ta, int* port);
te_errno tapi_cfg_l2tp_port_set(const char* ta, int port);
te_errno tapi_cfg_l2tp_lns_range_add(const char* ta, const char* lns, const l2tp_ipaddr_range* iprange, enum l2tp_iprange_class kind);
te_errno tapi_cfg_l2tp_lns_range_del(const char* ta, const char* lns, const l2tp_ipaddr_range* iprange, enum l2tp_iprange_class kind);
te_errno tapi_cfg_l2tp_lns_connected_get(const char* ta, const char* lns, struct sockaddr*** connected);
te_errno tapi_cfg_l2tp_lns_bit_add(const char* ta, const char* lns, enum l2tp_bit bit, te_bool value);
te_errno tapi_cfg_l2tp_lns_bit_del(const char* ta, const char* lns, enum l2tp_bit* bit);
te_errno tapi_cfg_l2tp_lns_bit_get(const char* ta, const char* lns, enum l2tp_bit* bit_name, char* selector);
te_errno tapi_cfg_l2tp_lns_add_auth(const char* ta, const char* lns, l2tp_auth param, te_bool value);
te_errno tapi_cfg_l2tp_lns_del_auth(const char* ta, const char* lns, l2tp_auth param);
te_errno tapi_cfg_l2tp_lns_secret_add(const char* ta, const char* lns, const l2tp_ppp_secret* secret);
te_errno tapi_cfg_l2tp_lns_secret_delete(const char* ta, const char* lns, const l2tp_ppp_secret* secret);
te_errno tapi_cfg_l2tp_lns_set_use_challenge(const char* ta, const char* lns, te_bool value);
te_errno tapi_cfg_l2tp_lns_get_use_challenge(const char* ta, const char* lns, te_bool* value);
te_errno tapi_cfg_l2tp_lns_set_unix_auth(const char* ta, const char* lns, te_bool value);
te_errno tapi_cfg_l2tp_lns_get_unix_auth(const char* ta, const char* lns, te_bool* value);
te_errno tapi_cfg_l2tp_lns_mtu_set(const char* ta, const char* lns, int value);
te_errno tapi_cfg_l2tp_lns_mtu_get(const char* ta, const char* lns, int* value);
te_errno tapi_cfg_l2tp_lns_mru_set(const char* ta, const char* lns, int value);
te_errno tapi_cfg_l2tp_lns_mru_get(const char* ta, const char* lns, int* value);
te_errno tapi_cfg_l2tp_lns_lcp_echo_failure_set(const char* ta, const char* lns, int value);
te_errno tapi_cfg_l2tp_lns_lcp_echo_failure_get(const char* ta, const char* lns, int* value);
te_errno tapi_cfg_l2tp_lns_lcp_echo_interval_set(const char* ta, const char* lns, int value);
te_errno tapi_cfg_l2tp_lns_lcp_echo_interval_get(const char* ta, const char* lns, int* value);
te_errno tapi_cfg_l2tp_lns_pppopt_add(const char* ta, const char* lns, const char* pparam);
te_errno tapi_cfg_l2tp_lns_pppopt_del(const char* ta, const char* lns, const char* pparam);

Detailed Documentation

Definition of TAPI to configure L2TP.

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

Typedefs

typedef struct l2tp_ipaddr_range l2tp_ipaddr_range

Structure for the IP-address pool

typedef struct l2tp_ppp_secret l2tp_ppp_secret

CHAP|PAP secret structure

typedef struct l2tp_auth l2tp_auth

Structure for desired authentication

Global Functions

te_errno tapi_cfg_l2tp_server_set(const char* ta, int status)

Set a l2tp server status.

Parameters:

ta

Test Agent.

status

Status: 1 to start, 0 to stop l2tp server.

Returns:

Status code

te_errno tapi_cfg_l2tp_server_get(const char* ta, int* status)

Get a l2tp server status.

Parameters:

ta

Test Agent.

status

Status.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_add(const char* ta, const char* lns)

Add LNS.

Delete LNS.

Parameters:

ta

Test Agent.

lns

LNS name to add.

ta

Test Agent.

lns

Name of LNS to delete.

Returns:

Status code

Status code

te_errno tapi_cfg_l2tp_tunnel_ip_get(const char* ta, const char* lns, struct sockaddr** addr)

Get tunnel IP address.

Parameters:

ta

Test Agent.

lns

Name of LNS.

addr

Current tunnel IP address.

Returns:

Status code

te_errno tapi_cfg_l2tp_tunnel_ip_set(const char* ta, const char* lns, const struct sockaddr* addr)

Set tunnel IP address.

Parameters:

ta

Test Agent.

lns

Name of LNS.

addr

Tunnel IP address to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_listen_ip_get(const char* ta, struct sockaddr** addr)

Get global listen IP address.

Parameters:

ta

Test Agent.

addr

Listen IP address.

Returns:

Status code

te_errno tapi_cfg_l2tp_listen_ip_set(const char* ta, const struct sockaddr* addr)

Set global listen IP address.

Parameters:

ta

Test Agent.

addr

Listen IP address to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_port_get(const char* ta, int* port)

Get a global port.

Parameters:

ta

Test Agent.

port

Port.

Returns:

Status code

te_errno tapi_cfg_l2tp_port_set(const char* ta, int port)

Set a global port.

Parameters:

ta

Test Agent.

port

Port to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_range_add(const char* ta, const char* lns, const l2tp_ipaddr_range* iprange, enum l2tp_iprange_class kind)

Add ip range to the configuration.

Parameters:

ta

Test Agent.

lns

The name of the section to modify.

iprange

IP address pool.

kind

The class of the added ip range IP|LAC.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_range_del(const char* ta, const char* lns, const l2tp_ipaddr_range* iprange, enum l2tp_iprange_class kind)

Delete specified ip range from the configuration.

Parameters:

ta

Test Agent.

lns

The name of the section to modify.

iprange

IP address pool.

kind

The class of the removed ip range IP|LAC.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_connected_get(const char* ta, const char* lns, struct sockaddr*** connected)

Get the list of connected clients.

Parameters:

ta

Test Agent.

lns

The name of the section.

connected

The connected ip addresses (array of pointers).

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_bit_add(const char* ta, const char* lns, enum l2tp_bit bit, te_bool value)

Add a bit option value for the specified LNS.

Parameters:

ta

Test Agent.

lns

The name of the section.

bit

Desired bit option to change.

value

Bit value.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_bit_del(const char* ta, const char* lns, enum l2tp_bit* bit)

Delete the bit option value of the specified LNS.

Parameters:

ta

Test Agent.

lns

The name of the section.

bit

Desired bit option to delete.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_bit_get(const char* ta, const char* lns, enum l2tp_bit* bit_name, char* selector)

Get the bit parameter’s value for the specified LNS.

Parameters:

ta

Test Agent.

lns

The name of the section.

bit_name

Name of the parameter(e.g. hidden, length, flow).

selector

Returned pointer to the current bit parameter value.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_add_auth(const char* ta, const char* lns, l2tp_auth param, te_bool value)

Set the instance value to yes or no for “/auth/refuse|require”.

Parameters:

ta

Test Agent.

lns

The name of the section.

param

Desired authentication.

value

TRUE(1) or FALSE(0).

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_del_auth(const char* ta, const char* lns, l2tp_auth param)

Delete the instance value “/auth/refuse|require”.

Parameters:

ta

Test Agent.

lns

The name of the section.

param

Desired authentication.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_secret_add(const char* ta, const char* lns, const l2tp_ppp_secret* secret)

Add chap|pap secret.

Parameters:

ta

Test Agent.

lns

The name of the section.

secret

Secret to add.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_secret_delete(const char* ta, const char* lns, const l2tp_ppp_secret* secret)

Delete chap|pap secret.

Parameters:

ta

Test Agent.

lns

The name of the section.

secret

Secret to delete.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_set_use_challenge(const char* ta, const char* lns, te_bool value)

Set the instance value to yes or no for “/use_challenge:”.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_get_use_challenge(const char* ta, const char* lns, te_bool* value)

Get the instance value “/use_challenge:”.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value of use challenge.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_set_unix_auth(const char* ta, const char* lns, te_bool value)

Set the instance value to yes or no for “/unix_auth:”.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_get_unix_auth(const char* ta, const char* lns, te_bool* value)

Get the instance value “/unix_auth:”.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value of auth.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_mtu_set(const char* ta, const char* lns, int value)

Set MTU size.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_mtu_get(const char* ta, const char* lns, int* value)

Get MTU size.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value of MTU.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_mru_set(const char* ta, const char* lns, int value)

Set MRU size.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_mru_get(const char* ta, const char* lns, int* value)

Get MRU size.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value of MRU.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_lcp_echo_failure_set(const char* ta, const char* lns, int value)

Set lcp-echo-failure.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_lcp_echo_failure_get(const char* ta, const char* lns, int* value)

Get lcp-echo-failure.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

lcp-echo-failure value.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_lcp_echo_interval_set(const char* ta, const char* lns, int value)

Set lcp-echo-interval.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

Value to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_lcp_echo_interval_get(const char* ta, const char* lns, int* value)

Get lcp-echo-interval.

Parameters:

ta

Test Agent.

lns

The name of the section.

value

lcp-echo-interval value.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_pppopt_add(const char* ta, const char* lns, const char* pparam)

Add an option to pppd.

Parameters:

ta

Test Agent.

lns

The name of the section.

opt

Option to set.

Returns:

Status code

te_errno tapi_cfg_l2tp_lns_pppopt_del(const char* ta, const char* lns, const char* pparam)

Delete an option from pppd.

Parameters:

ta

Test Agent.

lns

The name of the section.

opt

Option to delete.

Returns:

Status code