]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsock.h
ebl use tokyocabinet by default instead of htable
[bacula/bacula] / bacula / src / lib / bsock.h
index 06247da0dcce536bfed75caccae163ee96e01a9c..0205accd3b6a6f0e2a1dca99885757b66122c598 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 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.
@@ -54,6 +54,7 @@ class BSOCK {
 private:
    BSOCK *m_next;                     /* next BSOCK if duped */
    JCR *m_jcr;                        /* jcr or NULL for error msgs */
+   pthread_mutex_t m_mutex;           /* for locking if use_locking set */
    char *m_who;                       /* Name of daemon to which we are talking */
    char *m_host;                      /* Host name/IP */
    int m_port;                        /* desired port */
@@ -62,6 +63,7 @@ private:
    volatile bool m_terminated: 1;     /* set when BNET_TERMINATE arrives */
    bool m_duped: 1;                   /* set if duped BSOCK */
    bool m_spool: 1;                   /* set for spooling */
+   bool m_use_locking: 1;             /* set to use locking */
 
    void fin_init(JCR * jcr, int sockfd, const char *who, const char *host, int port,
                struct sockaddr *lclient_addr);
@@ -91,6 +93,7 @@ public:
    /* methods -- in bsock.c */
    void init();
    void free_bsock();
+   void free_tls();
    bool 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);
@@ -111,6 +114,8 @@ public:
    int wait_data_intr(int sec);
    bool authenticate_director(const char *name, const char *password,
                   TLS_CONTEXT *tls_ctx, char *msg, int msglen);
+   bool set_locking();                /* in bsock.c */
+   void clear_locking();              /* in bsock.c */
 
    /* Inline functions */
    void set_jcr(JCR *jcr) { m_jcr = jcr; };
@@ -167,7 +172,9 @@ enum {
    BNET_ERROR_MSG      = -21,         /* Error message -- command failed */
    BNET_INFO_MSG       = -22,         /* Info message -- status line */
    BNET_RUN_CMD        = -23,         /* Run command follows */
-   BNET_YESNO          = -24          /* Request yes no response */
+   BNET_YESNO          = -24,         /* Request yes no response */
+   BNET_START_RTREE    = -25,         /* Start restore tree mode */
+   BNET_END_RTREE      = -26          /* End restore tree mode */ 
 };
 
 #define BNET_SETBUF_READ  1           /* Arg for bnet_set_buffer_size */