1 #ifndef _LIBBACKUPPCD_H
2 #define _LIBBACKUPPCD_H 1
4 * Copyright (C) 2005 Roy Keene
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 * Planning Systems Inc
24 * backuppcd-bugs@psislidell.com
28 #include <backuppcd.h>
31 * These define symbols to determine whether or not write() or send() should
32 * be used to transfer data to a descriptor. write() may not be usable on
33 * socket descriptors, and send() will never work for file descriptors.
41 * This structure is used to give access to file information from a GET or
45 backuppc_filetype_t type;
46 unsigned long long size;
47 unsigned char hash_md4[16];
48 unsigned char hash_md5[16];
49 unsigned char hash_bpc[16];
50 unsigned char hash_sha1[20];
57 char owner_group[BPC_MAXPATH_LEN];
58 char owner_user[BPC_MAXPATH_LEN];
59 char linkdest[BPC_MAXPATH_LEN];
60 char name[BPC_MAXPATH_LEN];
65 * The BPC_CONN type is used as a handle to represent an individual connection
68 typedef struct bpc_conn BPC_CONN;
75 * Operations associated with connection management
77 BPC_CONN *bpc_connect(const char *host, const int port, const char *username, const char *password);
78 int bpc_disconnect(BPC_CONN *handle);
81 * Operations associated with authentication
83 int bpc_auth(BPC_CONN *handle, const char *username, const char *password);
86 * Operations associated with getting a listing of files
88 int bpc_list_open(BPC_CONN *handle, const char *rootpath, const int recursive, backuppc_hashid_t hashalgo, const char *exclpat, const char *inclpat);
89 struct bpc_fileinfo *bpc_list(BPC_CONN *handle);
90 int bpc_list_close(BPC_CONN *handle);
93 * Operations associated with transfering files
95 int bpc_get_open(BPC_CONN *handle, const char *rootpath, const int recursive, backuppc_hashid_t hashalgo, const char *exclpat, const char *inclpat);
96 struct bpc_fileinfo *bpc_get_head(BPC_CONN *handle);
97 ssize_t bpc_get(BPC_CONN *handle, void *buf, size_t count);
98 int bpc_copy(BPC_CONN *handle, bpc_mode_t mode, int fd);
99 int bpc_copyfile(BPC_CONN *handle, struct bpc_fileinfo *src, const char *dest, int preserve);
100 int bpc_get_close(BPC_CONN *handle);