OpenDNSSEC-enforcer  2.1.6
Macros | Functions
policy_export.h File Reference
#include "db/db_connection.h"
#include "db/policy.h"

Go to the source code of this file.

Macros

#define POLICY_EXPORT_OK   0
 
#define POLICY_EXPORT_ERR_ARGS   1
 
#define POLICY_EXPORT_ERR_XML   2
 
#define POLICY_EXPORT_ERR_DATABASE   3
 
#define POLICY_EXPORT_ERR_MEMORY   4
 
#define POLICY_EXPORT_ERR_FILE   5
 

Functions

int policy_export_all (int sockfd, const db_connection_t *connection, const char *filename)
 
int policy_export (int sockfd, const policy_t *policy, const char *filename)
 

Macro Definition Documentation

◆ POLICY_EXPORT_ERR_ARGS

#define POLICY_EXPORT_ERR_ARGS   1

Indicates an error with the arguments provided to policy_export().

Definition at line 43 of file policy_export.h.

◆ POLICY_EXPORT_ERR_DATABASE

#define POLICY_EXPORT_ERR_DATABASE   3

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

Definition at line 51 of file policy_export.h.

◆ POLICY_EXPORT_ERR_FILE

#define POLICY_EXPORT_ERR_FILE   5

Indicates an error when handing files.

Definition at line 59 of file policy_export.h.

◆ POLICY_EXPORT_ERR_MEMORY

#define POLICY_EXPORT_ERR_MEMORY   4

Indicates a memory allocation error or generic internal error.

Definition at line 55 of file policy_export.h.

◆ POLICY_EXPORT_ERR_XML

#define POLICY_EXPORT_ERR_XML   2

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

Definition at line 47 of file policy_export.h.

◆ POLICY_EXPORT_OK

#define POLICY_EXPORT_OK   0

Indicates a successful policy export.

Definition at line 39 of file policy_export.h.

Function Documentation

◆ policy_export()

int policy_export ( int  sockfd,
const policy_t policy,
const char *  filename 
)

Export the policy from the database to XML.

Parameters
[in]sockfda socket.
[in]policya policy_t pointer with the policy to export.
[in]filenamethe filename to write to, if NULL write to stdout.
Returns
POLICY_EXPORT_ERR_* on error otherwise POLICY_EXPORT_OK.

Definition at line 532 of file policy_export.c.

References POLICY_EXPORT_ERR_ARGS, POLICY_EXPORT_ERR_FILE, and POLICY_EXPORT_ERR_MEMORY.

◆ policy_export_all()

int policy_export_all ( int  sockfd,
const db_connection_t connection,
const char *  filename 
)

Export all policies from the database to XML.

Parameters
[in]sockfda socket.
[in]dbconna db_connection_t pointer.
[in]filenamethe filename to write to, if NULL write to stdout.
Returns
POLICY_EXPORT_ERR_* on error otherwise POLICY_EXPORT_OK.

Definition at line 413 of file policy_export.c.