/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
- The main author of Bacula is Kern Sibbald, with contributions from
- many others, a complete list can be found in the file AUTHORS.
- This program is Free Software; you can redistribute it and/or
- modify it under the terms of version three of the GNU Affero General Public
- License as published by the Free Software Foundation and included
- in the file LICENSE.
+ The main author of Bacula is Kern Sibbald, with contributions from many
+ others, a complete list can be found in the file AUTHORS.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
+ You may use this file and others of this release according to the
+ license defined in the LICENSE file, which includes the Affero General
+ Public License, v3.0 ("AGPLv3") and some additional permissions and
+ terms pursuant to its AGPLv3 Section 7.
Bacula® is a registered trademark of Kern Sibbald.
- The licensor of Bacula is the Free Software Foundation Europe
- (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
- Switzerland, email:ftf@fsfeurope.org.
*/
/*
* Prototypes for lib directory of Bacula
class JCR;
+/* address_conf.c */
+void remove_duplicate_addresses(dlist *addr_list);
+
/* attr.c */
ATTR *new_attr(JCR *jcr);
void free_attr(ATTR *attr);
void base64_init (void);
int to_base64 (int64_t value, char *where);
int from_base64 (int64_t *value, char *where);
-int bin_to_base64 (char *buf, int buflen, char *bin, int binlen,
+int bin_to_base64 (char *buf, int buflen, char *bin, int binlen,
int compatible);
int base64_to_bin(char *dest, int destlen, char *src, int srclen);
/* bsys.c */
+POOLMEM *quote_string (POOLMEM *snew, const char *old);
+POOLMEM *quote_where (POOLMEM *snew, const char *old);
char *bstrncpy (char *dest, const char *src, int maxlen);
char *bstrncpy (char *dest, POOL_MEM &src, int maxlen);
char *bstrncat (char *dest, const char *src, int maxlen);
char *bstrncat (char *dest, POOL_MEM &src, int maxlen);
bool bstrcmp (const char *s1, const char *s2);
+bool bstrcasecmp (const char *s1, const char *s2);
int cstrlen (const char *str);
void *b_malloc (const char *file, int line, size_t size);
#ifndef bmalloc
int safer_unlink(const char *pathname, const char *regex);
/* bnet.c */
-int32_t bnet_recv (BSOCK *bsock);
-bool bnet_send (BSOCK *bsock);
-bool bnet_fsend (BSOCK *bs, const char *fmt, ...);
-bool bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw);
-bool bnet_sig (BSOCK *bs, int sig);
bool bnet_tls_server (TLS_CONTEXT *ctx, BSOCK *bsock,
alist *verify_list);
bool bnet_tls_client (TLS_CONTEXT *ctx, BSOCK *bsock,
alist *verify_list);
-BSOCK * bnet_connect (JCR *jcr, int retry_interval,
- utime_t max_retry_time, utime_t heart_beat,
- const char *name, char *host, char *service,
- int port, int verbose);
-void bnet_close (BSOCK *bsock);
BSOCK * init_bsock (JCR *jcr, int sockfd, const char *who, const char *ip,
int port, struct sockaddr *client_addr);
#ifdef HAVE_WIN32
void term_bsock (BSOCK *bsock);
const char *bnet_strerror (BSOCK *bsock);
const char *bnet_sig_to_ascii (BSOCK *bsock);
-int bnet_wait_data (BSOCK *bsock, int sec);
-int bnet_wait_data_intr (BSOCK *bsock, int sec);
-bool is_bnet_stop (BSOCK *bsock);
-int is_bnet_error (BSOCK *bsock);
-void bnet_suppress_error_messages(BSOCK *bsock, bool flag);
dlist *bnet_host2ipaddrs(const char *host, int family, const char **errstr);
-int bnet_set_blocking (BSOCK *sock);
-int bnet_set_nonblocking (BSOCK *sock);
void bnet_restore_blocking (BSOCK *sock, int flags);
+int set_socket_errno(int sockstat);
/* bget_msg.c */
int bget_msg(BSOCK *sock);
bool crypto_digest_finalize (DIGEST *digest, uint8_t *dest, uint32_t *length);
void crypto_digest_free (DIGEST *digest);
SIGNATURE * crypto_sign_new (JCR *jcr);
-crypto_error_t crypto_sign_get_digest (SIGNATURE *sig, X509_KEYPAIR *keypair,
+crypto_error_t crypto_sign_get_digest (SIGNATURE *sig, X509_KEYPAIR *keypair,
crypto_digest_t &algorithm, DIGEST **digest);
crypto_error_t crypto_sign_verify (SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST *digest);
int crypto_sign_add_signer (SIGNATURE *sig, DIGEST *digest, X509_KEYPAIR *keypair);
CRYPTO_SESSION * crypto_session_new (crypto_cipher_t cipher, alist *pubkeys);
void crypto_session_free (CRYPTO_SESSION *cs);
bool crypto_session_encode (CRYPTO_SESSION *cs, uint8_t *dest, uint32_t *length);
-crypto_error_t crypto_session_decode (const uint8_t *data, uint32_t length, alist *keypairs, CRYPTO_SESSION **session);
+crypto_error_t crypto_session_decode (const uint8_t *data, uint32_t length, alist *keypairs, CRYPTO_SESSION **session);
CRYPTO_SESSION * crypto_session_decode (const uint8_t *data, uint32_t length);
CIPHER_CONTEXT * crypto_cipher_new (CRYPTO_SESSION *cs, bool encrypt, uint32_t *blocksize);
bool crypto_cipher_update (CIPHER_CONTEXT *cipher_ctx, const uint8_t *data, uint32_t length, const uint8_t *dest, uint32_t *written);
JCR *get_jcr_from_tsd();
void set_jcr_in_tsd(JCR *jcr);
void remove_jcr_from_tsd(JCR *jcr);
-uint32_t get_jobid_from_tsd();
+uint32_t get_jobid_from_tsd();
uint32_t get_jobid_from_tid(pthread_t tid);
void lex_set_default_error_handler (LEX *lf);
int lex_set_error_handler_error_type (LEX *lf, int err_type);
+/* Required typedef, not in a C file */
+extern "C" {
+typedef char *(*job_code_callback_t)(JCR *, const char *);
+}
+
/* message.c */
void my_name_is (int argc, char *argv[], const char *name);
-void init_msg (JCR *jcr, MSGS *msg);
+void init_msg (JCR *jcr, MSGS *msg, job_code_callback_t job_code_callback = NULL);
void term_msg (void);
void close_msg (JCR *jcr);
void add_msg_dest (MSGS *msg, int dest, int type, char *where, char *dest_code);
void set_hangup (int hangup_value);
int get_hangup (void);
void set_db_type (const char *name);
+void set_assert_msg (const char *file, int line, const char *msg);
void register_message_callback(void msg_callback(int type, char *msg));
/* bnet_server.c */
BSOCK * bnet_bind (int port);
BSOCK * bnet_accept (BSOCK *bsock, char *who);
-/* pythonlib.c */
typedef int (EVENT_HANDLER)(JCR *jcr, const char *event);
-//EVENT_HANDLER *generate_daemon_event;
int generate_daemon_event(JCR *jcr, const char *event);
/* signal.c */
/* util.c */
-
-extern "C" {
-typedef char *(*job_code_callback_t)(JCR *, const char *);
-}
-
bool is_buf_zero (char *buf, int len);
void lcase (char *str);
void bash_spaces (char *str);
void set_working_directory (char *wd);
const char * last_path_separator (const char *str);
-
/* watchdog.c */
int start_watchdog(void);
int stop_watchdog(void);