DNS zone file generation tool TAPI

Overview

(tapi_dns_zone_file). More…

// typedefs

typedef enum tapi_dns_zone_file_rr_type tapi_dns_zone_file_rr_type;
typedef enum tapi_dns_zone_file_rr_class tapi_dns_zone_file_rr_class;
typedef struct tapi_dns_zone_file_rr_a tapi_dns_zone_file_rr_a;
typedef struct tapi_dns_zone_file_rr_soa tapi_dns_zone_file_rr_soa;
typedef struct tapi_dns_zone_file_rr_ns tapi_dns_zone_file_rr_ns;
typedef struct tapi_dns_zone_file_rr_data tapi_dns_zone_file_rr_data;
typedef struct tapi_dns_zone_file_rr tapi_dns_zone_file_rr;

// enums

enum tapi_dns_zone_file_rr_class;
enum tapi_dns_zone_file_rr_type;

// structs

struct tapi_dns_zone_file_rr;
struct tapi_dns_zone_file_rr_a;
struct tapi_dns_zone_file_rr_data;
struct tapi_dns_zone_file_rr_ns;
struct tapi_dns_zone_file_rr_soa;

// global functions

te_errno tapi_dns_zone_file_create(const char* ta, tapi_dns_zone_file_rr* resource_records, size_t resource_records_n, const char* base_dir, const char* pathname, char** result_pathname);
te_errno tapi_dns_zone_file_destroy(const char* ta, const char* pathname);

Detailed Documentation

(tapi_dns_zone_file).

TAPI to handle DNS zone file generation tool.

Typedefs

typedef enum tapi_dns_zone_file_rr_type tapi_dns_zone_file_rr_type

Possible types of resource record in zone file.

typedef enum tapi_dns_zone_file_rr_class tapi_dns_zone_file_rr_class

Possible classes of resource record in zone file.

typedef struct tapi_dns_zone_file_rr_a tapi_dns_zone_file_rr_a

Describe RDATA field of resource record of A type.

At the moment, only the IN class is supported.

typedef struct tapi_dns_zone_file_rr_soa tapi_dns_zone_file_rr_soa

Describe RDATA field of resource record of SOA type.

typedef struct tapi_dns_zone_file_rr_ns tapi_dns_zone_file_rr_ns

Describe RDATA field of resource record of NS type.

typedef struct tapi_dns_zone_file_rr_data tapi_dns_zone_file_rr_data

Describe pair of TYPE and corresponding RDATA fields of resource record.

typedef struct tapi_dns_zone_file_rr tapi_dns_zone_file_rr

Analog of resource record in zone file.

Global Functions

te_errno tapi_dns_zone_file_create(const char* ta, tapi_dns_zone_file_rr* resource_records, size_t resource_records_n, const char* base_dir, const char* pathname, char** result_pathname)

Generate zone file for DNS server.

Parameters:

ta

Test Agent name.

resource_records

Array of resource records.

resource_records_n

Number of resource records.

base_dir

Path to directory where the file will be generated. If NULL, the default base directory will be used.

pathname

Path to the config file. If NULL, the file name will be randomly generated. If not an absolute path, base_dir will be used.

result_pathname

Resulting path to the file. Maybe NULL.

Returns:

Status code.

te_errno tapi_dns_zone_file_destroy(const char* ta, const char* pathname)

Destroy zone file for DNS server.

Parameters:

ta

Test Agent name.

pathname

Path to zone file.

Returns:

Status code.