policy_export.c File Reference
`#include "log.h"`
`#include "str.h"`
`#include "clientpipe.h"`
`#include "duration.h"`
`#include "db/policy_key.h"`
`#include "utils/kc_helper.h"`
`#include "policy/policy_export.h"`
`#include <libxml/parser.h>`
`#include <libxml/tree.h>`
`#include <limits.h>`
`#include <unistd.h>`
`#include <stdio.h>`
`#include <string.h>`
`#include <errno.h>`

Go to the source code of this file.

## Macros

#define | POLICY_EXPORT_MAX_LENGHT 1000

## 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_MAX_LENGHT

#define POLICY_EXPORT_MAX_LENGHT 1000

Definition at line 46 of file policy_export.c.

## 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] | sockfd | a socket.
  [in] | policy | a policy_t pointer with the policy to export.
  [in] | filename | the 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] | sockfd | a socket.
  [in] | dbconn | a db_connection_t pointer.
  [in] | filename | the 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.