adapter.h File Reference
`#include "config.h"`
`#include <stdio.h>`
`#include "adapter/addns.h"`
`#include "adapter/adfile.h"`
`#include "status.h"`
`#include "signer/zone.h"`

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_type * | adapter_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 (zone_type *zone)
ods_status | adapter_write (zone_type *zone)
void | adapter_cleanup (adapter_type *adapter)

## Typedef Documentation

## adapter_mode

typedef enum adapter_mode_enum adapter_mode

Definition at line 44 of file adapter.h.

## adapter_type

typedef struct adapter_struct adapter_type

Definition at line 46 of file adapter.h.

## Enumeration Type Documentation

## adapter_mode_enum

enum adapter_mode_enum

Inbound and Outbound Adapters.Adapter mode.

Enumerator
ADAPTER_FILE |
ADAPTER_DNS |

Definition at line 39 of file adapter.h.

## Function Documentation

## adapter_cleanup()

void adapter_cleanup | ( | adapter_type * | adapter | ) |

Clean up adapter.

Parameters

  [in] | adapter | adapter to cleanup

Clean up adapter.

Definition at line 234 of file adapter.c.

References ADAPTER_DNS, ADAPTER_FILE, adapter_struct::config, adapter_struct::configstr, dnsin_cleanup(), dnsout_cleanup(), adapter_struct::inbound, and adapter_struct::type.

Referenced by zone_cleanup().

## adapter_compare()

int adapter_compare | ( | adapter_type * | a1,
|  | adapter_type * | a2
| ) |  |

Compare adapters.

Parameters

  [in] | a1 | adapter 1
  [in] | a2 | adapter 2

Returns
  int 0 on equal, -1 if a1 < a2, 1 if a1 > a2

Compare adapters.

Definition at line 212 of file adapter.c.

References adapter_struct::configstr, adapter_struct::inbound, and adapter_struct::type.

## adapter_create()

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

Create new adapter.

Parameters

  [in] | str | configuration string
  [in] | type | type of adapter
  [in] | in | inbound or not (thus outbound)

Returns
  adapter_type* created adapter

Create a new adapter.

Definition at line 48 of file adapter.c.

References adapter_struct::config, adapter_struct::config_last_modified, adapter_struct::configstr, adapter_struct::error, adapter_struct::inbound, and adapter_struct::type.

## adapter_load_config()

ods_status adapter_load_config | ( | adapter_type * | adapter | ) |

Load configuration.

Parameters

  [in] | adapter | adapter

Returns
  ods_status status

Load ACL.

Definition at line 99 of file adapter.c.

References ADAPTER_DNS, ADAPTER_FILE, adapter_struct::config, adapter_struct::config_last_modified, adapter_struct::configstr, dnsin_update(), dnsout_update(), adapter_struct::inbound, and adapter_struct::type.

## adapter_read()

ods_status adapter_read | ( | zone_type * | zone | ) |

Read zone from input adapter.

Parameters

  [in] | zone | zone

Returns
  ods_status status

Definition at line 147 of file adapter.c.

References zone_struct::adinbound.

## adapter_write()

ods_status adapter_write | ( | zone_type * | zone | ) |

Write zone to output adapter.

Parameters

  [in] | zone | zone

Returns
  ods_status status

Write zone to output adapter.

Definition at line 179 of file adapter.c.

References zone_struct::adoutbound, and zone_struct::db.