]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsock.h
change all void *jcr into JCR *jcr
[bacula/bacula] / bacula / src / lib / bsock.h
index 54d1ed3d5c80e6ac8a54e2d0ec97aff021521001..5ca7d1ad7ec34dc70d434aa35d982bae38344205 100644 (file)
 /*
    Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   This library 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.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    MA 02111-1307, USA.
 
  */
@@ -39,6 +39,7 @@ typedef struct s_bsock {
    int32_t msglen;                    /* message length */
    int port;                          /* desired port */
    int errors;                        /* set if errors on socket */
+   int suppress_error_msgs;           /* set to suppress error messages */
    int b_errno;                       /* bsock errno */
    time_t timer_start;                /* time started read/write */
    int timed_out;                     /* timed out in read/write */
@@ -53,11 +54,10 @@ typedef struct s_bsock {
    struct s_bsock *next;              /* next BSOCK if duped */
    int spool;                         /* set for spooling */
    FILE *spool_fd;                    /* spooling file */
-   void *jcr;                         /* jcr or NULL for error msgs */
+   JCR *jcr;                          /* jcr or NULL for error msgs */
 } BSOCK;
 
 /* Signal definitions for use in bnet_sig() */
-#define BNET_NONO         0           /* DO NOT USE, remains for compatibility */
 #define BNET_EOD         -1           /* End of data stream, new data may follow */
 #define BNET_EOD_POLL    -2           /* End of data and poll all in one */
 #define BNET_STATUS      -3           /* Send full status */
@@ -70,6 +70,16 @@ typedef struct s_bsock {
 #define BNET_SETBUF_READ  1           /* Arg for bnet_set_buffer_size */
 #define BNET_SETBUF_WRITE 2           /* Arg for bnet_set_buffer_size */
 
+/* Return status from bnet_recv() */
+#define BNET_SIGNAL  -1
+#define BNET_HARDEOF -2
+#define BNET_ERROR   -3
+
+/* SSL enabling values */
+#define BNET_SSL_NONE     0           /* cannot do SSL */
+#define BNET_SSL_OK       1           /* can do, but not required on my end */
+#define BNET_SSL_REQUIRED 2           /* SSL is required */
+
 /*
  * This is the structure of the in memory BPKT
  */