signconf_xml.h File Reference
`#include "daemon/engine.h"`
`#include "db/db_connection.h"`
`#include "db/zone_db.h"`
`#include "db/policy.h"`

Go to the source code of this file.

## Macros

#define | SIGNCONF_EXPORT_OK 0
#define | SIGNCONF_EXPORT_ERR_ARGS 1
#define | SIGNCONF_EXPORT_ERR_XML 2
#define | SIGNCONF_EXPORT_ERR_DATABASE 3
#define | SIGNCONF_EXPORT_ERR_MEMORY 4
#define | SIGNCONF_EXPORT_ERR_FILE 5
#define | SIGNCONF_EXPORT_NO_CHANGE 6

## Functions

int | signconf_export_all (int sockfd, const db_connection_t *connection, int force)
int | signconf_export_zone (char const *zonename, db_connection_t *dbconn)
int | signconf_export_policy (int sockfd, const db_connection_t *connection, const policy_t *policy, int force)

## Macro Definition Documentation

## SIGNCONF_EXPORT_ERR_ARGS

#define SIGNCONF_EXPORT_ERR_ARGS 1

Indicates an error with the arguments provided to signconf_export*().

Definition at line 44 of file signconf_xml.h.

Referenced by signconf_export_all().

## SIGNCONF_EXPORT_ERR_DATABASE

#define SIGNCONF_EXPORT_ERR_DATABASE 3

Indicates an error with the database like reading, updating or creating.

Definition at line 52 of file signconf_xml.h.

Referenced by signconf_export_all(), and signconf_export_zone().

## SIGNCONF_EXPORT_ERR_FILE

#define SIGNCONF_EXPORT_ERR_FILE 5

Indicates an error when handing files.

Definition at line 60 of file signconf_xml.h.

## SIGNCONF_EXPORT_ERR_MEMORY

#define SIGNCONF_EXPORT_ERR_MEMORY 4

Indicates a memory allocation error or generic internal error.

Definition at line 56 of file signconf_xml.h.

Referenced by signconf_export_all().

## SIGNCONF_EXPORT_ERR_XML

#define SIGNCONF_EXPORT_ERR_XML 2

Indicates an error with the signconf XML like parsing, validating or content.

Definition at line 48 of file signconf_xml.h.

## SIGNCONF_EXPORT_NO_CHANGE

#define SIGNCONF_EXPORT_NO_CHANGE 6

Indicates that the operation was successful but no changes where made.

Definition at line 64 of file signconf_xml.h.

Referenced by signconf_export_all().

## SIGNCONF_EXPORT_OK

#define SIGNCONF_EXPORT_OK 0

Indicates a successful signconf export.

Definition at line 40 of file signconf_xml.h.

Referenced by signconf_export_all().

## Function Documentation

## signconf_export_all()

int signconf_export_all | ( | int | sockfd,
|  | const db_connection_t * | connection,
|  | int | force )

Export the signconf XML for all zones.

Parameters

  [in] | sockfd | a socket fd.
  [in] | connection | a db_connection_t pointer.
  [in] | force | if non-zero it will force the export for all zones even if there are no updates for the zones.

Returns
  SIGNCONF_EXPORT_ERR_* on error, otherwise SIGNCONF_EXPORT_OK or SIGNCONF_EXPORT_NO_CHANGE.

Definition at line 84 of file signconf_xml.c.

References db_value_cmp(), policy_free(), policy_id(), SIGNCONF_EXPORT_ERR_ARGS, SIGNCONF_EXPORT_ERR_DATABASE, SIGNCONF_EXPORT_ERR_MEMORY, SIGNCONF_EXPORT_NO_CHANGE, SIGNCONF_EXPORT_OK, zone_db_free(), zone_db_get_policy(), zone_db_policy_id(), zone_list_db_free(), zone_list_db_get(), zone_list_db_get_next(), and zone_list_db_new().

## signconf_export_policy()

int signconf_export_policy | ( | int | sockfd,
|  | const db_connection_t * | connection,
|  | const policy_t * | policy,
|  | int | force )

extern

Export the signconf XML for all zones that uses a specified policy.

Parameters

  [in] | sockfd | a socket fd.
  [in] | connection | a db_connection_t pointer.
  [in] | policy | a policy_t pointer.
  [in] | force | if non-zero it will force the export for all zones even if there are no updates for the zones.

Returns
  SIGNCONF_EXPORT_ERR_* on error, otherwise SIGNCONF_EXPORT_OK or SIGNCONF_EXPORT_NO_CHANGE.

## signconf_export_zone()

int signconf_export_zone | ( | char const * | zonename,
|  | db_connection_t * | dbconn )

extern

Export the signconf XML for zone.

Parameters

  [in] | zonename | Name of zone to write signconf for.
  [in] | dbconn | a db_connection_t pointer.

Returns
  SIGNCONF_EXPORT_ERR_* on error, otherwise SIGNCONF_EXPORT_OK or SIGNCONF_EXPORT_NO_CHANGE.

Definition at line 57 of file signconf_xml.c.

References policy_free(), SIGNCONF_EXPORT_ERR_DATABASE, zone_db_free(), zone_db_get_policy(), and zone_db_new_get_by_name().