|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Amanda, The Advanced Maryland Automatic Network Disk Archiver
|
|
Packit Service |
392537 |
* Copyright (c) 1991-2000 University of Maryland at College Park
|
|
Packit Service |
392537 |
* Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
|
|
Packit Service |
392537 |
* Copyright (c) 2013-2016 Carbonite, Inc. All Rights Reserved.
|
|
Packit Service |
392537 |
* All Rights Reserved.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
Packit Service |
392537 |
* documentation for any purpose is hereby granted without fee, provided that
|
|
Packit Service |
392537 |
* the above copyright notice appear in all copies and that both that
|
|
Packit Service |
392537 |
* copyright notice and this permission notice appear in supporting
|
|
Packit Service |
392537 |
* documentation, and that the name of U.M. not be used in advertising or
|
|
Packit Service |
392537 |
* publicity pertaining to distribution of the software without specific,
|
|
Packit Service |
392537 |
* written prior permission. U.M. makes no representations about the
|
|
Packit Service |
392537 |
* suitability of this software for any purpose. It is provided "as is"
|
|
Packit Service |
392537 |
* without express or implied warranty.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
|
Packit Service |
392537 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
|
|
Packit Service |
392537 |
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
Packit Service |
392537 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
Packit Service |
392537 |
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
Packit Service |
392537 |
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Author: James da Silva, Systems Design and Analysis Group
|
|
Packit Service |
392537 |
* Computer Science Department
|
|
Packit Service |
392537 |
* University of Maryland at College Park
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* $Id: conffile.h,v 1.72 2006/07/26 15:17:37 martinea Exp $
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* interface for config file reading code
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#ifndef CONFFILE_H
|
|
Packit Service |
392537 |
#define CONFFILE_H
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#include "amanda.h"
|
|
Packit Service |
392537 |
#include "amutil.h"
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Getting Configuration Values
|
|
Packit Service |
392537 |
* ============================
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Amanda configurations consist of a number of "global" parameters, as well as
|
|
Packit Service |
392537 |
* named subsections of several types. The global parameters are fetched with
|
|
Packit Service |
392537 |
* the getconf_CONFTYPE functions, keyed by a confparam_t constant (with prefix
|
|
Packit Service |
392537 |
* CNF_). The subsection parameters are fetched with SUBSEC_get_PARAM()
|
|
Packit Service |
392537 |
* macros, e.g., tapetype_get_blocksize(ttyp), where the argument comes from
|
|
Packit Service |
392537 |
* lookup_SUBSEC(), in this case lookup_tapetype(name).
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Types
|
|
Packit Service |
392537 |
* =====
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* This module juggles two kinds of types: C types and conftypes. Conftypes include
|
|
Packit Service |
392537 |
* everything from integers through property lists, and are specific to the needs of
|
|
Packit Service |
392537 |
* the configuration system. Each conftype has a corresponding C type, which is of course
|
|
Packit Service |
392537 |
* necessary to actually use the data.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* The val_t__CONFTYPE macros represent the canonical correspondance of conftypes to C
|
|
Packit Service |
392537 |
* types, but in general the relationship is obvious: ints, strings, reals, and so forth
|
|
Packit Service |
392537 |
* are represented directly. Enumerated conftypes are represented by the corresponding
|
|
Packit Service |
392537 |
* C enum type. The 'rate' conftype is represented as a 2-element array of doubles, and
|
|
Packit Service |
392537 |
* the 'intrange' conftype is represented as a 2-element array of ints. exincludes are
|
|
Packit Service |
392537 |
* a exinclude_t *, and a proplist is represented as a GHashTable *.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Memory
|
|
Packit Service |
392537 |
* ======
|
|
Packit Service |
392537 |
* Note that, unless specified, all memory in this module is managed by the module
|
|
Packit Service |
392537 |
* itself; return strings should not be freed by the caller.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Error Handling
|
|
Packit Service |
392537 |
* ==============
|
|
Packit Service |
392537 |
* All errors and warnings generated by this module are available from get_config_errors().
|
|
Packit Service |
392537 |
* It is up to the caller to route these messages to the user. The function
|
|
Packit Service |
392537 |
* config_print_errors() will print the errors to stderr, as a convenience.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Generic values
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* This module uses a generic val_t type to hold values of various types -- it's basically
|
|
Packit Service |
392537 |
* a union with type information and a 'seen' flag. In a way, it's a very simple equivalent
|
|
Packit Service |
392537 |
* to Glib's GValue. It's worth considering rewriting this with GValue, but for the moment,
|
|
Packit Service |
392537 |
* this works and it's here.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A "seen" struct. Rather than allocate strings all over the place, this
|
|
Packit Service |
392537 |
* string is in the "parsed_filenames" GSList and will be freed when that
|
|
Packit Service |
392537 |
* GSList is freed. This struct should be opaque to other modules. */
|
|
Packit Service |
392537 |
typedef struct seen_s {
|
|
Packit Service |
392537 |
char *block;
|
|
Packit Service |
392537 |
char *filename;
|
|
Packit Service |
392537 |
int linenum;
|
|
Packit Service |
392537 |
} seen_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* boolean and no_yes_all */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
VALUE_NO,
|
|
Packit Service |
392537 |
VALUE_YES,
|
|
Packit Service |
392537 |
VALUE_ALL
|
|
Packit Service |
392537 |
} no_yes_all_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* priority types */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
PRIORITY_LOW, /* Always direct to tape */
|
|
Packit Service |
392537 |
PRIORITY_MEDIUM, /* If possible */
|
|
Packit Service |
392537 |
PRIORITY_HIGH /* Always to holding disk */
|
|
Packit Service |
392537 |
} priority_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* holdingdisk types */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
HOLD_NEVER, /* Always direct to tape */
|
|
Packit Service |
392537 |
HOLD_AUTO, /* If possible */
|
|
Packit Service |
392537 |
HOLD_REQUIRED /* Always to holding disk */
|
|
Packit Service |
392537 |
} dump_holdingdisk_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Compression types */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
COMP_NONE, /* No compression */
|
|
Packit Service |
392537 |
COMP_FAST, /* Fast compression on client */
|
|
Packit Service |
392537 |
COMP_BEST, /* Best compression on client */
|
|
Packit Service |
392537 |
COMP_CUST, /* Custom compression on client */
|
|
Packit Service |
392537 |
COMP_SERVER_FAST, /* Fast compression on server */
|
|
Packit Service |
392537 |
COMP_SERVER_BEST, /* Best compression on server */
|
|
Packit Service |
392537 |
COMP_SERVER_CUST /* Custom compression on server */
|
|
Packit Service |
392537 |
} comp_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Encryption types */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
ENCRYPT_NONE, /* No encryption */
|
|
Packit Service |
392537 |
ENCRYPT_CUST, /* Custom encryption on client */
|
|
Packit Service |
392537 |
ENCRYPT_SERV_CUST /* Custom encryption on server */
|
|
Packit Service |
392537 |
} encrypt_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Estimate strategies */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
ES_CLIENT, /* client estimate */
|
|
Packit Service |
392537 |
ES_SERVER, /* server estimate */
|
|
Packit Service |
392537 |
ES_CALCSIZE, /* calcsize estimate */
|
|
Packit Service |
392537 |
ES_ES /* sentinel */
|
|
Packit Service |
392537 |
} estimate_t;
|
|
Packit Service |
392537 |
/* A GSlist where each element is a element_t */
|
|
Packit Service |
392537 |
typedef GSList *estimatelist_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
AL_OTHER_CONFIG = 1<<0,
|
|
Packit Service |
392537 |
AL_NON_AMANDA = 1<<1,
|
|
Packit Service |
392537 |
AL_VOLUME_ERROR = 1<<2,
|
|
Packit Service |
392537 |
AL_EMPTY = 1<<3,
|
|
Packit Service |
392537 |
} autolabel_enum_t;
|
|
Packit Service |
392537 |
typedef int autolabel_set_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct autolabel_s {
|
|
Packit Service |
392537 |
char *template;
|
|
Packit Service |
392537 |
autolabel_set_t autolabel;
|
|
Packit Service |
392537 |
} autolabel_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct labelstr_s {
|
|
Packit Service |
392537 |
char *template;
|
|
Packit Service |
392537 |
gboolean match_autolabel;
|
|
Packit Service |
392537 |
} labelstr_s;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Dump strategies */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
DS_SKIP, /* Don't do any dumps at all */
|
|
Packit Service |
392537 |
DS_STANDARD, /* Standard (0 1 1 1 1 2 2 2 ...) */
|
|
Packit Service |
392537 |
DS_NOFULL, /* No full's (1 1 1 ...) */
|
|
Packit Service |
392537 |
DS_NOINC, /* No inc's (0 0 0 ...) */
|
|
Packit Service |
392537 |
DS_4, /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
|
|
Packit Service |
392537 |
DS_5, /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
|
|
Packit Service |
392537 |
DS_HANOI, /* Tower of Hanoi (? ? ? ? ? ...) */
|
|
Packit Service |
392537 |
DS_INCRONLY, /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
|
|
Packit Service |
392537 |
DS_DS /* sentinel */
|
|
Packit Service |
392537 |
} strategy_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
ALGO_FIRST,
|
|
Packit Service |
392537 |
ALGO_FIRSTFIT,
|
|
Packit Service |
392537 |
ALGO_LARGEST,
|
|
Packit Service |
392537 |
ALGO_LARGESTFIT,
|
|
Packit Service |
392537 |
ALGO_SMALLEST,
|
|
Packit Service |
392537 |
ALGO_SMALLESTFIT, /* for internal use */
|
|
Packit Service |
392537 |
ALGO_LAST,
|
|
Packit Service |
392537 |
ALGO_LASTFIT, /* for internal use */
|
|
Packit Service |
392537 |
ALGO_ALGO /* sentinel */
|
|
Packit Service |
392537 |
} taperalgo_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* execute_on types */
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_AMCHECK (1 << 0)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_DLE_AMCHECK (1 << 1)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_HOST_AMCHECK (1 << 2)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_AMCHECK (1 << 3)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_DLE_AMCHECK (1 << 4)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_HOST_AMCHECK (1 << 5)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_ESTIMATE (1 << 6)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_DLE_ESTIMATE (1 << 7)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_HOST_ESTIMATE (1 << 8)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_ESTIMATE (1 << 9)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_DLE_ESTIMATE (1 << 10)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_HOST_ESTIMATE (1 << 11)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_BACKUP (1 << 12)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_DLE_BACKUP (1 << 13)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_HOST_BACKUP (1 << 14)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_BACKUP (1 << 15)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_DLE_BACKUP (1 << 16)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_HOST_BACKUP (1 << 17)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_RECOVER (1 << 18)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_RECOVER (1 << 19)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_PRE_LEVEL_RECOVER (1 << 20)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_POST_LEVEL_RECOVER (1 << 21)
|
|
Packit Service |
392537 |
#define EXECUTE_ON_INTER_LEVEL_RECOVER (1 << 22)
|
|
Packit Service |
392537 |
typedef int execute_on_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
EXECUTE_WHERE_CLIENT,
|
|
Packit Service |
392537 |
EXECUTE_WHERE_SERVER,
|
|
Packit Service |
392537 |
} execute_where_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
SEND_AMREPORT_ALL,
|
|
Packit Service |
392537 |
SEND_AMREPORT_STRANGE,
|
|
Packit Service |
392537 |
SEND_AMREPORT_ERROR,
|
|
Packit Service |
392537 |
SEND_AMREPORT_NEVER
|
|
Packit Service |
392537 |
} send_amreport_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
DATA_PATH_AMANDA = 1<<0,
|
|
Packit Service |
392537 |
DATA_PATH_DIRECTTCP = 1<<1,
|
|
Packit Service |
392537 |
} data_path_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct exinclude_s {
|
|
Packit Service |
392537 |
am_sl_t *sl_list;
|
|
Packit Service |
392537 |
am_sl_t *sl_file;
|
|
Packit Service |
392537 |
int optional;
|
|
Packit Service |
392537 |
} exinclude_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct {
|
|
Packit Service |
392537 |
int append;
|
|
Packit Service |
392537 |
int visible;
|
|
Packit Service |
392537 |
int priority;
|
|
Packit Service |
392537 |
GSList* values;
|
|
Packit Service |
392537 |
seen_t seen;
|
|
Packit Service |
392537 |
} property_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef GHashTable* proplist_t;
|
|
Packit Service |
392537 |
/* A GSlist where each element is a 'char*' */
|
|
Packit Service |
392537 |
typedef GSList* identlist_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
TAG_NAME,
|
|
Packit Service |
392537 |
TAG_ALL,
|
|
Packit Service |
392537 |
TAG_OTHER
|
|
Packit Service |
392537 |
} dumptype_tag_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
LEVEL_ALL,
|
|
Packit Service |
392537 |
LEVEL_FULL,
|
|
Packit Service |
392537 |
LEVEL_INCR
|
|
Packit Service |
392537 |
} level_type_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct {
|
|
Packit Service |
392537 |
dumptype_tag_t tag_type;
|
|
Packit Service |
392537 |
char *tag;
|
|
Packit Service |
392537 |
level_type_t level;
|
|
Packit Service |
392537 |
} dump_selection_t;
|
|
Packit Service |
392537 |
typedef GSList* dump_selection_list_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct {
|
|
Packit Service |
392537 |
char *storage;
|
|
Packit Service |
392537 |
int days;
|
|
Packit Service |
392537 |
} vault_el_t;
|
|
Packit Service |
392537 |
typedef GSList* vault_list_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* part_cache_types */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
PART_CACHE_TYPE_NONE,
|
|
Packit Service |
392537 |
PART_CACHE_TYPE_MEMORY,
|
|
Packit Service |
392537 |
PART_CACHE_TYPE_DISK,
|
|
Packit Service |
392537 |
} part_cache_type_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* host_limit */
|
|
Packit Service |
392537 |
typedef struct {
|
|
Packit Service |
392537 |
gboolean server;
|
|
Packit Service |
392537 |
gboolean same_host;
|
|
Packit Service |
392537 |
GSList *match_pats;
|
|
Packit Service |
392537 |
} host_limit_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Names for the type of value in a val_t. Mostly for internal use, but useful
|
|
Packit Service |
392537 |
* for wrapping val_t's, too. */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
CONFTYPE_INT,
|
|
Packit Service |
392537 |
CONFTYPE_INT64,
|
|
Packit Service |
392537 |
CONFTYPE_REAL,
|
|
Packit Service |
392537 |
CONFTYPE_STR,
|
|
Packit Service |
392537 |
CONFTYPE_IDENT,
|
|
Packit Service |
392537 |
CONFTYPE_TIME,
|
|
Packit Service |
392537 |
CONFTYPE_SIZE,
|
|
Packit Service |
392537 |
CONFTYPE_BOOLEAN,
|
|
Packit Service |
392537 |
CONFTYPE_COMPRESS,
|
|
Packit Service |
392537 |
CONFTYPE_ENCRYPT,
|
|
Packit Service |
392537 |
CONFTYPE_HOLDING,
|
|
Packit Service |
392537 |
CONFTYPE_ESTIMATELIST,
|
|
Packit Service |
392537 |
CONFTYPE_STRATEGY,
|
|
Packit Service |
392537 |
CONFTYPE_TAPERALGO,
|
|
Packit Service |
392537 |
CONFTYPE_PRIORITY,
|
|
Packit Service |
392537 |
CONFTYPE_RATE,
|
|
Packit Service |
392537 |
CONFTYPE_INTRANGE,
|
|
Packit Service |
392537 |
CONFTYPE_EXINCLUDE,
|
|
Packit Service |
392537 |
CONFTYPE_PROPLIST,
|
|
Packit Service |
392537 |
CONFTYPE_APPLICATION,
|
|
Packit Service |
392537 |
CONFTYPE_EXECUTE_ON,
|
|
Packit Service |
392537 |
CONFTYPE_EXECUTE_WHERE,
|
|
Packit Service |
392537 |
CONFTYPE_SEND_AMREPORT_ON,
|
|
Packit Service |
392537 |
CONFTYPE_IDENTLIST,
|
|
Packit Service |
392537 |
CONFTYPE_DATA_PATH,
|
|
Packit Service |
392537 |
CONFTYPE_AUTOLABEL,
|
|
Packit Service |
392537 |
CONFTYPE_LABELSTR,
|
|
Packit Service |
392537 |
CONFTYPE_PART_CACHE_TYPE,
|
|
Packit Service |
392537 |
CONFTYPE_HOST_LIMIT,
|
|
Packit Service |
392537 |
CONFTYPE_NO_YES_ALL,
|
|
Packit Service |
392537 |
CONFTYPE_STR_LIST,
|
|
Packit Service |
392537 |
CONFTYPE_DUMP_SELECTION,
|
|
Packit Service |
392537 |
CONFTYPE_VAULT_LIST,
|
|
Packit Service |
392537 |
} conftype_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
CONF_UNIT_NONE,
|
|
Packit Service |
392537 |
CONF_UNIT_K,
|
|
Packit Service |
392537 |
} confunit_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* This should be considered an opaque type for any other modules. The complete
|
|
Packit Service |
392537 |
* struct is included here to allow quick access via macros. Access it *only* through
|
|
Packit Service |
392537 |
* those macros. */
|
|
Packit Service |
392537 |
typedef struct val_s {
|
|
Packit Service |
392537 |
union {
|
|
Packit Service |
392537 |
int i;
|
|
Packit Service |
392537 |
gint64 int64;
|
|
Packit Service |
392537 |
double r;
|
|
Packit Service |
392537 |
char *s;
|
|
Packit Service |
392537 |
size_t size;
|
|
Packit Service |
392537 |
time_t t;
|
|
Packit Service |
392537 |
float rate[2];
|
|
Packit Service |
392537 |
exinclude_t exinclude;
|
|
Packit Service |
392537 |
int intrange[2];
|
|
Packit Service |
392537 |
proplist_t proplist;
|
|
Packit Service |
392537 |
estimatelist_t estimatelist;
|
|
Packit Service |
392537 |
identlist_t identlist;
|
|
Packit Service |
392537 |
autolabel_t autolabel;
|
|
Packit Service |
392537 |
labelstr_s labelstr;
|
|
Packit Service |
392537 |
host_limit_t host_limit;
|
|
Packit Service |
392537 |
dump_selection_list_t dump_selection;
|
|
Packit Service |
392537 |
vault_list_t vault_list;
|
|
Packit Service |
392537 |
} v;
|
|
Packit Service |
392537 |
seen_t seen;
|
|
Packit Service |
392537 |
conftype_t type;
|
|
Packit Service |
392537 |
confunit_t unit;
|
|
Packit Service |
392537 |
} val_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Functions to typecheck and extract a particular type of
|
|
Packit Service |
392537 |
* value from a val_t. All call error() if the type is incorrect,
|
|
Packit Service |
392537 |
* as this is a programming error. */
|
|
Packit Service |
392537 |
int val_t_to_int (val_t *);
|
|
Packit Service |
392537 |
gint64 val_t_to_int64 (val_t *);
|
|
Packit Service |
392537 |
float val_t_to_real (val_t *);
|
|
Packit Service |
392537 |
char *val_t_to_str (val_t *); /* (also converts CONFTYPE_IDENT) */
|
|
Packit Service |
392537 |
char *val_t_to_ident (val_t *); /* (also converts CONFTYPE_STR) */
|
|
Packit Service |
392537 |
identlist_t val_t_to_identlist(val_t *);
|
|
Packit Service |
392537 |
identlist_t val_t_to_str_list (val_t *);
|
|
Packit Service |
392537 |
time_t val_t_to_time (val_t *);
|
|
Packit Service |
392537 |
ssize_t val_t_to_size (val_t *);
|
|
Packit Service |
392537 |
int val_t_to_boolean (val_t *);
|
|
Packit Service |
392537 |
int val_t_to_no_yes_all(val_t *);
|
|
Packit Service |
392537 |
comp_t val_t_to_compress (val_t *);
|
|
Packit Service |
392537 |
encrypt_t val_t_to_encrypt (val_t *);
|
|
Packit Service |
392537 |
dump_holdingdisk_t val_t_to_holding (val_t *);
|
|
Packit Service |
392537 |
estimatelist_t val_t_to_estimatelist (val_t *);
|
|
Packit Service |
392537 |
strategy_t val_t_to_strategy (val_t *);
|
|
Packit Service |
392537 |
taperalgo_t val_t_to_taperalgo(val_t *);
|
|
Packit Service |
392537 |
int val_t_to_priority (val_t *); /* priority_t or int */
|
|
Packit Service |
392537 |
float *val_t_to_rate (val_t *); /* array of two floats */
|
|
Packit Service |
392537 |
exinclude_t val_t_to_exinclude(val_t *);
|
|
Packit Service |
392537 |
int *val_t_to_intrange (val_t *); /* array of two ints */
|
|
Packit Service |
392537 |
proplist_t val_t_to_proplist (val_t *);
|
|
Packit Service |
392537 |
char *val_t_to_application(val_t *);
|
|
Packit Service |
392537 |
execute_on_t val_t_to_execute_on(val_t *);
|
|
Packit Service |
392537 |
execute_where_t val_t_to_execute_where(val_t *);
|
|
Packit Service |
392537 |
send_amreport_t val_t_to_send_amreport(val_t *);
|
|
Packit Service |
392537 |
data_path_t val_t_to_data_path(val_t *);
|
|
Packit Service |
392537 |
autolabel_t *val_t_to_autolabel(val_t *);
|
|
Packit Service |
392537 |
labelstr_s *val_t_to_labelstr(val_t *);
|
|
Packit Service |
392537 |
part_cache_type_t val_t_to_part_cache_type(val_t *);
|
|
Packit Service |
392537 |
host_limit_t *val_t_to_host_limit(val_t *);
|
|
Packit Service |
392537 |
dump_selection_list_t val_t_to_dump_selection(val_t *);
|
|
Packit Service |
392537 |
vault_list_t val_t_to_vault_list(val_t *);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Has the given val_t been seen in a configuration file or config overwrite?
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param val: val_t* to examine
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define val_t_seen(val) ((val)->seen.linenum)
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* What is the underlying type of this val_t?
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param val: val_t* to examine
|
|
Packit Service |
392537 |
* @returns: conftype_t
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define val_t_type(val) ((val)->type)
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Macros to convert val_t's to a particular type without the benefit of
|
|
Packit Service |
392537 |
* a typecheck. Use these only if you really know what you're doing!
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Implementation note: these macros encode the relationship of conftypes
|
|
Packit Service |
392537 |
* (in the macro name) to the corresponding union field. The macros work
|
|
Packit Service |
392537 |
* as lvalues, too.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define val_t__seen(val) ((val)->seen)
|
|
Packit Service |
392537 |
#define val_t__int(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__int64(val) ((val)->v.int64)
|
|
Packit Service |
392537 |
#define val_t__real(val) ((val)->v.r)
|
|
Packit Service |
392537 |
#define val_t__str(val) ((val)->v.s)
|
|
Packit Service |
392537 |
#define val_t__ident(val) ((val)->v.s)
|
|
Packit Service |
392537 |
#define val_t__identlist(val) ((val)->v.identlist)
|
|
Packit Service |
392537 |
#define val_t__time(val) ((val)->v.t)
|
|
Packit Service |
392537 |
#define val_t__size(val) ((val)->v.size)
|
|
Packit Service |
392537 |
#define val_t__boolean(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__no_yes_all(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__compress(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__encrypt(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__holding(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__estimatelist(val) ((val)->v.estimatelist)
|
|
Packit Service |
392537 |
#define val_t__strategy(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__taperalgo(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__send_amreport(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__priority(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__rate(val) ((val)->v.rate)
|
|
Packit Service |
392537 |
#define val_t__exinclude(val) ((val)->v.exinclude)
|
|
Packit Service |
392537 |
#define val_t__intrange(val) ((val)->v.intrange)
|
|
Packit Service |
392537 |
#define val_t__proplist(val) ((val)->v.proplist)
|
|
Packit Service |
392537 |
#define val_t__application(val) ((val)->v.application)
|
|
Packit Service |
392537 |
#define val_t__execute_on(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__execute_where(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__data_path(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__autolabel(val) (&((val)->v.autolabel))
|
|
Packit Service |
392537 |
#define val_t__labelstr(val) (&((val)->v.labelstr))
|
|
Packit Service |
392537 |
#define val_t__part_cache_type(val) ((val)->v.i)
|
|
Packit Service |
392537 |
#define val_t__host_limit(val) ((val)->v.host_limit)
|
|
Packit Service |
392537 |
#define val_t__dump_selection(val) ((val)->v.dump_selection)
|
|
Packit Service |
392537 |
#define val_t__vault_list(val) ((val)->v.vault_list)
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Parameters
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Programs get val_t's by giving the index of the parameters they're interested in.
|
|
Packit Service |
392537 |
* For global parameters, these start with CNF; for subsections, they start with the
|
|
Packit Service |
392537 |
* name of the subsection.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Global parameter access
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
CNF_ORG,
|
|
Packit Service |
392537 |
CNF_CONF,
|
|
Packit Service |
392537 |
CNF_INDEX_SERVER,
|
|
Packit Service |
392537 |
CNF_TAPE_SERVER,
|
|
Packit Service |
392537 |
CNF_AMDUMP_SERVER,
|
|
Packit Service |
392537 |
CNF_AUTH,
|
|
Packit Service |
392537 |
CNF_SSH_KEYS,
|
|
Packit Service |
392537 |
CNF_AMANDAD_PATH,
|
|
Packit Service |
392537 |
CNF_CLIENT_USERNAME,
|
|
Packit Service |
392537 |
CNF_CLIENT_PORT,
|
|
Packit Service |
392537 |
CNF_GNUTAR_LIST_DIR,
|
|
Packit Service |
392537 |
CNF_AMANDATES,
|
|
Packit Service |
392537 |
CNF_MAILTO,
|
|
Packit Service |
392537 |
CNF_DUMPUSER,
|
|
Packit Service |
392537 |
CNF_TAPEDEV,
|
|
Packit Service |
392537 |
CNF_DEVICE_PROPERTY,
|
|
Packit Service |
392537 |
CNF_PROPERTY,
|
|
Packit Service |
392537 |
CNF_INTERACTIVITY,
|
|
Packit Service |
392537 |
CNF_APPLICATION,
|
|
Packit Service |
392537 |
CNF_APPLICATION_TOOL,
|
|
Packit Service |
392537 |
CNF_EXECUTE_ON,
|
|
Packit Service |
392537 |
CNF_PP_SCRIPT,
|
|
Packit Service |
392537 |
CNF_PP_SCRIPT_TOOL,
|
|
Packit Service |
392537 |
CNF_PLUGIN,
|
|
Packit Service |
392537 |
CNF_CHANGERDEV,
|
|
Packit Service |
392537 |
CNF_CHANGERFILE,
|
|
Packit Service |
392537 |
CNF_LABELSTR,
|
|
Packit Service |
392537 |
CNF_TAPELIST,
|
|
Packit Service |
392537 |
CNF_DISKFILE,
|
|
Packit Service |
392537 |
CNF_INFOFILE,
|
|
Packit Service |
392537 |
CNF_LOGDIR,
|
|
Packit Service |
392537 |
CNF_INDEXDIR,
|
|
Packit Service |
392537 |
CNF_TAPETYPE,
|
|
Packit Service |
392537 |
CNF_DUMPCYCLE,
|
|
Packit Service |
392537 |
CNF_RUNSPERCYCLE,
|
|
Packit Service |
392537 |
CNF_TAPECYCLE,
|
|
Packit Service |
392537 |
CNF_NETUSAGE,
|
|
Packit Service |
392537 |
CNF_INPARALLEL,
|
|
Packit Service |
392537 |
CNF_DUMPORDER,
|
|
Packit Service |
392537 |
CNF_BUMPPERCENT,
|
|
Packit Service |
392537 |
CNF_BUMPSIZE,
|
|
Packit Service |
392537 |
CNF_BUMPMULT,
|
|
Packit Service |
392537 |
CNF_BUMPDAYS,
|
|
Packit Service |
392537 |
CNF_TPCHANGER,
|
|
Packit Service |
392537 |
CNF_RUNTAPES,
|
|
Packit Service |
392537 |
CNF_MAXDUMPS,
|
|
Packit Service |
392537 |
CNF_ETIMEOUT,
|
|
Packit Service |
392537 |
CNF_DTIMEOUT,
|
|
Packit Service |
392537 |
CNF_CTIMEOUT,
|
|
Packit Service |
392537 |
CNF_DEVICE_OUTPUT_BUFFER_SIZE,
|
|
Packit Service |
392537 |
CNF_PRINTER,
|
|
Packit Service |
392537 |
CNF_MAILER,
|
|
Packit Service |
392537 |
CNF_AUTOFLUSH,
|
|
Packit Service |
392537 |
CNF_RESERVE,
|
|
Packit Service |
392537 |
CNF_MAXDUMPSIZE,
|
|
Packit Service |
392537 |
CNF_COLUMNSPEC,
|
|
Packit Service |
392537 |
CNF_AMRECOVER_DO_FSF,
|
|
Packit Service |
392537 |
CNF_AMRECOVER_CHECK_LABEL,
|
|
Packit Service |
392537 |
CNF_AMRECOVER_CHANGER,
|
|
Packit Service |
392537 |
CNF_TAPERALGO,
|
|
Packit Service |
392537 |
CNF_SEND_AMREPORT_ON,
|
|
Packit Service |
392537 |
CNF_FLUSH_THRESHOLD_DUMPED,
|
|
Packit Service |
392537 |
CNF_FLUSH_THRESHOLD_SCHEDULED,
|
|
Packit Service |
392537 |
CNF_TAPERFLUSH,
|
|
Packit Service |
392537 |
CNF_DISPLAYUNIT,
|
|
Packit Service |
392537 |
CNF_KRB5KEYTAB,
|
|
Packit Service |
392537 |
CNF_KRB5PRINCIPAL,
|
|
Packit Service |
392537 |
CNF_LABEL_NEW_TAPES,
|
|
Packit Service |
392537 |
CNF_USETIMESTAMPS,
|
|
Packit Service |
392537 |
CNF_REP_TRIES,
|
|
Packit Service |
392537 |
CNF_CONNECT_TRIES,
|
|
Packit Service |
392537 |
CNF_REQ_TRIES,
|
|
Packit Service |
392537 |
CNF_DEBUG_AMANDAD,
|
|
Packit Service |
392537 |
CNF_DEBUG_RECOVERY,
|
|
Packit Service |
392537 |
CNF_DEBUG_AMIDXTAPED,
|
|
Packit Service |
392537 |
CNF_DEBUG_AMINDEXD,
|
|
Packit Service |
392537 |
CNF_DEBUG_AMRECOVER,
|
|
Packit Service |
392537 |
CNF_DEBUG_AUTH,
|
|
Packit Service |
392537 |
CNF_DEBUG_EVENT,
|
|
Packit Service |
392537 |
CNF_DEBUG_HOLDING,
|
|
Packit Service |
392537 |
CNF_DEBUG_PROTOCOL,
|
|
Packit Service |
392537 |
CNF_DEBUG_PLANNER,
|
|
Packit Service |
392537 |
CNF_DEBUG_DRIVER,
|
|
Packit Service |
392537 |
CNF_DEBUG_DUMPER,
|
|
Packit Service |
392537 |
CNF_DEBUG_CHUNKER,
|
|
Packit Service |
392537 |
CNF_DEBUG_TAPER,
|
|
Packit Service |
392537 |
CNF_DEBUG_SELFCHECK,
|
|
Packit Service |
392537 |
CNF_DEBUG_SENDSIZE,
|
|
Packit Service |
392537 |
CNF_DEBUG_SENDBACKUP,
|
|
Packit Service |
392537 |
CNF_RESERVED_UDP_PORT,
|
|
Packit Service |
392537 |
CNF_RESERVED_TCP_PORT,
|
|
Packit Service |
392537 |
CNF_UNRESERVED_TCP_PORT,
|
|
Packit Service |
392537 |
CNF_HOLDINGDISK,
|
|
Packit Service |
392537 |
CNF_AUTOLABEL,
|
|
Packit Service |
392537 |
CNF_META_AUTOLABEL,
|
|
Packit Service |
392537 |
CNF_DEBUG_DAYS,
|
|
Packit Service |
392537 |
CNF_TAPER_PARALLEL_WRITE,
|
|
Packit Service |
392537 |
CNF_RECOVERY_LIMIT,
|
|
Packit Service |
392537 |
CNF_TAPERSCAN,
|
|
Packit Service |
392537 |
CNF_MAX_DLE_BY_VOLUME,
|
|
Packit Service |
392537 |
CNF_EJECT_VOLUME,
|
|
Packit Service |
392537 |
CNF_TMPDIR,
|
|
Packit Service |
392537 |
CNF_REPORT_USE_MEDIA,
|
|
Packit Service |
392537 |
CNF_REPORT_NEXT_MEDIA,
|
|
Packit Service |
392537 |
CNF_REPORT_FORMAT,
|
|
Packit Service |
392537 |
CNF_ACTIVE_STORAGE,
|
|
Packit Service |
392537 |
CNF_STORAGE,
|
|
Packit Service |
392537 |
CNF_VAULT_STORAGE,
|
|
Packit Service |
392537 |
CNF_CMDFILE,
|
|
Packit Service |
392537 |
CNF_COMPRESS_INDEX,
|
|
Packit Service |
392537 |
CNF_SORT_INDEX,
|
|
Packit Service |
392537 |
CNF_REST_API_PORT,
|
|
Packit Service |
392537 |
CNF_REST_SSL_CERT,
|
|
Packit Service |
392537 |
CNF_REST_SSL_KEY,
|
|
Packit Service |
392537 |
CNF_SSL_FINGERPRINT_FILE,
|
|
Packit Service |
392537 |
CNF_SSL_CERT_FILE,
|
|
Packit Service |
392537 |
CNF_SSL_KEY_FILE,
|
|
Packit Service |
392537 |
CNF_SSL_CA_CERT_FILE,
|
|
Packit Service |
392537 |
CNF_SSL_CIPHER_LIST,
|
|
Packit Service |
392537 |
CNF_SSL_CHECK_HOST,
|
|
Packit Service |
392537 |
CNF_SSL_CHECK_CERTIFICATE_HOST,
|
|
Packit Service |
392537 |
CNF_SSL_DIR,
|
|
Packit Service |
392537 |
CNF_SSL_CHECK_FINGERPRINT,
|
|
Packit Service |
392537 |
CNF_HOSTNAME,
|
|
Packit Service |
392537 |
CNF_CNF /* sentinel */
|
|
Packit Service |
392537 |
} confparm_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a confparm_key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: confparm_key
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *getconf(confparm_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this global parameter been seen?
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: confparm_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define getconf_seen(key) (val_t_seen(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_linenum(key) (val_t_seen(getconf((key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* Fetch a global parameter of a specific type. Note that these
|
|
Packit Service |
392537 |
* convenience macros have a different form from those for the
|
|
Packit Service |
392537 |
* subsections: here you specify a type and a key, while for the
|
|
Packit Service |
392537 |
* subsections you specify only a key. The difference is historical.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: confparm_key
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define getconf_int(key) (val_t_to_int(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_int64(key) (val_t_to_int64(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_real(key) (val_t_to_real(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_str(key) (val_t_to_str(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_ident(key) (val_t_to_ident(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_identlist(key) (val_t_to_identlist(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_time(key) (val_t_to_time(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_size(key) (val_t_to_size(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_boolean(key) (val_t_to_boolean(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_no_yes_all(key) (val_t_to_no_yes_all(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_compress(key) (val_t_to_compress(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_encrypt(key) (val_t_to_encrypt(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_holding(key) (val_t_to_holding(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_estimatelist(key) (val_t_to_estimatelist(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_strategy(key) (val_t_to_strategy(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_taperalgo(key) (val_t_to_taperalgo(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_priority(key) (val_t_to_priority(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_rate(key) (val_t_to_rate(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_exinclude(key) (val_t_to_exinclude(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_intrange(key) (val_t_to_intrange(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_proplist(key) (val_t_to_proplist(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_send_amreport(key) (val_t_to_send_amreport(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_autolabel(key) (val_t_to_autolabel(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_labelstr(key) (val_t_to_labelstr(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_part_cache_type(key) (val_t_to_part_cache_type(getconf((key))))
|
|
Packit Service |
392537 |
#define getconf_recovery_limit(key) (val_t_to_host_limit(getconf((key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get a list of names for subsections of the given type
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param listname: the desired type of subsection
|
|
Packit Service |
392537 |
* @returns: list of subsection names; caller is responsible for freeing
|
|
Packit Service |
392537 |
* this list, but not the strings it points to, using g_slist_free().
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
GSList *getconf_list(char *listname);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get a configuration value by name, supporting the TYPE:SUBSEC:KEYWORD.
|
|
Packit Service |
392537 |
* Returns NULL if the configuration value doesnt exist.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *getconf_byname(char *key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *confparm_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Derived values
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Values which aren't directly specified by the configuration, but which
|
|
Packit Service |
392537 |
* are derived from it.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Return a divisor which will convert a value in units of kilo-whatevers
|
|
Packit Service |
392537 |
* to the user's selected display unit.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @returns: long integer divisor
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
long int getconf_unit_divisor(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
extern char *prepend_prefix;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* If any of these globals are true, the corresponding component will
|
|
Packit Service |
392537 |
* send verbose debugging output to the debug file. The options are
|
|
Packit Service |
392537 |
* set during config_init, but can be modified at will after that if
|
|
Packit Service |
392537 |
* desired. */
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
extern int debug_amandad;
|
|
Packit Service |
392537 |
extern int debug_recovery;
|
|
Packit Service |
392537 |
extern int debug_amidxtaped;
|
|
Packit Service |
392537 |
extern int debug_amindexd;
|
|
Packit Service |
392537 |
extern int debug_amrecover;
|
|
Packit Service |
392537 |
extern int debug_auth;
|
|
Packit Service |
392537 |
extern int debug_event;
|
|
Packit Service |
392537 |
extern int debug_holding;
|
|
Packit Service |
392537 |
extern int debug_protocol;
|
|
Packit Service |
392537 |
extern int debug_planner;
|
|
Packit Service |
392537 |
extern int debug_driver;
|
|
Packit Service |
392537 |
extern int debug_dumper;
|
|
Packit Service |
392537 |
extern int debug_chunker;
|
|
Packit Service |
392537 |
extern int debug_taper;
|
|
Packit Service |
392537 |
extern int debug_selfcheck;
|
|
Packit Service |
392537 |
extern int debug_sendsize;
|
|
Packit Service |
392537 |
extern int debug_sendbackup;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Tapetype parameter access
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
TAPETYPE_COMMENT,
|
|
Packit Service |
392537 |
TAPETYPE_LBL_TEMPL,
|
|
Packit Service |
392537 |
TAPETYPE_BLOCKSIZE,
|
|
Packit Service |
392537 |
TAPETYPE_READBLOCKSIZE,
|
|
Packit Service |
392537 |
TAPETYPE_LENGTH,
|
|
Packit Service |
392537 |
TAPETYPE_FILEMARK,
|
|
Packit Service |
392537 |
TAPETYPE_SPEED,
|
|
Packit Service |
392537 |
TAPETYPE_PART_SIZE,
|
|
Packit Service |
392537 |
TAPETYPE_PART_CACHE_TYPE,
|
|
Packit Service |
392537 |
TAPETYPE_PART_CACHE_DIR,
|
|
Packit Service |
392537 |
TAPETYPE_PART_CACHE_MAX_SIZE,
|
|
Packit Service |
392537 |
TAPETYPE_TAPETYPE /* sentinel */
|
|
Packit Service |
392537 |
} tapetype_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct tapetype_s tapetype_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the tapetype, return a tapetype object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching tapetype exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired tapetype
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
tapetype_t *lookup_tapetype(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a tapetype and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the tapetype to examine
|
|
Packit Service |
392537 |
* @param key: tapetype_key (one of the TAPETYPE_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *tapetype_getconf(tapetype_t *ttyp, tapetype_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this tapetype.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the tapetype to examine
|
|
Packit Service |
392537 |
* @returns: name of the tapetype
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *tapetype_name(tapetype_t *ttyp);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *tapetype_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this tapetype? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the tapetype.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: tapetype_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define tapetype_seen(ttyp, key) (val_t_seen(tapetype_getconf((ttyp), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the tapetype to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define tapetype_get_comment(ttyp) (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_COMMENT)))
|
|
Packit Service |
392537 |
#define tapetype_get_lbl_templ(ttyp) (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_LBL_TEMPL)))
|
|
Packit Service |
392537 |
#define tapetype_get_blocksize(ttyp) (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_BLOCKSIZE)))
|
|
Packit Service |
392537 |
#define tapetype_get_readblocksize(ttyp) (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_READBLOCKSIZE)))
|
|
Packit Service |
392537 |
#define tapetype_get_length(ttyp) (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_LENGTH)))
|
|
Packit Service |
392537 |
#define tapetype_get_filemark(ttyp) (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_FILEMARK)))
|
|
Packit Service |
392537 |
#define tapetype_get_speed(ttyp) (val_t_to_int(tapetype_getconf((ttyp), TAPETYPE_SPEED)))
|
|
Packit Service |
392537 |
#define tapetype_get_part_size(ttyp) (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_PART_SIZE)))
|
|
Packit Service |
392537 |
#define tapetype_get_part_cache_type(ttyp) (val_t_to_part_cache_type(tapetype_getconf((ttyp), TAPETYPE_PART_CACHE_TYPE)))
|
|
Packit Service |
392537 |
#define tapetype_get_part_cache_dir(ttyp) (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_PART_CACHE_DIR)))
|
|
Packit Service |
392537 |
#define tapetype_get_part_cache_max_size(ttyp) (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_PART_CACHE_MAX_SIZE)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Dumptype parameter access
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Note that some parameters are generic to the host
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
DUMPTYPE_COMMENT,
|
|
Packit Service |
392537 |
DUMPTYPE_PROGRAM,
|
|
Packit Service |
392537 |
DUMPTYPE_SRVCOMPPROG,
|
|
Packit Service |
392537 |
DUMPTYPE_CLNTCOMPPROG,
|
|
Packit Service |
392537 |
DUMPTYPE_SRV_ENCRYPT,
|
|
Packit Service |
392537 |
DUMPTYPE_CLNT_ENCRYPT,
|
|
Packit Service |
392537 |
DUMPTYPE_AMANDAD_PATH, /* host parameter */
|
|
Packit Service |
392537 |
DUMPTYPE_CLIENT_USERNAME, /* host parameter */
|
|
Packit Service |
392537 |
DUMPTYPE_SSH_KEYS, /* host parameter */
|
|
Packit Service |
392537 |
DUMPTYPE_AUTH, /* host parameter */
|
|
Packit Service |
392537 |
DUMPTYPE_EXCLUDE,
|
|
Packit Service |
392537 |
DUMPTYPE_INCLUDE,
|
|
Packit Service |
392537 |
DUMPTYPE_PRIORITY,
|
|
Packit Service |
392537 |
DUMPTYPE_DUMPCYCLE,
|
|
Packit Service |
392537 |
DUMPTYPE_MAXDUMPS, /* host parameter */
|
|
Packit Service |
392537 |
DUMPTYPE_MAXPROMOTEDAY,
|
|
Packit Service |
392537 |
DUMPTYPE_BUMPPERCENT,
|
|
Packit Service |
392537 |
DUMPTYPE_BUMPSIZE,
|
|
Packit Service |
392537 |
DUMPTYPE_BUMPDAYS,
|
|
Packit Service |
392537 |
DUMPTYPE_BUMPMULT,
|
|
Packit Service |
392537 |
DUMPTYPE_STARTTIME,
|
|
Packit Service |
392537 |
DUMPTYPE_STRATEGY,
|
|
Packit Service |
392537 |
DUMPTYPE_ESTIMATELIST,
|
|
Packit Service |
392537 |
DUMPTYPE_COMPRESS,
|
|
Packit Service |
392537 |
DUMPTYPE_ENCRYPT,
|
|
Packit Service |
392537 |
DUMPTYPE_SRV_DECRYPT_OPT,
|
|
Packit Service |
392537 |
DUMPTYPE_CLNT_DECRYPT_OPT,
|
|
Packit Service |
392537 |
DUMPTYPE_COMPRATE,
|
|
Packit Service |
392537 |
DUMPTYPE_TAPE_SPLITSIZE,
|
|
Packit Service |
392537 |
DUMPTYPE_FALLBACK_SPLITSIZE,
|
|
Packit Service |
392537 |
DUMPTYPE_SPLIT_DISKBUFFER,
|
|
Packit Service |
392537 |
DUMPTYPE_RECORD,
|
|
Packit Service |
392537 |
DUMPTYPE_SKIP_INCR,
|
|
Packit Service |
392537 |
DUMPTYPE_SKIP_FULL,
|
|
Packit Service |
392537 |
DUMPTYPE_HOLDINGDISK,
|
|
Packit Service |
392537 |
DUMPTYPE_KENCRYPT,
|
|
Packit Service |
392537 |
DUMPTYPE_IGNORE,
|
|
Packit Service |
392537 |
DUMPTYPE_INDEX,
|
|
Packit Service |
392537 |
DUMPTYPE_APPLICATION,
|
|
Packit Service |
392537 |
DUMPTYPE_SCRIPTLIST,
|
|
Packit Service |
392537 |
DUMPTYPE_PROPERTY,
|
|
Packit Service |
392537 |
DUMPTYPE_CLIENT_PORT,
|
|
Packit Service |
392537 |
DUMPTYPE_DATA_PATH,
|
|
Packit Service |
392537 |
DUMPTYPE_ALLOW_SPLIT,
|
|
Packit Service |
392537 |
DUMPTYPE_RECOVERY_LIMIT,
|
|
Packit Service |
392537 |
DUMPTYPE_DUMP_LIMIT,
|
|
Packit Service |
392537 |
DUMPTYPE_MAX_WARNINGS,
|
|
Packit Service |
392537 |
DUMPTYPE_RETRY_DUMP,
|
|
Packit Service |
392537 |
DUMPTYPE_TAG,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_FINGERPRINT_FILE,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_CERT_FILE,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_KEY_FILE,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_CA_CERT_FILE,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_CIPHER_LIST,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_CHECK_HOST,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_CHECK_CERTIFICATE_HOST,
|
|
Packit Service |
392537 |
DUMPTYPE_SSL_CHECK_FINGERPRINT,
|
|
Packit Service |
392537 |
DUMPTYPE_DUMPTYPE /* sentinel */
|
|
Packit Service |
392537 |
} dumptype_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct dumptype_s dumptype_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the dumptype, return a dumptype object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching dumptype exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired dumptype
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
dumptype_t *lookup_dumptype(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a dumptype and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param dtyp: the dumptype to examine
|
|
Packit Service |
392537 |
* @param key: dumptype_key (one of the TAPETYPE_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *dumptype_getconf(dumptype_t *dtyp, dumptype_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this dumptype.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param dtyp: the dumptype to examine
|
|
Packit Service |
392537 |
* @returns: name of the dumptype
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *dumptype_name(dumptype_t *dtyp);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *dumptype_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this dumptype? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the dumptype.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: dumptype_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define dumptype_seen(dtyp, key) (val_t_seen(dumptype_getconf((dtyp), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param dtyp: the dumptype to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define dumptype_get_comment(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_COMMENT)))
|
|
Packit Service |
392537 |
#define dumptype_get_program(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_PROGRAM)))
|
|
Packit Service |
392537 |
#define dumptype_get_srvcompprog(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRVCOMPPROG)))
|
|
Packit Service |
392537 |
#define dumptype_get_clntcompprog(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNTCOMPPROG)))
|
|
Packit Service |
392537 |
#define dumptype_get_srv_encrypt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRV_ENCRYPT)))
|
|
Packit Service |
392537 |
#define dumptype_get_clnt_encrypt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNT_ENCRYPT)))
|
|
Packit Service |
392537 |
#define dumptype_get_amandad_path(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_AMANDAD_PATH)))
|
|
Packit Service |
392537 |
#define dumptype_get_client_username(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLIENT_USERNAME)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssh_keys(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSH_KEYS)))
|
|
Packit Service |
392537 |
#define dumptype_get_auth(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_AUTH)))
|
|
Packit Service |
392537 |
#define dumptype_get_exclude(dtyp) (val_t_to_exinclude(dumptype_getconf((dtyp), DUMPTYPE_EXCLUDE)))
|
|
Packit Service |
392537 |
#define dumptype_get_include(dtyp) (val_t_to_exinclude(dumptype_getconf((dtyp), DUMPTYPE_INCLUDE)))
|
|
Packit Service |
392537 |
#define dumptype_get_priority(dtyp) (val_t_to_priority(dumptype_getconf((dtyp), DUMPTYPE_PRIORITY)))
|
|
Packit Service |
392537 |
#define dumptype_get_dumpcycle(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_DUMPCYCLE)))
|
|
Packit Service |
392537 |
#define dumptype_get_maxcycle(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXCYCLE)))
|
|
Packit Service |
392537 |
#define dumptype_get_frequency(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_FREQUENCY)))
|
|
Packit Service |
392537 |
#define dumptype_get_maxdumps(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXDUMPS)))
|
|
Packit Service |
392537 |
#define dumptype_get_maxpromoteday(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXPROMOTEDAY)))
|
|
Packit Service |
392537 |
#define dumptype_get_bumppercent(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPPERCENT)))
|
|
Packit Service |
392537 |
#define dumptype_get_bumpsize(dtyp) (val_t_to_int64(dumptype_getconf((dtyp), DUMPTYPE_BUMPSIZE)))
|
|
Packit Service |
392537 |
#define dumptype_get_bumpdays(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPDAYS)))
|
|
Packit Service |
392537 |
#define dumptype_get_bumpmult(dtyp) (val_t_to_real(dumptype_getconf((dtyp), DUMPTYPE_BUMPMULT)))
|
|
Packit Service |
392537 |
#define dumptype_get_starttime(dtyp) (val_t_to_time(dumptype_getconf((dtyp), DUMPTYPE_STARTTIME)))
|
|
Packit Service |
392537 |
#define dumptype_get_strategy(dtyp) (val_t_to_strategy(dumptype_getconf((dtyp), DUMPTYPE_STRATEGY)))
|
|
Packit Service |
392537 |
#define dumptype_get_estimatelist(dtyp) (val_t_to_estimatelist(dumptype_getconf((dtyp), DUMPTYPE_ESTIMATELIST)))
|
|
Packit Service |
392537 |
#define dumptype_get_compress(dtyp) (val_t_to_compress(dumptype_getconf((dtyp), DUMPTYPE_COMPRESS)))
|
|
Packit Service |
392537 |
#define dumptype_get_encrypt(dtyp) (val_t_to_encrypt(dumptype_getconf((dtyp), DUMPTYPE_ENCRYPT)))
|
|
Packit Service |
392537 |
#define dumptype_get_srv_decrypt_opt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRV_DECRYPT_OPT)))
|
|
Packit Service |
392537 |
#define dumptype_get_clnt_decrypt_opt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNT_DECRYPT_OPT)))
|
|
Packit Service |
392537 |
#define dumptype_get_comprate(dtyp) (val_t_to_rate(dumptype_getconf((dtyp), DUMPTYPE_COMPRATE)))
|
|
Packit Service |
392537 |
#define dumptype_get_tape_splitsize(dtyp) (val_t_to_int64(dumptype_getconf((dtyp), DUMPTYPE_TAPE_SPLITSIZE)))
|
|
Packit Service |
392537 |
#define dumptype_get_fallback_splitsize(dtyp) (val_t_to_int64(dumptype_getconf((dtyp), DUMPTYPE_FALLBACK_SPLITSIZE)))
|
|
Packit Service |
392537 |
#define dumptype_get_split_diskbuffer(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SPLIT_DISKBUFFER)))
|
|
Packit Service |
392537 |
#define dumptype_get_record(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_RECORD)))
|
|
Packit Service |
392537 |
#define dumptype_get_skip_incr(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SKIP_INCR)))
|
|
Packit Service |
392537 |
#define dumptype_get_skip_full(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SKIP_FULL)))
|
|
Packit Service |
392537 |
#define dumptype_get_to_holdingdisk(dtyp) (val_t_to_holding(dumptype_getconf((dtyp), DUMPTYPE_HOLDINGDISK)))
|
|
Packit Service |
392537 |
#define dumptype_get_kencrypt(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_KENCRYPT)))
|
|
Packit Service |
392537 |
#define dumptype_get_ignore(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_IGNORE)))
|
|
Packit Service |
392537 |
#define dumptype_get_index(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_INDEX)))
|
|
Packit Service |
392537 |
#define dumptype_get_application(dtyp) (val_t_to_application(dumptype_getconf((dtyp), DUMPTYPE_APPLICATION)))
|
|
Packit Service |
392537 |
#define dumptype_get_scriptlist(dtyp) (val_t_to_identlist(dumptype_getconf((dtyp), DUMPTYPE_SCRIPTLIST)))
|
|
Packit Service |
392537 |
#define dumptype_get_property(dtyp) (val_t_to_proplist(dumptype_getconf((dtyp), DUMPTYPE_PROPERTY)))
|
|
Packit Service |
392537 |
#define dumptype_get_client_port(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLIENT_PORT)))
|
|
Packit Service |
392537 |
#define dumptype_get_data_path(dtyp) (val_t_to_data_path(dumptype_getconf((dtyp), DUMPTYPE_DATA_PATH)))
|
|
Packit Service |
392537 |
#define dumptype_get_allow_split(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_ALLOW_SPLIT)))
|
|
Packit Service |
392537 |
#define dumptype_get_recovery_limit(dtyp) (val_t_to_host_limit(dumptype_getconf((dtyp), DUMPTYPE_RECOVERY_LIMIT)))
|
|
Packit Service |
392537 |
#define dumptype_get_dump_limit(dtyp) (val_t_to_host_limit(dumptype_getconf((dtyp), DUMPTYPE_DUMP_LIMIT)))
|
|
Packit Service |
392537 |
#define dumptype_get_max_warnings(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAX_WARNINGS)))
|
|
Packit Service |
392537 |
#define dumptype_get_retry_dump(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_RETRY_DUMP)))
|
|
Packit Service |
392537 |
#define dumptype_get_tags(dtyp) (val_t_to_str_list(dumptype_getconf((dtyp), DUMPTYPE_TAG)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_fingerprint_file(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSL_FINGERPRINT_FILE)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_cert_file(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSL_CERT_FILE)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_key_file(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSL_KEY_FILE)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_ca_cert_file(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSL_CA_CERT_FILE)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_cipher_list(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSL_CIPHER_LIST)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_check_host(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SSL_CHECK_HOST)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_check_certificate_host(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SSL_CHECK_CERTIFICATE_HOST)))
|
|
Packit Service |
392537 |
#define dumptype_get_ssl_check_fingerprint(dtyp)(val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SSL_CHECK_FINGERPRINT)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Interface parameter access
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
INTER_COMMENT,
|
|
Packit Service |
392537 |
INTER_MAXUSAGE,
|
|
Packit Service |
392537 |
INTER_SRC_IP,
|
|
Packit Service |
392537 |
INTER_INTER /* sentinel */
|
|
Packit Service |
392537 |
} interface_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct interface_s interface_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the interface, return a interface object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching interface exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired interface
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
interface_t *lookup_interface(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a interface and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param iface: the interface to examine
|
|
Packit Service |
392537 |
* @param key: interface_key (one of the TAPETYPE_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *interface_getconf(interface_t *iface, interface_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this interface.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param iface: the interface to examine
|
|
Packit Service |
392537 |
* @returns: name of the interface
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *interface_name(interface_t *iface);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *interface_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this interface? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the interface.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: interface_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define interface_seen(iface, key) (val_t_seen(interface_getconf((iface), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param iface: the interface to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define interface_get_comment(iface) (val_t_to_str(interface_getconf((iface), INTER_COMMENT)))
|
|
Packit Service |
392537 |
#define interface_get_maxusage(iface) (val_t_to_int(interface_getconf((iface), INTER_MAXUSAGE)))
|
|
Packit Service |
392537 |
#define interface_get_src_ip(iface) (val_t_to_str(interface_getconf((iface), INTER_SRC_IP)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Holdingdisk parameter access
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
HOLDING_COMMENT,
|
|
Packit Service |
392537 |
HOLDING_DISKDIR,
|
|
Packit Service |
392537 |
HOLDING_DISKSIZE,
|
|
Packit Service |
392537 |
HOLDING_CHUNKSIZE,
|
|
Packit Service |
392537 |
HOLDING_HOLDING /* sentinel */
|
|
Packit Service |
392537 |
} holdingdisk_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct holdingdisk_s holdingdisk_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the holdingdisk, return a holdingdisk object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching holdingdisk exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired holdingdisk
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
holdingdisk_t *lookup_holdingdisk(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Return the whole linked list of holdingdisks.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @returns: first holding disk
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
GSList *getconf_holdingdisks(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a holdingdisk and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param hdisk: the holdingdisk to examine
|
|
Packit Service |
392537 |
* @param key: holdingdisk_key (one of the TAPETYPE_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *holdingdisk_getconf(holdingdisk_t *hdisk, holdingdisk_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this holdingdisk.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param hdisk: the holdingdisk to examine
|
|
Packit Service |
392537 |
* @returns: name of the holdingdisk
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *holdingdisk_name(holdingdisk_t *hdisk);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *holdingdisk_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this holdingdisk? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the holdingdisk.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: holdingdisk_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define holdingdisk_seen(hdisk, key) (val_t_seen(holdingdisk_getconf((hdisk), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param hdisk: the holdingdisk to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define holdingdisk_get_comment(hdisk) (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_COMMENT)))
|
|
Packit Service |
392537 |
#define holdingdisk_get_diskdir(hdisk) (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_DISKDIR)))
|
|
Packit Service |
392537 |
#define holdingdisk_get_disksize(hdisk) (val_t_to_int64(holdingdisk_getconf((hdisk), HOLDING_DISKSIZE)))
|
|
Packit Service |
392537 |
#define holdingdisk_get_chunksize(hdisk) (val_t_to_int64(holdingdisk_getconf((hdisk), HOLDING_CHUNKSIZE)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A application-tool interface */
|
|
Packit Service |
392537 |
typedef enum application_e {
|
|
Packit Service |
392537 |
APPLICATION_COMMENT,
|
|
Packit Service |
392537 |
APPLICATION_PLUGIN,
|
|
Packit Service |
392537 |
APPLICATION_PROPERTY,
|
|
Packit Service |
392537 |
APPLICATION_CLIENT_NAME,
|
|
Packit Service |
392537 |
APPLICATION_APPLICATION
|
|
Packit Service |
392537 |
} application_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct application_s application_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the application, return a application object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching application exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired application
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
application_t *lookup_application(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a application and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the application to examine
|
|
Packit Service |
392537 |
* @param key: application (one of the APPLICATION_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *application_getconf(application_t *app, application_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this application.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the application to examine
|
|
Packit Service |
392537 |
* @returns: name of the application
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *application_name(application_t *app);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *application_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this application? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the application.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: application_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define application_seen(app, key) (val_t_seen(application_getconf((app), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the application to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define application_get_comment(application) (val_t_to_str(application_getconf((application), APPLICATION_COMMENT))
|
|
Packit Service |
392537 |
#define application_get_plugin(application) (val_t_to_str(application_getconf((application), APPLICATION_PLUGIN)))
|
|
Packit Service |
392537 |
#define application_get_property(application) (val_t_to_proplist(application_getconf((application), APPLICATION_PROPERTY)))
|
|
Packit Service |
392537 |
#define application_get_client_name(application) (val_t_to_str(application_getconf((application), APPLICATION_CLIENT_NAME)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A pp-script-tool interface */
|
|
Packit Service |
392537 |
typedef enum pp_script_e {
|
|
Packit Service |
392537 |
PP_SCRIPT_COMMENT,
|
|
Packit Service |
392537 |
PP_SCRIPT_PLUGIN,
|
|
Packit Service |
392537 |
PP_SCRIPT_PROPERTY,
|
|
Packit Service |
392537 |
PP_SCRIPT_EXECUTE_ON,
|
|
Packit Service |
392537 |
PP_SCRIPT_EXECUTE_WHERE,
|
|
Packit Service |
392537 |
PP_SCRIPT_ORDER,
|
|
Packit Service |
392537 |
PP_SCRIPT_SINGLE_EXECUTION,
|
|
Packit Service |
392537 |
PP_SCRIPT_CLIENT_NAME,
|
|
Packit Service |
392537 |
PP_SCRIPT_PP_SCRIPT
|
|
Packit Service |
392537 |
} pp_script_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct pp_script_s pp_script_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the pp_script, return a pp_script object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching pp_script exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired pp_script
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
pp_script_t *lookup_pp_script(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a pp_script and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the pp_script to examine
|
|
Packit Service |
392537 |
* @param key: pp_script (one of the PP_SCRIPT_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *pp_script_getconf(pp_script_t *pps, pp_script_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this pp_script.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the pp_script to examine
|
|
Packit Service |
392537 |
* @returns: name of the pp_script
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *pp_script_name(pp_script_t *pps);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *pp_script_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this pp_script? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the pp_script.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: pp_script_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define pp_script_seen(pps, key) (val_t_seen(pp_script_getconf((pps), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the pp_script to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#define pp_script_get_comment(pp_script) (val_t_to_str(pp_script_getconf((pp_script), PP_SCRIPT_COMMENT)))
|
|
Packit Service |
392537 |
#define pp_script_get_plugin(pp_script) (val_t_to_str(pp_script_getconf((pp_script), PP_SCRIPT_PLUGIN)))
|
|
Packit Service |
392537 |
#define pp_script_get_property(pp_script) (val_t_to_proplist(pp_script_getconf((pp_script), PP_SCRIPT_PROPERTY)))
|
|
Packit Service |
392537 |
#define pp_script_get_execute_on(pp_script) (val_t_to_execute_on(pp_script_getconf((pp_script), PP_SCRIPT_EXECUTE_ON)))
|
|
Packit Service |
392537 |
#define pp_script_get_execute_where(pp_script) (val_t_to_execute_where(pp_script_getconf((pp_script), PP_SCRIPT_EXECUTE_WHERE)))
|
|
Packit Service |
392537 |
#define pp_script_get_order(pp_script) (val_t_to_int(pp_script_getconf((pp_script), PP_SCRIPT_ORDER)))
|
|
Packit Service |
392537 |
#define pp_script_get_single_execution(pp_script) (val_t_to_boolean(pp_script_getconf((pp_script), PP_SCRIPT_SINGLE_EXECUTION)))
|
|
Packit Service |
392537 |
#define pp_script_get_client_name(pp_script) (val_t_to_str(pp_script_getconf((pp_script), PP_SCRIPT_CLIENT_NAME)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
pp_script_t *lookup_pp_script(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A device definition */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
DEVICE_CONFIG_COMMENT,
|
|
Packit Service |
392537 |
DEVICE_CONFIG_TAPEDEV,
|
|
Packit Service |
392537 |
DEVICE_CONFIG_DEVICE_PROPERTY,
|
|
Packit Service |
392537 |
DEVICE_CONFIG_DEVICE_CONFIG
|
|
Packit Service |
392537 |
} device_config_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct device_config_s device_config_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the device, return a device_config_t object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching device exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired device
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
device_config_t *lookup_device_config(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a device_config and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the device_config to examine
|
|
Packit Service |
392537 |
* @param key: device_config (one of the DEVICE_CONFIG_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *device_config_getconf(device_config_t *devconf, device_config_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this device_config.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the device_config to examine
|
|
Packit Service |
392537 |
* @returns: name of the device_config
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *device_config_name(device_config_t *devconf);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *device_config_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this device_config? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the device_config.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: device_config_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define device_config_seen(devconf, key) (val_t_seen(device_config_getconf((devconf), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param devconf: the device_config to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#define device_config_get_comment(devconf) (val_t_to_str(device_config_getconf((devconf), DEVICE_CONFIG_COMMENT)))
|
|
Packit Service |
392537 |
#define device_config_get_tapedev(devconf) (val_t_to_str(device_config_getconf((devconf), DEVICE_CONFIG_TAPEDEV)))
|
|
Packit Service |
392537 |
#define device_config_get_property(devconf) (val_t_to_proplist(device_config_getconf((devconf), DEVICE_CONFIG_DEVICE_PROPERTY)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
device_config_t *lookup_device_config(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A changer definition */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
CHANGER_CONFIG_COMMENT,
|
|
Packit Service |
392537 |
CHANGER_CONFIG_TAPEDEV,
|
|
Packit Service |
392537 |
CHANGER_CONFIG_TPCHANGER,
|
|
Packit Service |
392537 |
CHANGER_CONFIG_CHANGERDEV,
|
|
Packit Service |
392537 |
CHANGER_CONFIG_CHANGERFILE,
|
|
Packit Service |
392537 |
CHANGER_CONFIG_PROPERTY,
|
|
Packit Service |
392537 |
CHANGER_CONFIG_DEVICE_PROPERTY,
|
|
Packit Service |
392537 |
CHANGER_CONFIG_CHANGER_CONFIG
|
|
Packit Service |
392537 |
} changer_config_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
char **get_changer_list(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct changer_config_s changer_config_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the changer, return a changer_config_t object. Returns NULL
|
|
Packit Service |
392537 |
* if no matching changer exists. Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired changer
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
changer_config_t *lookup_changer_config(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a changer_config and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the changer_config to examine
|
|
Packit Service |
392537 |
* @param key: changer_config (one of the DEVICE_CONFIG_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *changer_config_getconf(changer_config_t *devconf, changer_config_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this changer_config.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the changer_config to examine
|
|
Packit Service |
392537 |
* @returns: name of the changer_config
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *changer_config_name(changer_config_t *devconf);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *changer_config_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this changer_config? This
|
|
Packit Service |
392537 |
* applies to the specific parameter *within* the changer_config.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: changer_config_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define changer_config_seen(devconf, key) (val_t_seen(changer_config_getconf((devconf), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param devconf: the changer_config to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#define changer_config_get_comment(devconf) (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_COMMENT)))
|
|
Packit Service |
392537 |
#define changer_config_get_tapedev(devconf) (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_TAPEDEV)))
|
|
Packit Service |
392537 |
#define changer_config_get_tpchanger(devconf) (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_TPCHANGER)))
|
|
Packit Service |
392537 |
#define changer_config_get_changerdev(devconf) (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_CHANGERDEV)))
|
|
Packit Service |
392537 |
#define changer_config_get_changerfile(devconf) (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_CHANGERFILE)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
changer_config_t *lookup_changer_config(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A interacrtivity interface */
|
|
Packit Service |
392537 |
typedef enum interactivity_e {
|
|
Packit Service |
392537 |
INTERACTIVITY_COMMENT,
|
|
Packit Service |
392537 |
INTERACTIVITY_PLUGIN,
|
|
Packit Service |
392537 |
INTERACTIVITY_PROPERTY,
|
|
Packit Service |
392537 |
INTERACTIVITY_INTERACTIVITY
|
|
Packit Service |
392537 |
} interactivity_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct interactivity_s interactivity_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the interactivity, return a interactivity object.
|
|
Packit Service |
392537 |
* Returns NULL if no matching interactivity exists.
|
|
Packit Service |
392537 |
* Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired interactivity
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
interactivity_t *lookup_interactivity(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a interactivity and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the interactivity to examine
|
|
Packit Service |
392537 |
* @param key: interactivity (one of the INTERACTIVITY_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *interactivity_getconf(interactivity_t *app, interactivity_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this interactivity.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the interactivity to examine
|
|
Packit Service |
392537 |
* @returns: name of the interactivity
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *interactivity_name(interactivity_t *app);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *interactivity_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this interactivity?
|
|
Packit Service |
392537 |
* This applies to the specific parameter *within* the interactivity.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: interactivity_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define interactivity_seen(app, key) (val_t_seen(interactivity_getconf((app), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the interactivity to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define interactivity_get_comment(interactivity) (val_t_to_str(interactivity_getconf((interactivity), INTERACTIVITY_COMMENT))
|
|
Packit Service |
392537 |
#define interactivity_get_plugin(interactivity) (val_t_to_str(interactivity_getconf((interactivity), INTERACTIVITY_PLUGIN)))
|
|
Packit Service |
392537 |
#define interactivity_get_property(interactivity) (val_t_to_proplist(interactivity_getconf((interactivity), INTERACTIVITY_PROPERTY)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A taperscan interface */
|
|
Packit Service |
392537 |
typedef enum taperscan_e {
|
|
Packit Service |
392537 |
TAPERSCAN_COMMENT,
|
|
Packit Service |
392537 |
TAPERSCAN_PLUGIN,
|
|
Packit Service |
392537 |
TAPERSCAN_PROPERTY,
|
|
Packit Service |
392537 |
TAPERSCAN_TAPERSCAN
|
|
Packit Service |
392537 |
} taperscan_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct taperscan_s taperscan_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the taperscan, return a taperscan object.
|
|
Packit Service |
392537 |
* Returns NULL if no matching taperscan exists.
|
|
Packit Service |
392537 |
* Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired taperscan
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
taperscan_t *lookup_taperscan(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a taperscan and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the taperscan to examine
|
|
Packit Service |
392537 |
* @param key: taperscan (one of the TAPERSCAN_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *taperscan_getconf(taperscan_t *app, taperscan_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this taperscan.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the taperscan to examine
|
|
Packit Service |
392537 |
* @returns: name of the taperscan
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *taperscan_name(taperscan_t *app);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *taperscan_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this taperscan?
|
|
Packit Service |
392537 |
* This applies to the specific parameter *within* the taperscan.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: taperscan_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define taperscan_seen(app, key) (val_t_seen(taperscan_getconf((app), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the taperscan to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define taperscan_get_comment(taperscan) (val_t_to_str(taperscan_getconf((taperscan), TAPERSCAN_COMMENT)))
|
|
Packit Service |
392537 |
#define taperscan_get_plugin(taperscan) (val_t_to_str(taperscan_getconf((taperscan), TAPERSCAN_PLUGIN)))
|
|
Packit Service |
392537 |
#define taperscan_get_property(taperscan) (val_t_to_proplist(taperscan_getconf((taperscan), TAPERSCAN_PROPERTY)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A policy interface */
|
|
Packit Service |
392537 |
typedef enum policy_e {
|
|
Packit Service |
392537 |
POLICY_COMMENT,
|
|
Packit Service |
392537 |
POLICY_RETENTION_TAPES,
|
|
Packit Service |
392537 |
POLICY_RETENTION_DAYS,
|
|
Packit Service |
392537 |
POLICY_RETENTION_RECOVER,
|
|
Packit Service |
392537 |
POLICY_RETENTION_FULL,
|
|
Packit Service |
392537 |
POLICY_POLICY
|
|
Packit Service |
392537 |
} policy_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct policy_s policy_s;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the policy, return a policy object.
|
|
Packit Service |
392537 |
* Returns NULL if no matching policy exists.
|
|
Packit Service |
392537 |
* Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired policy
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
policy_s *lookup_policy(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a policy and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the policy to examine
|
|
Packit Service |
392537 |
* @param key: policy (one of the TAPERSCAN_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *policy_getconf(policy_s *app, policy_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this policy.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the policy to examine
|
|
Packit Service |
392537 |
* @returns: name of the policy
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *policy_name(policy_s *app);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *policy_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this policy?
|
|
Packit Service |
392537 |
* This applies to the specific parameter *within* the policy.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: policy_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define policy_seen(app, key) (val_t_seen(policy_getconf((app), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the policy to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define policy_get_comment(policy) (val_t_to_str(policy_getconf((policy), POLICY_COMMENT)))
|
|
Packit Service |
392537 |
#define policy_get_retention_tapes(policy) (val_t_to_int(policy_getconf((policy), POLICY_RETENTION_TAPES)))
|
|
Packit Service |
392537 |
#define policy_get_retention_days(policy) (val_t_to_int(policy_getconf((policy), POLICY_RETENTION_DAYS)))
|
|
Packit Service |
392537 |
#define policy_get_retention_recover(policy) (val_t_to_int(policy_getconf((policy), POLICY_RETENTION_RECOVER)))
|
|
Packit Service |
392537 |
#define policy_get_retention_full(policy) (val_t_to_int(policy_getconf((policy), POLICY_RETENTION_FULL)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* A storage interface */
|
|
Packit Service |
392537 |
typedef enum storage_e {
|
|
Packit Service |
392537 |
STORAGE_COMMENT,
|
|
Packit Service |
392537 |
STORAGE_POLICY,
|
|
Packit Service |
392537 |
STORAGE_TAPEDEV,
|
|
Packit Service |
392537 |
STORAGE_TPCHANGER,
|
|
Packit Service |
392537 |
STORAGE_LABELSTR,
|
|
Packit Service |
392537 |
STORAGE_AUTOLABEL,
|
|
Packit Service |
392537 |
STORAGE_META_AUTOLABEL,
|
|
Packit Service |
392537 |
STORAGE_TAPEPOOL,
|
|
Packit Service |
392537 |
STORAGE_RUNTAPES,
|
|
Packit Service |
392537 |
STORAGE_TAPERSCAN,
|
|
Packit Service |
392537 |
STORAGE_TAPETYPE,
|
|
Packit Service |
392537 |
STORAGE_MAX_DLE_BY_VOLUME,
|
|
Packit Service |
392537 |
STORAGE_TAPERALGO,
|
|
Packit Service |
392537 |
STORAGE_TAPER_PARALLEL_WRITE,
|
|
Packit Service |
392537 |
STORAGE_EJECT_VOLUME,
|
|
Packit Service |
392537 |
STORAGE_ERASE_VOLUME,
|
|
Packit Service |
392537 |
STORAGE_DEVICE_OUTPUT_BUFFER_SIZE,
|
|
Packit Service |
392537 |
STORAGE_AUTOFLUSH,
|
|
Packit Service |
392537 |
STORAGE_FLUSH_THRESHOLD_DUMPED,
|
|
Packit Service |
392537 |
STORAGE_FLUSH_THRESHOLD_SCHEDULED,
|
|
Packit Service |
392537 |
STORAGE_TAPERFLUSH,
|
|
Packit Service |
392537 |
STORAGE_REPORT_USE_MEDIA,
|
|
Packit Service |
392537 |
STORAGE_REPORT_NEXT_MEDIA,
|
|
Packit Service |
392537 |
STORAGE_INTERACTIVITY,
|
|
Packit Service |
392537 |
STORAGE_SET_NO_REUSE,
|
|
Packit Service |
392537 |
STORAGE_DUMP_SELECTION,
|
|
Packit Service |
392537 |
STORAGE_ERASE_ON_FAILURE,
|
|
Packit Service |
392537 |
STORAGE_ERASE_ON_FULL,
|
|
Packit Service |
392537 |
STORAGE_VAULT_LIST,
|
|
Packit Service |
392537 |
STORAGE_STORAGE
|
|
Packit Service |
392537 |
} storage_key;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque object */
|
|
Packit Service |
392537 |
typedef struct storage_s storage_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
storage_t *get_first_storage(void);
|
|
Packit Service |
392537 |
storage_t *get_next_storage(storage_t *st);
|
|
Packit Service |
392537 |
char **get_storage_list(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given the name of the storage, return a storage object.
|
|
Packit Service |
392537 |
* Returns NULL if no matching storage exists.
|
|
Packit Service |
392537 |
* Note that the match is case-insensitive.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param identifier: name of the desired storage
|
|
Packit Service |
392537 |
* @returns: object or NULL
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
storage_t *lookup_storage(char *identifier);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a storage and a key, return a pointer to the corresponding val_t.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the storage to examine
|
|
Packit Service |
392537 |
* @param key: storage (one of the TAPERSCAN_* constants)
|
|
Packit Service |
392537 |
* @returns: pointer to value
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
val_t *storage_getconf(storage_t *app, storage_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the name of this storage.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the storage to examine
|
|
Packit Service |
392537 |
* @returns: name of the storage
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *storage_name(storage_t *app);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *storage_key_to_name(int parm);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macro) has this parameter been seen in this storage?
|
|
Packit Service |
392537 |
* This applies to the specific parameter *within* the storage.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param key: storage_key
|
|
Packit Service |
392537 |
* @returns: boolean
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define storage_seen(app, key) (val_t_seen(storage_getconf((app), (key))))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* (convenience macros)
|
|
Packit Service |
392537 |
* fetch a particular parameter; caller must know the correct type.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param ttyp: the storage to examine
|
|
Packit Service |
392537 |
* @returns: various
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#define storage_get_comment(storage) (val_t_to_str(storage_getconf((storage), STORAGE_COMMENT)))
|
|
Packit Service |
392537 |
#define storage_get_policy(storage) (val_t_to_str(storage_getconf((storage), STORAGE_POLICY)))
|
|
Packit Service |
392537 |
#define storage_get_tapedev(storage) (val_t_to_str(storage_getconf((storage), STORAGE_TAPEDEV)))
|
|
Packit Service |
392537 |
#define storage_get_tpchanger(storage) (val_t_to_str(storage_getconf((storage), STORAGE_TPCHANGER)))
|
|
Packit Service |
392537 |
#define storage_get_labelstr(storage) (val_t_to_labelstr(storage_getconf((storage), STORAGE_LABELSTR)))
|
|
Packit Service |
392537 |
#define storage_get_autolabel(storage) (val_t_to_autolabel(storage_getconf((storage), STORAGE_AUTOLABEL)))
|
|
Packit Service |
392537 |
#define storage_get_meta_autolabel(storage) (val_t_to_str(storage_getconf((storage), STORAGE_META_AUTOLABEL)))
|
|
Packit Service |
392537 |
#define storage_get_tapepool(storage) (val_t_to_str(storage_getconf((storage), STORAGE_TAPEPOOL)))
|
|
Packit Service |
392537 |
#define storage_get_runtapes(storage) (val_t_to_int(storage_getconf((storage), STORAGE_RUNTAPES)))
|
|
Packit Service |
392537 |
#define storage_get_taperscan(storage) (val_t_to_str(storage_getconf((storage), STORAGE_TAPERSCAN)))
|
|
Packit Service |
392537 |
#define storage_get_tapetype(storage) (val_t_to_str(storage_getconf((storage), STORAGE_TAPETYPE)))
|
|
Packit Service |
392537 |
#define storage_get_max_dle_by_volume(storage) (val_t_to_int(storage_getconf((storage), STORAGE_MAX_DLE_BY_VOLUME)))
|
|
Packit Service |
392537 |
#define storage_get_taperalgo(storage) (val_t_to_taperalgo(storage_getconf((storage), STORAGE_TAPERALGO)))
|
|
Packit Service |
392537 |
#define storage_get_taper_parallel_write(storage) (val_t_to_int(storage_getconf((storage), STORAGE_TAPER_PARALLEL_WRITE)))
|
|
Packit Service |
392537 |
#define storage_get_eject_volume(storage) (val_t_to_boolean(storage_getconf((storage), STORAGE_EJECT_VOLUME)))
|
|
Packit Service |
392537 |
#define storage_get_erase_volume(storage) (val_t_to_boolean(storage_getconf((storage), STORAGE_ERASE_VOLUME)))
|
|
Packit Service |
392537 |
#define storage_get_device_output_buffer_size(storage) (val_t_to_size(storage_getconf((storage), STORAGE_DEVICE_OUTPUT_BUFFER_SIZE)))
|
|
Packit Service |
392537 |
#define storage_get_autoflush(storage) (val_t_to_no_yes_all(storage_getconf((storage), STORAGE_AUTOFLUSH)))
|
|
Packit Service |
392537 |
#define storage_get_flush_threshold_dumped(storage) (val_t_to_int(storage_getconf((storage), STORAGE_FLUSH_THRESHOLD_DUMPED)))
|
|
Packit Service |
392537 |
#define storage_get_flush_threshold_scheduled(storage) (val_t_to_int(storage_getconf((storage), STORAGE_FLUSH_THRESHOLD_SCHEDULED)))
|
|
Packit Service |
392537 |
#define storage_get_taperflush(storage) (val_t_to_int(storage_getconf((storage), STORAGE_TAPERFLUSH)))
|
|
Packit Service |
392537 |
#define storage_get_report_use_media(storage) (val_t_to_bool(storage_getconf((storage), STORAGE_REPORT_USE_MEDIA)))
|
|
Packit Service |
392537 |
#define storage_get_report_next_media(storage) (val_t_to_bool(storage_getconf((storage), STORAGE_REPORT_NEXT_MEDIA)))
|
|
Packit Service |
392537 |
#define storage_get_interactivity(storage) (val_t_to_str(storage_getconf((storage), STORAGE_INTERACTIVITY)))
|
|
Packit Service |
392537 |
#define storage_get_set_no_reuse(storage) (val_t_to_bool(storage_getconf((storage), STORAGE_SET_NO_REUSE)))
|
|
Packit Service |
392537 |
#define storage_get_dump_selection(storage) (val_t_to_dump_selection(storage_getconf((storage), STORAGE_DUMP_SELECTION)))
|
|
Packit Service |
392537 |
#define storage_get_erase_on_failure(storage) (val_t_to_boolean(storage_getconf((storage), STORAGE_ERASE_ON_FAILURE)))
|
|
Packit Service |
392537 |
#define storage_get_erase_on_full(storage) (val_t_to_boolean(storage_getconf((storage), STORAGE_ERASE_ON_FULL)))
|
|
Packit Service |
392537 |
#define storage_get_vault_list(storage) (val_t_to_vault_list(storage_getconf((storage), STORAGE_VAULT_LIST)))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Error Handling
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
/* No errors or warnings */
|
|
Packit Service |
392537 |
CFGERR_OK = 0,
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* warnings were encountered */
|
|
Packit Service |
392537 |
CFGERR_WARNINGS = 1,
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* errors (and maybe some warnings too, who knows) were encountered */
|
|
Packit Service |
392537 |
CFGERR_ERRORS = 2,
|
|
Packit Service |
392537 |
} cfgerr_level_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Errors
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get a GSList of all error and warning messages accumulated so far.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param (output) errlist: pointer to the list of error strings; allocated
|
|
Packit Service |
392537 |
* memory remains the responsibility of the config module. If errlist is
|
|
Packit Service |
392537 |
* NULL, the list is not returned.
|
|
Packit Service |
392537 |
* @returns: current error level
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
cfgerr_level_t config_errors(GSList **errlist);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Clear any error conditions.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void config_clear_errors(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Print the list of current error and warning messages, one per line,
|
|
Packit Service |
392537 |
* to stderr. This is a convenience function for command-line
|
|
Packit Service |
392537 |
* applications.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void config_print_errors(void);
|
|
Packit Service |
392537 |
void config_print_errors_as_message(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Add an error message to the list of errors, and make sure tha the
|
|
Packit Service |
392537 |
* error level is at least LEVEL. This is used by the diskfile module
|
|
Packit Service |
392537 |
* to insert its errors into this module's error list.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param level: level for this error
|
|
Packit Service |
392537 |
* @param errmsg: error message; conffile takes responsibility for freeing
|
|
Packit Service |
392537 |
* this string.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void config_add_error(cfgerr_level_t level, char *errmsg);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Command-line handling
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* opaque type */
|
|
Packit Service |
392537 |
typedef struct config_overrides_s config_overrides_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Create a new, empty config_overrides object.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param size_estimate: a guess at the number of overwrites; argc/2 is a
|
|
Packit Service |
392537 |
* good estimate.
|
|
Packit Service |
392537 |
* @returns: new object
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
config_overrides_t *new_config_overrides(int size_estimate);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Free a config_overrides object. This usually won't be needed, as
|
|
Packit Service |
392537 |
* apply_config_overrides takes ownership of the overwrites for you.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param co: config_overrides object
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void free_config_overrides(config_overrides_t *co);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Add an overwrite to a config_overrides object.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param co: the config_overrides object
|
|
Packit Service |
392537 |
* @param key: the configuration parameter's key, possibly with the format
|
|
Packit Service |
392537 |
* SUBTYPE:NAME:KEYWORD
|
|
Packit Service |
392537 |
* @param value: the value for the parameter, as would be seen in amanda.conf
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void add_config_override(config_overrides_t *co,
|
|
Packit Service |
392537 |
char *key,
|
|
Packit Service |
392537 |
char *value);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Add an overwrite option from the command line to a config_overrides
|
|
Packit Service |
392537 |
* object. Calls error() with any errors
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param co: the config_overrides object
|
|
Packit Service |
392537 |
* @param optarg: the value of the command-line option
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void add_config_override_opt(config_overrides_t *co,
|
|
Packit Service |
392537 |
char *optarg);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Given a command line, represented as argc/argv, extract any -o options
|
|
Packit Service |
392537 |
* as config overwrites. This function modifies argc and argv in place.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* This is the deprecated way to extract config overwrites, for applications
|
|
Packit Service |
392537 |
* which do not use getopt. The preferred method is to use getopt and
|
|
Packit Service |
392537 |
* call add_config_override_opt for any -o options.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param argc: (in/out) command-line length
|
|
Packit Service |
392537 |
* @param argv: (in/out) command-line strings
|
|
Packit Service |
392537 |
* @returns: newly allocated config_overrides object
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
config_overrides_t *
|
|
Packit Service |
392537 |
extract_commandline_config_overrides(int *argc,
|
|
Packit Service |
392537 |
char ***argv);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Set configuration overwrites to the current configuration and take
|
|
Packit Service |
392537 |
* ownership of the config_overrides object.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param co: the config_overrides object
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void set_config_overrides(config_overrides_t *co);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Initialization
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* If the config is initialized */
|
|
Packit Service |
392537 |
gboolean
|
|
Packit Service |
392537 |
config_is_initialized(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Constants for config_init */
|
|
Packit Service |
392537 |
typedef enum {
|
|
Packit Service |
392537 |
/* Use arg_config_name, if not NULL */
|
|
Packit Service |
392537 |
CONFIG_INIT_EXPLICIT_NAME = 1 << 0,
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Use the current working directory if an explicit name is not available */
|
|
Packit Service |
392537 |
CONFIG_INIT_USE_CWD = 1 << 1,
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* This is a client application (server is default) */
|
|
Packit Service |
392537 |
CONFIG_INIT_CLIENT = 1 << 2,
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* New configuration should "overlay" existing configuration; this
|
|
Packit Service |
392537 |
* is used by clients to load multiple amanda-client.conf files. */
|
|
Packit Service |
392537 |
CONFIG_INIT_OVERLAY = 1 << 3,
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Load the global config */
|
|
Packit Service |
392537 |
CONFIG_INIT_GLOBAL = 1 << 4,
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Do not generate errors (internal use) */
|
|
Packit Service |
392537 |
CONFIG_OVERRDIDE_NO_ERROR = 1 << 5,
|
|
Packit Service |
392537 |
} config_init_flags;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Initialize this application's configuration, with the specific actions
|
|
Packit Service |
392537 |
* based on 'flags':
|
|
Packit Service |
392537 |
* - if CONFIG_INIT_OVERLAY is not set, configuration values are reset
|
|
Packit Service |
392537 |
* to their defaults
|
|
Packit Service |
392537 |
* - if CONFIG_INIT_EXPLICIT_NAME and arg_config_name is not NULL,
|
|
Packit Service |
392537 |
* use CONFIG_DIR/arg_config_name as config_dir arg_config_name as
|
|
Packit Service |
392537 |
* config_name.
|
|
Packit Service |
392537 |
* - otherwise, if CONFIG_USE_CWD is set, use the directory in which
|
|
Packit Service |
392537 |
* the application was started as config_dir, and its filename as
|
|
Packit Service |
392537 |
* config_name.
|
|
Packit Service |
392537 |
* - otherwise, for the client only, se config_dir to CONFIG_DIR and
|
|
Packit Service |
392537 |
* config_name to NULL.
|
|
Packit Service |
392537 |
* - depending on CONFIG_INIT_CLIENT, read amanda.conf or amanda-client.conf
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param flags: flags indicating desired behavior, as above
|
|
Packit Service |
392537 |
* @param arg_config_name: config name to use (from e.g., argv[1])
|
|
Packit Service |
392537 |
* @returns: current error level
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
cfgerr_level_t config_init(
|
|
Packit Service |
392537 |
config_init_flags flags,
|
|
Packit Service |
392537 |
char *arg_config_name);
|
|
Packit Service |
392537 |
cfgerr_level_t config_init_with_global(
|
|
Packit Service |
392537 |
config_init_flags flags,
|
|
Packit Service |
392537 |
char *arg_config_name);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Free all memory allocated for the configuration. This effectively
|
|
Packit Service |
392537 |
* reverses the effects of config_init().
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void config_uninit(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Encode any applied config_overrides into a strv format suitale for
|
|
Packit Service |
392537 |
* executing another Amanda tool.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* The * result is dynamically allocated and NULL terminated. There is no
|
|
Packit Service |
392537 |
* provision to free the result, as this function is always called just
|
|
Packit Service |
392537 |
* before execve(..).
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* First gives the number of array elements to leave for the caller to
|
|
Packit Service |
392537 |
* fill in. The usual calling pattern is this:
|
|
Packit Service |
392537 |
* command_line = get_config_options(3);
|
|
Packit Service |
392537 |
* command_line[0] = "appname";
|
|
Packit Service |
392537 |
* command_line[1] = config_name;
|
|
Packit Service |
392537 |
* command_line[2] = "--foo";
|
|
Packit Service |
392537 |
* execve(command_line[0], command_line, safe_env());
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param first: number of unused elements to leave at the beginning of
|
|
Packit Service |
392537 |
* the array.
|
|
Packit Service |
392537 |
* @returns: NULL-terminated string array suitable for execve
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char **get_config_options(int first);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the config name */
|
|
Packit Service |
392537 |
char *get_config_name(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the config directory */
|
|
Packit Service |
392537 |
char *get_config_dir(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Get the config filename */
|
|
Packit Service |
392537 |
char *get_config_filename(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *get_running_on(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Utilities
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Security plugins get their configuration information through a callback
|
|
Packit Service |
392537 |
* with the signature:
|
|
Packit Service |
392537 |
* char *callback(char *key, void *userpointer);
|
|
Packit Service |
392537 |
* where key is the name of the desired parameter, which may not match the
|
|
Packit Service |
392537 |
* name used in this module. See the implementations of these functions
|
|
Packit Service |
392537 |
* to learn which keys they support, or to add new keys.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *generic_client_get_security_conf(char *, void *);
|
|
Packit Service |
392537 |
char *generic_get_security_conf(char *, void *);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Dump the current configuration information to stdout, in a format
|
|
Packit Service |
392537 |
* that can be re-read by this module. The results will include any
|
|
Packit Service |
392537 |
* command-line overwrites.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* This function only dumps the server configuration, and will fail on
|
|
Packit Service |
392537 |
* clients.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void dump_configuration(gboolean print_default, gboolean print_source);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
void dump_dumptype(dumptype_t *dp, char *prefix, gboolean print_default,
|
|
Packit Service |
392537 |
gboolean print_source);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Return a sequence of strings giving the printable representation
|
|
Packit Service |
392537 |
* of the given val_t. If str_needs_quotes is true and each string is
|
|
Packit Service |
392537 |
* prefixed by the relevant configuration keyword, these strings will
|
|
Packit Service |
392537 |
* be parseable by this module, and will reproduce exactly the same
|
|
Packit Service |
392537 |
* configuration value. See the implementation of dump_configuration
|
|
Packit Service |
392537 |
* for details.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* If str_needs_quotes is provided, a CONFTYPE_STR value will be returned with
|
|
Packit Service |
392537 |
* quotes.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* The result is a NULL-terminated strv, which can be freed with g_strfreev or
|
|
Packit Service |
392537 |
* joined with g_strjoinv. Caller is responsible for freeing the memory.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param val: the value to analyze
|
|
Packit Service |
392537 |
* @param str_needs_quotes: add quotes to CONFTYPE_STR values?
|
|
Packit Service |
392537 |
* @returns: NULL-terminated string vector
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char **val_t_display_strs(val_t *val, int str_needs_quotes, gboolean print_source,
|
|
Packit Service |
392537 |
gboolean print_unit);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Read a dumptype; this is used by this module as well as by diskfile.c to
|
|
Packit Service |
392537 |
* read the disklist. The two are carefully balanced in their parsing process.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Nobody else should use this function. Seriously.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
dumptype_t *read_dumptype(char *name, FILE *from, char *fname, int *linenum);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Every call return a pointer to a string with an increasing number; this is
|
|
Packit Service |
392537 |
* used by this module as well as by diskfile.c to read the disklist.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Nobody else should use this function. Seriously.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @returns: a pointer to a static string.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *anonymous_value(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Extend a relative filename with the current config_dir; if filename is already
|
|
Packit Service |
392537 |
* absolute, this is equivalent to g_strdup.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param filename: filename to extend
|
|
Packit Service |
392537 |
* @returns: newly allocated filename
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *config_dir_relative(char *filename);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Convert from a symbol back to a name for logging and for dumping
|
|
Packit Service |
392537 |
* config values
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param taperalgo: the constant value
|
|
Packit Service |
392537 |
* @returns: statically allocated string
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
char *taperalgo2str(taperalgo_t taperalgo);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Looks for a unit value like b, byte, bytes, bps, etc. Technically
|
|
Packit Service |
392537 |
* the return value should never be < 1, but we return a signed value
|
|
Packit Service |
392537 |
* to help mitigate bad C promotion semantics. Returns 0 on error.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* This is here in this module because it uses the numb_keytable.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param casestr: the unit string
|
|
Packit Service |
392537 |
* @returns: the corresponding multiplier (e.g., 'M' => 1024*1024)
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
gint64 find_multiplier(char * casestr);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Converts a string matching any of Amanda's names for "true" or
|
|
Packit Service |
392537 |
* "false" to a boolean value.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param str: string to match
|
|
Packit Service |
392537 |
* @returns: 0 or 1 (boolean) or -1 (no match)
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
int string_to_boolean(const char *str);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Return a pointer to a static string for the data_path */
|
|
Packit Service |
392537 |
char *data_path_to_string(data_path_t data_path);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Return the data_path for the string */
|
|
Packit Service |
392537 |
data_path_t data_path_from_string(char *data);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
void free_property_t(gpointer p);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* Converts a string into Amanda property name style.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param name: The name to convert.
|
|
Packit Service |
392537 |
* @returns: A newly allocated string, with name in lowercase and
|
|
Packit Service |
392537 |
* any instances of '_' replaced with '-'.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
gchar *amandaify_property_name(const gchar *name);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/**
|
|
Packit Service |
392537 |
* Returns a string representation of a CONFTYPE_EXECUTE_ON property with a
|
|
Packit Service |
392537 |
* given separator. It is up to the caller to free that string if it so desires.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* @param flags: the CONFTYPE_EXECUTE_ON property.
|
|
Packit Service |
392537 |
* @param separator: the separator to use.
|
|
Packit Service |
392537 |
* @returns: the string representation.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *execute_on_to_string(int flags, char *separator);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *custom_escape(char *str);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
val_t *getconf_human(confparm_key key);
|
|
Packit Service |
392537 |
val_t *dumptype_getconf_human(dumptype_t *typ, dumptype_key key);
|
|
Packit Service |
392537 |
val_t *tapetype_getconf_human(tapetype_t *typ, tapetype_key key);
|
|
Packit Service |
392537 |
val_t *application_getconf_human(application_t *typ, application_key key);
|
|
Packit Service |
392537 |
val_t *device_config_getconf_human(device_config_t *typ, device_config_key key);
|
|
Packit Service |
392537 |
val_t *changer_config_getconf_human(changer_config_t *typ, changer_config_key key);
|
|
Packit Service |
392537 |
val_t *storage_getconf_human(storage_t *typ, storage_key key);
|
|
Packit Service |
392537 |
val_t *pp_script_getconf_human(pp_script_t *typ, pp_script_key key);
|
|
Packit Service |
392537 |
val_t *holdingdisk_getconf_human(holdingdisk_t *typ, holdingdisk_key key);
|
|
Packit Service |
392537 |
val_t *interface_getconf_human(interface_t *typ, interface_key key);
|
|
Packit Service |
392537 |
val_t *interactivity_getconf_human(interactivity_t *typ, interactivity_key key);
|
|
Packit Service |
392537 |
val_t *taperscan_getconf_human(taperscan_t *typ, taperscan_key key);
|
|
Packit Service |
392537 |
val_t *policy_getconf_human(policy_s *typ, policy_key key);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#endif /* ! CONFFILE_H */
|