/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* BSD 3 Clause License
*
* Copyright (c) 2007, The Storage Networking Industry Association.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* - Neither the name of The Storage Networking Industry Association (SNIA)
* nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This defines structures used to pass information between threads
* for both local-backup and NDMP.
*
*/
#ifndef _TLM_BUFFERS_H_
#define _TLM_BUFFERS_H_
#include <stdlib.h>
#include <limits.h>
#include <thread.h>
#include "tlm.h"
#ifndef RECORDSIZE
#endif /* !RECORDSIZE */
/*
* List of files/directories to be excluded from backup list.
*/
typedef struct tlm_buffer {
/* where in the file this buffer stops. */
/* this is used for the Multi Volume */
/* Header record. */
/* how much of the file is left. */
} tlm_buffer_t;
/*
* Flags for tlm_buffers.
*/
typedef struct tlm_buffers {
/* these are indexes into tlm_buffers */
typedef struct tlm_cmd {
/* for restore */
} tlm_cmd_t;
typedef struct tlm_commands {
typedef struct tlm_job_stats {
int js_errors;
void *js_callbacks;
struct full_dir_info {
};
/*
* For more info please refer to
* "Functional Specification Document: Usgin new LBR engine in NDMP",
* Revision: 0.2
* Document No.: 101438.
* the "File history of backup" section
*/
typedef struct lbr_fhlog_call_backs {
void *fh_cookie;
int (*fh_logpname)();
int (*fh_log_dir)();
int (*fh_log_node)();
typedef struct bk_selector {
void *bs_cookie;
int bs_level;
int bs_ldate;
/*
* Call back structure to create new name for objects at restore time.
*/
struct rs_name_maker;
char *buf,
int pos,
char *path);
struct rs_name_maker {
void *rn_nlp;
};
/*
* RSFLG_OVR_*: overwriting policies. Refer to LBR FSD for more info.
* RSFLG_MATCH_WCARD: should wildcards be supported in the selection list.
* RSFLG_IGNORE_CASE: should the compare be case-insensetive. NDMP needs
* case-sensetive name comparison.
*/
/*
* Different cases where two paths can match with each other.
* Parent means that the current path, is parent of an entry in
* the selection list.
* Child means that the current path, is child of an entry in the
* selection list.
*/
#define PM_NONE 0
extern tlm_job_stats_t *tlm_new_job_stats(char *);
extern tlm_job_stats_t *tlm_ref_job_stats(char *);
extern void tlm_un_ref_job_stats(char *);
extern boolean_t tlm_is_excluded(char *, char *, char **);
extern char *tlm_build_snapshot_name(char *, char *, char *);
extern char *tlm_remove_checkpoint(char *, char *);
extern void tlm_buffer_mark_empty(tlm_buffer_t *);
extern void tlm_buffer_release_in_buf(tlm_buffers_t *);
extern void tlm_buffer_release_out_buf(tlm_buffers_t *);
extern void tlm_buffer_in_buf_wait(tlm_buffers_t *);
extern void tlm_buffer_out_buf_wait(tlm_buffers_t *);
extern void tlm_buffer_in_buf_timed_wait(tlm_buffers_t *, unsigned);
extern void tlm_buffer_out_buf_timed_wait(tlm_buffers_t *, unsigned);
extern char *tlm_get_write_buffer(long, long *, tlm_buffers_t *, int);
extern char *tlm_get_read_buffer(int, int *, tlm_buffers_t *, int *);
extern void tlm_unget_read_buffer(tlm_buffers_t *, int);
extern void tlm_unget_write_buffer(tlm_buffers_t *, int);
extern void tlm_release_buffers(tlm_buffers_t *);
extern void tlm_release_reader_writer_ipc(tlm_cmd_t *);
char *,
struct stat64 *,
char *,
struct stat64 *);
char *,
char *,
struct stat64 *,
typedef struct {
char *ba_job;
char *ba_dir;
extern void lbrlog_callbacks_done(lbr_fhlog_call_backs_t *);
extern boolean_t tlm_cat_path(char *, char *, char *);
extern char *trim_name(char *);
extern void write_tar_eof(tlm_cmd_t *);
extern int tlm_get_chkpnt_time(char *, int, time_t *, char *);
char *,
char *);
extern void tlm_release_list(char **);
extern int tlm_tarhdr_size(void);
#endif /* _TLM_BUFFERS_H_ */