]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsock.h
04Jul05
[bacula/bacula] / bacula / src / lib / bsock.h
index da3f9ce82bc537d7662a25e3d72159535d068665..71d36e3541d837d9dd9f512a80b33c1d275d0ce5 100644 (file)
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
-   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 free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as ammended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
-   This library is distributed in the hope that it will be useful,
+   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
-   Lesser General Public License for more details.
-
-   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.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -36,9 +31,11 @@ struct BSOCK {
    uint32_t in_msg_no;                /* input message number */
    uint32_t out_msg_no;               /* output message number */
    int fd;                            /* socket file descriptor */
+   TLS_CONNECTION *tls;               /* associated tls connection */
    int32_t msglen;                    /* message length */
    int b_errno;                       /* bsock errno */
    int port;                          /* desired port */
+   int blocking;                      /* blocking state (0 = nonblocking, 1 = blocking) */
    volatile int errors;               /* incremented for each error on socket */
    volatile bool suppress_error_msgs: 1; /* set to suppress error messages */
    volatile bool timed_out: 1;        /* timed out in read/write */
@@ -80,10 +77,13 @@ enum {
 #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 */
+/*
+ * TLS enabling values. Value is important for comparison, ie:
+ * if (tls_remote_need < BNET_TLS_REQUIRED) { ... }
+ */
+#define BNET_TLS_NONE     0           /* cannot do TLS */
+#define BNET_TLS_OK       1           /* can do, but not required on my end */
+#define BNET_TLS_REQUIRED 2           /* TLS is required */
 
 /*
  * This is the structure of the in memory BPKT