DHCP Server configuration

Overview

// global functions

int tapi_cfg_dhcps_add_subnet(const char* ta, const struct sockaddr* subnet, int prefix_len, cfg_handle* handle);
int tapi_cfg_dhcps_add_host(const char* ta, const char* name, const char* group, const struct sockaddr* chaddr, const void* client_id, int client_id_len, const struct sockaddr* fixed_ip, const char* next_server, const char* filename, const char* flags, cfg_handle* handle);
int tapi_cfg_dhcps_add_host_gen(const char* ta, const char* name, const char* group, const struct sockaddr* chaddr, const void* client_id, int client_id_len, const struct sockaddr* fixed_ip, const char* next_server, const char* filename, const char* flags, const void* host_id, int host_id_len, const char* prefix6, cfg_handle* handle);

Detailed Documentation

Global Functions

int tapi_cfg_dhcps_add_subnet(const char* ta, const struct sockaddr* subnet, int prefix_len, cfg_handle* handle)

Add subnet declaration in DHCP server on the Test Agent.

Parameters:

ta

Test Agent

subnet

Subnet address

prefix_len

Subnet prefix length

handle

Location for handle of the created instance or NULL

Returns:

Status code

int tapi_cfg_dhcps_add_host(const char* ta, const char* name, const char* group, const struct sockaddr* chaddr, const void* client_id, int client_id_len, const struct sockaddr* fixed_ip, const char* next_server, const char* filename, const char* flags, cfg_handle* handle)

Add host definition in DHCP server on the Test Agent.

In the case of failure, configuration changes are not rolled back. It is assumed that test fails and configuration backup will be restored.

Ideally the function must used local set operations and, then, commit. However, it does not work :(

Parameters:

ta

Test Agent

name

Name of the host for human or NULL (unique name will be generated by TAPI)

group

Name of the group the host belongs to or NULL

chaddr

Hardware address

client_id

Client identifier or NULL

client_id_len

Client identifier length if ID is in binary format or -1 if ID is a string

fixed_ip

Fixed IP address or NULL

next_server

Next server or NULL

filename

File name or NULL

flags

Flags for Solaris ‘dhcp’ server lease type (bootp)

handle

Location for handle of the created instance or NULL

Returns:

Status code

int tapi_cfg_dhcps_add_host_gen(const char* ta, const char* name, const char* group, const struct sockaddr* chaddr, const void* client_id, int client_id_len, const struct sockaddr* fixed_ip, const char* next_server, const char* filename, const char* flags, const void* host_id, int host_id_len, const char* prefix6, cfg_handle* handle)

Add host definition in DHCP server on the Test Agent, host identifier and prefix delegation are supported.

In the case of failure, configuration changes are not rolled back. It is assumed that test fails and configuration backup will be restored.

Ideally the function must used local set operations and, then, commit. However, it does not work :(

Parameters:

ta

Test Agent

name

Name of the host for human or NULL (unique name will be generated by TAPI)

group

Name of the group the host belongs to or NULL

chaddr

Hardware address

client_id

Client identifier or NULL

client_id_len

Client identifier length if ID is in binary format or -1 if ID is a string

fixed_ip

Fixed IP address or NULL

next_server

Next server or NULL

filename

File name or NULL

flags

Flags for Solaris ‘dhcp’ server lease type (bootp)

host_id

DHCPv6 host identifier or NULL

host_id_len

Host identifier length if ID is in binary format or -1 if ID is a string

prefix6

DHCPv6 prefix delegation in string format or NULL

handle

Location for handle of the created instance or NULL

Returns:

Status code