OpenDNSSEC-signer  1.4.8.2
Data Structures | Typedefs | Enumerations | Functions
adapter.h File Reference
#include "config.h"
#include "adapter/addns.h"
#include "adapter/adfile.h"
#include "shared/allocator.h"
#include "shared/status.h"
#include <stdio.h>
Include dependency graph for adapter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  adapter_struct
 

Typedefs

typedef enum adapter_mode_enum adapter_mode
 
typedef struct adapter_struct adapter_type
 

Enumerations

enum  adapter_mode_enum { ADAPTER_FILE = 1, ADAPTER_DNS }
 

Functions

adapter_typeadapter_create (const char *str, adapter_mode type, unsigned in)
 
ods_status adapter_load_config (adapter_type *adapter)
 
int adapter_compare (adapter_type *a1, adapter_type *a2)
 
ods_status adapter_read (void *zone)
 
ods_status adapter_write (void *zone)
 
void adapter_cleanup (adapter_type *adapter)
 

Typedef Documentation

Definition at line 49 of file adapter.h.

typedef struct adapter_struct adapter_type

Adapter.

Definition at line 55 of file adapter.h.

Enumeration Type Documentation

Inbound and Outbound Adapters.Adapter mode.

Enumerator
ADAPTER_FILE 
ADAPTER_DNS 

Definition at line 44 of file adapter.h.

Function Documentation

void adapter_cleanup ( adapter_type adapter)
int adapter_compare ( adapter_type a1,
adapter_type a2 
)

Compare adapters.

Parameters
[in]a1adapter 1
[in]a2adapter 2
Returns
int 0 on equal, -1 if a1 < a2, 1 if a1 > a2

Compare adapters.

Definition at line 231 of file adapter.c.

References adapter_struct::configstr, adapter_struct::inbound, ods_strcmp(), and adapter_struct::type.

Referenced by zone_merge().

adapter_type* adapter_create ( const char *  str,
adapter_mode  type,
unsigned  in 
)

Create new adapter.

Parameters
[in]strconfiguration string
[in]typetype of adapter
[in]ininbound or not (thus outbound)
Returns
adapter_type* created adapter

Create a new adapter.

Definition at line 49 of file adapter.c.

References adapter_cleanup(), ADAPTER_DNS, ADAPTER_FILE, adapter_struct::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), allocator_strdup(), adapter_struct::config, adapter_struct::config_last_modified, adapter_struct::configstr, dnsin_create(), dnsout_create(), adapter_struct::error, adapter_struct::inbound, ods_log_error(), and adapter_struct::type.

ods_status adapter_load_config ( adapter_type adapter)
ods_status adapter_read ( void *  zone)

Read zone from input adapter.

Parameters
[in]zonezone
Returns
ods_status status

Definition at line 164 of file adapter.c.

References ADAPTER_DNS, ADAPTER_FILE, addns_read(), adfile_read(), zone_struct::adinbound, adapter_struct::configstr, zone_struct::name, ods_log_assert, ods_log_error(), ods_log_verbose(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, and adapter_struct::type.

Referenced by tools_input().

ods_status adapter_write ( void *  zone)

Write zone to output adapter.

Parameters
[in]zonezone
Returns
ods_status status

Write zone to output adapter.

Definition at line 197 of file adapter.c.

References ADAPTER_DNS, ADAPTER_FILE, addns_write(), adfile_write(), zone_struct::adoutbound, adapter_struct::configstr, zone_struct::db, namedb_struct::intserial, zone_struct::name, ods_log_assert, ods_log_error(), ods_log_verbose(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, and adapter_struct::type.

Referenced by tools_output().