]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsock.h
Detect mount/junction points and ignore junctions in Windows
[bacula/bacula] / bacula / src / lib / bsock.h
index 996ce4973e6a36546f147f5c6cef1a07842e1cd3..9b9f40c4403fc5329ec4a18328ffe20331bbe23c 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2009 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 two of the GNU General Public
+   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.
 
@@ -15,7 +15,7 @@
    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 General Public License
+   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.
@@ -51,6 +51,32 @@ void stop_bsock_timer(btimer_t *wid);
 
 
 class BSOCK {
+/* 
+ * Note, keep this public part before the private otherwise
+ *  bat breaks on some systems such as RedHat.
+ */
+public:
+   uint64_t read_seqno;               /* read sequence number */
+   POOLMEM *msg;                      /* message pool buffer */
+   POOLMEM *errmsg;                   /* edited error message */
+   RES *res;                          /* Resource to which we are connected */
+   FILE *m_spool_fd;                  /* spooling file */
+   TLS_CONNECTION *tls;               /* associated tls connection */
+   IPADDR *src_addr;                  /* IP address to source connections from */
+   uint32_t in_msg_no;                /* input message number */
+   uint32_t out_msg_no;               /* output message number */
+   int32_t msglen;                    /* message length */
+   volatile time_t timer_start;       /* time started read/write */
+   volatile time_t timeout;           /* timeout BSOCK after this interval */
+   int m_fd;                          /* socket file descriptor */
+   int b_errno;                       /* bsock errno */
+   int m_blocking;                    /* blocking state (0 = nonblocking, 1 = blocking) */
+   volatile int errors;               /* incremented for each error on socket */
+   volatile bool m_suppress_error_msgs; /* set to suppress error messages */
+
+   struct sockaddr client_addr;       /* client's IP address */
+   struct sockaddr_in peer_addr;      /* peer's IP address */
+
 private:
    BSOCK *m_next;                     /* next BSOCK if duped */
    JCR *m_jcr;                        /* jcr or NULL for error msgs */
@@ -72,26 +98,6 @@ private:
                int port, utime_t heart_beat, int *fatal);
    
 public:
-   uint64_t read_seqno;               /* read sequence number */
-   uint32_t in_msg_no;                /* input message number */
-   uint32_t out_msg_no;               /* output message number */
-   int m_fd;                          /* socket file descriptor */
-   TLS_CONNECTION *tls;               /* associated tls connection */
-   int32_t msglen;                    /* message length */
-   int b_errno;                       /* bsock errno */
-   int m_blocking;                    /* blocking state (0 = nonblocking, 1 = blocking) */
-   volatile int errors;               /* incremented for each error on socket */
-   volatile bool m_suppress_error_msgs: 1; /* set to suppress error messages */
-   volatile time_t timer_start;       /* time started read/write */
-   volatile time_t timeout;           /* timeout BSOCK after this interval */
-   POOLMEM *msg;                      /* message pool buffer */
-   POOLMEM *errmsg;                   /* edited error message */
-   RES *res;                          /* Resource to which we are connected */
-   FILE *m_spool_fd;                  /* spooling file */
-   struct sockaddr client_addr;       /* client's IP address */
-   struct sockaddr_in peer_addr;      /* peer's IP address */
-   IPADDR *src_addr;                  /* IP address to source connections from */
-
    /* methods -- in bsock.c */
    void init();
    void free_bsock();
@@ -160,7 +166,7 @@ enum {
    BNET_POLL           = -5,          /* Poll request, I'm hanging on a read */
    BNET_HEARTBEAT      = -6,          /* Heartbeat Response requested */
    BNET_HB_RESPONSE    = -7,          /* Only response permited to HB */
-   BNET_PROMPT         = -8,          /* Prompt for subcommand */
+   BNET_xxxxxxPROMPT   = -8,          /* No longer used -- Prompt for subcommand */
    BNET_BTIME          = -9,          /* Send UTC btime */
    BNET_BREAK          = -10,         /* Stop current command -- ctl-c */
    BNET_START_SELECT   = -11,         /* Start of a selection list */
@@ -178,7 +184,9 @@ enum {
    BNET_RUN_CMD        = -23,         /* Run command follows */
    BNET_YESNO          = -24,         /* Request yes no response */
    BNET_START_RTREE    = -25,         /* Start restore tree mode */
-   BNET_END_RTREE      = -26          /* End restore tree mode */ 
+   BNET_END_RTREE      = -26,         /* End restore tree mode */ 
+   BNET_SUB_PROMPT     = -27,         /* Indicate we are at a subprompt */
+   BNET_TEXT_INPUT     = -28          /* Get text input from user */
 };
 
 #define BNET_SETBUF_READ  1           /* Arg for bnet_set_buffer_size */